Add generation and install of CMake packages

This commit is contained in:
Samuel Debionne
2019-02-11 13:56:48 +01:00
parent 01e3cb8d5e
commit c064dc84ae
9 changed files with 334 additions and 39 deletions

View File

@ -37,7 +37,10 @@ add_library(slsSupportLib SHARED
${HEADERS}
)
target_include_directories(slsSupportLib PUBLIC include)
target_include_directories(slsSupportLib PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
)
set_target_properties(slsSupportLib PROPERTIES
LIBRARY_OUTPUT_NAME SlsSupport
@ -49,8 +52,10 @@ if (USE_TESTS)
add_subdirectory(tests)
endif(USE_TESTS)
# Install the library
install(TARGETS slsSupportLib
LIBRARY DESTINATION lib
PUBLIC_HEADER DESTINATION include
ARCHIVE DESTINATION lib
EXPORT "${TARGETS_EXPORT_NAME}"
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)