-
Notifications
You must be signed in to change notification settings - Fork 49
/
CMakeLists.txt
43 lines (34 loc) · 1.25 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
project(OMSimulator)
set(CMAKE_INSTALL_RPATH "$ORIGIN/../lib/${HOST_SHORT}:$ORIGIN/")
include_directories(../OMSimulatorLib)
link_directories(
${ZLIB_LIBRARYDIR}
${FMI4c_LIBRARYDIR}
${MINIZIP_LIBRARYDIR}
${LUALibrary_LIBRARYDIR}
${CVODELibrary_LIBRARYDIR}
${KINSOLLibrary_LIBRARYDIR}
${Boost_LIBRARY_DIRS})
IF (OMTLM)
link_directories(${OMTLMSIMULATORLIB_LIBRARYDIR})
ENDIF ()
add_executable(OMSimulator main.cpp)
IF (BOOST_ROOT AND MINGW)
# For some reason the above link_directories is ignored when cross-compiling MinGW64...
target_link_libraries(OMSimulator "-L${BOOST_ROOT}/lib")
message(STATUS BOOST_ROOT MinGW64 workaround active)
ENDIF ()
IF (APPLE)
add_custom_command(TARGET OMSimulator POST_BUILD COMMAND
${CMAKE_INSTALL_NAME_TOOL} -add_rpath "@loader_path/../../../../lib/${HOST_SHORT}"
$<TARGET_FILE:OMSimulator>)
add_custom_command(TARGET OMSimulator POST_BUILD COMMAND
${CMAKE_INSTALL_NAME_TOOL} -add_rpath "@loader_path/../lib/${HOST_SHORT}"
$<TARGET_FILE:OMSimulator>)
ENDIF ()
IF (WIN32 AND MINGW)
set(CMAKE_EXE_LINKER_FLAGS "-static -static-libgcc -static-libstdc++")
ENDIF ()
add_definitions(-DOMS_STATIC)
target_link_libraries(OMSimulator OMSimulatorLib_static)
install(TARGETS OMSimulator DESTINATION bin)