mirror of
https://github.com/reactos/CMake.git
synced 2024-11-24 20:19:53 +00:00
Merge topic 'test-install-objects-as-files'
f4c23ee2
Tests: Add case for install(FILES) with TARGET_OBJECTSd272c4d5
Tests: Generalize RunCMake.install internal infrastructure Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !769
This commit is contained in:
commit
6cc5bf3dfa
@ -0,0 +1 @@
|
||||
check_installed([[^objs;objs/obj1(\.c)?\.(o|obj);objs/obj2(\.c)?\.(o|obj)$]])
|
3
Tests/RunCMake/install/FILES-TARGET_OBJECTS.cmake
Normal file
3
Tests/RunCMake/install/FILES-TARGET_OBJECTS.cmake
Normal file
@ -0,0 +1,3 @@
|
||||
enable_language(C)
|
||||
add_library(objs OBJECT obj1.c obj2.c)
|
||||
install(FILES $<TARGET_OBJECTS:objs> DESTINATION objs)
|
@ -13,12 +13,15 @@ function(run_install_test case)
|
||||
# Check "all" components.
|
||||
set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root-all)
|
||||
run_cmake_command(${case}-all ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -P cmake_install.cmake)
|
||||
# Check unspecified component.
|
||||
set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root-uns)
|
||||
run_cmake_command(${case}-uns ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -DCOMPONENT=Unspecified -P cmake_install.cmake)
|
||||
# Check explicit component.
|
||||
set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root-exc)
|
||||
run_cmake_command(${case}-exc ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -DCOMPONENT=exc -P cmake_install.cmake)
|
||||
|
||||
if(run_install_test_components)
|
||||
# Check unspecified component.
|
||||
set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root-uns)
|
||||
run_cmake_command(${case}-uns ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -DCOMPONENT=Unspecified -P cmake_install.cmake)
|
||||
# Check explicit component.
|
||||
set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root-exc)
|
||||
run_cmake_command(${case}-exc ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -DCOMPONENT=exc -P cmake_install.cmake)
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
# Function called in *-check.cmake scripts to check installed files.
|
||||
@ -57,5 +60,10 @@ run_cmake(CMP0062-OLD)
|
||||
run_cmake(CMP0062-NEW)
|
||||
run_cmake(CMP0062-WARN)
|
||||
|
||||
if(NOT RunCMake_GENERATOR STREQUAL "Xcode" OR NOT "$ENV{CMAKE_OSX_ARCHITECTURES}" MATCHES "[;$]")
|
||||
run_install_test(FILES-TARGET_OBJECTS)
|
||||
endif()
|
||||
|
||||
set(run_install_test_components 1)
|
||||
run_install_test(FILES-EXCLUDE_FROM_ALL)
|
||||
run_install_test(TARGETS-EXCLUDE_FROM_ALL)
|
||||
|
4
Tests/RunCMake/install/obj1.c
Normal file
4
Tests/RunCMake/install/obj1.c
Normal file
@ -0,0 +1,4 @@
|
||||
int obj1(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
4
Tests/RunCMake/install/obj2.c
Normal file
4
Tests/RunCMake/install/obj2.c
Normal file
@ -0,0 +1,4 @@
|
||||
int obj2(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user