mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 00:11:07 -06:00
Add tests for install(PACKAGE_INFO) destination
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/Assertions.cmake)
|
||||
|
||||
file(READ "${RunCMake_BINARY_DIR}/install/test/foo.cps" content)
|
||||
expect_value("${content}" "foo" "name")
|
||||
expect_value("${content}" "interface" "components" "foo" "type")
|
||||
7
Tests/RunCMake/InstallPackageInfo/Destination.cmake
Normal file
7
Tests/RunCMake/InstallPackageInfo/Destination.cmake
Normal file
@@ -0,0 +1,7 @@
|
||||
cmake_path(GET CMAKE_BINARY_DIR PARENT_PATH out_dir)
|
||||
set(CMAKE_PREFIX_PATH "${out_dir}/install")
|
||||
set(CMAKE_INSTALL_PREFIX "${out_dir}/install")
|
||||
|
||||
add_library(foo INTERFACE)
|
||||
install(TARGETS foo EXPORT foo)
|
||||
install(PACKAGE_INFO foo DESTINATION test EXPORT foo)
|
||||
@@ -10,6 +10,19 @@ set(RunCMake_TEST_OPTIONS
|
||||
"-DCMAKE_EXPERIMENTAL_EXPORT_PACKAGE_INFO:STRING=b80be207-778e-46ba-8080-b23bba22639e"
|
||||
)
|
||||
|
||||
function(run_cmake_install test)
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${test}-build)
|
||||
if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
|
||||
list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
|
||||
endif()
|
||||
|
||||
run_cmake(${test})
|
||||
|
||||
set(RunCMake_TEST_NO_CLEAN TRUE)
|
||||
run_cmake_command(${test}-build ${CMAKE_COMMAND} --build . --config Release)
|
||||
run_cmake_command(${test}-install ${CMAKE_COMMAND} --install . --config Release)
|
||||
endfunction()
|
||||
|
||||
# Test incorrect usage
|
||||
run_cmake(BadArgs1)
|
||||
run_cmake(BadArgs2)
|
||||
@@ -36,3 +49,4 @@ run_cmake(Requirements)
|
||||
run_cmake(TargetTypes)
|
||||
run_cmake(DependsMultiple)
|
||||
run_cmake(DependsMultipleNotInstalled)
|
||||
run_cmake_install(Destination)
|
||||
|
||||
Reference in New Issue
Block a user