forked from rock-simulation/lib_manager
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
72 lines (55 loc) · 2.07 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
66
67
68
69
70
71
72
project(lib_manager)
set(PROJECT_VERSION 1.0)
set(PROJECT_DESCRIPTION "This is the simulation plugin for the RIMRES Reipos modules")
cmake_minimum_required(VERSION 2.6)
include(scripts/cmake/lib_manager.cmake)
lib_defaults()
define_module_info()
set(SOURCES
src/LibManager.cpp
)
set(HEADERS
src/LibInterface.hpp
src/LibManager.hpp
)
set(DEPRECATED_HEADERS
src/LibInterface.h
src/LibManager.h
)
if(MSVC)
#this is needed to create the .lib file of the shared library
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS 1)
endif(MSVC)
add_library(${PROJECT_NAME} SHARED ${SOURCES})
add_library(${PROJECT_NAME}_static STATIC ${SOURCES})
if(UNIX)
target_link_libraries(${PROJECT_NAME} dl)
target_link_libraries(${PROJECT_NAME}_static dl)
endif(UNIX)
if(WIN32)
set(LIB_INSTALL_DIR bin) # .dll are in PATH, like executables
else(WIN32)
set(LIB_INSTALL_DIR lib)
endif(WIN32)
set(_INSTALL_DESTINATIONS
RUNTIME DESTINATION bin
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
ARCHIVE DESTINATION lib
)
# Install the library into the lib folder
install(TARGETS ${PROJECT_NAME} ${_INSTALL_DESTINATIONS})
install(TARGETS ${PROJECT_NAME}_static ${_INSTALL_DESTINATIONS})
# Install headers
install(FILES ${HEADERS} DESTINATION include/${PROJECT_NAME})
install(FILES ${DEPRECATED_HEADERS} DESTINATION include/mars/${PROJECT_NAME})
#INSTALL(DIRECTORY ../../scripts/cmake DESTINATION .)
# Prepare and install necessary files to support finding of the library
# using pkg-config
configure_file(${PROJECT_NAME}.pc.in ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/${PROJECT_NAME}.pc DESTINATION lib/pkgconfig)
configure_file(scripts/cmake/lib_manager-config.cmake.in ${CMAKE_BINARY_DIR}/lib_manager-config.cmake @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/lib_manager-config.cmake DESTINATION share/lib_manager/cmake)
install(FILES scripts/cmake/lib_manager.cmake DESTINATION share/lib_manager/cmake)
# for deprecated support
configure_file(scripts/cmake/mars-config.cmake.in ${CMAKE_BINARY_DIR}/mars-config.cmake @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/mars-config.cmake DESTINATION share/mars/cmake)