summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-06-16 12:54:44 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-06-16 12:54:44 (GMT)
commit3eb50bbe8c99e3480b0ca85dc3d49b0a8ca9d8d1 (patch)
tree4143d0ecf13f5083914dc8819d892bcf7dfc84ff /Tests
parent94d1879ba049fbb52a168228218e479b281bce12 (diff)
parentcb67509b06b9acdc3e23ea7dfc13257e9e8d1b20 (diff)
downloadCMake-3eb50bbe8c99e3480b0ca85dc3d49b0a8ca9d8d1.zip
CMake-3eb50bbe8c99e3480b0ca85dc3d49b0a8ca9d8d1.tar.gz
CMake-3eb50bbe8c99e3480b0ca85dc3d49b0a8ca9d8d1.tar.bz2
Merge topic 'vs-subdir-sln-depends'
cb67509b VS: Remove unused parameter of WriteTargetConfigurations 790e1677 VS: Fix subproject .sln dependencies on custom targets 5fba44cf VS: Move VS-only API out of cmGlobalGenerator
Diffstat (limited to 'Tests')
-rw-r--r--Tests/SubProject/CMakeLists.txt11
-rw-r--r--Tests/SubProject/bar.cxx5
-rw-r--r--Tests/SubProject/gen.cxx.in4
3 files changed, 15 insertions, 5 deletions
diff --git a/Tests/SubProject/CMakeLists.txt b/Tests/SubProject/CMakeLists.txt
index b669621..b2bada9 100644
--- a/Tests/SubProject/CMakeLists.txt
+++ b/Tests/SubProject/CMakeLists.txt
@@ -1,6 +1,15 @@
cmake_minimum_required (VERSION 2.6)
project(SubProject)
-message("${CMAKE_IMPORT_LIBRARY_SUFFIX}")
+file(REMOVE ${CMAKE_CURRENT_BINARY_DIR}/gen.cxx) # require generation
+add_custom_command(
+ OUTPUT gen.cxx
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gen.cxx.in
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${CMAKE_CURRENT_SOURCE_DIR}/gen.cxx.in gen.cxx
+ )
+add_custom_target(gen DEPENDS gen.cxx)
add_library(bar bar.cxx)
+target_include_directories(bar PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
+add_dependencies(bar gen)
add_executable(car car.cxx)
add_subdirectory(foo)
diff --git a/Tests/SubProject/bar.cxx b/Tests/SubProject/bar.cxx
index c3f6a18..c8b8743 100644
--- a/Tests/SubProject/bar.cxx
+++ b/Tests/SubProject/bar.cxx
@@ -1,4 +1 @@
-int bar()
-{
- return 10;
-}
+#include "gen.cxx"
diff --git a/Tests/SubProject/gen.cxx.in b/Tests/SubProject/gen.cxx.in
new file mode 100644
index 0000000..c3f6a18
--- /dev/null
+++ b/Tests/SubProject/gen.cxx.in
@@ -0,0 +1,4 @@
+int bar()
+{
+ return 10;
+}