summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2011-06-02 14:28:10 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2011-06-02 14:28:10 (GMT)
commit7815e90e21049cb06ecbdbe8ed44aa008aa9d6f4 (patch)
treec326e90b7c2563285951f39e0f26909b15e87b14
parent5764739f52095d6be5bb8d105335c58974ee40ec (diff)
downloadCMake-7815e90e21049cb06ecbdbe8ed44aa008aa9d6f4.zip
CMake-7815e90e21049cb06ecbdbe8ed44aa008aa9d6f4.tar.gz
CMake-7815e90e21049cb06ecbdbe8ed44aa008aa9d6f4.tar.bz2
Fix for bug#10798. VS10 did not append -I flags with COMPILE_FLAGS prop.
This fix adds a test for this case for all generators.
-rw-r--r--Source/cmVisualStudioGeneratorOptions.cxx7
-rw-r--r--Tests/CMakeLists.txt12
-rw-r--r--Tests/IncludeDirectories/CMakeLists.txt10
-rw-r--r--Tests/IncludeDirectories/Flags/Flags.h1
-rw-r--r--Tests/IncludeDirectories/IncDir/IncDir.h1
-rw-r--r--Tests/IncludeDirectories/SrcProp/SrcProp.h1
-rw-r--r--Tests/IncludeDirectories/TarProp/TarProp.h1
-rw-r--r--Tests/IncludeDirectories/main.cpp9
8 files changed, 41 insertions, 1 deletions
diff --git a/Source/cmVisualStudioGeneratorOptions.cxx b/Source/cmVisualStudioGeneratorOptions.cxx
index ed0d60c..ae496ad 100644
--- a/Source/cmVisualStudioGeneratorOptions.cxx
+++ b/Source/cmVisualStudioGeneratorOptions.cxx
@@ -299,7 +299,12 @@ cmVisualStudioGeneratorOptions
{
fout << "<" << m->first << ">";
}
- fout << m->second << "</" << m->first << ">\n";
+ fout << m->second;
+ if (m->first == "AdditionalIncludeDirectories")
+ {
+ fout << ";%(AdditionalIncludeDirectories)";
+ }
+ fout << "</" << m->first << ">\n";
}
}
else
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index e9aed16..bf08b52 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -2043,6 +2043,18 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
ADD_TEST_MACRO(CompileCommandOutput
"${CMake_BINARY_DIR}/Tests/CMakeLib/runcompilecommands")
ENDIF()
+
+ ADD_TEST(IncludeDirectories ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/IncludeDirectories"
+ "${CMake_BINARY_DIR}/Tests/IncludeDirectories"
+ --build-two-config
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-project IncludeDirectories
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --test-command IncludeDirectories)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/IncludeDirectories")
+
ENDIF(BUILD_TESTING)
SUBDIRS(CMakeTests)
diff --git a/Tests/IncludeDirectories/CMakeLists.txt b/Tests/IncludeDirectories/CMakeLists.txt
new file mode 100644
index 0000000..af2a2b7
--- /dev/null
+++ b/Tests/IncludeDirectories/CMakeLists.txt
@@ -0,0 +1,10 @@
+cmake_minimum_required (VERSION 2.6)
+project(IncludeDirectories)
+
+set(CMAKE_CXX_FLAGS "\"-I${CMAKE_SOURCE_DIR}/Flags\"")
+include_directories(${CMAKE_SOURCE_DIR}/IncDir)
+set_source_files_properties(main.cpp PROPERTIES COMPILE_FLAGS
+ "\"-I${CMAKE_SOURCE_DIR}/SrcProp\"")
+add_executable(IncludeDirectories main.cpp)
+set_target_properties(IncludeDirectories
+ PROPERTIES COMPILE_FLAGS "\"-I${CMAKE_SOURCE_DIR}/TarProp\"")
diff --git a/Tests/IncludeDirectories/Flags/Flags.h b/Tests/IncludeDirectories/Flags/Flags.h
new file mode 100644
index 0000000..0397515
--- /dev/null
+++ b/Tests/IncludeDirectories/Flags/Flags.h
@@ -0,0 +1 @@
+// include Flags.h
diff --git a/Tests/IncludeDirectories/IncDir/IncDir.h b/Tests/IncludeDirectories/IncDir/IncDir.h
new file mode 100644
index 0000000..7c0ca96
--- /dev/null
+++ b/Tests/IncludeDirectories/IncDir/IncDir.h
@@ -0,0 +1 @@
+// include IncDir.h
diff --git a/Tests/IncludeDirectories/SrcProp/SrcProp.h b/Tests/IncludeDirectories/SrcProp/SrcProp.h
new file mode 100644
index 0000000..18b42cc
--- /dev/null
+++ b/Tests/IncludeDirectories/SrcProp/SrcProp.h
@@ -0,0 +1 @@
+// include SrcProp.h
diff --git a/Tests/IncludeDirectories/TarProp/TarProp.h b/Tests/IncludeDirectories/TarProp/TarProp.h
new file mode 100644
index 0000000..59326f6
--- /dev/null
+++ b/Tests/IncludeDirectories/TarProp/TarProp.h
@@ -0,0 +1 @@
+// include TarProp.h
diff --git a/Tests/IncludeDirectories/main.cpp b/Tests/IncludeDirectories/main.cpp
new file mode 100644
index 0000000..a59d27c
--- /dev/null
+++ b/Tests/IncludeDirectories/main.cpp
@@ -0,0 +1,9 @@
+#include "Flags.h"
+#include "IncDir.h"
+#include "SrcProp.h"
+#include "TarProp.h"
+
+int main(int argc, char** argv)
+{
+ return 0;
+}