summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Modules/FindCUDA.cmake12
-rw-r--r--Modules/Qt4Macros.cmake8
-rw-r--r--Source/CMakeVersion.cmake2
-rw-r--r--Source/cmDepends.cxx63
-rw-r--r--Source/cmDepends.h1
-rw-r--r--Source/cmDependsJava.cxx2
-rw-r--r--Source/cmDependsJava.h3
-rw-r--r--Source/cmDocumentVariables.cxx8
-rw-r--r--Source/cmTarget.cxx7
-rw-r--r--Source/cmTarget.h3
-rw-r--r--Tests/ObjectLibrary/A/CMakeLists.txt2
-rw-r--r--Tests/ObjectLibrary/B/CMakeLists.txt2
12 files changed, 78 insertions, 35 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake
index 0cc80be..0a98bf5 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -1010,7 +1010,17 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
if(CUDA_PROPAGATE_HOST_FLAGS)
# nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g
- if(CMAKE_COMPILER_IS_GNUCC AND CUDA_VERSION VERSION_LESS "3.0")
+ set(_cuda_fix_g3 FALSE)
+
+ if(CMAKE_COMPILER_IS_GNUCC)
+ if (CUDA_VERSION VERSION_LESS "3.0" OR
+ CUDA_VERSION VERSION_EQUAL "4.1" OR
+ CUDA_VERSION VERSION_EQUAL "4.2"
+ )
+ set(_cuda_fix_g3 TRUE)
+ endif()
+ endif()
+ if(_cuda_fix_g3)
string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")
else()
set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")
diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake
index 7c9dc9e..8e8680c 100644
--- a/Modules/Qt4Macros.cmake
+++ b/Modules/Qt4Macros.cmake
@@ -187,15 +187,17 @@ macro (QT4_ADD_RESOURCES outfiles )
if(EXISTS "${infile}")
# parse file for dependencies
# all files are absolute paths or relative to the location of the qrc file
- file(STRINGS "${infile}" _RC_FILES REGEX "<file[^>]*>[^<]+")
- foreach(_RC_FILE IN LISTS _RC_FILES)
- string(REGEX REPLACE "^<file[^>]*>([^<]*)" "\\1" _RC_FILE "${_RC_FILE}")
+ file(STRINGS "${infile}" _RC_FILE_CONTENTS REGEX "<file[^>]*>[^<]+")
+ string(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
+ foreach(_RC_FILE ${_RC_FILES})
+ string(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
if(NOT IS_ABSOLUTE "${_RC_FILE}")
set(_RC_FILE "${rc_path}/${_RC_FILE}")
endif()
set(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
endforeach()
unset(_RC_FILES)
+ unset(_RC_FILE_CONTENTS)
# Since this cmake macro is doing the dependency scanning for these files,
# let's make a configured file and add it as a dependency so cmake is run
# again when dependencies need to be recomputed.
diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 88b859c..3bdb60c 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -2,5 +2,5 @@
set(CMake_VERSION_MAJOR 2)
set(CMake_VERSION_MINOR 8)
set(CMake_VERSION_PATCH 9)
-set(CMake_VERSION_TWEAK 20120820)
+set(CMake_VERSION_TWEAK 20120824)
#set(CMake_VERSION_RC 1)
diff --git a/Source/cmDepends.cxx b/Source/cmDepends.cxx
index 545fe97..166a584 100644
--- a/Source/cmDepends.cxx
+++ b/Source/cmDepends.cxx
@@ -98,7 +98,7 @@ bool cmDepends::Check(const char *makeFile, const char *internalFile,
// Check whether dependencies must be regenerated.
bool okay = true;
std::ifstream fin(internalFile);
- if(!(fin && this->CheckDependencies(fin, validDeps)))
+ if(!(fin && this->CheckDependencies(fin, internalFile, validDeps)))
{
// Clear all dependencies so they will be regenerated.
this->Clear(makeFile);
@@ -143,6 +143,7 @@ bool cmDepends::WriteDependencies(const char*, const char*,
//----------------------------------------------------------------------------
bool cmDepends::CheckDependencies(std::istream& internalDepends,
+ const char* internalDependsFileName,
std::map<std::string, DependencyVector>& validDeps)
{
// Parse dependencies from the stream. If any dependee is missing
@@ -186,8 +187,11 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends,
}
*/
- // Dependencies must be regenerated if the dependee does not exist
- // or if the depender exists and is older than the dependee.
+ // Dependencies must be regenerated
+ // * if the dependee does not exist
+ // * if the depender exists and is older than the dependee.
+ // * if the depender does not exist, but the dependee is newer than the
+ // depends file
bool regenerate = false;
const char* dependee = this->Dependee+1;
const char* depender = this->Depender;
@@ -211,24 +215,49 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends,
cmSystemTools::Stdout(msg.str().c_str());
}
}
- else if(dependerExists)
+ else
{
- // The dependee and depender both exist. Compare file times.
- int result = 0;
- if((!this->FileComparison->FileTimeCompare(depender, dependee,
- &result) || result < 0))
+ if(dependerExists)
{
- // The depender is older than the dependee.
- regenerate = true;
+ // The dependee and depender both exist. Compare file times.
+ int result = 0;
+ if((!this->FileComparison->FileTimeCompare(depender, dependee,
+ &result) || result < 0))
+ {
+ // The depender is older than the dependee.
+ regenerate = true;
- // Print verbose output.
- if(this->Verbose)
+ // Print verbose output.
+ if(this->Verbose)
+ {
+ cmOStringStream msg;
+ msg << "Dependee \"" << dependee
+ << "\" is newer than depender \""
+ << depender << "\"." << std::endl;
+ cmSystemTools::Stdout(msg.str().c_str());
+ }
+ }
+ }
+ else
+ {
+ // The dependee exists, but the depender doesn't. Regenerate if the
+ // internalDepends file is older than the dependee.
+ int result = 0;
+ if((!this->FileComparison->FileTimeCompare(internalDependsFileName,
+ dependee, &result) || result < 0))
{
- cmOStringStream msg;
- msg << "Dependee \"" << dependee
- << "\" is newer than depender \""
- << depender << "\"." << std::endl;
- cmSystemTools::Stdout(msg.str().c_str());
+ // The depends-file is older than the dependee.
+ regenerate = true;
+
+ // Print verbose output.
+ if(this->Verbose)
+ {
+ cmOStringStream msg;
+ msg << "Dependee \"" << dependee
+ << "\" is newer than depends file \""
+ << internalDependsFileName << "\"." << std::endl;
+ cmSystemTools::Stdout(msg.str().c_str());
+ }
}
}
}
diff --git a/Source/cmDepends.h b/Source/cmDepends.h
index 100e187..f7dc881 100644
--- a/Source/cmDepends.h
+++ b/Source/cmDepends.h
@@ -83,6 +83,7 @@ protected:
// Return false if dependencies must be regenerated and true
// otherwise.
virtual bool CheckDependencies(std::istream& internalDepends,
+ const char* internalDependsFileName,
std::map<std::string, DependencyVector>& validDeps);
// Finalize the dependency information for the target.
diff --git a/Source/cmDependsJava.cxx b/Source/cmDependsJava.cxx
index 1d84914..ba0e8fb 100644
--- a/Source/cmDependsJava.cxx
+++ b/Source/cmDependsJava.cxx
@@ -38,7 +38,7 @@ bool cmDependsJava::WriteDependencies(const char *src, const char *,
return true;
}
-bool cmDependsJava::CheckDependencies(std::istream&,
+bool cmDependsJava::CheckDependencies(std::istream&, const char*,
std::map<std::string, DependencyVector >&)
{
return true;
diff --git a/Source/cmDependsJava.h b/Source/cmDependsJava.h
index fe6fef5..bf7e234 100644
--- a/Source/cmDependsJava.h
+++ b/Source/cmDependsJava.h
@@ -32,7 +32,8 @@ protected:
virtual bool WriteDependencies(const char *src, const char *file,
std::ostream& makeDepends, std::ostream& internalDepends);
virtual bool CheckDependencies(std::istream& internalDepends,
- std::map<std::string, DependencyVector >& validDeps);
+ const char* internalDependsFileName,
+ std::map<std::string, DependencyVector>& validDeps);
private:
cmDependsJava(cmDependsJava const&); // Purposely not implemented.
diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx
index c2197f2..badc3e4 100644
--- a/Source/cmDocumentVariables.cxx
+++ b/Source/cmDocumentVariables.cxx
@@ -841,9 +841,9 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"Tell cmake to use MFC for an executable or dll.",
"This can be set in a CMakeLists.txt file and will "
"enable MFC in the application. It should be set "
- "to 1 for static the static MFC library, and 2 for "
- "the shared MFC library. This is used in visual "
- "studio 6 and 7 project files. The CMakeSetup "
+ "to 1 for the static MFC library, and 2 for "
+ "the shared MFC library. This is used in Visual "
+ "Studio 6 and 7 project files. The CMakeSetup "
"dialog used MFC and the CMakeLists.txt looks like this:\n"
" add_definitions(-D_AFXDLL)\n"
" set(CMAKE_MFC_FLAG 2)\n"
@@ -1365,7 +1365,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
false,
"Variables that Control the Build");
cm->DefineProperty
- ("CMAKE_POSITION_INDEPENDENT_FLAGS", cmProperty::VARIABLE,
+ ("CMAKE_POSITION_INDEPENDENT_CODE", cmProperty::VARIABLE,
"Default value for POSITION_INDEPENDENT_CODE of targets.",
"This variable is used to initialize the "
"POSITION_INDEPENDENT_CODE property on all the targets. "
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 775662c..65b586d 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -761,7 +761,10 @@ void cmTarget::DefineProperties(cmake *cm)
"The POSITION_INDEPENDENT_CODE property determines whether position "
"independent executables or shared libraries will be created. "
"This property is true by default for SHARED and MODULE library "
- "targets and false otherwise.");
+ "targets and false otherwise. "
+ "This property is initialized by the value of the variable "
+ "CMAKE_POSITION_INDEPENDENT_CODE if it is set when a target is"
+ "created.");
cm->DefineProperty
("POST_INSTALL_SCRIPT", cmProperty::TARGET,
@@ -903,7 +906,7 @@ void cmTarget::DefineProperties(cmake *cm)
"Build an executable with a WinMain entry point on windows.",
"When this property is set to true the executable when linked "
"on Windows will be created with a WinMain() entry point instead "
- "of of just main()."
+ "of just main(). "
"This makes it a GUI executable instead of a console application. "
"See the CMAKE_MFC_FLAG variable documentation to configure use "
"of MFC for WinMain executables. "
diff --git a/Source/cmTarget.h b/Source/cmTarget.h
index a89c5d9..98eaeec 100644
--- a/Source/cmTarget.h
+++ b/Source/cmTarget.h
@@ -158,9 +158,6 @@ public:
void AddSources(std::vector<std::string> const& srcs);
cmSourceFile* AddSource(const char* src);
- /**
- * Get the list of the source files used by this target
- */
enum LinkLibraryType {GENERAL, DEBUG, OPTIMIZED};
//* how we identify a library, by name and type
diff --git a/Tests/ObjectLibrary/A/CMakeLists.txt b/Tests/ObjectLibrary/A/CMakeLists.txt
index 04ab02f..36c86e7 100644
--- a/Tests/ObjectLibrary/A/CMakeLists.txt
+++ b/Tests/ObjectLibrary/A/CMakeLists.txt
@@ -1,4 +1,4 @@
-project(ObjectLibraryA)
+project(ObjectLibraryA C)
# Add -fPIC so objects can be used in shared libraries.
# TODO: Need property for this.
if(CMAKE_SHARED_LIBRARY_C_FLAGS AND NOT WATCOM)
diff --git a/Tests/ObjectLibrary/B/CMakeLists.txt b/Tests/ObjectLibrary/B/CMakeLists.txt
index 4b0b07d..32d8ceb 100644
--- a/Tests/ObjectLibrary/B/CMakeLists.txt
+++ b/Tests/ObjectLibrary/B/CMakeLists.txt
@@ -1,4 +1,4 @@
-project(ObjectLibraryB)
+project(ObjectLibraryB C)
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio 6")
# VS 6 generator does not use per-target object locations.
set(vs6 _vs6)