summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-06-26 13:47:21 (GMT)
committerKitware Robot <kwrobot@kitware.com>2023-06-26 13:47:30 (GMT)
commit61bb728c0c874b85620289fd233bd0deb741a27c (patch)
treecfe01697ec42c20c9b5694223acd83832f27b29a /Tests
parentfd74c4e16b353b0e5b20987efe51811928896948 (diff)
parentd605f728f76b84e1e60000b9cb8704e5c1396763 (diff)
downloadCMake-61bb728c0c874b85620289fd233bd0deb741a27c.zip
CMake-61bb728c0c874b85620289fd233bd0deb741a27c.tar.gz
CMake-61bb728c0c874b85620289fd233bd0deb741a27c.tar.bz2
Merge topic 'imported-target-framework-path'
d605f728f7 macOS: Allow IMPORTED_LOCATION to be a framework folder Acked-by: Kitware Robot <kwrobot@kitware.com> Tested-by: buildbot <buildbot@kitware.com> Merge-request: !8586
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMP0111/CMP0111-NEW-stderr.txt19
-rw-r--r--Tests/RunCMake/CMP0111/CMP0111-WARN-stderr.txt29
-rw-r--r--Tests/RunCMake/Framework/FrameworkConsumption.cmake4
-rw-r--r--Tests/RunCMake/Framework/ImportedFrameworkConsumption.cmake7
-rw-r--r--Tests/RunCMake/Framework/RunCMakeTest.cmake11
5 files changed, 28 insertions, 42 deletions
diff --git a/Tests/RunCMake/CMP0111/CMP0111-NEW-stderr.txt b/Tests/RunCMake/CMP0111/CMP0111-NEW-stderr.txt
index 91a90e5..e5eb4bf 100644
--- a/Tests/RunCMake/CMP0111/CMP0111-NEW-stderr.txt
+++ b/Tests/RunCMake/CMP0111/CMP0111-NEW-stderr.txt
@@ -1,17 +1,4 @@
-^CMake Error in CMakeLists.txt:
- IMPORTED_LOCATION not set for imported target "unknown_lib"( configuration
- "[^"]+")?.
-+
-CMake Error in CMakeLists.txt:
- IMPORTED_LOCATION not set for imported target "static_lib"( configuration
- "[^"]+")?.
-+
-CMake Error in CMakeLists.txt:
- IMPORTED_IMPLIB not set for imported target "shared_lib"( configuration
- "[^"]+")?.(
-+
-CMake Error in CMakeLists.txt:
+^(CMake Error in CMakeLists.txt:
IMPORTED_(LOCATION|IMPLIB) not set for imported target "(unknown|static|shared)_lib"( configuration
- "[^"]+")?.)*
-+
-CMake Generate step failed. Build files cannot be regenerated correctly.$
+ "[^"]+")?.
++)+CMake Generate step failed. Build files cannot be regenerated correctly.$
diff --git a/Tests/RunCMake/CMP0111/CMP0111-WARN-stderr.txt b/Tests/RunCMake/CMP0111/CMP0111-WARN-stderr.txt
index 27af911..5286134 100644
--- a/Tests/RunCMake/CMP0111/CMP0111-WARN-stderr.txt
+++ b/Tests/RunCMake/CMP0111/CMP0111-WARN-stderr.txt
@@ -1,34 +1,13 @@
-^CMake Warning \(dev\) in CMakeLists.txt:
+^(CMake Warning \(dev\) in CMakeLists.txt:
Policy CMP0111 is not set: An imported target missing its location property
fails during generation. Run "cmake --help-policy CMP0111" for policy
details. Use the cmake_policy command to set the policy and suppress this
warning.
- IMPORTED_LOCATION not set for imported target "unknown_lib"( configuration
- "[^"]+")?.
-This warning is for project developers. Use -Wno-dev to suppress it.
-+
-CMake Warning \(dev\) in CMakeLists.txt:
- Policy CMP0111 is not set: An imported target missing its location property
- fails during generation. Run "cmake --help-policy CMP0111" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- IMPORTED_LOCATION not set for imported target "static_lib"( configuration
+ IMPORTED_(LOCATION|IMPLIB) not set for imported target "(unknown|static|shared)_lib"( configuration
"[^"]+")?.
This warning is for project developers. Use -Wno-dev to suppress it.
-+
-CMake Warning \(dev\) in CMakeLists.txt:
- Policy CMP0111 is not set: An imported target missing its location property
- fails during generation. Run "cmake --help-policy CMP0111" for policy
- details. Use the cmake_policy command to set the policy and suppress this
- warning.
-
- IMPORTED_IMPLIB not set for imported target "shared_lib"( configuration
- "[^"]+")?.
-This warning is for project developers. Use -Wno-dev to suppress it.(
-+
-CMake Warning \(dev\) in CMakeLists.txt:
++)+CMake Warning \(dev\) in CMakeLists.txt:
Policy CMP0111 is not set: An imported target missing its location property
fails during generation. Run "cmake --help-policy CMP0111" for policy
details. Use the cmake_policy command to set the policy and suppress this
@@ -36,4 +15,4 @@ CMake Warning \(dev\) in CMakeLists.txt:
IMPORTED_(LOCATION|IMPLIB) not set for imported target "(unknown|static|shared)_lib"( configuration
"[^"]+")?.
-This warning is for project developers. Use -Wno-dev to suppress it.)*$
+This warning is for project developers. Use -Wno-dev to suppress it.$
diff --git a/Tests/RunCMake/Framework/FrameworkConsumption.cmake b/Tests/RunCMake/Framework/FrameworkConsumption.cmake
index 2180cf9..f831a94 100644
--- a/Tests/RunCMake/Framework/FrameworkConsumption.cmake
+++ b/Tests/RunCMake/Framework/FrameworkConsumption.cmake
@@ -1,5 +1,7 @@
enable_language(C)
+set(CMAKE_INSTALL_PREFIX "${CMAKE_BINARY_DIR}/install")
+
# Create framework and ensure header is placed in Headers
set(input_header "${CMAKE_SOURCE_DIR}/Gui.h")
add_library(Gui SHARED Gui.c "${input_header}")
@@ -8,6 +10,8 @@ set_target_properties(Gui PROPERTIES
FRAMEWORK TRUE
)
+install(TARGETS Gui DESTINATION .)
+
add_executable(app main.c)
target_link_libraries(app PRIVATE Gui)
diff --git a/Tests/RunCMake/Framework/ImportedFrameworkConsumption.cmake b/Tests/RunCMake/Framework/ImportedFrameworkConsumption.cmake
new file mode 100644
index 0000000..c44a1bb
--- /dev/null
+++ b/Tests/RunCMake/Framework/ImportedFrameworkConsumption.cmake
@@ -0,0 +1,7 @@
+enable_language(C)
+
+add_library(Gui IMPORTED UNKNOWN)
+set_property(TARGET Gui PROPERTY IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/../FrameworkConsumption-build/install/Gui.framework")
+
+add_executable(app main.c)
+target_link_libraries(app PRIVATE Gui)
diff --git a/Tests/RunCMake/Framework/RunCMakeTest.cmake b/Tests/RunCMake/Framework/RunCMakeTest.cmake
index a767130..7319a59 100644
--- a/Tests/RunCMake/Framework/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Framework/RunCMakeTest.cmake
@@ -113,7 +113,16 @@ function(framework_consumption)
file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
run_cmake(FrameworkConsumption)
- run_cmake_command(FrameworkConsumption-build ${CMAKE_COMMAND} --build .)
+ run_cmake_command(FrameworkConsumption-build ${CMAKE_COMMAND} --build . --config Release)
+ run_cmake_command(FrameworkConsumption-install ${CMAKE_COMMAND} --install . --config Release)
+
+ set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/ImportedFrameworkConsumption-build")
+ set(RunCMake_TEST_NO_CLEAN 1)
+
+ file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+ file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+ run_cmake(ImportedFrameworkConsumption)
+ run_cmake_command(ImportedFrameworkConsumption-build ${CMAKE_COMMAND} --build . --config Release)
endfunction()
framework_consumption()