mirror of
https://github.com/cpm-cmake/CPM.cmake.git
synced 2025-11-17 06:37:43 -05:00
* Fix #222 * Fix #222 * move policy change and local options to cpm_add_subdirectory * change default policy as well see https://gitlab.kitware.com/cmake/cmake/-/issues/20312 * add test * update check to not use the NOT operator (interestingly it works as expected locally) * simplify test by not using options * check options in tests Co-authored-by: Lars Melchior <TheLartians@users.noreply.github.com>
20 lines
555 B
CMake
20 lines
555 B
CMake
include(CMakePackageConfigHelpers)
|
|
include(${CPM_PATH}/testing.cmake)
|
|
|
|
set(TEST_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/source_dir)
|
|
|
|
set(TEST_DEPENDENCY_NAME Dependency)
|
|
|
|
configure_package_config_file(
|
|
"${CMAKE_CURRENT_LIST_DIR}/local_dependency/OptionsCMakeLists.txt.in"
|
|
"${CMAKE_CURRENT_LIST_DIR}/local_dependency/CMakeLists.txt"
|
|
INSTALL_DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/junk
|
|
)
|
|
|
|
execute_process(
|
|
COMMAND ${CMAKE_COMMAND} "-H${CMAKE_CURRENT_LIST_DIR}/local_dependency" "-B${TEST_BUILD_DIR}"
|
|
RESULT_VARIABLE ret
|
|
)
|
|
|
|
assert_equal(${ret} "0")
|