diff --git a/CMakeLists.txt b/CMakeLists.txt index a7c70d142..c0c147399 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,9 +106,26 @@ set(FAKER_UT_SOURCES add_library(${LIBRARY_NAME} ${FAKER_SOURCES}) target_include_directories( - ${LIBRARY_NAME} - INTERFACE "${CMAKE_CURRENT_LIST_DIR}/include" - PRIVATE "${CMAKE_CURRENT_LIST_DIR}/include") + ${LIBRARY_NAME} PUBLIC + $ + $) + +install(TARGETS ${LIBRARY_NAME} + EXPORT ${LIBRARY_NAME}-targets + ARCHIVE DESTINATION lib + LIBRARY DESTINATION lib + RUNTIME DESTINATION bin) + +install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/faker-cxx + DESTINATION include/ + FILES_MATCHING + PATTERN "*.h" +) + +install(EXPORT ${LIBRARY_NAME}-targets + NAMESPACE ${LIBRARY_NAME}:: + FILE ${LIBRARY_NAME}-config.cmake + DESTINATION lib/cmake/${LIBRARY_NAME}) if (APPLE OR (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12)) @@ -160,4 +177,4 @@ if (BUILD_FAKER_TESTS) WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}) target_code_coverage(${LIBRARY_NAME}-UT ALL) -endif () +endif () \ No newline at end of file