diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/CPack/cmCPackDebGenerator.cxx | 44 | ||||
-rw-r--r-- | Source/CTest/cmCTestRunTest.cxx | 10 | ||||
-rw-r--r-- | Source/QtDialog/CMakeIngestOSXBundleLibraries.cmake | 347 | ||||
-rw-r--r-- | Source/QtDialog/CMakeLists.txt | 32 | ||||
-rw-r--r-- | Source/cmDocumentVariables.cxx | 114 | ||||
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 2 | ||||
-rw-r--r-- | Source/cmMakefile.cxx | 46 | ||||
-rw-r--r-- | Source/kwsys/SystemInformation.cxx | 21 | ||||
-rw-r--r-- | Source/kwsys/kwsysDateStamp.cmake | 4 |
9 files changed, 177 insertions, 443 deletions
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index ac2e151..47a1ff6 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -94,6 +94,18 @@ int cmCPackDebGenerator::PackageFiles() this->GetOption("CPACK_DEBIAN_PACKAGE_SUGGESTS"); const char* debian_pkg_url = this->GetOption("CPACK_DEBIAN_PACKAGE_HOMEPAGE"); + const char* debian_pkg_predep = + this->GetOption("CPACK_DEBIAN_PACKAGE_PREDEPENDS"); + const char* debian_pkg_enhances = + this->GetOption("CPACK_DEBIAN_PACKAGE_ENHANCES"); + const char* debian_pkg_breaks = + this->GetOption("CPACK_DEBIAN_PACKAGE_BREAKS"); + const char* debian_pkg_conflicts = + this->GetOption("CPACK_DEBIAN_PACKAGE_CONFLICTS"); + const char* debian_pkg_provides = + this->GetOption("CPACK_DEBIAN_PACKAGE_PROVIDES"); + const char* debian_pkg_replaces = + this->GetOption("CPACK_DEBIAN_PACKAGE_REPLACES"); { // the scope is needed for cmGeneratedFileStream cmGeneratedFileStream out(ctlfilename.c_str()); @@ -102,22 +114,46 @@ int cmCPackDebGenerator::PackageFiles() out << "Section: " << debian_pkg_section << "\n"; out << "Priority: " << debian_pkg_priority << "\n"; out << "Architecture: " << debian_pkg_arch << "\n"; - if(debian_pkg_dep) + if(debian_pkg_dep && *debian_pkg_dep) { out << "Depends: " << debian_pkg_dep << "\n"; } - if(debian_pkg_rec) + if(debian_pkg_rec && *debian_pkg_rec) { out << "Recommends: " << debian_pkg_rec << "\n"; } - if(debian_pkg_sug) + if(debian_pkg_sug && *debian_pkg_sug) { out << "Suggests: " << debian_pkg_sug << "\n"; } - if(debian_pkg_url) + if(debian_pkg_url && *debian_pkg_url) { out << "Homepage: " << debian_pkg_url << "\n"; } + if (debian_pkg_predep && *debian_pkg_predep) + { + out << "Pre-Depends: " << debian_pkg_predep << "\n"; + } + if (debian_pkg_enhances && *debian_pkg_enhances) + { + out << "Enhances: " << debian_pkg_enhances << "\n"; + } + if (debian_pkg_breaks && *debian_pkg_breaks) + { + out << "Breaks: " << debian_pkg_breaks << "\n"; + } + if (debian_pkg_conflicts && *debian_pkg_conflicts) + { + out << "Conflicts: " << debian_pkg_conflicts << "\n"; + } + if (debian_pkg_provides && *debian_pkg_provides) + { + out << "Provides: " << debian_pkg_provides << "\n"; + } + if (debian_pkg_replaces && *debian_pkg_replaces) + { + out << "Replaces: " << debian_pkg_replaces << "\n"; + } unsigned long totalSize = 0; { std::string dirName = this->GetOption("CPACK_TEMPORARY_DIRECTORY"); diff --git a/Source/CTest/cmCTestRunTest.cxx b/Source/CTest/cmCTestRunTest.cxx index 6570d0e..76ff23a 100644 --- a/Source/CTest/cmCTestRunTest.cxx +++ b/Source/CTest/cmCTestRunTest.cxx @@ -264,7 +264,17 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started) { *this->TestHandler->LogFile << "Test time = " << buf << std::endl; } + + // Set the working directory to the tests directory + std::string oldpath = cmSystemTools::GetCurrentWorkingDirectory(); + cmSystemTools::ChangeDirectory(this->TestProperties->Directory.c_str()); + this->DartProcessing(); + + // restore working directory + cmSystemTools::ChangeDirectory(oldpath.c_str()); + + // if this is doing MemCheck then all the output needs to be put into // Output since that is what is parsed by cmCTestMemCheckHandler if(!this->TestHandler->MemCheck && started) diff --git a/Source/QtDialog/CMakeIngestOSXBundleLibraries.cmake b/Source/QtDialog/CMakeIngestOSXBundleLibraries.cmake deleted file mode 100644 index 9f5cf00..0000000 --- a/Source/QtDialog/CMakeIngestOSXBundleLibraries.cmake +++ /dev/null @@ -1,347 +0,0 @@ -# -# CMakeIngestOSXBundleLibraries.cmake -# -# Only for the Mac build. -# -# Depends on OS tools: -# otool -# install_name_tool -# -# This script ingests libraries and frameworks into an existing .app bundle and -# then uses install_name_tool to fixup the references to the newly embedded -# libraries so that they all refer to each other via "@executable_path." -# -# The main intent (and simplifying assumption used for developing the script) -# is to have a single executable .app bundle that becomes "self-contained" by -# copying all non-system libs that it depends on into itself. The further -# assumption is that all such dependencies are simple .dylib shared library -# files or Mac Framework libraries. -# -# This script can be used as part of the build via ADD_CUSTOM_COMMAND, or used -# only during make install via INSTALL SCRIPT. -# -if(NOT DEFINED input_file) - message(FATAL_ERROR " -${CMAKE_CURRENT_LIST_FILE}(${CMAKE_CURRENT_LIST_LINE}): error: Variable input_file is not defined. - -Use a command line like this to use this script: - cmake \"-Dinput_file=filename\" \"-Dextra_libs=/path/to/lib1;/path/to/lib2\" \"-Dlib_path=/path/to/unqualified/libs\" -P \"${CMAKE_CURRENT_LIST_FILE}\" - -'input_file' should be the main executable inside a Mac bundle directory structure. -For example, use 'bin/paraview.app/Contents/MacOS/paraview' from a ParaView binary dir. - -'extra_libs' should be a semi-colon separated list of full path names to extra libraries -to copy into the bundle that cannot be derived from otool -L output. For example, you may -also want to fixup dynamically loaded plugins from your build tree and copy them into the -bundle. - -'lib_path' should be the path where to find libraries referenced without a path name in -otool -L output. - -") -endif(NOT DEFINED input_file) -message("ingest ${input_file}") -set(eol_char "E") - -if(APPLE) - set(dep_tool "otool") - set(dep_cmd_args "-L") - set(dep_regex "^\t([^\t]+) \\(compatibility version ([0-9]+.[0-9]+.[0-9]+), current version ([0-9]+.[0-9]+.[0-9]+)\\)${eol_char}$") -endif(APPLE) - -message("") -message("# Script \"${CMAKE_CURRENT_LIST_FILE}\" running...") -message("") -message("input_file: '${input_file}'") -message("extra_libs: '${extra_libs}'") -message("lib_path: '${lib_path}'") -message("") - -get_filename_component(input_file_full "${input_file}" ABSOLUTE) -message("input_file_full: '${input_file_full}'") - -get_filename_component(bundle "${input_file_full}/../../.." ABSOLUTE) -message("bundle: '${bundle}'") - - -find_program(dep_cmd ${dep_tool}) - -# find the full path to the framework in path set the result -# in pathout -macro(find_framework_full_path path pathout) - set(${pathout} "${path}") - if(NOT EXISTS "${path}") - set(FRAMEWORK_SEARCH "/Library/Frameworks" - "/System/Library/Frameworks" ) - set(__FOUND FALSE) - foreach(f ${FRAMEWORK_SEARCH}) - set(newd "${f}/${path}") - if(EXISTS "${newd}" AND NOT __FOUND) - set(${pathout} "${newd}") - set(__FOUND TRUE) - endif(EXISTS "${newd}" AND NOT __FOUND) - endforeach(f) - endif(NOT EXISTS "${path}") -endmacro(find_framework_full_path) - - -macro(append_unique au_list_var au_value) - set(${au_list_var} ${${au_list_var}} "${au_value}") -endmacro(append_unique) - - -macro(gather_dependents gd_target gd_dependents_var) - execute_process( - COMMAND ${dep_cmd} ${dep_cmd_args} ${gd_target} - OUTPUT_VARIABLE dep_tool_ov - ) - - string(REGEX REPLACE ";" "\\\\;" dep_candidates "${dep_tool_ov}") - string(REGEX REPLACE "\n" "${eol_char};" dep_candidates "${dep_candidates}") - - set(${gd_dependents_var} "") - - foreach(candidate ${dep_candidates}) - if("${candidate}" MATCHES "${dep_regex}") - string(REGEX REPLACE "${dep_regex}" "\\1" raw_item "${candidate}") - string(REGEX REPLACE "${dep_regex}" "\\2" raw_compat_version "${candidate}") - string(REGEX REPLACE "${dep_regex}" "\\3" raw_current_version "${candidate}") - - set(item "${raw_item}") - - string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" compat_major_version "${raw_compat_version}") - string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" compat_minor_version "${raw_compat_version}") - string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" compat_patch_version "${raw_compat_version}") - - string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\1" current_major_version "${raw_current_version}") - string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\2" current_minor_version "${raw_current_version}") - string(REGEX REPLACE "^([0-9]+)\\.([0-9]+)\\.([0-9]+)$" "\\3" current_patch_version "${raw_current_version}") - - #message("${raw_item} - compat ${raw_compat_version} - current ${raw_current_version}") - append_unique("${gd_dependents_var}" "${item}") - else("${candidate}" MATCHES "${dep_regex}") - if("${candidate}" STREQUAL "${gd_target}:${eol_char}") - #message("info: ignoring target name...") - else("${candidate}" STREQUAL "${gd_target}:${eol_char}") - message("error: candidate='${candidate}'") - endif("${candidate}" STREQUAL "${gd_target}:${eol_char}") - endif("${candidate}" MATCHES "${dep_regex}") - endforeach(candidate) -endmacro(gather_dependents) - - -message("Gathering dependent libraries for '${input_file_full}'...") -gather_dependents("${input_file_full}" deps) -message("") - - -# Order lexicographically: -# -list(SORT deps) - - -# Split into separate lists, "system" "embedded" and "nonsystem" libraries. -# System libs are assumed to be available on all target runtime Macs and do not -# need to be copied/fixed-up by this script. Embedded libraries are assumed to -# be in the bundle and fixed-up already. Only non-system, non-embedded libs -# need copying and fixing up... -# -set(system_deps "") -set(embedded_deps "") -set(nonsystem_deps "") - -foreach(d ${deps}) - set(d_is_embedded_lib 0) - set(d_is_system_lib 0) - - if("${d}" MATCHES "^(/System/Library|/usr/lib)") - set(d_is_system_lib 1) - else("${d}" MATCHES "^(/System/Library|/usr/lib)") - if("${d}" MATCHES "^@executable_path") - set(d_is_embedded_lib 1) - endif("${d}" MATCHES "^@executable_path") - endif("${d}" MATCHES "^(/System/Library|/usr/lib)") - - if(d_is_system_lib) - set(system_deps ${system_deps} "${d}") - else(d_is_system_lib) - if(d_is_embedded_lib) - set(embedded_deps ${embedded_deps} "${d}") - else(d_is_embedded_lib) - set(nonsystem_deps ${nonsystem_deps} "${d}") - endif(d_is_embedded_lib) - endif(d_is_system_lib) -endforeach(d) - -message("") -message("system_deps:") -foreach(d ${system_deps}) - message("${d}") -endforeach(d ${system_deps}) - -message("") -message("embedded_deps:") -foreach(d ${embedded_deps}) - message("${d}") -endforeach(d ${embedded_deps}) - -message("") -message("nonsystem_deps:") -foreach(d ${nonsystem_deps}) - message("${d}") -endforeach(d ${nonsystem_deps}) - -message("") - - -macro(copy_library_into_bundle clib_bundle clib_libsrc clib_dstlibs clib_fixups) - # - # If the source library is a framework, copy just the shared lib bit of the framework - # into the bundle under "${clib_bundle}/Contents/Frameworks" - if it is just a dylib - # copy it into the same directory with the main bundle executable under - # "${clib_bundle}/Contents/MacOS" - # - if("${clib_libsrc}" MATCHES ".framework/.*/.*/.*") - # make sure clib_libsrc is a full path to the framework as a framework - # maybe linked in with relative paths in some cases - find_framework_full_path("${clib_libsrc}" fw_full_src) - get_filename_component(fw_src "${fw_full_src}" ABSOLUTE) - get_filename_component(fw_srcdir "${clib_libsrc}/../../.." ABSOLUTE) - get_filename_component(fwdirname "${fw_srcdir}" NAME) - string(REGEX REPLACE "^(.*)\\.framework$" "\\1" fwname "${fwdirname}") - string(REGEX REPLACE "^.*/${fwname}\\.framework/(.*)$" "\\1" fwlibname "${clib_libsrc}") - set(fw_dstdir "${clib_bundle}/Contents/Frameworks") - -# message("") -# message("fwdirname: '${fwdirname}'") -# message("fwname: '${fwname}'") -# message("fwlibname: '${fwlibname}'") -# message("fw_src: '${fw_src}'") -# message("fw_srcdir: '${fw_srcdir}'") -# message("fw_dstdir: '${fw_dstdir}'") -# message("new_name: '@executable_path/../Frameworks/${fwdirname}/${fwlibname}'") -# message("") - - message("Copying ${fw_srcdir} into bundle...") - - # This command copies the *entire* framework recursively: - # -# execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory -# "${fw_srcdir}" "${fw_dstdir}" -# ) - - # This command copies just the main shared lib of the framework: - # (This technique will not work for frameworks that have necessary - # resource or auxiliary files...) - # - message("fw_src = [${fw_src}] fw_full_src = [${fw_full_src}]") - message("Copy: ${CMAKE_COMMAND} -E copy \"${fw_src}\" \"${fw_dstdir}/${fwlibname}\"") - execute_process(COMMAND ${CMAKE_COMMAND} -E copy - "${fw_src}" "${fw_dstdir}/${fwlibname}" - ) - - get_filename_component(fw_src_path "${fw_src}" PATH) - message("Checking ${fw_src_path}/Resources") - if(EXISTS "${fw_src_path}/Resources") - message("Copy: ${CMAKE_COMMAND} -E copy_directory \"${fw_src_path}/Resources/\" \"${fw_dstdir}/Resources/\"") - execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory - "${fw_src_path}/Resources/" "${fw_dstdir}/${fwdirname}/Resources/") - endif(EXISTS "${fw_src_path}/Resources") - - execute_process(COMMAND install_name_tool - -id "@executable_path/../Frameworks/${fwlibname}" - "${clib_bundle}/Contents/Frameworks/${fwlibname}" - ) - set(${clib_dstlibs} ${${clib_dstlibs}} - "${clib_bundle}/Contents/Frameworks/${fwlibname}" - ) - set(${clib_fixups} ${${clib_fixups}} - "-change" - "${clib_libsrc}" - "@executable_path/../Frameworks/${fwlibname}" - ) - else("${clib_libsrc}" MATCHES ".framework/.*/.*/.*") - if("${clib_libsrc}" MATCHES "/") - set(clib_libsrcfull "${clib_libsrc}") - else("${clib_libsrc}" MATCHES "/") - set(clib_libsrcfull "${lib_path}/${clib_libsrc}") - if(NOT EXISTS "${clib_libsrcfull}") - message(FATAL_ERROR "error: '${clib_libsrcfull}' does not exist...") - endif(NOT EXISTS "${clib_libsrcfull}") - endif("${clib_libsrc}" MATCHES "/") - - get_filename_component(dylib_src "${clib_libsrcfull}" ABSOLUTE) - get_filename_component(dylib_name "${dylib_src}" NAME) - set(dylib_dst "${clib_bundle}/Contents/MacOS/${dylib_name}") - -# message("dylib_src: ${dylib_src}") -# message("dylib_dst: ${dylib_dst}") -# message("new_name: '@executable_path/${dylib_name}'") - - message("Copying ${dylib_src} into bundle...") - execute_process(COMMAND ${CMAKE_COMMAND} -E copy - "${dylib_src}" "${dylib_dst}") - execute_process(COMMAND install_name_tool - -id "@executable_path/${dylib_name}" - "${dylib_dst}" - ) - set(${clib_dstlibs} ${${clib_dstlibs}} - "${dylib_dst}" - ) - set(${clib_fixups} ${${clib_fixups}} - "-change" - "${clib_libsrc}" - "@executable_path/${dylib_name}" - ) - endif("${clib_libsrc}" MATCHES ".framework/.*/.*/.*") -endmacro(copy_library_into_bundle) - - -# Copy dependent "nonsystem" libraries into the bundle: -# -message("Copying dependent libraries into bundle...") -set(srclibs ${nonsystem_deps} ${extra_libs}) -set(dstlibs "") -set(fixups "") -foreach(d ${srclibs}) - message("copy it --- ${d}") - copy_library_into_bundle("${bundle}" "${d}" dstlibs fixups) -endforeach(d) - -message("") -message("dstlibs='${dstlibs}'") -message("") -message("fixups='${fixups}'") -message("") - - -# Fixup references to copied libraries in the main bundle executable and in the -# copied libraries themselves: -# -if(NOT "${fixups}" STREQUAL "") - message("Fixing up references...") - foreach(d ${dstlibs} "${input_file_full}") - message("fixing up references in: '${d}'") - execute_process(COMMAND install_name_tool ${fixups} "${d}") - endforeach(d) - message("") -endif(NOT "${fixups}" STREQUAL "") - - -# List all references to eyeball them and make sure they look right: -# -message("Listing references...") -foreach(d ${dstlibs} "${input_file_full}") - execute_process(COMMAND otool -L "${d}") - message("") -endforeach(d) -message("") - - -# Output file: -# -#get_filename_component(script_name "${CMAKE_CURRENT_LIST_FILE}" NAME) -#file(WRITE "${input_file_full}_${script_name}" "# Script \"${CMAKE_CURRENT_LIST_FILE}\" completed.\n") -message("") -message("# Script \"${CMAKE_CURRENT_LIST_FILE}\" completed.") -message("") diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 405c952..4785188 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -19,13 +19,6 @@ ELSE(NOT QT4_FOUND) INCLUDE(${QT_USE_FILE}) SET(CMAKE_PACKAGE_QTGUI TRUE) - # i don't want to install or package the qt gui on windows - # unless qt is static - IF(WIN32 AND NOT QT_CONFIG MATCHES "static") - SET(CMAKE_PACKAGE_QTGUI FALSE) - MESSAGE(STATUS - "WARNING: QtDialog requires a static built qt for installation.") - ENDIF(WIN32 AND NOT QT_CONFIG MATCHES "static") SET(SRCS AddCacheEntry.cxx AddCacheEntry.h @@ -86,12 +79,8 @@ ELSE(NOT QT4_FOUND) SET(CMAKE_INSTALL_DESTINATION_ARGS BUNDLE DESTINATION "${CMAKE_BUNDLE_LOCATION}") ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4) - # if qt is not static and we are on windows then skip the install - # I don't want to distribute qt dlls - IF(CMAKE_PACKAGE_QTGUI) - INSTALL(TARGETS cmake-gui RUNTIME DESTINATION bin - ${CMAKE_INSTALL_DESTINATION_ARGS}) - ENDIF(CMAKE_PACKAGE_QTGUI) + + INSTALL(TARGETS cmake-gui RUNTIME DESTINATION bin ${CMAKE_INSTALL_DESTINATION_ARGS}) IF(UNIX) # install a desktop file so CMake appears in the application start menu @@ -112,10 +101,21 @@ ELSE(NOT QT4_FOUND) "${CMake_BINARY_DIR}/Source/QtDialog/postupgrade.sh") INSTALL(CODE "execute_process(COMMAND ln -s \"../MacOS/${CMAKE_BUNDLE_NAME}\" cmake-gui WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin)") - INSTALL(CODE "set(input_file - \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}\")") - INSTALL(SCRIPT "${CMake_SOURCE_DIR}/Source/QtDialog/CMakeIngestOSXBundleLibraries.cmake") ENDIF(APPLE) + + if(APPLE OR WIN32) + # install rules for including 3rd party libs such as Qt + # if a system Qt is used (e.g. installed in /usr/lib/), it will not be included in the installation + set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/bin/cmake-gui${CMAKE_EXECUTABLE_SUFFIX}") + if(APPLE) + set(fixup_exe "\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/MacOS/${CMAKE_BUNDLE_NAME}") + endif(APPLE) + install(CODE " + include(\"${CMake_SOURCE_DIR}/Modules/BundleUtilities.cmake\") + fixup_bundle(\"${fixup_exe}\" \"\" \"${QT_LIBRARY_DIR};${QT_BINARY_DIR}\") + ") + endif(APPLE OR WIN32) + CONFIGURE_FILE("${QtDialog_SOURCE_DIR}/QtDialogCPack.cmake.in" "${QtDialog_BINARY_DIR}/QtDialogCPack.cmake" @ONLY) ENDIF(NOT QT4_FOUND) diff --git a/Source/cmDocumentVariables.cxx b/Source/cmDocumentVariables.cxx index 9617355..a877680 100644 --- a/Source/cmDocumentVariables.cxx +++ b/Source/cmDocumentVariables.cxx @@ -2,7 +2,7 @@ #include "cmake.h" void cmDocumentVariables::DefineVariables(cmake* cm) -{ +{ // Subsection: variables defined by cmake, that give // information about the project, and cmake cm->DefineProperty @@ -18,21 +18,21 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "This is the full path to the CMake executable cmake which is " "useful from custom commands that want to use the cmake -E " "option for portable system commands. " - "(e.g. /usr/local/bin/cmake", false, + "(e.g. /usr/local/bin/cmake", false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_BINARY_DIR", cmProperty::VARIABLE, "The path to the top level of the build tree.", "This is the full path to the top level of the current CMake " "build tree. For an in-source build, this would be the same " - "as CMAKE_SOURCE_DIR. ", false, + "as CMAKE_SOURCE_DIR. ", false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_SOURCE_DIR", cmProperty::VARIABLE, "The path to the top level of the source tree.", "This is the full path to the top level of the current CMake " "source tree. For an in-source build, this would be the same " - "as CMAKE_BINARY_DIR. ", false, + "as CMAKE_BINARY_DIR. ", false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_CURRENT_BINARY_DIR", cmProperty::VARIABLE, @@ -42,13 +42,13 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "add_subdirectory will create a binary directory in the build " "tree, and as it is being processed this variable will be set. " "For in-source builds this is the current source directory " - "being processed.", false, + "being processed.", false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_CURRENT_SOURCE_DIR", cmProperty::VARIABLE, "The path to the source directory currently being processed.", "This the full path to the source directory that is currently " - "being processed by cmake. ", false, + "being processed by cmake. ", false, "Variables that Provide Information"); cm->DefineProperty @@ -74,8 +74,28 @@ void cmDocumentVariables::DefineVariables(cmake* cm) ("CMAKE_CURRENT_LIST_LINE", cmProperty::VARIABLE, "The line number of the current file being processed.", "This is the line number of the file currently being" - " processed by cmake.", false, + " processed by cmake.", false, "Variables that Provide Information"); + + cm->DefineProperty + ("CMAKE_CURRENT_LIST_DIR", cmProperty::VARIABLE, + "Full directory of the listfile currently being processed.", + "As CMake processes the listfiles in your project this " + "variable will always be set to the directory where the listfile which " + "is currently being processed (CMAKE_CURRENT_LIST_FILE) is located. " + "The value has dynamic scope. " + "When CMake starts processing commands in a source file " + "it sets this variable to the directory where this file is located. " + "When CMake finishes processing commands from the file it " + "restores the previous value. " + "Therefore the value of the variable inside a macro or " + "function is the directory of the file invoking the bottom-most entry on " + "the call stack, not the directory of the file containing the macro or " + "function definition." + "\n" + "See also CMAKE_CURRENT_LIST_FILE.",false, + "Variables that Provide Information"); + cm->DefineProperty ("CMAKE_BUILD_TOOL", cmProperty::VARIABLE, "Tool used for the actual build process.", @@ -87,7 +107,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "and for Visual Studio 7 it set to devenv. For " "Nmake Makefiles the value is nmake. This can be " "useful for adding special flags and commands based" - " on the final build environment. ", false, + " on the final build environment. ", false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_CROSSCOMPILING", cmProperty::VARIABLE, @@ -101,7 +121,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "The directory with the CMakeCache.txt file.", "This is the full path to the directory that has the " "CMakeCache.txt file in it. This is the same as " - "CMAKE_BINARY_DIR.", false, + "CMAKE_BINARY_DIR.", false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_CACHE_MAJOR_VERSION", cmProperty::VARIABLE, @@ -109,7 +129,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "This is stores the major version of CMake used to " "write a CMake cache file. It is only different when " "a different version of CMake is run on a previously " - "created cache file.", false, + "created cache file.", false, "Variables that Provide Information"); cm->DefineProperty ("CMAKE_CACHE_MINOR_VERSION", cmProperty::VARIABLE, @@ -117,18 +137,18 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "This is stores the minor version of CMake used to " "write a CMake cache file. It is only different when " "a different version of CMake is run on a previously " - "created cache file.", false, + "created cache file.", false, "Variables that Provide Information"); - + cm->DefineProperty ("CMAKE_CACHE_PATCH_VERSION", cmProperty::VARIABLE, "Patch version of CMake used to create the CMakeCache.txt file", "This is stores the patch version of CMake used to " "write a CMake cache file. It is only different when " "a different version of CMake is run on a previously " - "created cache file.", false, + "created cache file.", false, "Variables that Provide Information"); - + cm->DefineProperty ("CMAKE_CFG_INTDIR", cmProperty::VARIABLE, "Build-time reference to per-configuration output subdirectory.", @@ -168,7 +188,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "is passed as the value of preprocessor symbol \"CMAKE_INTDIR\" to " "the compilation of all source files.",false, "Variables that Provide Information"); - + cm->DefineProperty ("CMAKE_CTEST_COMMAND", cmProperty::VARIABLE, "Full path to ctest command installed with cmake.", @@ -442,7 +462,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Variables that Provide Information"); - // Variables defined by cmake, that change the behavior + // Variables defined by cmake, that change the behavior // of cmake cm->DefineProperty ("CMAKE_FIND_LIBRARY_PREFIXES", cmProperty::VARIABLE, @@ -665,7 +685,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "to override any variables that need to be changed " "for some special project. ",false, "Variables That Change Behavior"); - + cm->DefineProperty ("BUILD_SHARED_LIBS", cmProperty::VARIABLE, "Global flag to cause add_library to create shared libraries if on.", @@ -676,14 +696,14 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "they want to build the project using shared or static " "libraries.",false, "Variables That Change Behavior"); - + cm->DefineProperty ("CMAKE_NOT_USING_CONFIG_FLAGS", cmProperty::VARIABLE, "Skip _BUILD_TYPE flags if true.", "This is an internal flag used by the generators in " "CMake to tell CMake to skip the _BUILD_TYPE flags.",false, "Variables That Change Behavior"); - + cm->DefineProperty ("CMAKE_MFC_FLAG", cmProperty::VARIABLE, "Tell cmake to use MFC for an executable or dll.", @@ -774,19 +794,19 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "True if running on Mac OSX.", "Set to true on Mac OSX.",false, "Variables That Describe the System"); - + cm->DefineProperty ("BORLAND", cmProperty::VARIABLE, "True of the borland compiler is being used.", "This is set to true if the Borland compiler is being used.",false, "Variables That Describe the System"); - + cm->DefineProperty ("CYGWIN", cmProperty::VARIABLE, "True for cygwin.", "Set to true when using CYGWIN.",false, "Variables That Describe the System"); - + cm->DefineProperty ("MSVC", cmProperty::VARIABLE, "True when using Microsoft Visual C", @@ -838,7 +858,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Set to true when the target system is UNIX or UNIX like " "(i.e. APPLE and CYGWIN).",false, "Variables That Describe the System"); - + cm->DefineProperty ("WIN32", cmProperty::VARIABLE, "True on windows systems, including win64.", @@ -865,7 +885,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "Set to true when the host system is UNIX or UNIX like " "(i.e. APPLE and CYGWIN).",false, "Variables That Describe the System"); - + cm->DefineProperty ("CMAKE_HOST_WIN32", cmProperty::VARIABLE, "True on windows systems, including win64.", @@ -890,7 +910,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "The value must be an integer no less than 128.",false, "Variables That Describe the System"); - // Variables that affect the building of object files and + // Variables that affect the building of object files and // targets. // cm->DefineProperty @@ -1106,7 +1126,7 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "This is the command that will be used as the <LANG> compiler. " "Once set, you can not change this variable.",false, "Variables for Languages"); - + cm->DefineProperty ("CMAKE_<LANG>_COMPILER_ID", cmProperty::VARIABLE, "An internal variable subject to change.", @@ -1150,54 +1170,54 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "If the selected <LANG> compiler is the GNU " "compiler then this is TRUE, if not it is FALSE.",false, "Variables for Languages"); - + cm->DefineProperty ("CMAKE_<LANG>_FLAGS_DEBUG", cmProperty::VARIABLE, "Flags for Debug build type or configuration.", "<LANG> flags used when CMAKE_BUILD_TYPE is Debug.",false, "Variables for Languages"); - + cm->DefineProperty ("CMAKE_<LANG>_FLAGS_MINSIZEREL", cmProperty::VARIABLE, "Flags for MinSizeRel build type or configuration.", "<LANG> flags used when CMAKE_BUILD_TYPE is MinSizeRel." "Short for minimum size release.",false, "Variables for Languages"); - + cm->DefineProperty ("CMAKE_<LANG>_FLAGS_RELEASE", cmProperty::VARIABLE, "Flags for Release build type or configuration.", "<LANG> flags used when CMAKE_BUILD_TYPE is Release",false, "Variables for Languages"); - + cm->DefineProperty ("CMAKE_<LANG>_FLAGS_RELWITHDEBINFO", cmProperty::VARIABLE, "Flags for RelWithDebInfo type or configuration.", "<LANG> flags used when CMAKE_BUILD_TYPE is RelWithDebInfo. " "Short for Release With Debug Information.",false, "Variables for Languages"); - + cm->DefineProperty ("CMAKE_<LANG>_COMPILE_OBJECT", cmProperty::VARIABLE, "Rule variable to compile a single object file.", "This is a rule variable that tells CMake how to " "compile a single object file for for the language <LANG>.",false, "Variables for Languages"); - + cm->DefineProperty ("CMAKE_<LANG>_CREATE_SHARED_LIBRARY", cmProperty::VARIABLE, "Rule variable to create a shared library.", "This is a rule variable that tells CMake how to " "create a shared library for the language <LANG>.",false, "Variables for Languages"); - + cm->DefineProperty ("CMAKE_<LANG>_CREATE_SHARED_MODULE", cmProperty::VARIABLE, "Rule variable to create a shared module.", "This is a rule variable that tells CMake how to " "create a shared library for the language <LANG>.",false, "Variables for Languages"); - + cm->DefineProperty ("CMAKE_<LANG>_CREATE_STATIC_LIBRARY", cmProperty::VARIABLE, "Rule variable to create a static library.", @@ -1289,20 +1309,20 @@ void cmDocumentVariables::DefineVariables(cmake* cm) "See also the CMAKE_<LANG>_LINKER_PREFERENCE_PROPAGATES variable.", false, "Variables for Languages"); - + cm->DefineProperty ("CMAKE_<LANG>_LINK_EXECUTABLE ", cmProperty::VARIABLE, "Rule variable to link and executable.", "Rule variable to link and executable for the given language.",false, "Variables for Languages"); - + cm->DefineProperty ("CMAKE_<LANG>_OUTPUT_EXTENSION", cmProperty::VARIABLE, "Extension for the output of a compile for a single file.", "This is the extension for an object file for " "the given <LANG>. For example .obj for C on Windows.",false, "Variables for Languages"); - + cm->DefineProperty ("CMAKE_<LANG>_SOURCE_FILE_EXTENSIONS", cmProperty::VARIABLE, "Extensions of source files for the given language.", @@ -1317,16 +1337,16 @@ void cmDocumentVariables::DefineVariables(cmake* cm) false,"Variables for Languages"); // variables that are used by cmake but not to be documented - cm->DefineProperty("CMAKE_MATCH_0", cmProperty::VARIABLE,0,0); - cm->DefineProperty("CMAKE_MATCH_1", cmProperty::VARIABLE,0,0); - cm->DefineProperty("CMAKE_MATCH_2", cmProperty::VARIABLE,0,0); - cm->DefineProperty("CMAKE_MATCH_3", cmProperty::VARIABLE,0,0); - cm->DefineProperty("CMAKE_MATCH_4", cmProperty::VARIABLE,0,0); - cm->DefineProperty("CMAKE_MATCH_5", cmProperty::VARIABLE,0,0); - cm->DefineProperty("CMAKE_MATCH_6", cmProperty::VARIABLE,0,0); - cm->DefineProperty("CMAKE_MATCH_7", cmProperty::VARIABLE,0,0); - cm->DefineProperty("CMAKE_MATCH_8", cmProperty::VARIABLE,0,0); - cm->DefineProperty("CMAKE_MATCH_9", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_MATCH_0", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_MATCH_1", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_MATCH_2", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_MATCH_3", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_MATCH_4", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_MATCH_5", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_MATCH_6", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_MATCH_7", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_MATCH_8", cmProperty::VARIABLE,0,0); + cm->DefineProperty("CMAKE_MATCH_9", cmProperty::VARIABLE,0,0); cm->DefineProperty("CMAKE_<LANG>_COMPILER_ARG1", cmProperty::VARIABLE,0,0); diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 0976a4d..2f7bc44 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -643,7 +643,7 @@ cmGlobalXCodeGenerator::CreateXCodeFileReference(cmSourceFile* sf, sourcecode += ".c.h"; } else if(ext == "hxx" || ext == "hpp" || ext == "txx" - || ext == "pch") + || ext == "pch" || ext == "hh") { sourcecode += ".cpp.h"; } diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx index ef15113..56e0ed9 100644 --- a/Source/cmMakefile.cxx +++ b/Source/cmMakefile.cxx @@ -353,7 +353,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, // No error. return result; } - + std::string name = lff.Name; // Place this call on the call stack. @@ -377,7 +377,7 @@ bool cmMakefile::ExecuteCommand(const cmListFileFunction& lff, cmOStringStream msg; msg << lff.FilePath << "(" << lff.Line << "): "; msg << lff.Name << "("; - for(std::vector<cmListFileArgument>::const_iterator i = + for(std::vector<cmListFileArgument>::const_iterator i = lff.Arguments.begin(); i != lff.Arguments.end(); ++i) { msg << i->Value; @@ -610,6 +610,8 @@ bool cmMakefile::ReadListFile(const char* filename_in, } this->AddDefinition("CMAKE_CURRENT_LIST_FILE", filenametoread); + this->AddDefinition("CMAKE_CURRENT_LIST_DIR", + cmSystemTools::GetFilenamePath(filenametoread).c_str()); // try to see if the list file is the top most // list file for a project, and if it is, then it @@ -643,6 +645,8 @@ bool cmMakefile::ReadListFile(const char* filename_in, } this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str()); + this->AddDefinition("CMAKE_CURRENT_LIST_DIR", + cmSystemTools::GetFilenamePath(currentFile).c_str()); return false; } // add this list file to the list of dependencies @@ -683,6 +687,8 @@ bool cmMakefile::ReadListFile(const char* filename_in, this->AddDefinition("CMAKE_PARENT_LIST_FILE", currentParentFile.c_str()); this->AddDefinition("CMAKE_CURRENT_LIST_FILE", currentFile.c_str()); + this->AddDefinition("CMAKE_CURRENT_LIST_DIR", + cmSystemTools::GetFilenamePath(currentFile).c_str()); // pop the listfile off the stack this->ListFileStack.pop_back(); @@ -1742,8 +1748,8 @@ void cmMakefile::AddLibrary(const char* lname, cmTarget::TargetType type, bool excludeFromAll) { // wrong type ? default to STATIC - if ( (type != cmTarget::STATIC_LIBRARY) - && (type != cmTarget::SHARED_LIBRARY) + if ( (type != cmTarget::STATIC_LIBRARY) + && (type != cmTarget::SHARED_LIBRARY) && (type != cmTarget::MODULE_LIBRARY)) { type = cmTarget::STATIC_LIBRARY; @@ -2325,14 +2331,14 @@ void cmMakefile::AddDefaultDefinitions() { /* Up to CMake 2.4 here only WIN32, UNIX and APPLE were set. With CMake must separate between target and host platform. In most cases - the tests for WIN32, UNIX and APPLE will be for the target system, so an + the tests for WIN32, UNIX and APPLE will be for the target system, so an additional set of variables for the host system is required -> CMAKE_HOST_WIN32, CMAKE_HOST_UNIX, CMAKE_HOST_APPLE. - WIN32, UNIX and APPLE are now set in the platform files in + WIN32, UNIX and APPLE are now set in the platform files in Modules/Platforms/. To keep cmake scripts (-P) and custom language and compiler modules working, these variables are still also set here in this place, but they - will be reset in CMakeSystemSpecificInformation.cmake before the platform + will be reset in CMakeSystemSpecificInformation.cmake before the platform files are executed. */ #if defined(_WIN32) || defined(__CYGWIN__) this->AddDefinition("WIN32", "1"); @@ -2643,13 +2649,13 @@ cmSourceFile* cmMakefile::GetOrCreateSource(const char* sourceName, } } -void cmMakefile::EnableLanguage(std::vector<std::string> const & lang, +void cmMakefile::EnableLanguage(std::vector<std::string> const & lang, bool optional) { this->AddDefinition("CMAKE_CFG_INTDIR", this->LocalGenerator->GetGlobalGenerator() ->GetCMakeCFGInitDirectory()); - this->LocalGenerator->GetGlobalGenerator()->EnableLanguage(lang, this, + this->LocalGenerator->GetGlobalGenerator()->EnableLanguage(lang, this, optional); } @@ -2725,7 +2731,7 @@ int cmMakefile::TryCompile(const char *srcdir, const char *bindir, { cm.AddCacheEntry("CMAKE_SUPPRESS_DEVELOPER_WARNINGS", "FALSE", "", cmCacheManager::INTERNAL); - } + } if (cm.Configure() != 0) { cmSystemTools::Error( @@ -3013,7 +3019,7 @@ void cmMakefile::SetProperty(const char* prop, const char* value) { return; } - + // handle special props std::string propname = prop; if ( propname == "INCLUDE_DIRECTORIES" ) @@ -3037,7 +3043,7 @@ void cmMakefile::SetProperty(const char* prop, const char* value) this->SetLinkDirectories(varArgsExpanded); return; } - + if ( propname == "INCLUDE_REGULAR_EXPRESSION" ) { this->SetIncludeRegularExpression(value); @@ -3047,7 +3053,7 @@ void cmMakefile::SetProperty(const char* prop, const char* value) if ( propname == "ADDITIONAL_MAKE_CLEAN_FILES" ) { // This property is not inherrited - if ( strcmp(this->GetCurrentDirectory(), + if ( strcmp(this->GetCurrentDirectory(), this->GetStartDirectory()) != 0 ) { return; @@ -3168,14 +3174,14 @@ const char *cmMakefile::GetProperty(const char* prop, return output.c_str(); } else if (!strcmp("DEFINITIONS",prop)) - { + { output += this->DefineFlagsOrig; return output.c_str(); } else if (!strcmp("INCLUDE_DIRECTORIES",prop) ) { cmOStringStream str; - for (std::vector<std::string>::const_iterator + for (std::vector<std::string>::const_iterator it = this->GetIncludeDirectories().begin(); it != this->GetIncludeDirectories().end(); ++ it ) @@ -3192,7 +3198,7 @@ const char *cmMakefile::GetProperty(const char* prop, else if (!strcmp("LINK_DIRECTORIES",prop)) { cmOStringStream str; - for (std::vector<std::string>::const_iterator + for (std::vector<std::string>::const_iterator it = this->GetLinkDirectories().begin(); it != this->GetLinkDirectories().end(); ++ it ) @@ -3606,7 +3612,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, msg = e.str(); return false; } - else + else { // target names must be globally unique switch (this->GetPolicyStatus(cmPolicies::CMP0002)) @@ -3625,7 +3631,7 @@ bool cmMakefile::EnforceUniqueName(std::string const& name, std::string& msg, case cmPolicies::NEW: break; } - + // The conflict is with a non-imported target. // Allow this if the user has requested support. cmake* cm = @@ -3774,7 +3780,7 @@ cmMakefile::GetPolicyStatusInternal(cmPolicies::PolicyID id) return this->GetPolicies()->GetPolicyStatus(id); } -bool cmMakefile::SetPolicy(const char *id, +bool cmMakefile::SetPolicy(const char *id, cmPolicies::PolicyStatus status) { cmPolicies::PolicyID pid; @@ -3904,7 +3910,7 @@ bool cmMakefile::SetPolicyVersion(const char *version) } cmPolicies *cmMakefile::GetPolicies() -{ +{ if (!this->GetCMakeInstance()) { return 0; diff --git a/Source/kwsys/SystemInformation.cxx b/Source/kwsys/SystemInformation.cxx index 936c1f7..4818ce9 100644 --- a/Source/kwsys/SystemInformation.cxx +++ b/Source/kwsys/SystemInformation.cxx @@ -3304,28 +3304,37 @@ bool SystemInformationImplementation::QueryOSInformation() { case VER_PLATFORM_WIN32_NT: // Test for the product. - if (osvi.dwMajorVersion <= 4) + if (osvi.dwMajorVersion <= 4) { this->OSRelease = "NT"; } - if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) + if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 0) { this->OSRelease = "2000"; } - if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) + if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1) + { + this->OSRelease = "XP"; + } + // XP Professional x64 + if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 2) { this->OSRelease = "XP"; } #ifdef VER_NT_WORKSTATION // Test for product type. - if (bOsVersionInfoEx) + if (bOsVersionInfoEx) { - if (osvi.wProductType == VER_NT_WORKSTATION) + if (osvi.wProductType == VER_NT_WORKSTATION) { - if (osvi.dwMajorVersion == 6) + if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 0) { this->OSRelease = "Vista"; } + if (osvi.dwMajorVersion == 6 && osvi.dwMinorVersion == 1) + { + this->OSRelease = "7"; + } // VER_SUITE_PERSONAL may not be defined #ifdef VER_SUITE_PERSONAL else diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 39c73df..5ff8eec 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -15,7 +15,7 @@ SET(KWSYS_DATE_STAMP_YEAR 2010) # KWSys version date month component. Format is MM. -SET(KWSYS_DATE_STAMP_MONTH 10) +SET(KWSYS_DATE_STAMP_MONTH 11) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 15) +SET(KWSYS_DATE_STAMP_DAY 09) |