summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2012-12-18 15:16:14 (GMT)
committerBrad King <brad.king@kitware.com>2013-01-03 18:45:40 (GMT)
commit0941d6232a979a129a651915972ab7332c15550d (patch)
tree9b7cb63ef89ca6aae92b03f28d82c06ffcbc1018 /Tests
parent18a3195ad57cafd06851ecf4cb7265cab95cfa38 (diff)
downloadCMake-0941d6232a979a129a651915972ab7332c15550d.zip
CMake-0941d6232a979a129a651915972ab7332c15550d.tar.gz
CMake-0941d6232a979a129a651915972ab7332c15550d.tar.bz2
Add a way to print the origins of used include directories.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/include_directories/DebugIncludes-result.txt1
-rw-r--r--Tests/RunCMake/include_directories/DebugIncludes-stderr.txt42
-rw-r--r--Tests/RunCMake/include_directories/DebugIncludes.cmake38
-rw-r--r--Tests/RunCMake/include_directories/RunCMakeTest.cmake1
4 files changed, 82 insertions, 0 deletions
diff --git a/Tests/RunCMake/include_directories/DebugIncludes-result.txt b/Tests/RunCMake/include_directories/DebugIncludes-result.txt
new file mode 100644
index 0000000..573541a
--- /dev/null
+++ b/Tests/RunCMake/include_directories/DebugIncludes-result.txt
@@ -0,0 +1 @@
+0
diff --git a/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt b/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt
new file mode 100644
index 0000000..948def1
--- /dev/null
+++ b/Tests/RunCMake/include_directories/DebugIncludes-stderr.txt
@@ -0,0 +1,42 @@
+CMake Warning at DebugIncludes.cmake:8 \(include_directories\):
+ Used includes:
+
+ \* .*/Tests/RunCMake/include_directories/one
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Warning at DebugIncludes.cmake:8 \(include_directories\):
+ Used includes:
+
+ \* .*/Tests/RunCMake/include_directories/two
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Warning at DebugIncludes.cmake:13 \(set_property\):
+ Used includes:
+
+ \* .*/Tests/RunCMake/include_directories/three
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Warning at DebugIncludes.cmake:18 \(include_directories\):
+ Used includes:
+
+ \* .*/Tests/RunCMake/include_directories/four
+
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
++
+CMake Warning at DebugIncludes.cmake:25 \(set_property\):
+ Used includes:
+
+ \* .*/Tests/RunCMake/include_directories/five
+ \* .*/Tests/RunCMake/include_directories/six
+
+Call Stack \(most recent call first\):
+ DebugIncludes.cmake:35 \(some_macro\)
+ DebugIncludes.cmake:38 \(some_function\)
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/include_directories/DebugIncludes.cmake b/Tests/RunCMake/include_directories/DebugIncludes.cmake
new file mode 100644
index 0000000..51daf74
--- /dev/null
+++ b/Tests/RunCMake/include_directories/DebugIncludes.cmake
@@ -0,0 +1,38 @@
+
+project(DebugIncludes)
+
+set(CMAKE_DEBUG_TARGET_PROPERTIES INCLUDE_DIRECTORIES)
+
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/DebugIncludes.cpp" "enum { dummy };\n")
+
+include_directories(
+ "${CMAKE_CURRENT_SOURCE_DIR}/one"
+ "${CMAKE_CURRENT_SOURCE_DIR}/two"
+)
+
+set_property(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES
+ "${CMAKE_CURRENT_SOURCE_DIR}/three")
+
+add_library(lll "${CMAKE_CURRENT_BINARY_DIR}/DebugIncludes.cpp")
+
+include_directories(
+ "${CMAKE_CURRENT_SOURCE_DIR}/two"
+ "${CMAKE_CURRENT_SOURCE_DIR}/three"
+ "${CMAKE_CURRENT_SOURCE_DIR}/four"
+)
+
+macro(some_macro)
+ set_property(TARGET lll APPEND PROPERTY
+ INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}/one"
+ "${CMAKE_CURRENT_SOURCE_DIR}/three"
+ "${CMAKE_CURRENT_SOURCE_DIR}/four"
+ "${CMAKE_CURRENT_SOURCE_DIR}/five"
+ "${CMAKE_CURRENT_SOURCE_DIR}/six"
+ )
+endmacro()
+
+function(some_function)
+ some_macro()
+endfunction()
+
+some_function()
diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
index aee3f79..de37252 100644
--- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake
+++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake
@@ -1,3 +1,4 @@
include(RunCMake)
run_cmake(NotFoundContent)
+run_cmake(DebugIncludes)