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.
This commit is contained in:
Bill Hoffman 2011-06-02 10:28:10 -04:00
parent 5764739f52
commit 7815e90e21
8 changed files with 41 additions and 1 deletions

View File

@ -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

View File

@ -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)

View File

@ -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\"")

View File

@ -0,0 +1 @@
// include Flags.h

View File

@ -0,0 +1 @@
// include IncDir.h

View File

@ -0,0 +1 @@
// include SrcProp.h

View File

@ -0,0 +1 @@
// include TarProp.h

View File

@ -0,0 +1,9 @@
#include "Flags.h"
#include "IncDir.h"
#include "SrcProp.h"
#include "TarProp.h"
int main(int argc, char** argv)
{
return 0;
}