-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added system installation configuration #124
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,10 @@ enable_testing() | |
option(RC_ENABLE_TESTS "Build RapidCheck tests" OFF) | ||
option(RC_ENABLE_EXAMPLES "Build RapidCheck examples" OFF) | ||
|
||
set(cmake_config_files | ||
"rapidcheck-config.cmake" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The naming here is a CMake convention, I suppose? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the official docs, yes. |
||
) | ||
|
||
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 | ||
|
@@ -76,3 +80,34 @@ if (RC_ENABLE_EXAMPLES) | |
endif() | ||
|
||
add_subdirectory(extras) | ||
|
||
# install the targets and include directories | ||
install(TARGETS rapidcheck | ||
ARCHIVE DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation seems off, should be spaces and not tabs. In general, continuations should be aligned. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My apologies. I thought vim had the right syntax loaded...I'll fix the tabs. As far as your continuations: what mean you? |
||
) | ||
|
||
install(DIRECTORY "include/" | ||
DESTINATION "${CMAKE_INSTALL_PREFIX}/include" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the docs, relative paths are interpreted as being relative to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Makes sense. |
||
) | ||
|
||
# setup the cmake config files | ||
# the include directories to export in our cmake config file | ||
set(CONFIG_INCLUDE_DIRS | ||
"${CMAKE_INSTALL_PREFIX}/include" | ||
) | ||
|
||
# The libraries to export in our cmake config file | ||
set(CONFIG_LIBRARIES "rapidcheck") | ||
|
||
# generate the cmake config files | ||
foreach(f ${cmake_config_files}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As I said above, right now there is only one file. |
||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/${f}.in" | ||
"${PROJECT_BINARY_DIR}/${f}" | ||
@ONLY | ||
) | ||
|
||
install( | ||
FILES "${PROJECT_BINARY_DIR}/${f}" | ||
DESTINATION "lib/cmake/rapidcheck" | ||
) | ||
endforeach() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
add_library(rapidcheck_boost_test INTERFACE) | ||
target_link_libraries(rapidcheck_boost_test INTERFACE rapidcheck) | ||
target_include_directories(rapidcheck_boost_test INTERFACE include) | ||
|
||
install(DIRECTORY "include/" | ||
DESTINATION "${CMAKE_INSTALL_PREFIX}/include" | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
add_library(rapidcheck_catch INTERFACE) | ||
target_link_libraries(rapidcheck_catch INTERFACE rapidcheck) | ||
target_include_directories(rapidcheck_catch INTERFACE include) | ||
target_include_directories(rapidcheck_catch INTERFACE include) | ||
|
||
install(DIRECTORY "include/" | ||
DESTINATION "${CMAKE_INSTALL_PREFIX}/include" | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
add_library(rapidcheck_gtest INTERFACE) | ||
target_link_libraries(rapidcheck_gtest INTERFACE rapidcheck) | ||
target_include_directories(rapidcheck_gtest INTERFACE include) | ||
|
||
install(DIRECTORY "include/" | ||
DESTINATION "${CMAKE_INSTALL_PREFIX}/include" | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#When run this file will define the following CMake cached variables: | ||
# | ||
# rapidcheck_INCLUDE_DIRS | ||
# rapidcheck_LIBRARIES | ||
# | ||
set(rapidcheck_INCLUDE_DIRS "@CONFIG_INCLUDE_DIRS@") | ||
set(rapidcheck_LIBRARIES "@CONFIG_LIBRARIES@") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this variable needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I follow the "write-once" principle in programming. I'm going to add a version file as soon as you respond to #123 (if you say yes). If not I'll remove it as it's unnecessary. In short it's a container for the loop below.