summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-04-21 14:26:06 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-04-21 14:26:06 (GMT)
commit8913cbffdee9fdff52e18e1ed795277c68acfc2c (patch)
tree9e7eb39f242efecf3230f4b2885e050be638c71c
parentf29d881d3df6a52e1f92e946681f393aec5903ee (diff)
downloadCMake-8913cbffdee9fdff52e18e1ed795277c68acfc2c.zip
CMake-8913cbffdee9fdff52e18e1ed795277c68acfc2c.tar.gz
CMake-8913cbffdee9fdff52e18e1ed795277c68acfc2c.tar.bz2
ENH: move stuff from main tree
-rw-r--r--CTestCustom.ctest.in1
-rw-r--r--ChangeLog.manual12
-rw-r--r--Docs/cmake-indent.vim4
-rw-r--r--Docs/cmake-syntax.vim2
-rw-r--r--Modules/CMakeGenericSystem.cmake2
-rw-r--r--Modules/Platform/HP-UX.cmake2
-rw-r--r--Modules/Platform/Linux-ifort.cmake2
-rw-r--r--Modules/Platform/Linux.cmake2
-rw-r--r--Modules/Platform/kFreeBSD.cmake2
-rw-r--r--Source/cmGlobalGenerator.cxx13
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx47
-rw-r--r--Source/cmMakefile.h4
-rw-r--r--Source/cmMakefileTargetGenerator.cxx4
-rw-r--r--Source/cmake.cxx2
14 files changed, 68 insertions, 31 deletions
diff --git a/CTestCustom.ctest.in b/CTestCustom.ctest.in
index 26c125d..ffc1945 100644
--- a/CTestCustom.ctest.in
+++ b/CTestCustom.ctest.in
@@ -15,6 +15,7 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"Source/CTest/Curl"
"Utilities/cmcurl"
"Source/CursesDialog/form"
+ "/usr/bin/ld.*warning.*-..*directory.name.*bin.*does not exist"
"Redeclaration of .send..... with a different storage class specifier"
"Utilities/cmexpat/"
"is not used for resolving any symbol"
diff --git a/ChangeLog.manual b/ChangeLog.manual
index 081bb38..ec2b9d0 100644
--- a/ChangeLog.manual
+++ b/ChangeLog.manual
@@ -1,5 +1,17 @@
Changes in CMake 2.4.1
+* allow the cache to be saved even if a fatal error occurs
+
+* fix bug in relative path subdir and add_subdirectoy commands
+
+* support in vs for two object files with the same name
+
+* short file names used for library paths in visual studio
+
+* package target only shows up when you have cpack config files
+
+* Use dl and not -ldl for adding in the dynamic library
+
* Fix check c/cxx source compiles macros to not clobber log files
* Fix nmake version detection of cl and create correct pdb files
diff --git a/Docs/cmake-indent.vim b/Docs/cmake-indent.vim
index e36937d..d0711d9 100644
--- a/Docs/cmake-indent.vim
+++ b/Docs/cmake-indent.vim
@@ -65,8 +65,8 @@ fun! CMakeGetIndent(lnum)
\ ')\s*' .
\ '\(' . cmake_regex_comment . '\)\?$'
- let cmake_indent_begin_regex = '^\s*\(IF\|MACRO\|FOREACH\|ELSE\)\s*('
- let cmake_indent_end_regex = '^\s*\(ENDIF\|ENDFOREACH\|ENDMACRO\|ELSE\)\s*('
+ let cmake_indent_begin_regex = '^\s*\(IF\|MACRO\|FOREACH\|ELSE\|WHILE\)\s*('
+ let cmake_indent_end_regex = '^\s*\(ENDIF\|ENDFOREACH\|ENDMACRO\|ELSE\|ENDWHILE\)\s*('
" Add
if previous_line =~? cmake_indent_comment_line " Handle comments
diff --git a/Docs/cmake-syntax.vim b/Docs/cmake-syntax.vim
index 8dfe3d7..302417e 100644
--- a/Docs/cmake-syntax.vim
+++ b/Docs/cmake-syntax.vim
@@ -49,7 +49,7 @@ syn region cmakeArguments start=/\s*(/ end=/)/
syn keyword cmakeDeprecated ABSTRACT_FILES BUILD_NAME SOURCE_FILES SOURCE_FILES_REMOVE VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WRAP_EXCLUDE_FILES
\ nextgroup=cmakeArgument
syn keyword cmakeStatement
- \ ADD_CUSTOM_COMMAND ADD_CUSTOM_TARGET ADD_DEFINITIONS ADD_DEPENDENCIES ADD_EXECUTABLE ADD_LIBRARY ADD_SUBDIRECTORY ADD_TEST AUX_SOURCE_DIRECTORY BUILD_COMMAND BUILD_NAME CMAKE_MINIMUM_REQUIRED CONFIGURE_FILE CREATE_TEST_SOURCELIST ELSE ENABLE_LANGUAGE ENABLE_TESTING ENDFOREACH ENDIF ENDWHILE EXEC_PROGRAM EXECUTE_PROCESS EXPORT_LIBRARY_DEPENDENCIES FILE FIND_FILE FIND_LIBRARY FIND_PACKAGE FIND_PATH FIND_PROGRAM FLTK_WRAP_UI FOREACH GET_CMAKE_PROPERTY GET_DIRECTORY_PROPERTY GET_FILENAME_COMPONENT GET_SOURCE_FILE_PROPERTY GET_TARGET_PROPERTY GET_TEST_PROPERTY IF INCLUDE INCLUDE_DIRECTORIES INCLUDE_EXTERNAL_MSPROJECT INCLUDE_REGULAR_EXPRESSION INSTALL INSTALL_FILES INSTALL_PROGRAMS INSTALL_TARGETS LINK_DIRECTORIES LINK_LIBRARIES LIST LOAD_CACHE LOAD_COMMAND MACRO MAKE_DIRECTORY MARK_AS_ADVANCED MATH MESSAGE OPTION OUTPUT_REQUIRED_FILES PROJECT QT_WRAP_CPP QT_WRAP_UI REMOVE REMOVE_DEFINITIONS SEPARATE_ARGUMENTS SET SET_DIRECTORY_PROPERTIES SET_SOURCE_FILES_PROPERTIES SET_TARGET_PROPERTIES SET_TESTS_PROPERTIES SITE_NAME SOURCE_GROUP STRING SUBDIR_DEPENDS SUBDIRS TARGET_LINK_LIBRARIES TRY_COMPILE TRY_RUN USE_MANGLED_MESA UTILITY_SOURCE VARIABLE_REQUIRES VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WHILE WRITE_FILE
+ \ ADD_CUSTOM_COMMAND ADD_CUSTOM_TARGET ADD_DEFINITIONS ADD_DEPENDENCIES ADD_EXECUTABLE ADD_LIBRARY ADD_SUBDIRECTORY ADD_TEST AUX_SOURCE_DIRECTORY BUILD_COMMAND BUILD_NAME CMAKE_MINIMUM_REQUIRED CONFIGURE_FILE CREATE_TEST_SOURCELIST ELSE ENABLE_LANGUAGE ENABLE_TESTING ENDFOREACH ENDIF ENDWHILE EXEC_PROGRAM EXECUTE_PROCESS EXPORT_LIBRARY_DEPENDENCIES FILE FIND_FILE FIND_LIBRARY FIND_PACKAGE FIND_PATH FIND_PROGRAM FLTK_WRAP_UI FOREACH GET_CMAKE_PROPERTY GET_DIRECTORY_PROPERTY GET_FILENAME_COMPONENT GET_SOURCE_FILE_PROPERTY GET_TARGET_PROPERTY GET_TEST_PROPERTY IF INCLUDE INCLUDE_DIRECTORIES INCLUDE_EXTERNAL_MSPROJECT INCLUDE_REGULAR_EXPRESSION INSTALL INSTALL_FILES INSTALL_PROGRAMS INSTALL_TARGETS LINK_DIRECTORIES LINK_LIBRARIES LIST LOAD_CACHE LOAD_COMMAND MACRO MAKE_DIRECTORY MARK_AS_ADVANCED MATH MESSAGE OPTION OUTPUT_REQUIRED_FILES PROJECT QT_WRAP_CPP QT_WRAP_UI REMOVE REMOVE_DEFINITIONS SEPARATE_ARGUMENTS SET SET_DIRECTORY_PROPERTIES SET_SOURCE_FILES_PROPERTIES SET_TARGET_PROPERTIES SET_TESTS_PROPERTIES SITE_NAME SOURCE_GROUP STRING SUBDIR_DEPENDS SUBDIRS TARGET_LINK_LIBRARIES TRY_COMPILE TRY_RUN USE_MANGLED_MESA UTILITY_SOURCE VARIABLE_REQUIRES VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WHILE WRITE_FILE ENDMACRO
\ nextgroup=cmakeArgumnts
"syn match cmakeMacro /^\s*[A-Z_]\+/ nextgroup=cmakeArgumnts
diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index 1ea6e36..5ec2501 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -5,7 +5,7 @@ SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
SET(CMAKE_EXECUTABLE_SUFFIX "") # .exe
-SET(CMAKE_DL_LIBS "-ldl")
+SET(CMAKE_DL_LIBS "dl")
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib
diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake
index bc48657..8c149ed 100644
--- a/Modules/Platform/HP-UX.cmake
+++ b/Modules/Platform/HP-UX.cmake
@@ -1,5 +1,5 @@
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".sl") # .so
-SET(CMAKE_DL_LIBS "-ldld")
+SET(CMAKE_DL_LIBS "dld")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".sl" ".so" ".a")
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") # : or empty
diff --git a/Modules/Platform/Linux-ifort.cmake b/Modules/Platform/Linux-ifort.cmake
index 3a5512f..6d6fcfb 100644
--- a/Modules/Platform/Linux-ifort.cmake
+++ b/Modules/Platform/Linux-ifort.cmake
@@ -1,4 +1,4 @@
-SET(CMAKE_DL_LIBS "-ldl")
+SET(CMAKE_DL_LIBS "dl")
SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-KPIC")
SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-shared")
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-i_dynamic")
diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake
index 3053f37..6ae2ed5 100644
--- a/Modules/Platform/Linux.cmake
+++ b/Modules/Platform/Linux.cmake
@@ -1,5 +1,5 @@
# GCC is the default compiler on Linux.
-SET(CMAKE_DL_LIBS "-ldl")
+SET(CMAKE_DL_LIBS "dl")
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-rdynamic")
diff --git a/Modules/Platform/kFreeBSD.cmake b/Modules/Platform/kFreeBSD.cmake
index 862d274..70eb52a 100644
--- a/Modules/Platform/kFreeBSD.cmake
+++ b/Modules/Platform/kFreeBSD.cmake
@@ -1,5 +1,5 @@
# kFreeBSD looks just like Linux.
-SET(CMAKE_DL_LIBS "-ldl")
+SET(CMAKE_DL_LIBS "dl")
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-rdynamic")
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 1ad42ca..812ed51 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1309,10 +1309,13 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
{
depends.push_back("preinstall");
}
+ if(cmSystemTools::FileExists(configFile.c_str()))
+ {
(*targets)[this->GetPackageTargetName()]
= this->CreateGlobalTarget(this->GetPackageTargetName(),
- "Run CPack packaging tool...", &cpackCommandLines, depends);
-
+ "Run CPack packaging tool...",
+ &cpackCommandLines, depends);
+ }
// CPack source
const char* packageSourceTargetName = this->GetPackageSourceTargetName();
if ( packageSourceTargetName )
@@ -1324,11 +1327,15 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
singleLine.push_back("--config");
configFile = mf->GetStartOutputDirectory();;
configFile += "/CPackSourceConfig.cmake";
+ if(cmSystemTools::FileExists(configFile.c_str()))
+ {
singleLine.push_back(configFile);
cpackCommandLines.push_back(singleLine);
(*targets)[packageSourceTargetName]
= this->CreateGlobalTarget(packageSourceTargetName,
- "Run CPack packaging tool for source...", &cpackCommandLines, depends);
+ "Run CPack packaging tool for source...",
+ &cpackCommandLines, depends);
+ }
}
// Test
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index 1f40847..96b609a 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -864,18 +864,32 @@ cmLocalVisualStudio7Generator
for(std::vector<cmStdString>::const_iterator d = dirs.begin();
d != dirs.end(); ++d)
{
+ // Remove any trailing slash and skip empty paths.
std::string dir = *d;
- if(!dir.empty())
+ if(dir[dir.size()-1] == '/')
{
- if(dir[dir.size()-1] != '/')
+ dir = dir.substr(0, dir.size()-1);
+ }
+ if(dir.empty())
{
- dir += "/";
+ continue;
}
- dir += "$(OutDir)";
- fout << comma << this->ConvertToXMLOutputPath(dir.c_str())
- << "," << this->ConvertToXMLOutputPath(d->c_str());
- comma = ",";
+
+ // Switch to a relative path specification if it is shorter.
+ if(cmSystemTools::FileIsFullPath(dir.c_str()))
+ {
+ std::string rel = this->Convert(dir.c_str(), START_OUTPUT, UNCHANGED);
+ if(rel.size() < dir.size())
+ {
+ dir = rel;
+ }
}
+
+ // First search a configuration-specific subdirectory and then the
+ // original directory.
+ fout << comma << this->ConvertToXMLOutputPath((dir+"/$(OutDir)").c_str())
+ << "," << this->ConvertToXMLOutputPath(dir.c_str());
+ comma = ",";
}
}
@@ -992,7 +1006,7 @@ void cmLocalVisualStudio7Generator::WriteGroup(const cmSourceGroup *sg, cmTarget
}
// Loop through each source in the source group.
- std::string sourceName;
+ std::string objectName;
for(std::vector<const cmSourceFile *>::const_iterator sf =
sourceFiles.begin(); sf != sourceFiles.end(); ++sf)
{
@@ -1000,15 +1014,16 @@ void cmLocalVisualStudio7Generator::WriteGroup(const cmSourceGroup *sg, cmTarget
const cmCustomCommand *command = (*sf)->GetCustomCommand();
std::string compileFlags;
std::string additionalDeps;
- sourceName = (*sf)->GetSourceName();
- if(sourceName.find("/") != sourceName.npos)
+ objectName = (*sf)->GetSourceName();
+ if(!(*sf)->GetPropertyAsBool("HEADER_FILE_ONLY" )
+ && objectName.find("/") != objectName.npos)
{
- cmSystemTools::ReplaceString(sourceName, "/", "_");
- sourceName += ".obj";
+ cmSystemTools::ReplaceString(objectName, "/", "_");
+ objectName += ".obj";
}
else
{
- sourceName = "";
+ objectName = "";
}
// Add per-source flags.
@@ -1061,7 +1076,7 @@ void cmLocalVisualStudio7Generator::WriteGroup(const cmSourceGroup *sg, cmTarget
comment.c_str(), command->GetDepends(),
command->GetOutputs(), flags);
}
- else if(compileFlags.size() || additionalDeps.length() || sourceName.size())
+ else if(compileFlags.size() || additionalDeps.length() || objectName.size())
{
const char* aCompilerTool = "VCCLCompilerTool";
std::string ext = (*sf)->GetSourceExtension();
@@ -1095,10 +1110,10 @@ void cmLocalVisualStudio7Generator::WriteGroup(const cmSourceGroup *sg, cmTarget
fout << "\t\t\t\t\tAdditionalDependencies=\""
<< additionalDeps.c_str() << "\"\n";
}
- if(sourceName.size())
+ if(objectName.size())
{
fout << "\t\t\t\t\tObjectFile=\"$(IntDir)/"
- << sourceName.c_str() << "\"\n";
+ << objectName.c_str() << "\"\n";
}
fout << "\t\t\t\t\t/>\n"
<< "\t\t\t\t</FileConfiguration>\n";
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 1651b49..4c3888d 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -341,6 +341,8 @@ public:
{
this->cmStartDirectory = dir;
cmSystemTools::ConvertToUnixSlashes(this->cmStartDirectory);
+ this->cmStartDirectory =
+ cmSystemTools::CollapseFullPath(this->cmStartDirectory.c_str());
this->AddDefinition("CMAKE_CURRENT_SOURCE_DIR",
this->cmStartDirectory.c_str());
}
@@ -352,6 +354,8 @@ public:
{
this->StartOutputDirectory = lib;
cmSystemTools::ConvertToUnixSlashes(this->StartOutputDirectory);
+ this->StartOutputDirectory =
+ cmSystemTools::CollapseFullPath(this->StartOutputDirectory.c_str());
cmSystemTools::MakeDirectory(this->StartOutputDirectory.c_str());
this->AddDefinition("CMAKE_CURRENT_BINARY_DIR",
this->StartOutputDirectory.c_str());
diff --git a/Source/cmMakefileTargetGenerator.cxx b/Source/cmMakefileTargetGenerator.cxx
index f114b73..a73213a 100644
--- a/Source/cmMakefileTargetGenerator.cxx
+++ b/Source/cmMakefileTargetGenerator.cxx
@@ -245,9 +245,7 @@ void cmMakefileTargetGenerator::WriteObjectRuleFiles(cmSourceFile& source)
const char* lang = this->LocalGenerator->GetSourceFileLanguage(source);
if(!lang)
{
- // If language is not known, this is an error.
- cmSystemTools::Error("Source file \"", source.GetFullPath().c_str(),
- "\" has unknown type.");
+ // don't know anything about this file so skip it
return;
}
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 0948959..2c08ae3 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -1432,7 +1432,7 @@ int cmake::Configure()
this->CacheManager->RemoveCacheEntry("CMAKE_GENERATOR");
}
// only save the cache if there were no fatal errors
- if ( !this->ScriptMode && !cmSystemTools::GetFatalErrorOccured() )
+ if ( !this->ScriptMode )
{
this->CacheManager->SaveCache(this->GetHomeOutputDirectory());
}