mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
Merge branch 'developer' into rxrmetadata
This commit is contained in:
@ -12,9 +12,7 @@ set(SOURCES
|
||||
src/sls_detector_exceptions.cpp
|
||||
)
|
||||
|
||||
set(HEADERS
|
||||
)
|
||||
|
||||
# Header files to install as a part of the library
|
||||
set(PUBLICHEADERS
|
||||
include/sls_detector_defs.h
|
||||
include/sls_detector_exceptions.h
|
||||
@ -26,6 +24,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,54 +46,66 @@ if(SLS_DEVEL_HEADERS)
|
||||
)
|
||||
endif()
|
||||
|
||||
add_library(slsSupportLib SHARED
|
||||
# Create an object library to avoid building the library twice
|
||||
add_library(slsSupportObject OBJECT
|
||||
${SOURCES}
|
||||
${HEADERS}
|
||||
)
|
||||
|
||||
|
||||
if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE)
|
||||
set_property(TARGET slsSupportLib PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
target_include_directories(slsSupportLib PUBLIC
|
||||
target_include_directories(slsSupportObject
|
||||
PUBLIC
|
||||
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
|
||||
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
||||
)
|
||||
|
||||
target_include_directories(slsSupportLib PRIVATE
|
||||
PRIVATE
|
||||
${ZeroMQ_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
|
||||
set_target_properties(slsSupportLib PROPERTIES
|
||||
LIBRARY_OUTPUT_NAME SlsSupport
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
PUBLIC_HEADER "${PUBLICHEADERS}"
|
||||
)
|
||||
|
||||
target_link_libraries(slsSupportLib
|
||||
PUBLIC
|
||||
target_link_libraries(slsSupportObject
|
||||
PUBLIC
|
||||
slsProjectOptions
|
||||
# ${ZeroMQ_LIBRARIES}
|
||||
zmq
|
||||
# zmq
|
||||
${ZeroMQ_LIBRARIES}
|
||||
rapidjson
|
||||
PRIVATE
|
||||
PRIVATE
|
||||
slsProjectWarnings
|
||||
)
|
||||
|
||||
|
||||
|
||||
if (SLS_USE_TESTS)
|
||||
add_subdirectory(tests)
|
||||
endif(SLS_USE_TESTS)
|
||||
|
||||
# Install the library
|
||||
install(TARGETS slsSupportLib
|
||||
# Add shared library version of the support lib
|
||||
add_library(slsSupportShared SHARED $<TARGET_OBJECTS:slsSupportObject>)
|
||||
|
||||
target_link_libraries(slsSupportShared PUBLIC slsSupportObject)
|
||||
|
||||
set_target_properties(slsSupportShared PROPERTIES
|
||||
LIBRARY_OUTPUT_NAME SlsSupport
|
||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
PUBLIC_HEADER "${PUBLICHEADERS}"
|
||||
)
|
||||
|
||||
# Add static version of the support lib
|
||||
add_library(slsSupportStatic STATIC $<TARGET_OBJECTS:slsSupportObject>)
|
||||
|
||||
target_link_libraries(slsSupportStatic PUBLIC slsSupportObject)
|
||||
|
||||
set_target_properties(slsSupportStatic PROPERTIES
|
||||
ARCHIVE_OUTPUT_NAME SlsSupportStatic
|
||||
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
|
||||
PUBLIC_HEADER "${PUBLICHEADERS}"
|
||||
)
|
||||
|
||||
if((CMAKE_BUILD_TYPE STREQUAL "Release") AND SLS_LTO_AVAILABLE)
|
||||
set_property(TARGET slsSupportObject PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
|
||||
set_property(TARGET slsSupportShared PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
|
||||
set_property(TARGET slsSupportStatic PROPERTY INTERPROCEDURAL_OPTIMIZATION True)
|
||||
endif()
|
||||
|
||||
install(TARGETS slsSupportShared slsSupportStatic slsSupportObject
|
||||
EXPORT "${TARGETS_EXPORT_NAME}"
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
|
||||
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||
)
|
||||
|
||||
|
Reference in New Issue
Block a user