Skip to content

Commit

Permalink
changes for vcpkg (#537)
Browse files Browse the repository at this point in the history
Co-authored-by: Christian Göhring <[email protected]>
  • Loading branch information
mostsignificant and Christian Göhring authored May 5, 2024
1 parent d159efb commit 266142b
Showing 1 changed file with 21 additions and 4 deletions.
25 changes: 21 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>)

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))
Expand Down Expand Up @@ -160,4 +177,4 @@ if (BUILD_FAKER_TESTS)
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR})

target_code_coverage(${LIBRARY_NAME}-UT ALL)
endif ()
endif ()

0 comments on commit 266142b

Please sign in to comment.