Update to upstream version '3.24.1'
with Debian dir 7184a444bb
ci/unstable
commit
985d4aa8f9
@ -0,0 +1,3 @@
|
||||
cmake_minimum_required(VERSION 3.23)
|
||||
project(${RunCMake_TEST} NONE)
|
||||
include(${RunCMake_TEST}.cmake)
|
@ -0,0 +1,24 @@
|
||||
cmake_minimum_required(VERSION 3.23)
|
||||
include(RunCMake)
|
||||
|
||||
function(run_ExportImport_test case)
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-export-build)
|
||||
set(CMAKE_INSTALL_PREFIX ${RunCMake_TEST_BINARY_DIR}/root)
|
||||
if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
|
||||
set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Debug)
|
||||
endif()
|
||||
run_cmake(${case}-export)
|
||||
unset(RunCMake_TEST_OPTIONS)
|
||||
set(RunCMake_TEST_NO_CLEAN 1)
|
||||
run_cmake_command(${case}-export-build ${CMAKE_COMMAND} --build . --config Debug)
|
||||
run_cmake_command(${case}-export-install ${CMAKE_COMMAND} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DBUILD_TYPE=Debug -P cmake_install.cmake)
|
||||
unset(RunCMake_TEST_NO_CLEAN)
|
||||
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-import-build)
|
||||
run_cmake_with_options(${case}-import
|
||||
-Dfoo_DIR=${CMAKE_INSTALL_PREFIX}/lib/cmake/foo
|
||||
-Dbar_DIR=${CMAKE_INSTALL_PREFIX}/lib/cmake/bar
|
||||
)
|
||||
endfunction()
|
||||
|
||||
run_ExportImport_test(SharedDep)
|
@ -0,0 +1,13 @@
|
||||
enable_language(C)
|
||||
|
||||
add_library(foo SHARED foo.c)
|
||||
install(TARGETS foo EXPORT foo)
|
||||
install(EXPORT foo DESTINATION lib/cmake/foo)
|
||||
install(FILES foo-config.cmake.in RENAME foo-config.cmake DESTINATION lib/cmake/foo)
|
||||
|
||||
add_library(bar SHARED bar.c)
|
||||
target_link_libraries(bar PRIVATE foo)
|
||||
# 'foo' only appears in IMPORTED_LINK_DEPENDENT_LIBRARIES, and so is not enforced on import.
|
||||
install(TARGETS bar EXPORT bar)
|
||||
install(EXPORT bar DESTINATION lib/cmake/bar)
|
||||
install(FILES bar-config.cmake.in RENAME bar-config.cmake DESTINATION lib/cmake/bar)
|
@ -0,0 +1 @@
|
||||
find_package(bar REQUIRED CONFIG NO_DEFAULT_PATH)
|
@ -0,0 +1,2 @@
|
||||
# find_dependency(foo) intentionally left out for this test case
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/bar.cmake)
|
@ -0,0 +1,12 @@
|
||||
#if defined(_WIN32)
|
||||
__declspec(dllimport)
|
||||
#endif
|
||||
int foo(void);
|
||||
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
int bar(void)
|
||||
{
|
||||
return foo();
|
||||
}
|
@ -0,0 +1 @@
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/foo.cmake)
|
@ -0,0 +1,7 @@
|
||||
#ifdef _WIN32
|
||||
__declspec(dllexport)
|
||||
#endif
|
||||
int foo(void)
|
||||
{
|
||||
return 0;
|
||||
}
|
Loading…
Reference in new issue