summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-06-16 15:54:24 (GMT)
committerBrad King <brad.king@kitware.com>2023-06-23 16:07:18 (GMT)
commitd605f728f76b84e1e60000b9cb8704e5c1396763 (patch)
treed960480f98093f89f4fe13937997d2afa3430555 /Tests
parentacc7e6a1445e584e21db57d167db3f0d7cae6257 (diff)
downloadCMake-d605f728f76b84e1e60000b9cb8704e5c1396763.zip
CMake-d605f728f76b84e1e60000b9cb8704e5c1396763.tar.gz
CMake-d605f728f76b84e1e60000b9cb8704e5c1396763.tar.bz2
macOS: Allow IMPORTED_LOCATION to be a framework folder
Issue: #24946
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()