-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
65 lines (54 loc) · 1.85 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
cmake_minimum_required(VERSION 3.12)
project(Tire_Model_Codegen)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
set(CMAKE_INCLUDE_HEADERS_IN_COMPILE_COMMANDS ON)
add_library(matlab_math_lib SHARED
src/const_params.cpp
src/HT09_Linear_Vehicle_Model.cpp
src/HT09_Linear_Vehicle_Model_data.cpp
src/interp1_ctBBGdhl.cpp
src/look1_binlcapw.cpp
src/maximum_kQ2v6WLV.cpp
src/minimum_5X1FIofZ.cpp
src/repelem_u5I1BzYw.cpp
src/rtGetNaN.cpp
src/rt_nonfinite.cpp
src/Tire_Model_Codegen.cpp
)
target_include_directories(matlab_math_lib PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
include(GNUInstallDirs)
install(TARGETS matlab_math_lib
EXPORT matlab_mathTargets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
PUBLIC_HEADER DESTINATION include
)
# NAMESPACE sets the namespace that your target will live within.
# you can have multiple targets under the same namespace
install(EXPORT matlab_mathTargets
FILE matlab_mathTargets.cmake
NAMESPACE matlab_math::
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/matlab_math
)
# this looks for your .cmake.in file that you created in step 1.
# if you set the directory differently you may need to handle this differently
include(CMakePackageConfigHelpers)
configure_package_config_file(${CMAKE_CURRENT_LIST_DIR}/cmake/matlab_mathConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/matlab_mathConfig.cmake"
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/matlab_math
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/matlab_mathConfig.cmake"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/matlab_math
)
# actually install your header files
install(
DIRECTORY include/
DESTINATION ${CMAKE_INSTALL_PREFIX}/include
FILES_MATCHING PATTERN "*.h*"
)