diff --git a/CMakeLists.txt b/CMakeLists.txt index 9f583afc..d55fdc51 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0) +cmake_minimum_required(VERSION 3.16) project(rapidcheck CXX) # Don't warn about symbol visibility for static libraries with CMake 3.3 and later. @@ -122,3 +122,20 @@ add_subdirectory(extras) # Install the export file specifying all the targets for RapidCheck install(EXPORT rapidcheckConfig DESTINATION share/rapidcheck/cmake) 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" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + ) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) diff --git a/extras/boost/CMakeLists.txt b/extras/boost/CMakeLists.txt index fe6b4e3a..87ce2dfc 100644 --- a/extras/boost/CMakeLists.txt +++ b/extras/boost/CMakeLists.txt @@ -1,3 +1,5 @@ +project(rapidcheck_boost CXX) + add_library(rapidcheck_boost INTERFACE) target_link_libraries(rapidcheck_boost INTERFACE rapidcheck) target_include_directories(rapidcheck_boost INTERFACE @@ -13,3 +15,20 @@ install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) if (RC_ENABLE_TESTS) add_subdirectory(test) endif() + +set(PKG_CONFIG_REQUIRES "rapidcheck") +set(PKG_CONFIG_DESCRIPTION_SUMMARY "boost headers for rapidcheck") +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" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + ) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) diff --git a/extras/boost_test/CMakeLists.txt b/extras/boost_test/CMakeLists.txt index a4394034..b17a5e4d 100644 --- a/extras/boost_test/CMakeLists.txt +++ b/extras/boost_test/CMakeLists.txt @@ -1,3 +1,5 @@ +project(rapidcheck_boost_test CXX) + add_library(rapidcheck_boost_test INTERFACE) target_link_libraries(rapidcheck_boost_test INTERFACE rapidcheck) target_include_directories(rapidcheck_boost_test INTERFACE @@ -9,3 +11,20 @@ target_include_directories(rapidcheck_boost_test INTERFACE # and information on its targets. install(TARGETS rapidcheck_boost_test EXPORT rapidcheckConfig) install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +set(PKG_CONFIG_REQUIRES "rapidcheck") +set(PKG_CONFIG_DESCRIPTION_SUMMARY "boost_test headers for rapidcheck") +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" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + ) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) diff --git a/extras/catch/CMakeLists.txt b/extras/catch/CMakeLists.txt index 1f1f6772..35fb3010 100644 --- a/extras/catch/CMakeLists.txt +++ b/extras/catch/CMakeLists.txt @@ -1,3 +1,5 @@ +project(rapidcheck_catch CXX) + add_library(rapidcheck_catch INTERFACE) target_link_libraries(rapidcheck_catch INTERFACE rapidcheck) target_include_directories(rapidcheck_catch INTERFACE @@ -9,3 +11,20 @@ target_include_directories(rapidcheck_catch INTERFACE # and information on its targets. install(TARGETS rapidcheck_catch EXPORT rapidcheckConfig) install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +set(PKG_CONFIG_REQUIRES "rapidcheck") +set(PKG_CONFIG_DESCRIPTION_SUMMARY "catch headers for rapidcheck") +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" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + ) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) diff --git a/extras/doctest/CMakeLists.txt b/extras/doctest/CMakeLists.txt index 9c41d913..d9170c76 100644 --- a/extras/doctest/CMakeLists.txt +++ b/extras/doctest/CMakeLists.txt @@ -1,3 +1,5 @@ +project(rapidcheck_doctest CXX) + add_library(rapidcheck_doctest INTERFACE) target_link_libraries(rapidcheck_doctest INTERFACE rapidcheck) target_include_directories(rapidcheck_doctest INTERFACE @@ -9,3 +11,20 @@ target_include_directories(rapidcheck_doctest INTERFACE # and information on its targets. install(TARGETS rapidcheck_doctest EXPORT rapidcheckConfig) install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +set(PKG_CONFIG_REQUIRES "rapidcheck") +set(PKG_CONFIG_DESCRIPTION_SUMMARY "doctest headers for rapidcheck") +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" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + ) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) diff --git a/extras/gmock/CMakeLists.txt b/extras/gmock/CMakeLists.txt index dd4fa6cc..fd709b2d 100644 --- a/extras/gmock/CMakeLists.txt +++ b/extras/gmock/CMakeLists.txt @@ -1,3 +1,5 @@ +project(rapidcheck_gtest CXX) + add_library(rapidcheck_gmock INTERFACE) target_link_libraries(rapidcheck_gmock INTERFACE rapidcheck) target_include_directories(rapidcheck_gmock INTERFACE @@ -13,3 +15,20 @@ install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) if (RC_ENABLE_TESTS) add_subdirectory(test) endif() + +set(PKG_CONFIG_REQUIRES "rapidcheck") +set(PKG_CONFIG_DESCRIPTION_SUMMARY "gmock headers for rapidcheck") +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" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + ) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) diff --git a/extras/gtest/CMakeLists.txt b/extras/gtest/CMakeLists.txt index 40c22ea0..ae36648a 100644 --- a/extras/gtest/CMakeLists.txt +++ b/extras/gtest/CMakeLists.txt @@ -1,3 +1,5 @@ +project(rapidcheck_gtest CXX) + add_library(rapidcheck_gtest INTERFACE) target_link_libraries(rapidcheck_gtest INTERFACE rapidcheck) target_include_directories(rapidcheck_gtest INTERFACE @@ -9,3 +11,20 @@ target_include_directories(rapidcheck_gtest INTERFACE # and information on its targets. install(TARGETS rapidcheck_gtest EXPORT rapidcheckConfig) install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + +set(PKG_CONFIG_REQUIRES "rapidcheck") +set(PKG_CONFIG_DESCRIPTION_SUMMARY "gtest headers for rapidcheck") +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" + "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + ) + +install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.pc" + DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig + ) diff --git a/pkg-config.pc.cmake b/pkg-config.pc.cmake new file mode 100644 index 00000000..182cf0e2 --- /dev/null +++ b/pkg-config.pc.cmake @@ -0,0 +1,9 @@ +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}