diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2015-07-10 22:03:29 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2015-07-10 22:18:46 +0200 |
commit | adfbf84fb43e75c83896bc9d38a39b9efc5989b1 (patch) | |
tree | 51891dba1d64a2960dc2a4442c6f80fb2054fe90 | |
parent | af63bd5688731b57551ac161c0dad26a0b4557d7 (diff) | |
download | ble-toys-adfbf84fb43e75c83896bc9d38a39b9efc5989b1.tar.gz ble-toys-adfbf84fb43e75c83896bc9d38a39b9efc5989b1.tar.bz2 ble-toys-adfbf84fb43e75c83896bc9d38a39b9efc5989b1.tar.xz ble-toys-adfbf84fb43e75c83896bc9d38a39b9efc5989b1.zip |
o Adding support for installing the code.
-rw-r--r-- | apps/CMakeLists.txt | 8 | ||||
-rw-r--r-- | ble/CMakeLists.txt | 2 | ||||
-rw-r--r-- | sensor/CMakeLists.txt | 18 |
3 files changed, 21 insertions, 7 deletions
diff --git a/apps/CMakeLists.txt b/apps/CMakeLists.txt index 01252cf..8ba5a0a 100644 --- a/apps/CMakeLists.txt +++ b/apps/CMakeLists.txt @@ -69,5 +69,11 @@ target_link_libraries(launcher ${CMAKE_THREAD_LIBS_INIT}) foreach(app ${APPS}) add_custom_command( TARGET launcher POST_BUILD - COMMAND ln -sf launcher ${app}) + COMMAND ln -sf ../libexec/launcher ${app}) + + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${app} DESTINATION bin) endforeach() + +set_target_properties(launcher PROPERTIES INSTALL_RPATH "\\$ORIGIN/../lib/trygvis") +install(TARGETS launcher + RUNTIME DESTINATION libexec) diff --git a/ble/CMakeLists.txt b/ble/CMakeLists.txt index 543e85d..3d8f7c9 100644 --- a/ble/CMakeLists.txt +++ b/ble/CMakeLists.txt @@ -1,4 +1,4 @@ -file(GLOB SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.h) +file(GLOB SOURCE_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.cpp *.h ../include/ble/*.h) add_library(ble ${SOURCE_FILES}) include_directories("${PROJECT_SOURCE_DIR}/include") diff --git a/sensor/CMakeLists.txt b/sensor/CMakeLists.txt index d571e38..c814687 100644 --- a/sensor/CMakeLists.txt +++ b/sensor/CMakeLists.txt @@ -1,14 +1,22 @@ file(GLOB_RECURSE INCLUDES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} include/*.h) add_library(trygvis-sensor - main/sensor.cpp - main/io.cpp - ${INCLUDES}) + STATIC + main/sensor.cpp + main/io.cpp + ${INCLUDES}) -include_directories("${PROJECT_SOURCE_DIR}/json/src") -include_directories(include) +target_include_directories(trygvis-sensor PUBLIC "${PROJECT_SOURCE_DIR}/json/src") +target_include_directories(trygvis-sensor PUBLIC include) # Boost find_package(Boost COMPONENTS regex system REQUIRED) add_subdirectory(test) + +install(TARGETS trygvis-sensor + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib/trygvis + ARCHIVE DESTINATION lib/trygvis) + +install(DIRECTORY include/trygvis DESTINATION include) |