Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 4 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ option(RC_ENABLE_TESTS "Build RapidCheck tests" OFF)
option(RC_ENABLE_EXAMPLES "Build RapidCheck examples" OFF)
option(RC_ENABLE_RTTI "Build RapidCheck with RTTI" ON)

include(GNUInstallDirs)

if(MSVC)
# /bigobj - some object files become very large so we need this
# /wd4503 - truncation of decorated name, not much we can do about it so
Expand Down Expand Up @@ -83,10 +85,9 @@ endif()

target_include_directories(rapidcheck PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
$<INSTALL_INTERFACE:include> # <prefix>/include
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
)

include(GNUInstallDirs)
install(TARGETS rapidcheck EXPORT rapidcheckConfig
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} # This is for Windows
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
Expand Down Expand Up @@ -120,16 +121,10 @@ endif()
add_subdirectory(extras)

# Install the export file specifying all the targets for RapidCheck
install(EXPORT rapidcheckConfig DESTINATION share/rapidcheck/cmake)
install(EXPORT rapidcheckConfig DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}")
export(EXPORT rapidcheckConfig FILE rapidcheckConfig.cmake)

set(PKG_CONFIG_REQUIRES)
set(PKG_CONFIG_DESCRIPTION_SUMMARY "C++ framework for property based testing inspired by QuickCheck and other similar frameworks")
set(PKG_CONFIG_VERSION)
set(PKG_CONFIG_LIBDIR "\${prefix}/lib")
set(PKG_CONFIG_INCLUDEDIR "\${prefix}/include")
set(PKG_CONFIG_LIBS)
set(PKG_CONFIG_CFLAGS "-I\${includedir}")

configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/pkg-config.pc.cmake"
Expand Down
14 changes: 7 additions & 7 deletions pkg-config.pc.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
prefix=${CMAKE_INSTALL_PREFIX}
includedir=${CMAKE_INSTALL_FULL_INCLUDEDIR}
libdir=${CMAKE_INSTALL_FULL_LIBDIR}

Name: ${PROJECT_NAME}
Description: ${PKG_CONFIG_DESCRIPTION_SUMMARY}
Version: ${PKG_CONFIG_VERSION}
Requires: ${PKG_CONFIG_REQUIRES}
prefix=${CMAKE_INSTALL_PREFIX}
includedir=${PKG_CONFIG_INCLUDEDIR}
libdir=${PKG_CONFIG_LIBDIR}
Libs: ${PKG_CONFIG_LIBS}
Cflags: ${PKG_CONFIG_CFLAGS}
Version:
Libs: -L${libdir} -lrapidcheck
Cflags: -I${includedir}