Commit e5d5a646 authored by Bill Hoffman's avatar Bill Hoffman
Browse files

ENH: merge in two bug fixes to 26

parent 04c369c6
......@@ -354,7 +354,7 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 6)
SET(CMake_VERSION_PATCH 1)
SET(CMake_VERSION_RC 9)
SET(CMake_VERSION_RC 10)
# CVS versions are odd, if this is an odd minor version
# then set the CMake_VERSION_DATE variable
IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")
......
Changes in CMake 2.6.1 RC 10
- Add a fix for bug # 7340, CMAKE_USER_MAKE_RULES_OVERRIDE was
not able to support a try-compile in cmake 2.6
- Remove bad test for bug # 7316
Changes in CMake 2.6.1 RC 9
- Fix bug # 7316 Xcode double escaped define strings
- FindBoost can now find the upcoming Boost 1.46
......
......@@ -559,6 +559,11 @@ for checking whether the language is already enabled. After setting this
flag still the values from the cmake variables have to be copied into the
internal maps, this is done in SetLanguageEnabledMaps() which is called
after the system- and compiler specific files have been loaded.
This split was done originally so that compiler-specific configuration
files could change the object file extension
(CMAKE_<LANG>_OUTPUT_EXTENSION) before the CMake variables were copied
to the C++ maps.
*/
void cmGlobalGenerator::SetLanguageEnabled(const char* l, cmMakefile* mf)
{
......@@ -566,9 +571,16 @@ void cmGlobalGenerator::SetLanguageEnabled(const char* l, cmMakefile* mf)
this->SetLanguageEnabledMaps(l, mf);
}
void cmGlobalGenerator::SetLanguageEnabledFlag(const char* l, cmMakefile*)
void cmGlobalGenerator::SetLanguageEnabledFlag(const char* l, cmMakefile* mf)
{
this->LanguageEnabled[l] = true;
// Fill the language-to-extension map with the current variable
// settings to make sure it is available for the try_compile()
// command source file signature. In SetLanguageEnabledMaps this
// will be done again to account for any compiler- or
// platform-specific entries.
this->FillExtensionToLanguageMap(l, mf);
}
void cmGlobalGenerator::SetLanguageEnabledMaps(const char* l, cmMakefile* mf)
......@@ -627,26 +639,37 @@ void cmGlobalGenerator::SetLanguageEnabledMaps(const char* l, cmMakefile* mf)
}
}
std::string extensionsVar = std::string("CMAKE_") +
std::string(l) + std::string("_SOURCE_FILE_EXTENSIONS");
// The map was originally filled by SetLanguageEnabledFlag, but
// since then the compiler- and platform-specific files have been
// loaded which might have added more entries.
this->FillExtensionToLanguageMap(l, mf);
std::string ignoreExtensionsVar = std::string("CMAKE_") +
std::string(l) + std::string("_IGNORE_EXTENSIONS");
std::string ignoreExts = mf->GetSafeDefinition(ignoreExtensionsVar.c_str());
std::string exts = mf->GetSafeDefinition(extensionsVar.c_str());
std::vector<std::string> extensionList;
cmSystemTools::ExpandListArgument(exts, extensionList);
cmSystemTools::ExpandListArgument(ignoreExts, extensionList);
for(std::vector<std::string>::iterator i = extensionList.begin();
i != extensionList.end(); ++i)
{
this->ExtensionToLanguage[*i] = l;
this->IgnoreExtensions[*i] = true;
}
cmSystemTools::ExpandListArgument(ignoreExts, extensionList);
}
void cmGlobalGenerator::FillExtensionToLanguageMap(const char* l,
cmMakefile* mf)
{
std::string extensionsVar = std::string("CMAKE_") +
std::string(l) + std::string("_SOURCE_FILE_EXTENSIONS");
std::string exts = mf->GetSafeDefinition(extensionsVar.c_str());
std::vector<std::string> extensionList;
cmSystemTools::ExpandListArgument(exts, extensionList);
for(std::vector<std::string>::iterator i = extensionList.begin();
i != extensionList.end(); ++i)
{
this->IgnoreExtensions[*i] = true;
this->ExtensionToLanguage[*i] = l;
}
}
bool cmGlobalGenerator::IgnoreFile(const char* l)
......
......@@ -264,6 +264,7 @@ protected:
projectTargets);
void SetLanguageEnabledFlag(const char* l, cmMakefile* mf);
void SetLanguageEnabledMaps(const char* l, cmMakefile* mf);
void FillExtensionToLanguageMap(const char* l, cmMakefile* mf);
virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS();
......
......@@ -26,38 +26,6 @@ MACRO(TEST_EXPECT_CONTAINS command expected)
ENDMACRO(TEST_EXPECT_CONTAINS command expected)
# Write a simple test program with an include file
WRITE_FILE( ${CMAKE_BINARY_DIR}/CMakeTmp/my_include.h "#define TEST_VALUE 0\n")
WRITE_FILE( ${CMAKE_BINARY_DIR}/my_test.cxx "#include \"my_include.h\"\nint main() { return TEST_VALUE; }")
SET(INC_STRING "-I \"${CMAKE_BINARY_DIR}/CMakeTmp\"")
# Removing the quotes fixes the Xcode 3 bug, but this
# will fail if ${CMAKE_BINARY_DIR} contains an spaces
# SET(INC_STRING "-I ${CMAKE_BINARY_DIR}/CMakeTmp")
TRY_RUN(my_test my_test_COMPILED
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/my_test.cxx
CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${INC_STRING}
OUTPUT_VARIABLE OUTPUT)
# Display the results of the test and write compilation errors to a log
IF(NOT my_test_COMPILED)
MESSAGE(FATAL_ERROR "Performing Try-Run - Test Compilation Failed")
WRITE_FILE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing Try-Run my_test failed to compile with the following output:\n"
"${OUTPUT}\n" APPEND)
ELSE(NOT my_test_COMPILED)
IF(my_test)
MESSAGE("The test compiled but failed at run time")
ELSE(my_test)
MESSAGE("The test compiled and passed")
ENDIF(my_test)
ENDIF(NOT my_test_COMPILED)
# try to compile a file that should compile
# also check that COPY_FILE works
TRY_COMPILE(SHOULD_PASS
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment