summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-04-15 12:23:50 (GMT)
committerKitware Robot <kwrobot@kitware.com>2022-04-15 12:23:57 (GMT)
commit1cf59d526733b9025f2e307c2ec9a247f5b27235 (patch)
tree4340a4af1fbe6a7abaef16fd3c2ca109f2f0d286 /Tests
parentbde8fa492295795b94b0a03bb62cd7a371fd1665 (diff)
parentd0d09aa29fa354bc13a925655c0d191bbadd4c6a (diff)
downloadCMake-1cf59d526733b9025f2e307c2ec9a247f5b27235.zip
CMake-1cf59d526733b9025f2e307c2ec9a247f5b27235.tar.gz
CMake-1cf59d526733b9025f2e307c2ec9a247f5b27235.tar.bz2
Merge topic 'file-set-generated-dependency'
d0d09aa29f FILE_SET: Make INTERFACE libraries with HEADER_SETS participate in buildsystem Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: buildbot <buildbot@kitware.com> Acked-by: Ben Boeckel <ben.boeckel@kitware.com> Acked-by: Gabriel Nützi <gnuetzi@gmail.com> Merge-request: !7173
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/target_sources/FileSetGeneratedDependency.cmake12
-rw-r--r--Tests/RunCMake/target_sources/FileSetGeneratedDependency.h.in1
-rw-r--r--Tests/RunCMake/target_sources/RunCMakeTest.cmake9
-rw-r--r--Tests/RunCMake/target_sources/dependency.c6
4 files changed, 28 insertions, 0 deletions
diff --git a/Tests/RunCMake/target_sources/FileSetGeneratedDependency.cmake b/Tests/RunCMake/target_sources/FileSetGeneratedDependency.cmake
new file mode 100644
index 0000000..9e91929
--- /dev/null
+++ b/Tests/RunCMake/target_sources/FileSetGeneratedDependency.cmake
@@ -0,0 +1,12 @@
+enable_language(C)
+
+add_library(lib INTERFACE)
+add_custom_command(
+ OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/dependency.h
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/FileSetGeneratedDependency.h.in ${CMAKE_CURRENT_BINARY_DIR}/dependency.h
+ VERBATIM
+ )
+target_sources(lib PUBLIC FILE_SET HEADERS BASE_DIRS ${CMAKE_CURRENT_BINARY_DIR} FILES ${CMAKE_CURRENT_BINARY_DIR}/dependency.h)
+
+add_executable(exe dependency.c)
+target_link_libraries(exe PRIVATE lib)
diff --git a/Tests/RunCMake/target_sources/FileSetGeneratedDependency.h.in b/Tests/RunCMake/target_sources/FileSetGeneratedDependency.h.in
new file mode 100644
index 0000000..40a8c17
--- /dev/null
+++ b/Tests/RunCMake/target_sources/FileSetGeneratedDependency.h.in
@@ -0,0 +1 @@
+/* empty */
diff --git a/Tests/RunCMake/target_sources/RunCMakeTest.cmake b/Tests/RunCMake/target_sources/RunCMakeTest.cmake
index 8429c96..e78ee9d 100644
--- a/Tests/RunCMake/target_sources/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_sources/RunCMakeTest.cmake
@@ -43,6 +43,15 @@ if(APPLE)
run_cmake(FileSetFramework)
endif()
+set(RunCMake_TEST_NO_CLEAN 1)
+set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/FileSetGeneratedDependency-build")
+file(REMOVE_RECURSE "${RunCMake_TEST_BINARY_DIR}")
+file(MAKE_DIRECTORY "${RunCMake_TEST_BINARY_DIR}")
+run_cmake(FileSetGeneratedDependency)
+run_cmake_command(FileSetGeneratedDependency-build ${CMAKE_COMMAND} --build . --config Debug)
+unset(RunCMake_TEST_BINARY_DIR)
+unset(RunCMake_TEST_NO_CLEAN)
+
set(RunCMake_TEST_OPTIONS -DCMAKE_POLICY_DEFAULT_CMP0115=NEW)
run_cmake(FileSetFileNoExist)
unset(RunCMake_TEST_OPTIONS)
diff --git a/Tests/RunCMake/target_sources/dependency.c b/Tests/RunCMake/target_sources/dependency.c
new file mode 100644
index 0000000..2f2dd25
--- /dev/null
+++ b/Tests/RunCMake/target_sources/dependency.c
@@ -0,0 +1,6 @@
+#include <dependency.h>
+
+int main(void)
+{
+ return 0;
+}