summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/CMakeCXXInformation.cmake14
-rw-r--r--Modules/CMakeFortranInformation.cmake8
-rw-r--r--Modules/CheckIncludeFiles.cmake10
-rw-r--r--Modules/FindLibArchive.cmake5
-rw-r--r--Modules/FindPerl.cmake39
-rw-r--r--Modules/FindPerlLibs.cmake36
-rw-r--r--Modules/NSIS.template.in4
-rw-r--r--Source/CPack/cmCPackArchiveGenerator.cxx11
-rw-r--r--Source/CPack/cmCPackGenerator.cxx5
-rw-r--r--Source/cmLocalUnixMakefileGenerator3.cxx15
-rw-r--r--Source/cmTarget.cxx10
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx56
-rw-r--r--Source/cmVisualStudio10TargetGenerator.h1
-rw-r--r--Source/cmake.cxx47
-rw-r--r--Source/cmake.h2
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake2
-rw-r--r--Tests/CMakeLists.txt78
-rw-r--r--Tests/CMakeOnly/AllFindModules/CMakeLists.txt51
-rw-r--r--Tests/COnly/CMakeLists.txt2
-rw-r--r--Tests/COnly/testCModule.c6
-rw-r--r--Tests/Contracts/Trilinos-10-6/Patch.cmake18
-rw-r--r--Tests/ConvLibrary/CMakeLists.txt20
-rw-r--r--Tests/ConvLibrary/bar.c4
-rw-r--r--Tests/ConvLibrary/bartest.cxx37
-rw-r--r--Tests/ConvLibrary/foo.cxx4
-rw-r--r--Tests/ConvLibrary/sub1/car.cxx4
-rw-r--r--Tests/CxxOnly/CMakeLists.txt2
-rw-r--r--Tests/CxxOnly/testCxxModule.cxx6
28 files changed, 272 insertions, 225 deletions
diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake
index b97a69c..25abb8c 100644
--- a/Modules/CMakeCXXInformation.cmake
+++ b/Modules/CMakeCXXInformation.cmake
@@ -93,12 +93,6 @@ IF(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
ENDIF()
-# for most systems a module is the same as a shared library
-# so unless the variable CMAKE_MODULE_EXISTS is set just
-# copy the values from the LIBRARY variables
-IF(NOT CMAKE_MODULE_EXISTS)
- SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
-ENDIF(NOT CMAKE_MODULE_EXISTS)
# Create a set of shared library variable specific to C++
# For 90% of the systems, these are the same flags as the C versions
# so if these are not set just copy the flags from the c version
@@ -158,6 +152,14 @@ IF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
SET(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C})
ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
+# for most systems a module is the same as a shared library
+# so unless the variable CMAKE_MODULE_EXISTS is set just
+# copy the values from the LIBRARY variables
+IF(NOT CMAKE_MODULE_EXISTS)
+ SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
+ SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
+ENDIF(NOT CMAKE_MODULE_EXISTS)
+
# repeat for modules
IF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake
index aed1fd2..76cf34e 100644
--- a/Modules/CMakeFortranInformation.cmake
+++ b/Modules/CMakeFortranInformation.cmake
@@ -109,6 +109,14 @@ IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
ENDIF()
+# for most systems a module is the same as a shared library
+# so unless the variable CMAKE_MODULE_EXISTS is set just
+# copy the values from the LIBRARY variables
+IF(NOT CMAKE_MODULE_EXISTS)
+ SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
+ SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
+ENDIF(NOT CMAKE_MODULE_EXISTS)
+
# repeat for modules
IF(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
diff --git a/Modules/CheckIncludeFiles.cmake b/Modules/CheckIncludeFiles.cmake
index 75b5ca1..642d962 100644
--- a/Modules/CheckIncludeFiles.cmake
+++ b/Modules/CheckIncludeFiles.cmake
@@ -44,7 +44,7 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c" @ONLY IMMEDIATE)
- MESSAGE(STATUS "Looking for include files ${VARIABLE}")
+ MESSAGE(STATUS "Looking for include files ${INCLUDE}")
TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c
@@ -54,15 +54,15 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
"${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"
OUTPUT_VARIABLE OUTPUT)
IF(${VARIABLE})
- MESSAGE(STATUS "Looking for include files ${VARIABLE} - found")
- SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${VARIABLE}")
+ MESSAGE(STATUS "Looking for include files ${INCLUDE} - found")
+ SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if files ${INCLUDE} "
"exist passed with the following output:\n"
"${OUTPUT}\n\n")
ELSE(${VARIABLE})
- MESSAGE(STATUS "Looking for include files ${VARIABLE} - not found.")
- SET(${VARIABLE} "" CACHE INTERNAL "Have includes ${VARIABLE}")
+ MESSAGE(STATUS "Looking for include files ${INCLUDE} - not found.")
+ SET(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if files ${INCLUDE} "
"exist failed with the following output:\n"
diff --git a/Modules/FindLibArchive.cmake b/Modules/FindLibArchive.cmake
index cedcd24..be931c5 100644
--- a/Modules/FindLibArchive.cmake
+++ b/Modules/FindLibArchive.cmake
@@ -54,8 +54,9 @@ endif()
# itself includes this FindLibArchive when built with an older CMake that does
# not provide it. The older CMake also does not have CMAKE_CURRENT_LIST_DIR.)
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
-find_package_handle_standard_args(LibArchive DEFAULT_MSG
- LibArchive_LIBRARY LibArchive_INCLUDE_DIR
+find_package_handle_standard_args(LibArchive
+ REQUIRED_VARS LibArchive_LIBRARY LibArchive_INCLUDE_DIR
+ VERSION_VAR LibArchive_VERSION
)
set(LibArchive_FOUND ${LIBARCHIVE_FOUND})
unset(LIBARCHIVE_FOUND)
diff --git a/Modules/FindPerl.cmake b/Modules/FindPerl.cmake
index db393e7..ae686df 100644
--- a/Modules/FindPerl.cmake
+++ b/Modules/FindPerl.cmake
@@ -1,8 +1,9 @@
# - Find perl
# this module looks for Perl
#
-# PERL_EXECUTABLE - the full path to perl
-# PERL_FOUND - If false, don't attempt to use perl.
+# PERL_EXECUTABLE - the full path to perl
+# PERL_FOUND - If false, don't attempt to use perl.
+# PERL_VERSION_STRING - version of perl found (since CMake 2.8.8)
#=============================================================================
# Copyright 2001-2009 Kitware, Inc.
@@ -39,12 +40,44 @@ FIND_PROGRAM(PERL_EXECUTABLE
PATHS ${PERL_POSSIBLE_BIN_PATHS}
)
+IF(PERL_EXECUTABLE)
+ ### PERL_VERSION
+ EXECUTE_PROCESS(
+ COMMAND
+ ${PERL_EXECUTABLE} -V:version
+ OUTPUT_VARIABLE
+ PERL_VERSION_OUTPUT_VARIABLE
+ RESULT_VARIABLE
+ PERL_VERSION_RESULT_VARIABLE
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ IF(NOT PERL_VERSION_RESULT_VARIABLE AND NOT PERL_VERSION_OUTPUT_VARIABLE MATCHES "^version='UNKNOWN'")
+ STRING(REGEX REPLACE "version='([^']+)'.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
+ ELSE()
+ EXECUTE_PROCESS(
+ COMMAND ${PERL_EXECUTABLE} -v
+ OUTPUT_VARIABLE PERL_VERSION_OUTPUT_VARIABLE
+ RESULT_VARIABLE PERL_VERSION_RESULT_VARIABLE
+ ERROR_QUIET
+ OUTPUT_STRIP_TRAILING_WHITESPACE
+ )
+ IF(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl.*[ \\(]v([0-9\\._]+)[ \\)]")
+ STRING(REGEX REPLACE ".*This is perl.*[ \\(]v([0-9\\._]+)[ \\)].*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
+ ELSEIF(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl, version ([0-9\\._]+) +")
+ STRING(REGEX REPLACE ".*This is perl, version ([0-9\\._]+) +.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
+ ENDIF()
+ ENDIF()
+ENDIF(PERL_EXECUTABLE)
+
# Deprecated settings for compatibility with CMake1.4
SET(PERL ${PERL_EXECUTABLE})
# handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl DEFAULT_MSG PERL_EXECUTABLE)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl
+ REQUIRED_VARS PERL_EXECUTABLE
+ VERSION_VAR PERL_VERSION_STRING)
MARK_AS_ADVANCED(PERL_EXECUTABLE)
diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake
index eea55f1..0ac8060 100644
--- a/Modules/FindPerlLibs.cmake
+++ b/Modules/FindPerlLibs.cmake
@@ -55,19 +55,6 @@ if (PERL_EXECUTABLE)
string(REGEX REPLACE "prefix='([^']+)'.*" "\\1" PERL_PREFIX ${PERL_PREFIX_OUTPUT_VARIABLE})
endif (NOT PERL_PREFIX_RESULT_VARIABLE)
- ### PERL_VERSION
- execute_process(
- COMMAND
- ${PERL_EXECUTABLE} -V:version
- OUTPUT_VARIABLE
- PERL_VERSION_OUTPUT_VARIABLE
- RESULT_VARIABLE
- PERL_VERSION_RESULT_VARIABLE
- )
- if (NOT PERL_VERSION_RESULT_VARIABLE)
- string(REGEX REPLACE "version='([^']+)'.*" "\\1" PERL_VERSION ${PERL_VERSION_OUTPUT_VARIABLE})
- endif (NOT PERL_VERSION_RESULT_VARIABLE)
-
### PERL_ARCHNAME
execute_process(
COMMAND
@@ -206,19 +193,19 @@ if (PERL_EXECUTABLE)
### PERL_POSSIBLE_INCLUDE_PATHS
set(PERL_POSSIBLE_INCLUDE_PATHS
${PERL_ARCHLIB}/CORE
- /usr/lib/perl5/${PERL_VERSION}/${PERL_ARCHNAME}/CORE
- /usr/lib/perl/${PERL_VERSION}/${PERL_ARCHNAME}/CORE
- /usr/lib/perl5/${PERL_VERSION}/CORE
- /usr/lib/perl/${PERL_VERSION}/CORE
+ /usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
+ /usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
+ /usr/lib/perl5/${PERL_VERSION_STRING}/CORE
+ /usr/lib/perl/${PERL_VERSION_STRING}/CORE
)
### PERL_POSSIBLE_LIB_PATHS
set(PERL_POSSIBLE_LIB_PATHS
${PERL_ARCHLIB}/CORE
- /usr/lib/perl5/${PERL_VERSION}/${PERL_ARCHNAME}/CORE
- /usr/lib/perl/${PERL_VERSION}/${PERL_ARCHNAME}/CORE
- /usr/lib/perl5/${PERL_VERSION}/CORE
- /usr/lib/perl/${PERL_VERSION}/CORE
+ /usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
+ /usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
+ /usr/lib/perl5/${PERL_VERSION_STRING}/CORE
+ /usr/lib/perl/${PERL_VERSION_STRING}/CORE
)
### PERL_POSSIBLE_LIBRARY_NAME
@@ -249,7 +236,7 @@ if (PERL_EXECUTABLE)
find_library(PERL_LIBRARY
NAMES
${PERL_POSSIBLE_LIBRARY_NAME}
- perl${PERL_VERSION}
+ perl${PERL_VERSION_STRING}
perl
PATHS
${PERL_POSSIBLE_LIB_PATHS}
@@ -261,15 +248,16 @@ endif (PERL_EXECUTABLE)
# all listed variables are TRUE
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(PerlLibs REQUIRED_VARS PERL_LIBRARY PERL_INCLUDE_PATH
- VERSION_VAR PERL_VERSION)
+ VERSION_VAR PERL_VERSION_STRING)
# Introduced after CMake 2.6.4 to bring module into compliance
set(PERL_INCLUDE_DIR ${PERL_INCLUDE_PATH})
set(PERL_INCLUDE_DIRS ${PERL_INCLUDE_PATH})
set(PERL_LIBRARIES ${PERL_LIBRARY})
+# For backward compatibility with CMake before 2.8.7
+set(PERL_VERSION ${PERL_VERSION_STRING})
mark_as_advanced(
PERL_INCLUDE_PATH
- PERL_EXECUTABLE
PERL_LIBRARY
)
diff --git a/Modules/NSIS.template.in b/Modules/NSIS.template.in
index 6259a5b..819cc5c 100644
--- a/Modules/NSIS.template.in
+++ b/Modules/NSIS.template.in
@@ -922,12 +922,12 @@ Function .onInit
Pop $0
UserInfo::GetAccountType
Pop $1
- StrCmp $1 "Admin" 0 +3
+ StrCmp $1 "Admin" 0 +4
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Admin group'
StrCpy $SV_ALLUSERS "AllUsers"
Goto done
- StrCmp $1 "Power" 0 +3
+ StrCmp $1 "Power" 0 +4
SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Power Users group'
StrCpy $SV_ALLUSERS "AllUsers"
diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx
index 0ce5b01..0ff9050 100644
--- a/Source/CPack/cmCPackArchiveGenerator.cxx
+++ b/Source/CPack/cmCPackArchiveGenerator.cxx
@@ -57,13 +57,20 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive,
std::string dir = cmSystemTools::GetCurrentWorkingDirectory();
// Change to local toplevel
cmSystemTools::ChangeDirectory(localToplevel.c_str());
+ std::string filePrefix;
+ if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY"))
+ {
+ filePrefix = this->GetOption("CPACK_PACKAGE_FILE_NAME");
+ filePrefix += "/";
+ }
std::vector<std::string>::const_iterator fileIt;
for (fileIt = component->Files.begin(); fileIt != component->Files.end();
++fileIt )
{
+ std::string rp = filePrefix + *fileIt;
cmCPackLogger(cmCPackLog::LOG_DEBUG,"Adding file: "
- << (*fileIt) << std::endl);
- archive.Add(*fileIt);
+ << rp << std::endl);
+ archive.Add(rp);
if (!archive)
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: "
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 083279f..f7d8a4d 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -691,6 +691,11 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// one install directory for each component.
tempInstallDirectory +=
GetComponentInstallDirNameSuffix(installComponent);
+ if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY"))
+ {
+ tempInstallDirectory += "/";
+ tempInstallDirectory += this->GetOption("CPACK_PACKAGE_FILE_NAME");
+ }
}
if (!setDestDir)
diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx
index 70dcfd5..dd313ca 100644
--- a/Source/cmLocalUnixMakefileGenerator3.cxx
+++ b/Source/cmLocalUnixMakefileGenerator3.cxx
@@ -562,6 +562,21 @@ cmLocalUnixMakefileGenerator3
space = " ";
}
+ // Warn about paths not supported by Make tools.
+ std::string::size_type pos = tgt.find_first_of("=");
+ if(pos != std::string::npos)
+ {
+ cmOStringStream m;
+ m <<
+ "Make rule for\n"
+ " " << tgt << "\n"
+ "has '=' on left hand side. "
+ "The make tool may not support this.";
+ cmListFileBacktrace bt;
+ this->GlobalGenerator->GetCMakeInstance()
+ ->IssueMessage(cmake::WARNING, m.str(), bt);
+ }
+
// Mark the rule as symbolic if requested.
if(symbolic)
{
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 1a68cee..ae5596b 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -1065,6 +1065,16 @@ void cmTarget::DefineProperties(cmake *cm)
"generated Visual Studio project. For example, \"System;"
"System.Windows.Forms\".");
cm->DefineProperty
+ ("VS_WINRT_EXTENSIONS", cmProperty::TARGET,
+ "Visual Studio project C++/CX language extensions for Windows Runtime",
+ "Can be set to enable C++/CX language extensions.");
+ cm->DefineProperty
+ ("VS_WINRT_REFERENCES", cmProperty::TARGET,
+ "Visual Studio project Windows Runtime Metadata references",
+ "Adds one or more semicolon-delimited WinRT references to a "
+ "generated Visual Studio project. For example, \"Windows;"
+ "Windows.UI.Core\".");
+ cm->DefineProperty
("VS_GLOBAL_<variable>", cmProperty::TARGET,
"Visual Studio project-specific global variable.",
"Tell the Visual Studio generator to set the global variable "
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 449adc1..9418761 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -255,6 +255,7 @@ void cmVisualStudio10TargetGenerator::Generate()
this->WriteObjSources();
this->WriteCLSources();
this->WriteDotNetReferences();
+ this->WriteWinRTReferences();
this->WriteProjectReferences();
this->WriteString(
"<Import Project=\"$(VCTargetsPath)\\Microsoft.Cpp.targets\""
@@ -268,33 +269,49 @@ void cmVisualStudio10TargetGenerator::Generate()
void cmVisualStudio10TargetGenerator::WriteDotNetReferences()
{
- const char* vsDotNetReferences
- = this->Target->GetProperty("VS_DOTNET_REFERENCES");
- if(vsDotNetReferences)
+ std::vector<std::string> references;
+ if(const char* vsDotNetReferences =
+ this->Target->GetProperty("VS_DOTNET_REFERENCES"))
+ {
+ cmSystemTools::ExpandListArgument(vsDotNetReferences, references);
+ }
+ if(!references.empty())
{
- std::string references(vsDotNetReferences);
- std::string::size_type position = 0;
-
this->WriteString("<ItemGroup>\n", 1);
- while(references.length() > 0)
+ for(std::vector<std::string>::iterator ri = references.begin();
+ ri != references.end(); ++ri)
{
- if((position = references.find(";")) == std::string::npos)
- {
- position = references.length() + 1;
- }
-
this->WriteString("<Reference Include=\"", 2);
- (*this->BuildFileStream) <<
- cmVS10EscapeXML(references.substr(0, position)) << "\">\n";
+ (*this->BuildFileStream) << cmVS10EscapeXML(*ri) << "\">\n";
this->WriteString("<CopyLocalSatelliteAssemblies>true"
"</CopyLocalSatelliteAssemblies>\n", 3);
this->WriteString("<ReferenceOutputAssembly>true"
"</ReferenceOutputAssembly>\n", 3);
this->WriteString("</Reference>\n", 2);
-
- references.erase(0, position + 1);
}
+ this->WriteString("</ItemGroup>\n", 1);
+ }
+}
+void cmVisualStudio10TargetGenerator::WriteWinRTReferences()
+{
+ std::vector<std::string> references;
+ if(const char* vsWinRTReferences =
+ this->Target->GetProperty("VS_WINRT_REFERENCES"))
+ {
+ cmSystemTools::ExpandListArgument(vsWinRTReferences, references);
+ }
+ if(!references.empty())
+ {
+ this->WriteString("<ItemGroup>\n", 1);
+ for(std::vector<std::string>::iterator ri = references.begin();
+ ri != references.end(); ++ri)
+ {
+ this->WriteString("<Reference Include=\"", 2);
+ (*this->BuildFileStream) << cmVS10EscapeXML(*ri) << "\">\n";
+ this->WriteString("<IsWinMDFile>true</IsWinMDFile>\n", 3);
+ this->WriteString("</Reference>\n", 2);
+ }
this->WriteString("</ItemGroup>\n", 1);
}
}
@@ -372,7 +389,8 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
this->WriteString(mfcLine.c_str(), 2);
if(this->Target->GetType() <= cmTarget::MODULE_LIBRARY &&
- this->ClOptions[*i]->UsingUnicode())
+ this->ClOptions[*i]->UsingUnicode() ||
+ this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
{
this->WriteString("<CharacterSet>Unicode</CharacterSet>\n", 2);
}
@@ -387,6 +405,10 @@ void cmVisualStudio10TargetGenerator::WriteProjectConfigurationValues()
pts += "</PlatformToolset>\n";
this->WriteString(pts.c_str(), 2);
}
+ if(this->Target->GetPropertyAsBool("VS_WINRT_EXTENSIONS"))
+ {
+ this->WriteString("<Immersive>true</Immersive>\n", 2);
+ }
this->WriteString("</PropertyGroup>\n", 1);
}
}
diff --git a/Source/cmVisualStudio10TargetGenerator.h b/Source/cmVisualStudio10TargetGenerator.h
index 6702509..90035f2 100644
--- a/Source/cmVisualStudio10TargetGenerator.h
+++ b/Source/cmVisualStudio10TargetGenerator.h
@@ -48,6 +48,7 @@ private:
void WriteProjectConfigurationValues();
void WriteCLSources();
void WriteDotNetReferences();
+ void WriteWinRTReferences();
void WriteObjSources();
void WritePathAndIncrementalLinkOptions();
void WriteItemDefinitionGroups();
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index d691f46..71dca3a 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -2126,32 +2126,8 @@ int cmake::Configure()
}
-bool cmake::RejectUnsupportedPaths(const char* desc, std::string const& path)
-{
- // Some characters are not well-supported by native build systems.
- std::string::size_type pos = path.find_first_of("=");
- if(pos == std::string::npos)
- {
- return false;
- }
- cmOStringStream e;
- e << "The path to the " << desc << " directory:\n"
- << " " << path << "\n"
- << "contains unsupported character '" << path[pos] << "'.\n"
- << "Please use a different " << desc << " directory name.";
- cmListFileBacktrace bt;
- this->IssueMessage(cmake::FATAL_ERROR, e.str(), bt);
- return true;
-}
-
int cmake::ActualConfigure()
{
- if(this->RejectUnsupportedPaths("source", this->cmHomeDirectory) ||
- this->RejectUnsupportedPaths("binary", this->HomeOutputDirectory))
- {
- return 1;
- }
-
// Construct right now our path conversion table before it's too late:
this->UpdateConversionPathTable();
this->CleanupCommandsAndMacros();
@@ -2204,8 +2180,11 @@ int cmake::ActualConfigure()
std::string installedCompiler;
// Try to find the newest VS installed on the computer and
// use that as a default if -G is not specified
- std::string vsregBase =
- "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\";
+ const std::string vsregBase =
+ "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\";
+ std::vector<std::string> vsVerions;
+ vsVerions.push_back("VisualStudio\\");
+ vsVerions.push_back("VCExpress\\");
struct VSRegistryEntryName
{
const char* MSVersion;
@@ -2219,14 +2198,18 @@ int cmake::ActualConfigure()
{"9.0", "Visual Studio 9 2008"},
{"10.0", "Visual Studio 10"},
{0, 0}};
- for(int i =0; version[i].MSVersion != 0; i++)
+ for(size_t b=0; b < vsVerions.size() && installedCompiler.empty(); b++)
{
- std::string reg = vsregBase + version[i].MSVersion;
- reg += ";InstallDir]";
- cmSystemTools::ExpandRegistryValues(reg);
- if (!(reg == "/registry"))
+ for(int i =0; version[i].MSVersion != 0; i++)
{
- installedCompiler = version[i].GeneratorName;
+ std::string reg = vsregBase + vsVerions[b] + version[i].MSVersion;
+ reg += ";InstallDir]";
+ cmSystemTools::ExpandRegistryValues(reg,
+ cmSystemTools::KeyWOW64_32);
+ if (!(reg == "/registry"))
+ {
+ installedCompiler = version[i].GeneratorName;
+ }
}
}
cmGlobalGenerator* gen
diff --git a/Source/cmake.h b/Source/cmake.h
index ae56e85..31b1bb7 100644
--- a/Source/cmake.h
+++ b/Source/cmake.h
@@ -468,8 +468,6 @@ protected:
///! Find the full path to one of the cmake programs like ctest, cpack, etc.
std::string FindCMakeProgram(const char* name) const;
-
- bool RejectUnsupportedPaths(const char* desc, std::string const& path);
private:
cmake(const cmake&); // Not implemented.
void operator=(const cmake&); // Not implemented.
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index bc468a4..2cbfe26 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2012)
SET(KWSYS_DATE_STAMP_MONTH 02)
# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 05)
+SET(KWSYS_DATE_STAMP_DAY 07)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 2c5acd9..906b40d 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -765,56 +765,36 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
)
LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/LoadCommandOneConfig")
- # Como does not seem to support shared libraries.
- GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
- IF(CMAKE_BASE_NAME MATCHES "^como$")
- SET(COMPILER_IS_COMO 1)
- ENDIF(CMAKE_BASE_NAME MATCHES "^como$")
- IF(NOT COMPILER_IS_COMO)
- ADD_TEST(complex ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/Complex"
- "${CMake_BINARY_DIR}/Tests/Complex"
- --build-two-config
- --build-config-sample "${CMAKE_CTEST_COMMAND}"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project Complex
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/Complex/bin"
- --build-options
- -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
- --test-command complex
- )
- LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Complex")
+ ADD_TEST(complex ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/Complex"
+ "${CMake_BINARY_DIR}/Tests/Complex"
+ --build-two-config
+ --build-config-sample "${CMAKE_CTEST_COMMAND}"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-project Complex
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/Complex/bin"
+ --build-options
+ -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+ --test-command complex
+ )
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/Complex")
- ADD_TEST(complexOneConfig ${CMAKE_CTEST_COMMAND}
- --build-and-test
- "${CMake_SOURCE_DIR}/Tests/ComplexOneConfig"
- "${CMake_BINARY_DIR}/Tests/ComplexOneConfig"
- --build-generator ${CMAKE_TEST_GENERATOR}
- --build-project Complex
- --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
- --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin"
- --build-options
- -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
- --test-command complex)
- LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig")
- # because of the registry write these tests depend on each other
- SET_TESTS_PROPERTIES ( complex PROPERTIES DEPENDS complexOneConfig)
-
-# This fails on VS 70
-# works on Xcode and makefiles
-# ADD_TEST(ConvLibrary ${CMAKE_CTEST_COMMAND}
-# --build-and-test
-# "${CMake_SOURCE_DIR}/Tests/ConvLibrary"
-# "${CMake_BINARY_DIR}/Tests/ConvLibrary"
-# --build-two-config
-# --build-generator ${CMAKE_TEST_GENERATOR}
-# --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
-# --build-project ConvLibrary
-# --test-command bartest)
-
- ENDIF(NOT COMPILER_IS_COMO)
+ ADD_TEST(complexOneConfig ${CMAKE_CTEST_COMMAND}
+ --build-and-test
+ "${CMake_SOURCE_DIR}/Tests/ComplexOneConfig"
+ "${CMake_BINARY_DIR}/Tests/ComplexOneConfig"
+ --build-generator ${CMAKE_TEST_GENERATOR}
+ --build-project Complex
+ --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM}
+ --build-exe-dir "${CMake_BINARY_DIR}/Tests/ComplexOneConfig/bin"
+ --build-options
+ -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
+ --test-command complex)
+ LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/ComplexOneConfig")
+ # because of the registry write these tests depend on each other
+ SET_TESTS_PROPERTIES ( complex PROPERTIES DEPENDS complexOneConfig)
ADD_TEST(Example ${CMAKE_CTEST_COMMAND}
--build-and-test
diff --git a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
index 8a38f06..127e9d7 100644
--- a/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
+++ b/Tests/CMakeOnly/AllFindModules/CMakeLists.txt
@@ -15,25 +15,54 @@ macro(do_find MODULE_NAME)
find_package(${MODULE_NAME})
endmacro(do_find)
+# It is only possible to use either Qt3 or Qt4 in one project.
+# Since FindQt will complain if both are found we explicitely
+# filter out this and FindQt3. FindKDE3 also depends on Qt3 and
+# is therefore also blocked
+set(NO_QT4_MODULES "Qt3" "KDE3")
+
+# These modules are named Find*.cmake, but are nothing that works in
+# find_package().
+set(NO_FIND_MODULES "PackageHandleStandardArgs" "PackageMessage")
+
+set(DESIRED_QT_VERSION 4)
foreach(FIND_MODULE ${FIND_MODULES})
string(REGEX REPLACE ".*/Find(.*)\\.cmake$" "\\1" MODULE_NAME "${FIND_MODULE}")
- # It is only possible to use either Qt3 or Qt4 in one project.
- # Since FindQt will complain if both are found we explicitely
- # filter out this and FindQt3. FindKDE3 also depends on Qt3 and
- # is therefore also blocked
-
- if (NOT MODULE_NAME STREQUAL "Qt" AND
- NOT MODULE_NAME STREQUAL "Qt3" AND
- NOT MODULE_NAME STREQUAL "KDE3")
+ list(FIND NO_QT4_MODULES ${MODULE_NAME} NO_QT4_INDEX)
+ list(FIND NO_FIND_MODULES ${MODULE_NAME} NO_FIND_INDEX)
+ if (NO_QT4_INDEX EQUAL -1 AND NO_FIND_INDEX EQUAL -1)
do_find(${MODULE_NAME})
endif ()
endforeach(FIND_MODULE)
# Qt4 is not present, so we can check Qt3
-if(NOT QT4_FOUND)
- foreach(FIND_MODULE "Qt3" "Qt" "KDE3")
+if (NOT QT4_FOUND)
+ set(DESIRED_QT_VERSION 3)
+ foreach(FIND_MODULE ${NO_QT4_MODULES} "Qt")
do_find(${FIND_MODULE})
endforeach(FIND_MODULE)
-endif(NOT QT4_FOUND)
+endif (NOT QT4_FOUND)
+
+# If any of these modules reported that it was found a version number should have been
+# reported.
+set(VERSIONS_REQUIRED
+ ALSA BISON BZIP2 CUPS CURL DOXYGEN EXPAT FLEX GETTEXT GIF GIT GNUPLOT
+ ImageMagick JASPER LibArchive LIBXML2 PERL PostgreSQL SWIG TIFF ZLIB)
+
+foreach(VTEST ${VERSIONS_REQUIRED})
+ if (${VTEST}_FOUND)
+ if (DEFINED ${VTEST}_VERSION_STRING)
+ if (NOT ${VTEST}_VERSION_STRING MATCHES "^[0-9][0-9\\.]*[A-Za-z_]*[0-9\\.]*$")
+ message(SEND_ERROR "${VTEST}_VERSION_STRING has unexpected content ${${VTEST}_VERSION_STRING}")
+ endif()
+ elseif (DEFINED ${VTEST}_VERSION)
+ if (NOT ${VTEST}_VERSION MATCHES "^[0-9][0-9\\.]*[A-Za-z_]*[0-9\\.]*$")
+ message(SEND_ERROR "${VTEST}_VERSION has unexpected content ${${VTEST}_VERSION}")
+ endif()
+ else()
+ message(SEND_ERROR "${VTEST}_FOUND is set but no version number is defined")
+ endif()
+ endif(${VTEST}_FOUND)
+endforeach(VTEST)
diff --git a/Tests/COnly/CMakeLists.txt b/Tests/COnly/CMakeLists.txt
index 7742055..5ef0f1e 100644
--- a/Tests/COnly/CMakeLists.txt
+++ b/Tests/COnly/CMakeLists.txt
@@ -19,3 +19,5 @@ if("${LANG}" STREQUAL "C")
else("${LANG}" STREQUAL "C")
message(FATAL_ERROR "Bad language for file conly.c")
endif("${LANG}" STREQUAL "C")
+
+add_library(testCModule MODULE testCModule.c)
diff --git a/Tests/COnly/testCModule.c b/Tests/COnly/testCModule.c
new file mode 100644
index 0000000..1a89292
--- /dev/null
+++ b/Tests/COnly/testCModule.c
@@ -0,0 +1,6 @@
+#ifdef _WIN32
+# define TEST_EXPORT __declspec(dllexport)
+#else
+# define TEST_EXPORT
+#endif
+TEST_EXPORT int testCModule(void) { return 0; }
diff --git a/Tests/Contracts/Trilinos-10-6/Patch.cmake b/Tests/Contracts/Trilinos-10-6/Patch.cmake
index a7aae27..76051eb 100644
--- a/Tests/Contracts/Trilinos-10-6/Patch.cmake
+++ b/Tests/Contracts/Trilinos-10-6/Patch.cmake
@@ -2,6 +2,7 @@ if(NOT DEFINED source_dir)
message(FATAL_ERROR "variable 'source_dir' not defined")
endif()
+
if(NOT EXISTS "${source_dir}/CMakeLists.txt")
message(FATAL_ERROR "error: No CMakeLists.txt file to patch!")
endif()
@@ -18,3 +19,20 @@ MESSAGE(\"Trilinos_WARNINGS_AS_ERRORS_FLAGS='\${Trilinos_WARNINGS_AS_ERRORS_FLAG
")
file(APPEND "${source_dir}/CMakeLists.txt" "${text}")
+
+
+if(NOT EXISTS "${source_dir}/CTestConfig.cmake")
+ message(FATAL_ERROR "error: No CTestConfig.cmake file to patch!")
+endif()
+
+set(text "
+
+#
+# Use newer than 10.6.1 CTestConfig settings from the Trilinos project.
+# Send the Trilinos dashboards to the new Trilinos CDash server instance.
+#
+SET(CTEST_NIGHTLY_START_TIME \"04:00:00 UTC\") # 10 PM MDT or 9 PM MST
+SET(CTEST_DROP_SITE \"testing.sandia.gov\")
+")
+
+file(APPEND "${source_dir}/CTestConfig.cmake" "${text}")
diff --git a/Tests/ConvLibrary/CMakeLists.txt b/Tests/ConvLibrary/CMakeLists.txt
deleted file mode 100644
index afc1cb6..0000000
--- a/Tests/ConvLibrary/CMakeLists.txt
+++ /dev/null
@@ -1,20 +0,0 @@
-cmake_minimum_required (VERSION 2.6)
-project(ConvLibrary)
-
-# create a source list
-set(foo_sources foo.cxx bar.c sub1/car.cxx)
-# create a library foo from the sources
-add_library(foo ${foo_sources})
-# get the object files from the target
-get_target_property(OBJECT_FILES foo OBJECT_FILES)
-message("${OBJECT_FILES}")
-# set the object files as generated
-set_source_files_properties(${OBJECT_FILES} PROPERTIES GENERATED true)
-# create a library bar that contains the object files from foo
-add_library(bar ${OBJECT_FILES})
-# set the linker language since bar only has .obj
-set_target_properties(bar PROPERTIES LINKER_LANGUAGE CXX)
-# make sure foo is built before bar
-add_dependencies(bar foo)
-add_executable(bartest bartest.cxx)
-target_link_libraries(bartest bar)
diff --git a/Tests/ConvLibrary/bar.c b/Tests/ConvLibrary/bar.c
deleted file mode 100644
index d063082..0000000
--- a/Tests/ConvLibrary/bar.c
+++ /dev/null
@@ -1,4 +0,0 @@
-int bar()
-{
- return 20;
-}
diff --git a/Tests/ConvLibrary/bartest.cxx b/Tests/ConvLibrary/bartest.cxx
deleted file mode 100644
index ab95773..0000000
--- a/Tests/ConvLibrary/bartest.cxx
+++ /dev/null
@@ -1,37 +0,0 @@
-extern "C" int bar();
-int foo();
-int car();
-
-#include <stdio.h>
-int main()
-{
- if(foo() == 10)
- {
- printf("foo is 10!\n");
- }
- else
- {
- printf("foo is not 10 error!\n");
- return -1;
- }
- if(bar() == 20)
- {
- printf("bar is 20!\n");
- }
- else
- {
- printf("bar is not 20 error!\n");
- return -1;
- }
- if(car() == 30)
- {
- printf("car is 30!\n");
- }
- else
- {
- printf("car is not 30 error!\n");
- return -1;
- }
- printf("Test past\n");
- return 0;
-}
diff --git a/Tests/ConvLibrary/foo.cxx b/Tests/ConvLibrary/foo.cxx
deleted file mode 100644
index 1f46ef4..0000000
--- a/Tests/ConvLibrary/foo.cxx
+++ /dev/null
@@ -1,4 +0,0 @@
-int foo()
-{
- return 10;
-}
diff --git a/Tests/ConvLibrary/sub1/car.cxx b/Tests/ConvLibrary/sub1/car.cxx
deleted file mode 100644
index aa66726..0000000
--- a/Tests/ConvLibrary/sub1/car.cxx
+++ /dev/null
@@ -1,4 +0,0 @@
-int car()
-{
- return 30;
-}
diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt
index 5d27890..e62f3c7 100644
--- a/Tests/CxxOnly/CMakeLists.txt
+++ b/Tests/CxxOnly/CMakeLists.txt
@@ -9,3 +9,5 @@ add_library(testcxx1.my STATIC libcxx1.cxx ${EXTRA_SRCS})
add_library(testcxx2 SHARED libcxx2.cxx)
add_executable (CxxOnly cxxonly.cxx)
target_link_libraries(CxxOnly testcxx1.my testcxx2)
+
+add_library(testCxxModule MODULE testCxxModule.cxx)
diff --git a/Tests/CxxOnly/testCxxModule.cxx b/Tests/CxxOnly/testCxxModule.cxx
new file mode 100644
index 0000000..dd16d2b
--- /dev/null
+++ b/Tests/CxxOnly/testCxxModule.cxx
@@ -0,0 +1,6 @@
+#ifdef _WIN32
+# define TEST_EXPORT __declspec(dllexport)
+#else
+# define TEST_EXPORT
+#endif
+TEST_EXPORT int testCxxModule(void) { return 0; }