summaryrefslogtreecommitdiffstats
path: root/Tests/IncludeDirectories
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2011-11-05 15:17:49 (GMT)
committerDavid Cole <david.cole@kitware.com>2012-02-22 11:31:50 (GMT)
commit9106b564ae5bf0bf1c1ff4a3fca484bcfd40e183 (patch)
tree26d6a7889a9fcafa83a4d7f8f8d48d37db0bee68 /Tests/IncludeDirectories
parent840509babb2d1c8fc5167c4580fef58546c06700 (diff)
downloadCMake-9106b564ae5bf0bf1c1ff4a3fca484bcfd40e183.zip
CMake-9106b564ae5bf0bf1c1ff4a3fca484bcfd40e183.tar.gz
CMake-9106b564ae5bf0bf1c1ff4a3fca484bcfd40e183.tar.bz2
Extract and use the INCLUDE_DIRECTORIES target properties.
Eliminate callers of cmMakefile::GetIncludeDirectories. All callers of GetIncludeDirectories should go through the local generator object. Only the local generator calls cmTarget::GetIncludeDirectories directly.
Diffstat (limited to 'Tests/IncludeDirectories')
-rw-r--r--Tests/IncludeDirectories/CMakeLists.txt2
-rw-r--r--Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt26
-rw-r--r--Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp10
3 files changed, 38 insertions, 0 deletions
diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt
index 60b8c22..60f5e5e 100644
--- a/Tests/IncludeDirectories/CMakeLists.txt
+++ b/Tests/IncludeDirectories/CMakeLists.txt
@@ -45,3 +45,5 @@ else()
set_target_properties(IncludeDirectories
PROPERTIES COMPILE_FLAGS "-ITarProp")
endif()
+
+add_subdirectory(TargetIncludeDirectories)
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
new file mode 100644
index 0000000..2cf36f5
--- /dev/null
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/CMakeLists.txt
@@ -0,0 +1,26 @@
+
+cmake_minimum_required(VERSION 2.8)
+
+project(TargetIncludeDirectories)
+
+macro(create_header _name)
+ file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/${_name}")
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${_name}/${_name}.h"
+ "//${_name}.h
+ ")
+endmacro()
+
+create_header(bar)
+create_header(bat)
+create_header(foo)
+create_header(baz)
+
+set(CMAKE_INCLUDE_CURRENT_DIR ON)
+
+include_directories("${CMAKE_CURRENT_BINARY_DIR}/bar")
+
+add_executable(TargetIncludeDirectories main.cpp)
+set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/bat")
+set_property(TARGET TargetIncludeDirectories APPEND PROPERTY INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}/foo")
+
+include_directories("${CMAKE_CURRENT_BINARY_DIR}/baz")
diff --git a/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
new file mode 100644
index 0000000..8aa3532
--- /dev/null
+++ b/Tests/IncludeDirectories/TargetIncludeDirectories/main.cpp
@@ -0,0 +1,10 @@
+
+#include "bar.h"
+#include "bat.h"
+#include "foo.h"
+#include "baz.h"
+
+int main(int, char**)
+{
+ return 0;
+}