From 39fa526e1db4be20a3c7133524e78d90e0320d37 Mon Sep 17 00:00:00 2001 From: Modestas Vainius Date: Sat, 21 Feb 2009 17:33:47 +0200 Subject: [PATCH] Import cmake 2.6.3 Signed-off-by: Modestas Vainius --- CMakeCPackOptions.cmake.in | 5 +- CMakeLists.txt | 2 +- ChangeLog.manual | 19 +++ Modules/FindBoost.cmake | 110 +++++++++--------- Modules/FindQt4.cmake | 43 ++++++- Modules/UseQt4.cmake | 7 +- Source/QtDialog/CMakeLists.txt | 2 + Source/QtDialog/CMakeSetup.cxx | 76 ++++++------ Source/QtDialog/QtDialogCPack.cmake.in | 2 +- Source/cmCacheManager.cxx | 24 +++- Source/cmGlobalUnixMakefileGenerator3.cxx | 30 +++-- Source/cmGlobalXCodeGenerator.cxx | 10 +- .../cmMakefileExecutableTargetGenerator.cxx | 8 +- Source/cmSystemTools.cxx | 13 ++- Source/cmake.cxx | 26 ++++- Tests/BuildDepends/Project/CMakeLists.txt | 10 +- Utilities/CMakeLists.txt | 1 + 17 files changed, 257 insertions(+), 131 deletions(-) diff --git a/CMakeCPackOptions.cmake.in b/CMakeCPackOptions.cmake.in index 16941c89c..3bcdb0234 100755 --- a/CMakeCPackOptions.cmake.in +++ b/CMakeCPackOptions.cmake.in @@ -11,18 +11,19 @@ if(CPACK_GENERATOR MATCHES "NSIS") SET(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp") # tell cpack to create links to the doc files SET(CPACK_NSIS_MENU_LINKS - "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/CMakeSetup.html" "CMakeSetup Help" + "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-gui.html" "cmake-gui Help" "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help" "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-properties.html" "CMake Properties and Variables Help" "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/ctest.html" "CTest Help" "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-modules.html" "CMake Modules Help" "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-commands.html" "CMake Commands Help" + "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/CMakeSetup.html" "CMakeSetup Help" "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cpack.html" "CPack Help" "http://www.cmake.org" "CMake Web Site" ) # tell cpack the executables you want in the start menu as links - SET(CPACK_PACKAGE_EXECUTABLES "CMakeSetup" "CMake" ) + SET(CPACK_PACKAGE_EXECUTABLES "CMakeSetup" "CMakeSetup(deprecated)" ) # tell cpack to create a desktop link to CMakeSetup SET(CPACK_CREATE_DESKTOP_LINKS "CMakeSetup") SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\CMakeSetup.exe") diff --git a/CMakeLists.txt b/CMakeLists.txt index d877f3393..7821b8e37 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -354,7 +354,7 @@ ENDMACRO (CMAKE_BUILD_UTILITIES) SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MINOR 6) SET(CMake_VERSION_PATCH 3) -SET(CMake_VERSION_RC 11) +#SET(CMake_VERSION_RC 17) # CVS versions are odd, if this is an odd minor version # then set the CMake_VERSION_DATE variable IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$") diff --git a/ChangeLog.manual b/ChangeLog.manual index 64d8e2d10..20564eb38 100755 --- a/ChangeLog.manual +++ b/ChangeLog.manual @@ -1,3 +1,22 @@ +Changes in CMake 2.6.3 RC 17 - 15 +- Fix Xcode rebuild issue with static libraries and add a test. + +Changes in CMake 2.6.3 RC 15 +- Fix Xcode rebuild issue with static libraries + +Changes in CMake 2.6.3 RC 14 +- Take cmake-gui out of beta for windows installer + +Changes in CMake 2.6.3 RC 13 +- Fix cmake can not find cmake when run on windows from PATH +- Fix #8378 FILEPATH cache UNC paths in list removed extra / +- Update FindBoost to reflect #8378 fix +- More FindQt4 fixes + +Changes in CMake 2.6.3 RC 12 +- Fix bug #8465 MACOSX_BUNDLE triggers re-configuration after build +- Add support for building with Qts ActiveX + Changes in CMake 2.6.3 RC 11 - Fix old-style install to prefix top - Fix Docs for relative paths in link_directories diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 8ea67e5bc..518f8a87d 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -3,25 +3,30 @@ # # == Using Header-Only libraries from within Boost: == # -# FIND_PACKAGE( Boost 1.36.0 ) -# INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) -# ADD_EXECUTABLE(foo foo.cc) +# find_package( Boost 1.36.0 ) +# if(Boost_FOUND) +# include_directories(${Boost_INCLUDE_DIRS}) +# add_executable(foo foo.cc) +# endif() +# # # == Using actual libraries from within Boost: == # -# SET(Boost_USE_STATIC_LIBS ON) -# SET(Boost_USE_MULTITHREADED ON) -# FIND_PACKAGE( Boost 1.36.0 COMPONENTS date_time filesystem system ... ) -# INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS}) +# set(Boost_USE_STATIC_LIBS ON) +# set(Boost_USE_MULTITHREADED ON) +# find_package( Boost 1.36.0 COMPONENTS date_time filesystem system ... ) +# +# if(Boost_FOUND) +# include_directories(${Boost_INCLUDE_DIRS}) +# add_executable(foo foo.cc) +# target_link_libraries(foo ${Boost_LIBRARIES}) +# endif() # -# ADD_EXECUTABLE(foo foo.cc) -# TARGET_LINK_LIBRARIES(foo ${Boost_LIBRARIES}) # -# The components list needs to be the actual names of boost libraries, that is -# the part of the actual library files that differ on different libraries. So -# its "date_time" for "libboost_date_time...". Anything else will result in -# errors. If you're using parts of Boost that contains header files only (e.g. -# foreach) you do not need to specify COMPONENTS. +# The components list needs to contain actual names of boost libraries only, +# such as "date_time" for "libboost_date_time". If you're using parts of +# Boost that contain header files only (e.g. foreach) you do not need to +# specify COMPONENTS. # # You should provide a minimum version number that should be used. If you provide this # version number and specify the REQUIRED attribute, this module will fail if it @@ -33,12 +38,14 @@ # Automatic linking is used on MSVC & Borland compilers by default when # #including things in Boost. It's important to note that setting # Boost_USE_STATIC_LIBS to OFF is NOT enough to get you dynamic linking, -# autolinking typically uses static libraries by default. +# should you need this feature. Automatic linking typically uses static +# libraries with a few exceptions (Boost.Python is one). # # Please see the section below near Boost_LIB_DIAGNOSTIC_DEFINITIONS for # more details. Adding a TARGET_LINK_LIBRARIES() as shown in the example # above appears to cause VS to link dynamically if Boost_USE_STATIC_LIBS -# gets set to OFF. +# gets set to OFF. It is suggested you avoid automatic linking since it +# will make your application less portable. # # =========== The mess that is Boost_ADDITIONAL_VERSIONS (sorry?) ============ # @@ -53,9 +60,9 @@ # 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0 # # NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should -# add both 1.x and 1.x.0 as shown above. Official boost include directories +# add both 1.x and 1.x.0 as shown above. Official Boost include directories # omit the 3rd version number from include paths if it is 0 although not all -# binary boost releases do so. +# binary Boost releases do so. # # SET(Boost_ADDITIONAL_VERSIONS "0.99" "0.99.0" "1.78" "1.78.0") # @@ -83,11 +90,15 @@ # Please enable this before filing any bug # reports. # -# Boost_COMPILER Set this to the compiler suffix used by boost (e.g. -gcc43) if the -# module has problems finding the proper Boost installation +# Boost_COMPILER Set this to the compiler suffix used by Boost +# (e.g. "-gcc43") if FindBoods has problems finding +# the proper Boost installation +# +# These last three variables are available also as environment variables: # -# BOOST_ROOT or BOOSTROOT Preferred installation prefix for searching for Boost, -# set this if the module has problems finding the proper Boost installation +# BOOST_ROOT or BOOSTROOT The preferred installation prefix for searching for +# Boost. Set this if the module has problems finding +# the proper Boost installation. # # BOOST_INCLUDEDIR Set this to the include directory of Boost, if the # module has problems finding the proper Boost installation @@ -95,27 +106,27 @@ # BOOST_LIBRARYDIR Set this to the lib directory of Boost, if the # module has problems finding the proper Boost installation # -# The last three variables are available also as environment variables -# -# # Variables defined by this module: # -# Boost_FOUND System has Boost, this means the include dir was found, -# as well as all the libraries specified in the COMPONENTS list +# Boost_FOUND System has Boost, this means the include dir was +# found, as well as all the libraries specified in +# the COMPONENTS list. # -# Boost_INCLUDE_DIRS Boost include directories, not cached +# Boost_INCLUDE_DIRS Boost include directories: not cached # -# Boost_INCLUDE_DIR This is almost the same as above, but this one is cached and may be -# modified by advanced users +# Boost_INCLUDE_DIR This is almost the same as above, but this one is +# cached and may be modified by advanced users # -# Boost_LIBRARIES Link these to use the Boost libraries that you specified, not cached +# Boost_LIBRARIES Link these to use the Boost libraries that you +# specified: not cached # # Boost_LIBRARY_DIRS The path to where the Boost library files are. # -# Boost_VERSION The version number of the boost libraries that have been found, -# same as in version.hpp from Boost +# Boost_VERSION The version number of the boost libraries that +# have been found, same as in version.hpp from Boost # -# Boost_LIB_VERSION The version number in filename form as its appended to the library filenames +# Boost_LIB_VERSION The version number in filename form as +# it's appended to the library filenames # # Boost_MAJOR_VERSION major version number of boost # Boost_MINOR_VERSION minor version number of boost @@ -123,13 +134,12 @@ # # Boost_LIB_DIAGNOSTIC_DEFINITIONS [WIN32 Only] You can call # add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINTIIONS}) -# to have diagnostic information about -# Boost's automatic linking outputted -# during compilation time. +# to have diagnostic information about Boost's +# automatic linking outputted during compilation time. # # For each component you list the following variables are set. # ATTENTION: The component names need to be in lower case, just as the boost -# library names however the cmake variables use upper case for the component +# library names however the CMake variables use upper case for the component # part. So you'd get Boost_SERIALIZATION_FOUND for example. # # Boost_${COMPONENT}_FOUND True IF the Boost library "component" was found. @@ -232,12 +242,7 @@ MACRO (_Boost_ADJUST_LIB_VARS basename) ENDIF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE) IF (Boost_${basename}_LIBRARY) - IF(WIN32) - # Workaround issue #8378. - SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY} CACHE STRING "The Boost ${basename} library") - ELSE() - SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY} CACHE FILEPATH "The Boost ${basename} library") - ENDIF() + set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY} CACHE FILEPATH "The Boost ${basename} library") # Remove superfluous "debug" / "optimized" keywords from # Boost_LIBRARY_DIRS @@ -247,12 +252,7 @@ MACRO (_Boost_ADJUST_LIB_VARS basename) ENDFOREACH() LIST(REMOVE_DUPLICATES Boost_LIBRARY_DIRS) - IF(WIN32) - # Workaround issue #8378. - SET(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE STRING "Boost library directory") - ELSE() - SET(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory") - ENDIF() + set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory") SET(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found") ENDIF (Boost_${basename}_LIBRARY) @@ -432,11 +432,11 @@ ELSE (_boost_IN_CACHE) _boost_BOOSTIFIED_VERSION ${_boost_VER}) ENDIF() - LIST(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}") - IF(WIN32) - # Yay Boost Pro! We dig your underscores. - LIST(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}") - ENDIF() + list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}") + if(WIN32) + # For BoostPro's underscores (and others?) + list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}") + endif() ENDFOREACH(_boost_VER) diff --git a/Modules/FindQt4.cmake b/Modules/FindQt4.cmake index 16ce8451a..8d028242f 100644 --- a/Modules/FindQt4.cmake +++ b/Modules/FindQt4.cmake @@ -11,6 +11,8 @@ # QT_DONT_USE_QTGUI # QT_USE_QT3SUPPORT # QT_USE_QTASSISTANT +# QT_USE_QAXCONTAINER +# QT_USE_QAXSERVER # QT_USE_QTDESIGNER # QT_USE_QTMOTIF # QT_USE_QTMAIN @@ -139,6 +141,8 @@ # QT_QTGUI_FOUND True if QtGui was found. # QT_QT3SUPPORT_FOUND True if Qt3Support was found. # QT_QTASSISTANT_FOUND True if QtAssistant was found. +# QT_QAXCONTAINER_FOUND True if QAxContainer was found (Windows only). +# QT_QAXSERVER_FOUND True if QAxServer was found (Windows only). # QT_QTDBUS_FOUND True if QtDBus was found. # QT_QTDESIGNER_FOUND True if QtDesigner was found. # QT_QTDESIGNERCOMPONENTS True if QtDesignerComponents was found. @@ -179,6 +183,8 @@ # QT_INCLUDE_DIR Path to "include" of Qt4 # QT_QT3SUPPORT_INCLUDE_DIR Path to "include/Qt3Support" # QT_QTASSISTANT_INCLUDE_DIR Path to "include/QtAssistant" +# QT_QAXCONTAINER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only) +# QT_QAXSERVER_INCLUDE_DIR Path to "include/ActiveQt" (Windows only) # QT_QTCORE_INCLUDE_DIR Path to "include/QtCore" # QT_QTDESIGNER_INCLUDE_DIR Path to "include/QtDesigner" # QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR Path to "include/QtDesigner" @@ -214,6 +220,8 @@ # # QT_QT3SUPPORT_LIBRARY The Qt3Support library # QT_QTASSISTANT_LIBRARY The QtAssistant library +# QT_QAXCONTAINER_LIBRARY The QAxContainer library (Windows only) +# QT_QAXSERVER_LIBRARY The QAxServer library (Windows only) # QT_QTCORE_LIBRARY The QtCore library # QT_QTDBUS_LIBRARY The QtDBus library # QT_QTDESIGNER_LIBRARY The QtDesigner library @@ -320,9 +328,9 @@ FIND_PROGRAM(QT_QMAKE_EXECUTABLE NAMES qmake qmake4 qmake-qt4 PATHS IF (QT_QMAKE_EXECUTABLE) - IF(QT_QMAKE_EXECUTABLE_LAST AND NOT QT_QMAKE_EXECUTABLE_LAST MATCHES "^${QT_QMAKE_EXECUTABLE}$") - SET(QT_QMAKE_CHANGED 1) - ENDIF(QT_QMAKE_EXECUTABLE_LAST AND NOT QT_QMAKE_EXECUTABLE_LAST MATCHES "^${QT_QMAKE_EXECUTABLE}$") + IF(QT_QMAKE_EXECUTABLE_LAST) + STRING(COMPARE NOTEQUAL "${QT_QMAKE_EXECUTABLE_LAST}" "${QT_QMAKE_EXECUTABLE}" QT_QMAKE_CHANGED) + ENDIF(QT_QMAKE_EXECUTABLE_LAST) SET(QT_QMAKE_EXECUTABLE_LAST "${QT_QMAKE_EXECUTABLE}" CACHE INTERNAL "" FORCE) @@ -512,6 +520,12 @@ IF (QT4_QMAKE_FOUND) SET(QT_QTASSISTANT_LIBRARY_DEBUG NOTFOUND) SET(QT_QTCLUCENE_LIBRARY_RELEASE NOTFOUND) SET(QT_QTCLUCENE_LIBRARY_DEBUG NOTFOUND) + SET(QT_QAXCONTAINER_INCLUDE_DIR NOTFOUND) + SET(QT_QAXCONTAINER_LIBRARY_RELEASE NOTFOUND) + SET(QT_QAXCONTAINER_LIBRARY_DEBUG NOTFOUND) + SET(QT_QAXSERVER_INCLUDE_DIR NOTFOUND) + SET(QT_QAXSERVER_LIBRARY_RELEASE NOTFOUND) + SET(QT_QAXSERVER_LIBRARY_DEBUG NOTFOUND) ENDIF(QT_QMAKE_CHANGED) FOREACH(QT_MODULE ${QT_MODULES}) @@ -524,6 +538,21 @@ IF (QT4_QMAKE_FOUND) ) ENDFOREACH(QT_MODULE) + IF(WIN32) + SET(QT_MODULES ${QT_MODULES} QAxContainer QAxServer) + # Set QT_AXCONTAINER_INCLUDE_DIR and QT_AXSERVER_INCLUDE_DIR + FIND_PATH(QT_QAXCONTAINER_INCLUDE_DIR ActiveQt + PATHS + ${QT_HEADERS_DIR}/ActiveQt + NO_DEFAULT_PATH + ) + FIND_PATH(QT_QAXSERVER_INCLUDE_DIR ActiveQt + PATHS + ${QT_HEADERS_DIR}/ActiveQt + NO_DEFAULT_PATH + ) + ENDIF(WIN32) + # Set QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR FIND_PATH(QT_QTDESIGNERCOMPONENTS_INCLUDE_DIR QDesignerComponents PATHS @@ -756,6 +785,8 @@ IF (QT4_QMAKE_FOUND) # platform dependent libraries IF(WIN32) _QT4_ADJUST_LIB_VARS(QTMAIN) + _QT4_ADJUST_LIB_VARS(QAXSERVER) + _QT4_ADJUST_LIB_VARS(QAXCONTAINER) ENDIF(WIN32) @@ -1136,7 +1167,11 @@ IF (QT4_QMAKE_FOUND) FOREACH (_current_MOC_INC ${_match}) STRING(REGEX MATCH "[^ <\"]+\\.moc" _current_MOC "${_current_MOC_INC}") GET_FILENAME_COMPONENT(_basename ${_current_MOC} NAME_WE) - SET(_header ${_abs_PATH}/${_basename}.h) + IF(EXISTS ${_abs_PATH}/${_basename}.hpp) + SET(_header ${_abs_PATH}/${_basename}.hpp) + ELSE(EXISTS ${_abs_PATH}/${_basename}.hpp) + SET(_header ${_abs_PATH}/${_basename}.h) + ENDIF(EXISTS ${_abs_PATH}/${_basename}.hpp) SET(_moc ${CMAKE_CURRENT_BINARY_DIR}/${_current_MOC}) QT4_CREATE_MOC_COMMAND(${_header} ${_moc} "${_moc_INCS}" "") MACRO_ADD_FILE_DEPENDENCIES(${_abs_FILE} ${_moc}) diff --git a/Modules/UseQt4.cmake b/Modules/UseQt4.cmake index f82ba77d1..29de8cb53 100755 --- a/Modules/UseQt4.cmake +++ b/Modules/UseQt4.cmake @@ -51,11 +51,14 @@ ELSE(QT_QTDBUS_FOUND) ENDIF(QT_QTDBUS_FOUND) SET(QT_QTDBUS_MODULE_DEPENDS QTXML QTCORE) SET(QT_QTXMLPATTERNS_MODULE_DEPENDS QTNETWORK QTCORE) +SET(QT_QAXCONTAINER_MODULE_DEPENDS QTGUI QTCORE) +SET(QT_QAXSERVER_MODULE_DEPENDS QTGUI QTCORE) # Qt modules (in order of dependence) FOREACH(module QT3SUPPORT QTOPENGL QTASSISTANT QTDESIGNER QTMOTIF QTNSPLUGIN - QTSCRIPT QTSVG QTUITOOLS QTHELP QTWEBKIT PHONON QTGUI QTTEST - QTDBUS QTXML QTSQL QTXMLPATTERNS QTNETWORK QTCORE) + QAXSERVER QAXCONTAINER QTSCRIPT QTSVG QTUITOOLS QTHELP + QTWEBKIT PHONON QTGUI QTTEST QTDBUS QTXML QTSQL QTXMLPATTERNS + QTNETWORK QTCORE) IF (QT_USE_${module} OR QT_USE_${module}_DEPENDS) IF (QT_${module}_FOUND) diff --git a/Source/QtDialog/CMakeLists.txt b/Source/QtDialog/CMakeLists.txt index 4032b474e..82bb7dbad 100644 --- a/Source/QtDialog/CMakeLists.txt +++ b/Source/QtDialog/CMakeLists.txt @@ -12,6 +12,8 @@ ELSE(NOT QT4_FOUND) # 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 diff --git a/Source/QtDialog/CMakeSetup.cxx b/Source/QtDialog/CMakeSetup.cxx index 8389fc338..62a4ce3e8 100644 --- a/Source/QtDialog/CMakeSetup.cxx +++ b/Source/QtDialog/CMakeSetup.cxx @@ -3,8 +3,8 @@ Program: CMake - Cross-Platform Makefile Generator Module: $RCSfile: CMakeSetup.cxx,v $ Language: C++ - Date: $Date: 2008-04-08 16:22:51 $ - Version: $Revision: 1.17.2.2 $ + Date: $Date: 2009-02-21 19:43:45 $ + Version: $Revision: 1.17.2.3 $ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. @@ -67,6 +67,42 @@ static const char * cmDocumentationOptions[][3] = int main(int argc, char** argv) { cmSystemTools::FindExecutableDirectory(argv[0]); + // check docs first so that X is not need to get docs + // do docs, if args were given + cmDocumentation doc; + if(argc >1 && doc.CheckOptions(argc, argv)) + { + // Construct and print requested documentation. + cmake hcm; + hcm.AddCMakePaths(); + // just incase the install is bad avoid a seg fault + const char* root = hcm.GetCacheDefinition("CMAKE_ROOT"); + if(root) + { + doc.SetCMakeRoot(root); + } + std::vector commands; + std::vector compatCommands; + std::map propDocs; + + std::vector generators; + hcm.GetCommandDocumentation(commands, true, false); + hcm.GetCommandDocumentation(compatCommands, false, true); + hcm.GetGeneratorDocumentation(generators); + hcm.GetPropertiesDocumentation(propDocs); + doc.SetName("cmake"); + doc.SetSection("Name",cmDocumentationName); + doc.SetSection("Usage",cmDocumentationUsage); + doc.SetSection("Description",cmDocumentationDescription); + doc.AppendSection("Generators",generators); + doc.PrependSection("Options",cmDocumentationOptions); + doc.SetSection("Commands",commands); + doc.SetSection("Compatilbility Commands", compatCommands); + doc.SetSections(propDocs); + + return (doc.PrintRequestedDocumentation(std::cout)? 0:1); + } + QApplication app(argc, argv); // clean out standard Qt paths for plugins, which we don't use anyway @@ -106,42 +142,6 @@ int main(int argc, char** argv) app.setOrganizationName("Kitware"); app.setWindowIcon(QIcon(":/Icons/CMakeSetup.png")); - // do docs, if args were given - cmDocumentation doc; - if(app.arguments().size() > 1 && - doc.CheckOptions(app.argc(), app.argv())) - { - // Construct and print requested documentation. - cmake hcm; - hcm.AddCMakePaths(); - // just incase the install is bad avoid a seg fault - const char* root = hcm.GetCacheDefinition("CMAKE_ROOT"); - if(root) - { - doc.SetCMakeRoot(root); - } - std::vector commands; - std::vector compatCommands; - std::map propDocs; - - std::vector generators; - hcm.GetCommandDocumentation(commands, true, false); - hcm.GetCommandDocumentation(compatCommands, false, true); - hcm.GetGeneratorDocumentation(generators); - hcm.GetPropertiesDocumentation(propDocs); - doc.SetName("cmake"); - doc.SetSection("Name",cmDocumentationName); - doc.SetSection("Usage",cmDocumentationUsage); - doc.SetSection("Description",cmDocumentationDescription); - doc.AppendSection("Generators",generators); - doc.PrependSection("Options",cmDocumentationOptions); - doc.SetSection("Commands",commands); - doc.SetSection("Compatilbility Commands", compatCommands); - doc.SetSections(propDocs); - - return (doc.PrintRequestedDocumentation(std::cout)? 0:1); - } - CMakeSetupDialog dialog; QString title = QString("CMake %1"); title = title.arg(cmVersion::GetCMakeVersion().c_str()); diff --git a/Source/QtDialog/QtDialogCPack.cmake.in b/Source/QtDialog/QtDialogCPack.cmake.in index 27bcbada9..feeb8b22a 100755 --- a/Source/QtDialog/QtDialogCPack.cmake.in +++ b/Source/QtDialog/QtDialogCPack.cmake.in @@ -2,7 +2,7 @@ SET(IS_APPLE @APPLE@) SET(CMAKE_PACKAGE_QTGUI @CMAKE_PACKAGE_QTGUI@) IF(CMAKE_PACKAGE_QTGUI) - SET(CPACK_PACKAGE_EXECUTABLES ${CPACK_PACKAGE_EXECUTABLES} "cmake-gui" "cmake-gui(beta)") + SET(CPACK_PACKAGE_EXECUTABLES "cmake-gui" "CMake (cmake-gui)" ${CPACK_PACKAGE_EXECUTABLES}) IF(IS_APPLE) # for apple install we set the install prefix to # / and then install diff --git a/Source/cmCacheManager.cxx b/Source/cmCacheManager.cxx index 98103d9b8..9972ff9bb 100644 --- a/Source/cmCacheManager.cxx +++ b/Source/cmCacheManager.cxx @@ -3,8 +3,8 @@ Program: CMake - Cross-Platform Makefile Generator Module: $RCSfile: cmCacheManager.cxx,v $ Language: C++ - Date: $Date: 2008-09-03 13:43:17 $ - Version: $Revision: 1.100.2.1 $ + Date: $Date: 2009-02-10 22:28:08 $ + Version: $Revision: 1.100.2.2 $ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. @@ -784,7 +784,25 @@ void cmCacheManager::AddCacheEntry(const char* key, // make sure we only use unix style paths if(type == FILEPATH || type == PATH) { - cmSystemTools::ConvertToUnixSlashes(e.Value); + if(e.Value.find(';') != e.Value.npos) + { + std::vector paths; + cmSystemTools::ExpandListArgument(e.Value, paths); + const char* sep = ""; + e.Value = ""; + for(std::vector::iterator i = paths.begin(); + i != paths.end(); ++i) + { + cmSystemTools::ConvertToUnixSlashes(*i); + e.Value += sep; + e.Value += *i; + sep = ";"; + } + } + else + { + cmSystemTools::ConvertToUnixSlashes(e.Value); + } } if ( helpString ) { diff --git a/Source/cmGlobalUnixMakefileGenerator3.cxx b/Source/cmGlobalUnixMakefileGenerator3.cxx index 2e8c87301..7826bb63d 100644 --- a/Source/cmGlobalUnixMakefileGenerator3.cxx +++ b/Source/cmGlobalUnixMakefileGenerator3.cxx @@ -3,8 +3,8 @@ Program: CMake - Cross-Platform Makefile Generator3 Module: $RCSfile: cmGlobalUnixMakefileGenerator3.cxx,v $ Language: C++ - Date: $Date: 2008-08-06 21:04:19 $ - Version: $Revision: 1.126.2.4 $ + Date: $Date: 2009-02-06 21:15:16 $ + Version: $Revision: 1.126.2.5 $ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. @@ -352,18 +352,26 @@ void cmGlobalUnixMakefileGenerator3::WriteMainCMakefile() cmakefileStream << " \"" << lg->Convert(tmpStr.c_str(),cmLocalGenerator::HOME_OUTPUT).c_str() << "\"\n"; - const std::vector& outfiles = - lg->GetMakefile()->GetOutputFiles(); - for(std::vector::const_iterator k= outfiles.begin(); - k != outfiles.end(); ++k) - { - cmakefileStream << " \"" << - lg->Convert(k->c_str(),cmLocalGenerator::HOME_OUTPUT).c_str() - << "\"\n"; - } } cmakefileStream << " )\n\n"; + // CMake must rerun if a byproduct is missing. + { + cmakefileStream + << "# Byproducts of CMake generate step:\n" + << "SET(CMAKE_MAKEFILE_PRODUCTS\n"; + const std::vector& outfiles = + lg->GetMakefile()->GetOutputFiles(); + for(std::vector::const_iterator k = outfiles.begin(); + k != outfiles.end(); ++k) + { + cmakefileStream << " \"" << + lg->Convert(k->c_str(),cmLocalGenerator::HOME_OUTPUT).c_str() + << "\"\n"; + } + cmakefileStream << " )\n\n"; + } + this->WriteMainCMakefileLanguageRules(cmakefileStream, this->LocalGenerators); } diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 933cc9303..8e0119e6a 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -3,8 +3,8 @@ Program: CMake - Cross-Platform Makefile Generator Module: $RCSfile: cmGlobalXCodeGenerator.cxx,v $ Language: C++ -Date: $Date: 2009-02-04 16:44:17 $ -Version: $Revision: 1.186.2.10 $ +Date: $Date: 2009-02-19 16:53:45 $ +Version: $Revision: 1.186.2.13 $ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. @@ -2691,11 +2691,11 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( { std::string universal = t->GetDirectory(); universal += "/"; - universal += this->CurrentMakefile->GetProjectName(); + universal += this->CurrentProject; universal += ".build/"; universal += configName; universal += "/"; - universal += t->GetName(); + universal += t->GetFullName(configName); universal += ".build/Objects-normal/"; for( std::vector::iterator arch = this->Architectures.begin(); @@ -2704,7 +2704,7 @@ cmGlobalXCodeGenerator::CreateXCodeDependHackTarget( std::string universalFile = universal; universalFile += *arch; universalFile += "/"; - universalFile += t->GetName(); + universalFile += t->GetFullName(configName); makefileStream << "\t/bin/rm -f " << this->ConvertToRelativeForMake(universalFile.c_str()) diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 5ed4fa263..fd89e12f8 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -3,8 +3,8 @@ Program: CMake - Cross-Platform Makefile Generator Module: $RCSfile: cmMakefileExecutableTargetGenerator.cxx,v $ Language: C++ - Date: $Date: 2008-10-24 15:18:52 $ - Version: $Revision: 1.46.2.3 $ + Date: $Date: 2009-02-06 21:15:16 $ + Version: $Revision: 1.46.2.4 $ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. @@ -476,8 +476,8 @@ cmMakefileExecutableTargetGenerator::CreateAppBundle(std::string& targetName, outpath = this->MacContentDirectory; outpath += "MacOS"; cmSystemTools::MakeDirectory(outpath.c_str()); + this->Makefile->AddCMakeOutputFile(outpath.c_str()); outpath += "/"; - this->Makefile->AddCMakeDependFile(outpath.c_str()); // Configure the Info.plist file. Note that it needs the executable name // to be set. @@ -485,5 +485,5 @@ cmMakefileExecutableTargetGenerator::CreateAppBundle(std::string& targetName, this->LocalGenerator->GenerateAppleInfoPList(this->Target, targetName.c_str(), plist.c_str()); - this->Makefile->AddCMakeDependFile(plist.c_str()); + this->Makefile->AddCMakeOutputFile(plist.c_str()); } diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 98f5660c0..ea6c5ad99 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -3,8 +3,8 @@ Program: CMake - Cross-Platform Makefile Generator Module: $RCSfile: cmSystemTools.cxx,v $ Language: C++ - Date: $Date: 2008-10-24 15:18:54 $ - Version: $Revision: 1.368.2.7 $ + Date: $Date: 2009-02-10 22:28:08 $ + Version: $Revision: 1.368.2.8 $ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. @@ -2192,6 +2192,14 @@ bool cmSystemTools::FileTimeSet(const char* fname, cmSystemToolsFileTime* t) static std::string cmSystemToolsExecutableDirectory; void cmSystemTools::FindExecutableDirectory(const char* argv0) { +#if defined(_WIN32) && !defined(__CYGWIN__) + (void)argv0; // ignore this on windows + char modulepath[_MAX_PATH]; + ::GetModuleFileName(NULL, modulepath, sizeof(modulepath)); + cmSystemToolsExecutableDirectory = + cmSystemTools::GetFilenamePath(modulepath); + return; +#else std::string errorMsg; std::string exe; if(cmSystemTools::FindProgramPath(argv0, exe, errorMsg)) @@ -2205,6 +2213,7 @@ void cmSystemTools::FindExecutableDirectory(const char* argv0) { // ??? } +#endif } //---------------------------------------------------------------------------- diff --git a/Source/cmake.cxx b/Source/cmake.cxx index f4cec5351..3c077c3c7 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -3,8 +3,8 @@ Program: CMake - Cross-Platform Makefile Generator Module: $RCSfile: cmake.cxx,v $ Language: C++ - Date: $Date: 2009-01-13 18:03:53 $ - Version: $Revision: 1.375.2.16 $ + Date: $Date: 2009-02-06 21:15:16 $ + Version: $Revision: 1.375.2.17 $ Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. @@ -2654,6 +2654,28 @@ int cmake::CheckBuildSystem() } } + // If any byproduct of makefile generation is missing we must re-run. + std::vector products; + if(const char* productStr = mf->GetDefinition("CMAKE_MAKEFILE_PRODUCTS")) + { + cmSystemTools::ExpandListArgument(productStr, products); + } + for(std::vector::const_iterator pi = products.begin(); + pi != products.end(); ++pi) + { + if(!(cmSystemTools::FileExists(pi->c_str()) || + cmSystemTools::FileIsSymlink(pi->c_str()))) + { + if(verbose) + { + cmOStringStream msg; + msg << "Re-run cmake, missing byproduct: " << *pi << "\n"; + cmSystemTools::Stdout(msg.str().c_str()); + } + return 1; + } + } + // Get the set of dependencies and outputs. std::vector depends; std::vector outputs; diff --git a/Tests/BuildDepends/Project/CMakeLists.txt b/Tests/BuildDepends/Project/CMakeLists.txt index 23aac4d25..e9d129682 100755 --- a/Tests/BuildDepends/Project/CMakeLists.txt +++ b/Tests/BuildDepends/Project/CMakeLists.txt @@ -1,7 +1,14 @@ cmake_minimum_required(VERSION 2.6) project(testRebuild) -add_library(foo STATIC ${testRebuild_BINARY_DIR}/foo.cxx) +if(APPLE) + # only use multi-arch if the sysroot exists on this machine + if(EXISTS "${CMAKE_OSX_SYSROOT}") + set(CMAKE_OSX_ARCHITECTURES "ppc;i386") + endif(EXISTS "${CMAKE_OSX_SYSROOT}") +endif(APPLE) +add_library(foo STATIC ${testRebuild_BINARY_DIR}/foo.cxx) +set_target_properties(foo PROPERTIES OUTPUT_NAME "foolib") # Add a generated header that regenerates when the generator is # rebuilt. add_custom_command( @@ -21,6 +28,7 @@ add_custom_command( # changes. This should cause regen.h to be recreated also. add_executable(generator generator.cxx) target_link_libraries(generator foo) +set_target_properties(generator PROPERTIES OUTPUT_NAME "gen") # Build an executable to drive the build and rebuild. include_directories(${CMAKE_CURRENT_BINARY_DIR}) diff --git a/Utilities/CMakeLists.txt b/Utilities/CMakeLists.txt index 5d75422b4..fb935f3a9 100644 --- a/Utilities/CMakeLists.txt +++ b/Utilities/CMakeLists.txt @@ -35,6 +35,7 @@ ADD_DOCS(ctest ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt) ADD_DOCS(cpack ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt) ADD_DOCS(ccmake ${CMake_SOURCE_DIR}/Utilities/Doxygen/authors.txt) ADD_DOCS(CMakeSetup ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in) +ADD_DOCS(cmake-gui ${CMake_SOURCE_DIR}/Utilities/Doxygen/doxyfile.in) # add the documentation for cmake itself