From a1b88d3a622834daf59bc1852f4d43c8ef4c63d7 Mon Sep 17 00:00:00 2001 From: Erik Frojdh Date: Fri, 4 Sep 2020 11:20:33 +0200 Subject: [PATCH] fix --- slsReceiverSoftware/CMakeLists.txt | 8 ++++--- slsSupportLib/CMakeLists.txt | 35 +++++++++++++++--------------- 2 files changed, 22 insertions(+), 21 deletions(-) diff --git a/slsReceiverSoftware/CMakeLists.txt b/slsReceiverSoftware/CMakeLists.txt index ecc9a262a..7c8394ef5 100755 --- a/slsReceiverSoftware/CMakeLists.txt +++ b/slsReceiverSoftware/CMakeLists.txt @@ -34,10 +34,12 @@ if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE) set_property(TARGET slsReceiverShared PROPERTY INTERPROCEDURAL_OPTIMIZATION True) endif() -target_link_libraries(slsReceiverShared PUBLIC +target_link_libraries(slsReceiverShared + PUBLIC slsProjectOptions - slsProjectWarnings - slsSupportLib + slsSupportLibStatic + PRIVATE + slsProjectWarnings #don't propagate warnigns ) target_include_directories(slsReceiverShared PUBLIC diff --git a/slsSupportLib/CMakeLists.txt b/slsSupportLib/CMakeLists.txt index 8ec99a318..9958a2178 100755 --- a/slsSupportLib/CMakeLists.txt +++ b/slsSupportLib/CMakeLists.txt @@ -12,9 +12,6 @@ set(SOURCES src/sls_detector_exceptions.cpp ) -set(HEADERS -) - set(PUBLICHEADERS include/sls_detector_defs.h include/sls_detector_exceptions.h @@ -26,6 +23,10 @@ set(PUBLICHEADERS include/TimeHelper.h ) +# Additional headers to be installed if SLS_DEVEL_HEADERS +# is specified as an option. Aim is to give the developer +# access to utilities in the support library while +# at the same time offer a minimal install if(SLS_DEVEL_HEADERS) set(PUBLICHEADERS ${PUBLICHEADERS} @@ -44,15 +45,12 @@ if(SLS_DEVEL_HEADERS) ) endif() -# Create a Object library to avoid duplicating the build +# Create a Object library to avoidbuilding the library twice add_library(slsSupportObject OBJECT ${SOURCES} ${HEADERS} ) - - - target_include_directories(slsSupportObject PUBLIC "$" "$" @@ -77,11 +75,11 @@ if (SLS_USE_TESTS) endif(SLS_USE_TESTS) add_library(slsSupportLib SHARED $) - -target_include_directories(slsSupportLib PUBLIC - "$" - "$" -) +target_link_libraries(slsSupportLib PUBLIC slsSupportObject) +# target_include_directories(slsSupportLib PUBLIC +# "$" +# "$" +# ) set_target_properties(slsSupportLib PROPERTIES LIBRARY_OUTPUT_NAME SlsSupport @@ -90,6 +88,7 @@ set_target_properties(slsSupportLib PROPERTIES ) add_library(slsSupportLibStatic STATIC $) +target_link_libraries(slsSupportLibStatic PUBLIC slsSupportObject) set_target_properties(slsSupportLibStatic PROPERTIES ARCHIVE_OUTPUT_NAME SlsSupportStatic @@ -97,19 +96,19 @@ set_target_properties(slsSupportLibStatic PROPERTIES PUBLIC_HEADER "${PUBLICHEADERS}" ) -target_include_directories(slsSupportLibStatic PUBLIC - "$" - "$" -) +# target_include_directories(slsSupportLibStatic PUBLIC +# "$" +# "$" +# ) if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE) set_property(TARGET slsSupportObject PROPERTY INTERPROCEDURAL_OPTIMIZATION True) - set_property(TARGET slsSupportLib PROPERTY INTERPROCEDURAL_OPTIMIZATION True) + set_property(TARGET slsSupportLib PROPERTY INTERPROCEDURAL_OPTIMIZATION True) set_property(TARGET slsSupportLibStatic PROPERTY INTERPROCEDURAL_OPTIMIZATION True) endif() # Install the library -install(TARGETS slsSupportLib slsSupportLibStatic +install(TARGETS slsSupportLib slsSupportLibStatic slsSupportObject EXPORT "${TARGETS_EXPORT_NAME}" LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}