summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt35
-rw-r--r--Modules/BundleUtilities.cmake9
-rw-r--r--Modules/CTestTargets.cmake2
-rw-r--r--Modules/FindGTK2.cmake11
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake172
-rw-r--r--Modules/FindwxWidgets.cmake51
-rw-r--r--Modules/GetPrerequisites.cmake25
-rw-r--r--Modules/Platform/Darwin.cmake5
-rw-r--r--Modules/Platform/HP-UX.cmake2
-rw-r--r--Modules/Platform/UnixPaths.cmake4
-rw-r--r--Modules/Platform/Windows-wcl386.cmake19
-rw-r--r--Modules/UsewxWidgets.cmake18
-rw-r--r--Source/CPack/cmCPackGenerator.cxx44
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.cxx42
-rw-r--r--Source/CTest/cmCTestMultiProcessHandler.h1
-rw-r--r--Source/CTest/cmCTestTestHandler.cxx9
-rw-r--r--Source/cmCTest.cxx6
-rw-r--r--Source/cmCTest.h3
-rw-r--r--Source/cmFindPackageCommand.cxx143
-rw-r--r--Source/cmFindPackageCommand.h6
-rw-r--r--Source/cmGlobalGenerator.cxx40
-rw-r--r--Source/cmGlobalGenerator.h3
-rw-r--r--Source/cmGlobalVisualStudio71Generator.cxx16
-rw-r--r--Source/cmGlobalVisualStudio7Generator.cxx99
-rw-r--r--Source/cmGlobalVisualStudio7Generator.h4
-rw-r--r--Source/cmGlobalVisualStudio8Generator.cxx7
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx15
-rw-r--r--Source/cmTarget.cxx11
-rw-r--r--Source/cmake.cxx17
-rw-r--r--Source/ctest.cxx5
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake2
-rw-r--r--Tests/CMakeLists.txt5
-rw-r--r--Tests/ExternalProject/CMakeLists.txt45
33 files changed, 731 insertions, 145 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b318a0c..6e8b928 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -180,6 +180,18 @@ MACRO(CMAKE_SETUP_TESTING)
ENDMACRO(CMAKE_SETUP_TESTING)
+MACRO(CMAKE_SET_TARGET_FOLDER tgt folder)
+ # Really, I just want this to be an "if(TARGET ${tgt})" ...
+ # but I'm not sure that our min req'd., CMake 2.4.5 can handle
+ # that... so I'm just activating this for now, with a version
+ # compare, and only for MSVC builds.
+ IF(MSVC)
+ IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
+ SET_PROPERTY(TARGET "${tgt}" PROPERTY FOLDER "${folder}")
+ ENDIF()
+ ENDIF()
+ENDMACRO(CMAKE_SET_TARGET_FOLDER)
+
#-----------------------------------------------------------------------
# a macro to build the utilities used by CMake
@@ -199,7 +211,17 @@ MACRO (CMAKE_BUILD_UTILITIES)
SET(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
SET(KWSYS_INSTALL_DOC_DIR "${CMake_DOC_DEST}")
ADD_SUBDIRECTORY(Source/kwsys)
-
+ SET(kwsys_folder "Utilities/KWSys")
+ CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}")
+ CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}_c "${kwsys_folder}")
+ CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}EncodeExecutable "${kwsys_folder}")
+ CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}ProcessFwd9x "${kwsys_folder}")
+ CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestDynload "${kwsys_folder}")
+ CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestProcess "${kwsys_folder}")
+ CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestsC "${kwsys_folder}")
+ CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestsCxx "${kwsys_folder}")
+ CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestSharedForward "${kwsys_folder}")
+
#---------------------------------------------------------------------
# Setup third-party libraries.
# Everything in the tree should be able to include files from the
@@ -228,6 +250,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
SET(CMAKE_ZLIB_INCLUDES)
SET(CMAKE_ZLIB_LIBRARIES cmzlib)
ADD_SUBDIRECTORY(Utilities/cmzlib)
+ CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
ENDIF(CMAKE_USE_SYSTEM_ZLIB)
#---------------------------------------------------------------------
@@ -254,6 +277,8 @@ MACRO (CMAKE_BUILD_UTILITIES)
SET(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
ENDIF(CMAKE_TESTS_CDASH_SERVER)
ADD_SUBDIRECTORY(Utilities/cmcurl)
+ CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty")
+ CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty")
ENDIF(CMAKE_USE_SYSTEM_CURL)
#---------------------------------------------------------------------
@@ -262,6 +287,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
"${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress")
SET(CMAKE_COMPRESS_LIBRARIES "cmcompress")
ADD_SUBDIRECTORY(Utilities/cmcompress)
+ CMAKE_SET_TARGET_FOLDER(cmcompress "Utilities/3rdParty")
IF(CMAKE_USE_SYSTEM_BZIP2)
FIND_PACKAGE(BZip2)
ELSE()
@@ -269,6 +295,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
"${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2")
SET(BZIP2_LIBRARIES cmbzip2)
ADD_SUBDIRECTORY(Utilities/cmbzip2)
+ CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty")
ENDIF()
#---------------------------------------------------------------------
@@ -293,6 +320,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
SET(BUILD_ARCHIVE_WITHIN_CMAKE TRUE)
ADD_DEFINITIONS(-DLIBARCHIVE_STATIC)
ADD_SUBDIRECTORY(Utilities/cmlibarchive)
+ CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty")
SET(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
ENDIF(CMAKE_USE_SYSTEM_LIBARCHIVE)
@@ -310,6 +338,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
SET(CMAKE_EXPAT_INCLUDES)
SET(CMAKE_EXPAT_LIBRARIES cmexpat)
ADD_SUBDIRECTORY(Utilities/cmexpat)
+ CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
ENDIF(CMAKE_USE_SYSTEM_EXPAT)
#---------------------------------------------------------------------
@@ -553,6 +582,10 @@ ADD_SUBDIRECTORY(Source)
ADD_SUBDIRECTORY(Utilities)
ADD_SUBDIRECTORY(Tests)
+CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests")
+CMAKE_SET_TARGET_FOLDER(cmw9xcom "Utilities/Win9xCompat")
+CMAKE_SET_TARGET_FOLDER(documentation "Documentation")
+
# add a test
ADD_TEST(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
--system-information -G "${CMAKE_TEST_GENERATOR}" )
diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake
index b48c61e..c7ead5b 100644
--- a/Modules/BundleUtilities.cmake
+++ b/Modules/BundleUtilities.cmake
@@ -118,6 +118,9 @@
# Accumulate changes in a local variable and make *one* call to
# install_name_tool at the end of the function with all the changes at once.
#
+# If the BU_CHMOD_BUNDLE_ITEMS variable is set then bundle items will be
+# marked writable before install_name_tool tries to change them.
+#
# VERIFY_BUNDLE_PREREQUISITES(<bundle> <result_var> <info_var>)
# Verifies that the sum of all prerequisites of all files inside the bundle
# are contained within the bundle or are "system" libraries, presumed to exist
@@ -412,7 +415,7 @@ function(get_bundle_keys app libs dirs keys_var)
# but that do not show up in otool -L output...)
#
foreach(lib ${libs})
- set_bundle_key_values(${keys_var} "${lib}" "${lib}" "${exepath}" "${dirs}" 1)
+ set_bundle_key_values(${keys_var} "${lib}" "${lib}" "${exepath}" "${dirs}" 0)
set(prereqs "")
get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}")
@@ -541,6 +544,10 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
endif(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "")
endforeach(pr)
+ if(BU_CHMOD_BUNDLE_ITEMS)
+ execute_process(COMMAND chmod u+w "${resolved_embedded_item}")
+ endif()
+
# Change this item's id and all of its references in one call
# to install_name_tool:
#
diff --git a/Modules/CTestTargets.cmake b/Modules/CTestTargets.cmake
index 835328c..e3ef86c 100644
--- a/Modules/CTestTargets.cmake
+++ b/Modules/CTestTargets.cmake
@@ -65,6 +65,7 @@ IF(NOT _CTEST_TARGETS_ADDED)
${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}
)
SET_PROPERTY(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "")
+ SET_PROPERTY(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets")
ENDFOREACH(mode)
# For Makefile generators add more granular targets.
@@ -79,6 +80,7 @@ IF(NOT _CTEST_TARGETS_ADDED)
${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}${testtype}
)
SET_PROPERTY(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "")
+ SET_PROPERTY(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets")
ENDFOREACH(testtype)
ENDFOREACH(mode)
ENDIF("${CMAKE_GENERATOR}" MATCHES Make)
diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake
index 4f341e7..e437e1c 100644
--- a/Modules/FindGTK2.cmake
+++ b/Modules/FindGTK2.cmake
@@ -66,6 +66,10 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+# Version 1.2 (8/30/2010) (CMake 2.8.3)
+# * Merge patch for detecting gdk-pixbuf library (split off
+# from core GTK in 2.21). Thanks to Vincent Untz for the patch
+# and Ricardo Cruz for the heads up.
# Version 1.1 (8/19/2010) (CMake 2.8.3)
# * Add support for detecting GTK2 under macports (thanks to Gary Kramlich)
# Version 1.0 (8/12/2010) (CMake 2.8.3)
@@ -152,6 +156,7 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr)
atkmm-1.6
cairo
cairomm-1.0
+ gdk-pixbuf-2.0
gdkmm-2.4
giomm-2.4
gtk-2.0
@@ -419,6 +424,9 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
_GTK2_FIND_INCLUDE_DIR(GTK2_GOBJECT_INCLUDE_DIR gobject/gobject.h)
_GTK2_FIND_LIBRARY (GTK2_GOBJECT_LIBRARY gobject false true)
+ _GTK2_FIND_INCLUDE_DIR(GTK2_GDK_PIXBUF_INCLUDE_DIR gdk-pixbuf/gdk-pixbuf.h)
+ _GTK2_FIND_LIBRARY (GTK2_GDK_PIXBUF_LIBRARY gdk_pixbuf false true)
+
_GTK2_FIND_INCLUDE_DIR(GTK2_GDK_INCLUDE_DIR gdk/gdk.h)
_GTK2_FIND_INCLUDE_DIR(GTK2_GDKCONFIG_INCLUDE_DIR gdkconfig.h)
_GTK2_FIND_INCLUDE_DIR(GTK2_GTK_INCLUDE_DIR gtk/gtk.h)
@@ -442,9 +450,6 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS})
_GTK2_FIND_INCLUDE_DIR(GTK2_ATK_INCLUDE_DIR atk/atk.h)
_GTK2_FIND_LIBRARY (GTK2_ATK_LIBRARY atk false true)
- #elseif(_GTK2_component STREQUAL "gdk_pixbuf")
- #_GTK2_FIND_INCLUDE_DIR(GTK2_GDKPIXBUF_INCLUDE_DIR gdk-pixbuf/gdk-pixbuf.h)
- #_GTK2_FIND_LIBRARY (GTK2_GDKPIXBUF_LIBRARY gdk_pixbuf false true)
elseif(_GTK2_component STREQUAL "gtkmm")
diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake
index c698480..cd33aa3 100644
--- a/Modules/FindPackageHandleStandardArgs.cmake
+++ b/Modules/FindPackageHandleStandardArgs.cmake
@@ -20,18 +20,24 @@
# The second mode is more powerful and also supports version checking:
# FIND_PACKAGE_HANDLE_STANDARD_ARGS(NAME [REQUIRED_VARS <var1>...<varN>]
# [VERSION_VAR <versionvar>
+# [CONFIG_MODE]
# [FAIL_MESSAGE "Custom failure message"] )
#
# As above, if <var1> through <varN> are all valid, <UPPERCASED_NAME>_FOUND
# will be set to TRUE.
-# Via FAIL_MESSAGE a custom failure message can be specified, if this is not
-# used, the default message will be displayed.
+# After REQUIRED_VARS the variables which are required for this package are listed.
# Following VERSION_VAR the name of the variable can be specified which holds
# the version of the package which has been found. If this is done, this version
# will be checked against the (potentially) specified required version used
# in the find_package() call. The EXACT keyword is also handled. The default
# messages include information about the required version and the version
# which has been actually found, both if the version is ok or not.
+# Use the option CONFIG_MODE if your FindXXX.cmake module is a wrapper for
+# a find_package(... NO_MODULE) call, in this case all the information
+# provided by the config-mode of find_package() will be evaluated
+# automatically.
+# Via FAIL_MESSAGE a custom failure message can be specified, if this is not
+# used, the default message will be displayed.
#
# Example for mode 1:
#
@@ -53,6 +59,15 @@
# Also the version of BISON will be checked by using the version contained
# in BISON_VERSION.
# Since no FAIL_MESSAGE is given, the default messages will be printed.
+#
+# Another example for mode 2:
+#
+# FIND_PACKAGE(Automoc4 QUIET NO_MODULE HINTS /opt/automoc4)
+# FIND_PACKAGE_HANDLE_STANDARD_ARGS(Automoc4 CONFIG_MODE)
+# In this case, FindAutmoc4.cmake wraps a call to FIND_PACKAGE(Automoc4 NO_MODULE)
+# and adds an additional search directory for automoc4.
+# The following FIND_PACKAGE_HANDLE_STANDARD_ARGS() call produces a proper
+# success/error message.
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.
@@ -70,12 +85,50 @@
INCLUDE(FindPackageMessage)
INCLUDE(CMakeParseArguments)
-
-FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG _VAR1)
+# internal helper macro
+MACRO(_FPHSA_FAILURE_MESSAGE _msg)
+ IF (${_NAME}_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "${_msg}")
+ ELSE (${_NAME}_FIND_REQUIRED)
+ IF (NOT ${_NAME}_FIND_QUIETLY)
+ MESSAGE(STATUS "${_msg}")
+ ENDIF (NOT ${_NAME}_FIND_QUIETLY)
+ ENDIF (${_NAME}_FIND_REQUIRED)
+ENDMACRO(_FPHSA_FAILURE_MESSAGE _msg)
+
+
+# internal helper macro to generate the failure message when used in CONFIG_MODE:
+MACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
+ # <name>_CONFIG is set, but FOUND is false, this means that some other of the REQUIRED_VARS was not found:
+ IF(${_NAME}_CONFIG)
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: missing: ${MISSING_VARS} (found ${${_NAME}_CONFIG} ${VERSION_MSG})")
+ ELSE(${_NAME}_CONFIG)
+ # If _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version.
+ # List them all in the error message:
+ IF(${_NAME}_CONSIDERED_CONFIGS)
+ SET(configsText "")
+ LIST(LENGTH ${_NAME}_CONSIDERED_CONFIGS configsCount)
+ MATH(EXPR configsCount "${configsCount} - 1")
+ FOREACH(currentConfigIndex RANGE ${configsCount})
+ LIST(GET ${_NAME}_CONSIDERED_CONFIGS ${currentConfigIndex} filename)
+ LIST(GET ${_NAME}_CONSIDERED_VERSIONS ${currentConfigIndex} version)
+ SET(configsText "${configsText} ${filename} (version ${version})\n")
+ ENDFOREACH(currentConfigIndex)
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} ${VERSION_MSG}, checked the following files:\n${configsText}")
+
+ ELSE(${_NAME}_CONSIDERED_CONFIGS)
+ # Simple case: No Config-file was found at all:
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake ${VERSION_MSG}")
+ ENDIF(${_NAME}_CONSIDERED_CONFIGS)
+ ENDIF(${_NAME}_CONFIG)
+ENDMACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE)
+
+
+FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG)
# set up the arguments for CMAKE_PARSE_ARGUMENTS and check whether we are in
# new extended or in the "old" mode:
- SET(options) # none
+ SET(options CONFIG_MODE)
SET(oneValueArgs FAIL_MESSAGE VERSION_VAR)
SET(multiValueArgs REQUIRED_VARS)
SET(_KEYWORDS_FOR_EXTENDED_MODE ${options} ${oneValueArgs} ${multiValueArgs} )
@@ -83,11 +136,11 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG _VAR1)
IF(${INDEX} EQUAL -1)
SET(FPHSA_FAIL_MESSAGE ${_FIRST_ARG})
- SET(FPHSA_REQUIRED_VARS ${_VAR1} ${ARGN})
+ SET(FPHSA_REQUIRED_VARS ${ARGN})
SET(FPHSA_VERSION_VAR)
ELSE(${INDEX} EQUAL -1)
- CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${_VAR1} ${ARGN})
+ CMAKE_PARSE_ARGUMENTS(FPHSA "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN})
IF(FPHSA_UNPARSED_ARGUMENTS)
MESSAGE(FATAL_ERROR "Unknown keywords given to FIND_PACKAGE_HANDLE_STANDARD_ARGS(): \"${FPHSA_UNPARSED_ARGUMENTS}\"")
@@ -104,6 +157,14 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG _VAR1)
SET(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}")
ENDIF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG")
+ # In config-mode, we rely on the variable <package>_CONFIG, which is set by find_package()
+ # when it successfully found the config-file, including version checking:
+ IF(FPHSA_CONFIG_MODE)
+ LIST(INSERT FPHSA_REQUIRED_VARS 0 ${_NAME}_CONFIG)
+ LIST(REMOVE_DUPLICATES FPHSA_REQUIRED_VARS)
+ SET(FPHSA_VERSION_VAR ${_NAME}_VERSION)
+ ENDIF(FPHSA_CONFIG_MODE)
+
IF(NOT FPHSA_REQUIRED_VARS)
MESSAGE(FATAL_ERROR "No REQUIRED_VARS specified for FIND_PACKAGE_HANDLE_STANDARD_ARGS()")
ENDIF(NOT FPHSA_REQUIRED_VARS)
@@ -111,8 +172,9 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG _VAR1)
LIST(GET FPHSA_REQUIRED_VARS 0 _FIRST_REQUIRED_VAR)
STRING(TOUPPER ${_NAME} _NAME_UPPER)
+ STRING(TOLOWER ${_NAME} _NAME_LOWER)
- # collect all variables which were not found, so they can be printed, so the
+ # collect all variables which were not found, so they can be printed, so the
# user knows better what went wrong (#6375)
SET(MISSING_VARS "")
SET(DETAILS "")
@@ -131,44 +193,42 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG _VAR1)
# version handling:
SET(VERSION_MSG "")
SET(VERSION_OK TRUE)
+ SET(VERSION ${${FPHSA_VERSION_VAR}} )
IF (${_NAME}_FIND_VERSION)
- # if the package was found, check for the version using <NAME>_FIND_VERSION
- IF (${_NAME_UPPER}_FOUND)
- SET(VERSION ${${FPHSA_VERSION_VAR}} )
-
- IF(VERSION)
-
- IF(${_NAME}_FIND_VERSION_EXACT) # exact version required
- IF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
- SET(VERSION_MSG " Found version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
- SET(VERSION_OK FALSE)
- ELSE (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
- SET(VERSION_MSG " (found exact version \"${VERSION}\")")
- ENDIF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
-
- ELSE(${_NAME}_FIND_VERSION_EXACT) # minimum version specified:
- IF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
- SET(VERSION_MSG " Found version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
- SET(VERSION_OK FALSE)
- ELSE ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
- SET(VERSION_MSG " (found version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
- ENDIF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
- ENDIF(${_NAME}_FIND_VERSION_EXACT)
-
-# Uncomment the following two lines to see to which Find-modules the VERSION_VAR keywords still need to be added:
-# ELSE(VERSION)
-# SET(VERSION_MSG " (WARNING: Required version is \"${${_NAME}_FIND_VERSION}\", but version of ${_NAME} is unknown)")
- ENDIF(VERSION)
-
- # if the package was not found, but a version was given, add that to the output:
- ELSE (${_NAME_UPPER}_FOUND)
+ IF(VERSION)
+
+ IF(${_NAME}_FIND_VERSION_EXACT) # exact version required
+ IF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+ SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is exact version \"${${_NAME}_FIND_VERSION}\"")
+ SET(VERSION_OK FALSE)
+ ELSE (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+ SET(VERSION_MSG "(found suitable exact version \"${VERSION}\")")
+ ENDIF (NOT "${${_NAME}_FIND_VERSION}" VERSION_EQUAL "${VERSION}")
+
+ ELSE(${_NAME}_FIND_VERSION_EXACT) # minimum version specified:
+ IF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ SET(VERSION_MSG "Found unsuitable version \"${VERSION}\", but required is at least \"${${_NAME}_FIND_VERSION}\"")
+ SET(VERSION_OK FALSE)
+ ELSE ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ SET(VERSION_MSG "(found suitable version \"${VERSION}\", required is \"${${_NAME}_FIND_VERSION}\")")
+ ENDIF ("${${_NAME}_FIND_VERSION}" VERSION_GREATER "${VERSION}")
+ ENDIF(${_NAME}_FIND_VERSION_EXACT)
+
+ ELSE(VERSION)
+
+ # if the package was not found, but a version was given, add that to the output:
IF(${_NAME}_FIND_VERSION_EXACT)
- SET(VERSION_MSG " (Required is exact version \"${${_NAME}_FIND_VERSION}\")")
+ SET(VERSION_MSG "(Required is exact version \"${${_NAME}_FIND_VERSION}\")")
ELSE(${_NAME}_FIND_VERSION_EXACT)
- SET(VERSION_MSG " (Required is at least version \"${${_NAME}_FIND_VERSION}\")")
+ SET(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")")
ENDIF(${_NAME}_FIND_VERSION_EXACT)
- ENDIF (${_NAME_UPPER}_FOUND)
+
+ ENDIF(VERSION)
+ ELSE (${_NAME}_FIND_VERSION)
+ IF(VERSION)
+ SET(VERSION_MSG "(found version \"${VERSION}\")")
+ ENDIF(VERSION)
ENDIF (${_NAME}_FIND_VERSION)
IF(VERSION_OK)
@@ -182,26 +242,16 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG _VAR1)
IF (${_NAME_UPPER}_FOUND)
FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG}" "${DETAILS}")
ELSE (${_NAME_UPPER}_FOUND)
- IF(NOT VERSION_OK)
-
- IF (${_NAME}_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
- ELSE (${_NAME}_FIND_REQUIRED)
- IF (NOT ${_NAME}_FIND_QUIETLY)
- MESSAGE(STATUS "${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
- ENDIF (NOT ${_NAME}_FIND_QUIETLY)
- ENDIF (${_NAME}_FIND_REQUIRED)
-
- ELSE(NOT VERSION_OK)
-
- IF (${_NAME}_FIND_REQUIRED)
- MESSAGE(FATAL_ERROR "${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
- ELSE (${_NAME}_FIND_REQUIRED)
- IF (NOT ${_NAME}_FIND_QUIETLY)
- MESSAGE(STATUS "${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
- ENDIF (NOT ${_NAME}_FIND_QUIETLY)
- ENDIF (${_NAME}_FIND_REQUIRED)
- ENDIF(NOT VERSION_OK)
+
+ IF(FPHSA_CONFIG_MODE)
+ _FPHSA_HANDLE_FAILURE_CONFIG_MODE()
+ ELSE(FPHSA_CONFIG_MODE)
+ IF(NOT VERSION_OK)
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})")
+ ELSE(NOT VERSION_OK)
+ _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}")
+ ENDIF(NOT VERSION_OK)
+ ENDIF(FPHSA_CONFIG_MODE)
ENDIF (${_NAME_UPPER}_FOUND)
diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake
index 90818bc..d991cd4 100644
--- a/Modules/FindwxWidgets.cmake
+++ b/Modules/FindwxWidgets.cmake
@@ -4,7 +4,7 @@
# modules that you will use, you need to name them as components to
# the package:
#
-# FIND_PACKAGE(wxWidgets COMPONENTS base core ...)
+# FIND_PACKAGE(wxWidgets COMPONENTS core base ...)
#
# There are two search branches: a windows style and a unix style. For
# windows, the following variables are searched for and set to
@@ -32,7 +32,14 @@
# wxWidgets_USE_UNICODE
# wxWidgets_USE_UNIVERSAL
# wxWidgets_USE_STATIC
-#
+#
+# There is also a wxWidgets_CONFIG_OPTIONS variable for all other
+# options that need to be passed to the wx-config utility. For
+# example, to use the base toolkit found in the /usr/local path, set
+# the variable (before calling the FIND_PACKAGE command) as such:
+#
+# SET(wxWidgets_CONFIG_OPTIONS --toolkit=base --prefix=/usr)
+#
# The following are set after the configuration is done for both
# windows and unix style:
#
@@ -54,7 +61,8 @@
# wxWidgets_USE_FILE - Convenience include file.
#
# Sample usage:
-# FIND_PACKAGE(wxWidgets COMPONENTS base core gl net)
+# # Note that for MinGW users the order of libs is important!
+# FIND_PACKAGE(wxWidgets COMPONENTS net gl core base)
# IF(wxWidgets_FOUND)
# INCLUDE(${wxWidgets_USE_FILE})
# # and for each of your dependent executable/library targets:
@@ -62,7 +70,7 @@
# ENDIF(wxWidgets_FOUND)
#
# If wxWidgets is required (i.e., not an optional part):
-# FIND_PACKAGE(wxWidgets REQUIRED base core gl net)
+# FIND_PACKAGE(wxWidgets REQUIRED net gl core base)
# INCLUDE(${wxWidgets_USE_FILE})
# # and for each of your dependent executable/library targets:
# TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
@@ -188,7 +196,7 @@ IF(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
SET(wxWidgets_USE_FILE
"${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
ELSE(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
- SET(wxWidgets_USE_FILE UsewxWidgets.cmake)
+ SET(wxWidgets_USE_FILE UsewxWidgets)
ENDIF(EXISTS "${wxWidgets_CURRENT_LIST_DIR}/UsewxWidgets.cmake")
#=====================================================================
@@ -213,7 +221,7 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
IF(wxWidgets_USE_MONOLITHIC)
SET(wxWidgets_FIND_COMPONENTS mono)
ELSE(wxWidgets_USE_MONOLITHIC)
- SET(wxWidgets_FIND_COMPONENTS base core) # this is default
+ SET(wxWidgets_FIND_COMPONENTS core base) # this is default
ENDIF(wxWidgets_USE_MONOLITHIC)
ENDIF(NOT wxWidgets_FIND_COMPONENTS)
@@ -563,23 +571,23 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32")
# Get configuration parameters from the name.
WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG)
- # Set wxWidgets main include directory.
- IF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
- SET(wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include)
- ELSE(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
- DBG_MSG("wxWidgets_FOUND FALSE because WX_ROOT_DIR=${WX_ROOT_DIR} has no ${WX_ROOT_DIR}/include/wx/wx.h")
- SET(wxWidgets_FOUND FALSE)
- ENDIF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
-
# Set wxWidgets lib setup include directory.
IF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
- LIST(APPEND wxWidgets_INCLUDE_DIRS
+ SET(wxWidgets_INCLUDE_DIRS
${WX_LIB_DIR}/${wxWidgets_CONFIGURATION})
ELSE(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
- DBG_MSG("WXWIDGET_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.")
+ DBG_MSG("wxWidgets_FOUND FALSE because ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h does not exists.")
SET(wxWidgets_FOUND FALSE)
ENDIF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h)
+ # Set wxWidgets main include directory.
+ IF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
+ LIST(APPEND wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include)
+ ELSE(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
+ DBG_MSG("wxWidgets_FOUND FALSE because WX_ROOT_DIR=${WX_ROOT_DIR} has no ${WX_ROOT_DIR}/include/wx/wx.h")
+ SET(wxWidgets_FOUND FALSE)
+ ENDIF(EXISTS ${WX_ROOT_DIR}/include/wx/wx.h)
+
# Find wxWidgets libraries.
WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}")
IF(WX_USE_REL_AND_DBG)
@@ -614,7 +622,8 @@ ELSE(wxWidgets_FIND_STYLE STREQUAL "win32")
#
MACRO(WX_CONFIG_SELECT_GET_DEFAULT)
EXECUTE_PROCESS(
- COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --selected-config
+ COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
+ ${wxWidgets_CONFIG_OPTIONS} --selected-config
OUTPUT_VARIABLE _wx_selected_config
RESULT_VARIABLE _wx_result
ERROR_QUIET
@@ -642,13 +651,15 @@ ELSE(wxWidgets_FIND_STYLE STREQUAL "win32")
#
MACRO(WX_CONFIG_SELECT_QUERY_BOOL _OPT_NAME _OPT_HELP)
EXECUTE_PROCESS(
- COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --${_OPT_NAME}=yes
+ COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
+ ${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=yes
RESULT_VARIABLE _wx_result_yes
OUTPUT_QUIET
ERROR_QUIET
)
EXECUTE_PROCESS(
- COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}" --${_OPT_NAME}=no
+ COMMAND sh "${wxWidgets_CONFIG_EXECUTABLE}"
+ ${wxWidgets_CONFIG_OPTIONS} --${_OPT_NAME}=no
RESULT_VARIABLE _wx_result_no
OUTPUT_QUIET
ERROR_QUIET
@@ -674,7 +685,7 @@ ELSE(wxWidgets_FIND_STYLE STREQUAL "win32")
# among multiple builds.
#
MACRO(WX_CONFIG_SELECT_SET_OPTIONS)
- SET(wxWidgets_SELECT_OPTIONS "")
+ SET(wxWidgets_SELECT_OPTIONS ${wxWidgets_CONFIG_OPTIONS})
FOREACH(_opt_name debug static unicode universal)
STRING(TOUPPER ${_opt_name} _upper_opt_name)
IF(DEFINED wxWidgets_USE_${_upper_opt_name})
diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake
index 847db34..c83da4f 100644
--- a/Modules/GetPrerequisites.cmake
+++ b/Modules/GetPrerequisites.cmake
@@ -634,6 +634,23 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
string(REGEX REPLACE ";" "\\\\;" candidates "${gp_cmd_ov}")
string(REGEX REPLACE "\n" "${eol_char};" candidates "${candidates}")
+ # check for install id and remove it from list, since otool -L can include a
+ # reference to itself
+ set(gp_install_id)
+ if("${gp_tool}" STREQUAL "otool")
+ execute_process(
+ COMMAND otool -D ${target}
+ OUTPUT_VARIABLE gp_install_id_ov
+ )
+ # second line is install name
+ string(REGEX REPLACE ".*:\n" "" gp_install_id "${gp_install_id_ov}")
+ if(gp_install_id)
+ # trim
+ string(REGEX MATCH "[^\n ].*[^\n ]" gp_install_id "${gp_install_id}")
+ #message("INSTALL ID is \"${gp_install_id}\"")
+ endif(gp_install_id)
+ endif("${gp_tool}" STREQUAL "otool")
+
# Analyze each line for file names that match the regular expression:
#
foreach(candidate ${candidates})
@@ -670,14 +687,18 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
#
set(add_item 1)
- if(${exclude_system})
+ if("${item}" STREQUAL "${gp_install_id}")
+ set(add_item 0)
+ endif("${item}" STREQUAL "${gp_install_id}")
+
+ if(add_item AND ${exclude_system})
set(type "")
gp_resolved_file_type("${target}" "${item}" "${exepath}" "${dirs}" type)
if("${type}" STREQUAL "system")
set(add_item 0)
endif("${type}" STREQUAL "system")
- endif(${exclude_system})
+ endif(add_item AND ${exclude_system})
if(add_item)
list(LENGTH ${prerequisites_var} list_length_before_append)
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index c8bcad1..db0642e 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -235,4 +235,7 @@ SET(CMAKE_SYSTEM_APPBUNDLE_PATH
/Developer/Applications)
INCLUDE(Platform/UnixPaths)
-LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH /sw)
+LIST(APPEND CMAKE_SYSTEM_PREFIX_PATH
+ /sw # Fink
+ /opt/local # MacPorts
+ )
diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake
index f8893d8..9d357c9 100644
--- a/Modules/Platform/HP-UX.cmake
+++ b/Modules/Platform/HP-UX.cmake
@@ -1,3 +1,5 @@
+SET(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib)
+
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".sl") # .so
SET(CMAKE_DL_LIBS "dld")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".sl" ".so" ".a")
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index ae3c187..5ee7ddb 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -51,7 +51,7 @@ LIST(APPEND CMAKE_SYSTEM_INCLUDE_PATH
/usr/X11R6/include /usr/include/X11
# Other
- /opt/local/include /usr/pkg/include
+ /usr/pkg/include
/opt/csw/include /opt/include
/usr/openwin/include
)
@@ -64,7 +64,7 @@ LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH
/usr/X11R6/lib /usr/lib/X11
# Other
- /opt/local/lib /usr/pkg/lib
+ /usr/pkg/lib
/opt/csw/lib /opt/lib
/usr/openwin/lib
)
diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake
index 7fc345f..e96ebb5 100644
--- a/Modules/Platform/Windows-wcl386.cmake
+++ b/Modules/Platform/Windows-wcl386.cmake
@@ -12,17 +12,29 @@ ELSE(CMAKE_VERBOSE_MAKEFILE)
SET(CMAKE_LIB_QUIET "-q")
ENDIF(CMAKE_VERBOSE_MAKEFILE)
+set(CMAKE_CREATE_WIN32_EXE "system nt_win" )
+SET(CMAKE_CREATE_CONSOLE_EXE "system nt" )
+
+SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "debug all" )
+SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "debug all" )
+SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
+SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "debug all" )
+
+set (CMAKE_SHARED_LIBRARY_C_FLAGS "-bd" )
+
+SET(CMAKE_RC_COMPILER "rc" )
+
SET(CMAKE_BUILD_TYPE_INIT Debug)
SET (CMAKE_CXX_FLAGS_INIT "-w=3 -xs")
-SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-br -bm -d2")
+SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-br -bm -d2")
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-br -bm -d2 -ot -dNDEBUG")
SET (CMAKE_C_FLAGS_INIT "-w=3 ")
-SET (CMAKE_C_FLAGS_DEBUG_INIT "-br -bm -od")
+SET (CMAKE_C_FLAGS_DEBUG_INIT "-br -bm -d2 -od")
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG")
SET (CMAKE_C_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG")
-SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-br -bm -ot -dNDEBUG")
+SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-br -bm -d2 -ot -dNDEBUG")
SET (CMAKE_C_STANDARD_LIBRARIES_INIT "library clbrdll.lib library plbrdll.lib library kernel32.lib library user32.lib library gdi32.lib library winspool.lib library comdlg32.lib library advapi32.lib library shell32.lib library ole32.lib library oleaut32.lib library uuid.lib library odbc32.lib library odbccp32.lib")
SET (CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
@@ -33,6 +45,7 @@ SET(CMAKE_CXX_CREATE_IMPORT_LIBRARY ${CMAKE_C_CREATE_IMPORT_LIBRARY})
SET(CMAKE_C_LINK_EXECUTABLE
"wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name '<TARGET_UNQUOTED>' <LINK_FLAGS> option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}")
+
SET(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE})
# compile a C++ file into an object file
diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake
index 037b715..9ecfff0 100644
--- a/Modules/UsewxWidgets.cmake
+++ b/Modules/UsewxWidgets.cmake
@@ -1,15 +1,13 @@
-# - Convenience include for using wxWidgets library
-# Finds if wxWidgets is installed
-# and set the appropriate libs, incdirs, flags etc.
-# INCLUDE_DIRECTORIES, LINK_DIRECTORIES and ADD_DEFINITIONS
-# are called.
+# - Convenience include for using wxWidgets library.
+# Determines if wxWidgets was FOUND and sets the appropriate libs, incdirs,
+# flags, etc. INCLUDE_DIRECTORIES and LINK_DIRECTORIES are called.
#
# USAGE
-# SET( wxWidgets_USE_LIBS gl xml xrc ) # optionally: more than wx std libs
-# FIND_PACKAGE(wxWidgets REQUIRED)
-# INCLUDE( ${xWidgets_USE_FILE} )
-# ... add your targets here, e.g. ADD_EXECUTABLE/ ADD_LIBRARY ...
-# TARGET_LINK_LIBRARIERS( <yourWxDependantTarget> ${wxWidgets_LIBRARIES})
+# # Note that for MinGW users the order of libs is important!
+# FIND_PACKAGE(wxWidgets REQUIRED net gl core base)
+# INCLUDE(${wxWidgets_USE_FILE})
+# # and for each of your dependant executable/library targets:
+# TARGET_LINK_LIBRARIES(<YourTarget> ${wxWidgets_LIBRARIES})
#
# DEPRECATED
# LINK_LIBRARIES is not called in favor of adding dependencies per target.
diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx
index 0abb0ff..7c3ff1d 100644
--- a/Source/CPack/cmCPackGenerator.cxx
+++ b/Source/CPack/cmCPackGenerator.cxx
@@ -330,6 +330,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
it != installDirectoriesVector.end();
++it )
{
+ std::list<std::pair<std::string,std::string> > symlinkedFiles;
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Find files" << std::endl);
cmsys::Glob gl;
std::string top = it->c_str();
@@ -373,7 +374,18 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
+ cmSystemTools::RelativePath(top.c_str(), gfit->c_str());
cmCPackLogger(cmCPackLog::LOG_DEBUG, "Copy file: "
<< inFile.c_str() << " -> " << filePath.c_str() << std::endl);
- if ( !cmSystemTools::CopyFileIfDifferent(inFile.c_str(),
+ /* If the file is a symlink we will have to re-create it */
+ if ( cmSystemTools::FileIsSymlink(inFile.c_str()))
+ {
+ std::string targetFile;
+ std::string inFileRelative =
+ cmSystemTools::RelativePath(top.c_str(),inFile.c_str());
+ cmSystemTools::ReadSymlink(inFile.c_str(),targetFile);
+ symlinkedFiles.push_back(std::pair<std::string,
+ std::string>(targetFile,inFileRelative));
+ }
+ /* If it is not a symlink then do a plain copy */
+ else if ( !cmSystemTools::CopyFileIfDifferent(inFile.c_str(),
filePath.c_str()) )
{
cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem copying file: "
@@ -381,6 +393,36 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories(
return 0;
}
}
+ /* rebuild symlinks in the installed tree */
+ if (symlinkedFiles.size()>0)
+ {
+ std::list< std::pair<std::string,std::string> >::iterator symlinkedIt;
+ std::string curDir = cmSystemTools::GetCurrentWorkingDirectory();
+ std::string goToDir = tempDir;
+ goToDir += "/"+subdir;
+ cmCPackLogger(cmCPackLog::LOG_DEBUG,
+ "Change dir to: " << goToDir <<std::endl);
+ cmSystemTools::ChangeDirectory(goToDir.c_str());
+ for (symlinkedIt=symlinkedFiles.begin();
+ symlinkedIt != symlinkedFiles.end();
+ ++symlinkedIt)
+ {
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Will create a symlink: "
+ << symlinkedIt->second << "--> "
+ << symlinkedIt->first << std::endl);
+ if (!cmSystemTools::CreateSymlink((symlinkedIt->first).c_str(),
+ (symlinkedIt->second).c_str()))
+ {
+ cmCPackLogger(cmCPackLog::LOG_ERROR, "Cannot create symlink: "
+ << symlinkedIt->second << "--> "
+ << symlinkedIt->first << std::endl);
+ return 0;
+ }
+ }
+ cmCPackLogger(cmCPackLog::LOG_DEBUG, "Going back to: "
+ << curDir <<std::endl);
+ cmSystemTools::ChangeDirectory(curDir.c_str());
+ }
}
}
return 1;
diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx
index d50eaaa..0d14c2d 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.cxx
+++ b/Source/CTest/cmCTestMultiProcessHandler.cxx
@@ -516,11 +516,13 @@ void cmCTestMultiProcessHandler::PrintTestList()
{
this->TestHandler->SetMaxIndex(this->FindMaxIndex());
int count = 0;
+
for (PropertiesMap::iterator it = this->Properties.begin();
it != this->Properties.end(); ++it)
{
count++;
cmCTestTestHandler::cmCTestTestProperties& p = *it->second;
+
//push working dir
std::string current_dir = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(p.Directory.c_str());
@@ -530,6 +532,20 @@ void cmCTestMultiProcessHandler::PrintTestList()
testRun.SetTestProperties(&p);
testRun.ComputeArguments(); //logs the command in verbose mode
+ if(p.Labels.size()) //print the labels
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, "Labels:");
+ }
+ for(std::vector<std::string>::iterator label = p.Labels.begin();
+ label != p.Labels.end(); ++label)
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, " " << *label);
+ }
+ if(p.Labels.size()) //print the labels
+ {
+ cmCTestLog(this->CTest, HANDLER_VERBOSE_OUTPUT, std::endl);
+ }
+
if (this->TestHandler->MemCheck)
{
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Memory Check");
@@ -548,10 +564,36 @@ void cmCTestMultiProcessHandler::PrintTestList()
//pop working dir
cmSystemTools::ChangeDirectory(current_dir.c_str());
}
+
cmCTestLog(this->CTest, HANDLER_OUTPUT, std::endl << "Total Tests: "
<< this->Total << std::endl);
}
+void cmCTestMultiProcessHandler::PrintLabels()
+{
+ std::set<std::string> allLabels;
+ for (PropertiesMap::iterator it = this->Properties.begin();
+ it != this->Properties.end(); ++it)
+ {
+ cmCTestTestHandler::cmCTestTestProperties& p = *it->second;
+ allLabels.insert(p.Labels.begin(), p.Labels.end());
+ }
+
+ if(allLabels.size())
+ {
+ cmCTestLog(this->CTest, HANDLER_OUTPUT, "All Labels:" << std::endl);
+ }
+ else
+ {
+ cmCTestLog(this->CTest, HANDLER_OUTPUT, "No Labels Exist" << std::endl);
+ }
+ for(std::set<std::string>::iterator label = allLabels.begin();
+ label != allLabels.end(); ++label)
+ {
+ cmCTestLog(this->CTest, HANDLER_OUTPUT, " " << *label << std::endl);
+ }
+}
+
//---------------------------------------------------------
void cmCTestMultiProcessHandler::CheckResume()
{
diff --git a/Source/CTest/cmCTestMultiProcessHandler.h b/Source/CTest/cmCTestMultiProcessHandler.h
index cc330f7..1483440 100644
--- a/Source/CTest/cmCTestMultiProcessHandler.h
+++ b/Source/CTest/cmCTestMultiProcessHandler.h
@@ -39,6 +39,7 @@ public:
void SetParallelLevel(size_t);
virtual void RunTests();
void PrintTestList();
+ void PrintLabels();
void SetPassFailVectors(std::vector<cmStdString>* passed,
std::vector<cmStdString>* failed)
diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx
index a4a4863..6dd348d 100644
--- a/Source/CTest/cmCTestTestHandler.cxx
+++ b/Source/CTest/cmCTestTestHandler.cxx
@@ -567,7 +567,7 @@ int cmCTestTestHandler::ProcessHandler()
if (total == 0)
{
- if ( !this->CTest->GetShowOnly() )
+ if ( !this->CTest->GetShowOnly() && !this->CTest->ShouldPrintLabels() )
{
cmCTestLog(this->CTest, ERROR_MESSAGE, "No tests were found!!!"
<< std::endl);
@@ -1079,7 +1079,12 @@ void cmCTestTestHandler::ProcessDirectory(std::vector<cmStdString> &passed,
parallel->SetPassFailVectors(&passed, &failed);
this->TestResults.clear();
parallel->SetTestResults(&this->TestResults);
- if(this->CTest->GetShowOnly())
+
+ if(this->CTest->ShouldPrintLabels())
+ {
+ parallel->PrintLabels();
+ }
+ else if(this->CTest->GetShowOnly())
{
parallel->PrintTestList();
}
diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx
index d12fde0..dcdc8e1 100644
--- a/Source/cmCTest.cxx
+++ b/Source/cmCTest.cxx
@@ -304,6 +304,7 @@ cmCTest::cmCTest()
this->ShowOnly = false;
this->RunConfigurationScript = false;
this->UseHTTP10 = false;
+ this->PrintLabels = false;
this->CompressTestOutput = true;
this->ComputedCompressOutput = false;
this->TestModel = cmCTest::EXPERIMENTAL;
@@ -1877,6 +1878,11 @@ void cmCTest::HandleCommandLineArguments(size_t &i,
this->CompressTestOutput = false;
}
+ if(this->CheckArgument(arg, "--print-labels"))
+ {
+ this->PrintLabels = true;
+ }
+
if(this->CheckArgument(arg, "--http1.0"))
{
this->UseHTTP10 = true;
diff --git a/Source/cmCTest.h b/Source/cmCTest.h
index 3d7d117..e54a205 100644
--- a/Source/cmCTest.h
+++ b/Source/cmCTest.h
@@ -210,6 +210,8 @@ public:
bool ShouldUseHTTP10() { return this->UseHTTP10; }
+ bool ShouldPrintLabels() { return this->PrintLabels; }
+
bool ShouldCompressTestOutput();
std::string GetCDashVersion();
@@ -413,6 +415,7 @@ private:
bool ProduceXML;
bool LabelSummary;
bool UseHTTP10;
+ bool PrintLabels;
bool Failover;
bool BatchJobs;
diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx
index 5c05ecb..ef0197a 100644
--- a/Source/cmFindPackageCommand.cxx
+++ b/Source/cmFindPackageCommand.cxx
@@ -156,6 +156,11 @@ cmFindPackageCommand::cmFindPackageCommand()
"The full path to the configuration file is stored in the cmake "
"variable <package>_CONFIG."
"\n"
+ "All configuration files which have been considered by CMake while "
+ "searching for an installation of the package with an appropriate "
+ "version are stored in the cmake variable <package>_CONSIDERED_CONFIGS, "
+ "the associated versions in <package>_CONSIDERED_VERSIONS. "
+ "\n"
"If the package configuration file cannot be found CMake "
"will generate an error describing the problem unless the QUIET "
"argument is specified. If REQUIRED is specified and the package "
@@ -618,7 +623,7 @@ void cmFindPackageCommand::SetModuleVariables(const std::string& components)
// Store the list of components.
std::string components_var = this->Name + "_FIND_COMPONENTS";
this->AddFindDefinition(components_var.c_str(), components.c_str());
-
+
if(this->Quiet)
{
// Tell the module that is about to be read that it should find
@@ -721,6 +726,8 @@ bool cmFindPackageCommand::FindModule(bool& found)
//----------------------------------------------------------------------------
bool cmFindPackageCommand::HandlePackageMode()
{
+ this->ConsideredConfigs.clear();
+
// Support old capitalization behavior.
std::string upperDir = cmSystemTools::UpperCase(this->Name);
std::string upperFound = cmSystemTools::UpperCase(this->Name);
@@ -809,36 +816,58 @@ bool cmFindPackageCommand::HandlePackageMode()
{
// The variable is not set.
cmOStringStream e;
- e << "Could not find ";
- if(!this->NoModule)
- {
- e << "module Find" << this->Name << ".cmake or ";
- }
- e << "a configuration file for package " << this->Name << ".\n";
- if(!this->NoModule)
- {
- e << "Adjust CMAKE_MODULE_PATH to find Find"
- << this->Name << ".cmake or set ";
- }
- else
- {
- e << "Set ";
- }
- e << this->Variable << " to the directory containing a CMake "
- << "configuration file for " << this->Name << ". ";
- if(this->Configs.size() == 1)
- {
- e << "The file will be called " << this->Configs[0];
+ // If there are files in ConsideredConfigs, it means that FooConfig.cmake
+ // have been found, but they didn't have appropriate versions.
+ if (this->ConsideredConfigs.size() > 0)
+ {
+ e << "Could not find a configuration file for package \""
+ << this->Name << "\" that "
+ << (this->VersionExact? "exactly matches" : "is compatible with")
+ << " requested version \"" << this->Version << "\".\n"
+ << "The following configuration files were considered but not "
+ "accepted:\n";
+ for(std::vector<ConfigFileInfo>::size_type i=0;
+ i<this->ConsideredConfigs.size(); i++)
+ {
+ e << " " << this->ConsideredConfigs[i].filename
+ << ", version: " << this->ConsideredConfigs[i].version << "\n";
+ }
}
else
{
- e << "The file will have one of the following names:\n";
- for(std::vector<std::string>::const_iterator ci = this->Configs.begin();
- ci != this->Configs.end(); ++ci)
+ e << "Could not find ";
+ if(!this->NoModule)
+ {
+ e << "module Find" << this->Name << ".cmake or ";
+ }
+ e << "a configuration file for package " << this->Name << ".\n";
+ if(!this->NoModule)
+ {
+ e << "Adjust CMAKE_MODULE_PATH to find Find"
+ << this->Name << ".cmake or set ";
+ }
+ else
+ {
+ e << "Set ";
+ }
+ e << this->Variable << " to the directory containing a CMake "
+ << "configuration file for " << this->Name << ". ";
+ if(this->Configs.size() == 1)
+ {
+ e << "The file will be called " << this->Configs[0];
+ }
+ else
{
- e << " " << *ci << "\n";
+ e << "The file will have one of the following names:\n";
+ for(std::vector<std::string>::const_iterator ci=this->Configs.begin();
+ ci != this->Configs.end(); ++ci)
+ {
+ e << " " << *ci << "\n";
+ }
}
}
+
+
this->Makefile->IssueMessage(
this->Required? cmake::FATAL_ERROR : cmake::WARNING, e.str());
}
@@ -897,6 +926,31 @@ bool cmFindPackageCommand::HandlePackageMode()
}
#endif
+ std::string consideredConfigsVar = this->Name;
+ consideredConfigsVar += "_CONSIDERED_CONFIGS";
+ std::string consideredVersionsVar = this->Name;
+ consideredVersionsVar += "_CONSIDERED_VERSIONS";
+
+ std::string consideredConfigFiles;
+ std::string consideredVersions;
+
+ const char* sep = "";
+ for(std::vector<ConfigFileInfo>::size_type i=0;
+ i<this->ConsideredConfigs.size(); i++)
+ {
+ consideredConfigFiles += sep;
+ consideredVersions += sep;
+ consideredConfigFiles += this->ConsideredConfigs[i].filename;
+ consideredVersions += this->ConsideredConfigs[i].version;
+ sep = ";";
+ }
+
+ this->Makefile->AddDefinition(consideredConfigsVar.c_str(),
+ consideredConfigFiles.c_str());
+
+ this->Makefile->AddDefinition(consideredVersionsVar.c_str(),
+ consideredVersions.c_str());
+
return result;
}
@@ -1481,6 +1535,10 @@ bool cmFindPackageCommand::FindConfigFile(std::string const& dir,
//----------------------------------------------------------------------------
bool cmFindPackageCommand::CheckVersion(std::string const& config_file)
{
+ bool result = false; // by default, assume the version is not ok.
+ bool haveResult = false;
+ std::string version = "unknown";
+
// Get the filename without the .cmake extension.
std::string::size_type pos = config_file.rfind('.');
std::string version_file_base = config_file.substr(0, pos);
@@ -1488,31 +1546,42 @@ bool cmFindPackageCommand::CheckVersion(std::string const& config_file)
// Look for foo-config-version.cmake
std::string version_file = version_file_base;
version_file += "-version.cmake";
- if(cmSystemTools::FileExists(version_file.c_str(), true))
+ if ((haveResult == false)
+ && (cmSystemTools::FileExists(version_file.c_str(), true)))
{
- return this->CheckVersionFile(version_file);
+ result = this->CheckVersionFile(version_file, version);
+ haveResult = true;
}
// Look for fooConfigVersion.cmake
version_file = version_file_base;
version_file += "Version.cmake";
- if(cmSystemTools::FileExists(version_file.c_str(), true))
+ if ((haveResult == false)
+ && (cmSystemTools::FileExists(version_file.c_str(), true)))
{
- return this->CheckVersionFile(version_file);
+ result = this->CheckVersionFile(version_file, version);
+ haveResult = true;
}
+
// If no version was requested a versionless package is acceptable.
- if(this->Version.empty())
+ if ((haveResult == false) && (this->Version.empty()))
{
- return true;
+ result = true;
+ haveResult = true;
}
- // No version file found. Assume the version is incompatible.
- return false;
+ ConfigFileInfo configFileInfo;
+ configFileInfo.filename = config_file;
+ configFileInfo.version = version;
+ this->ConsideredConfigs.push_back(configFileInfo);
+
+ return result;
}
//----------------------------------------------------------------------------
-bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file)
+bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file,
+ std::string& result_version)
{
// The version file will be loaded in an isolated scope.
cmMakefile::ScopePushPop varScope(this->Makefile);
@@ -1585,6 +1654,12 @@ bool cmFindPackageCommand::CheckVersionFile(std::string const& version_file)
}
}
+ result_version = this->Makefile->GetSafeDefinition("PACKAGE_VERSION");
+ if (result_version.empty())
+ {
+ result_version = "unknown";
+ }
+
// Succeed if the version is suitable.
return suitable;
}
diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h
index 53ea4fc..57aeab9 100644
--- a/Source/cmFindPackageCommand.h
+++ b/Source/cmFindPackageCommand.h
@@ -98,7 +98,8 @@ private:
bool CheckDirectory(std::string const& dir);
bool FindConfigFile(std::string const& dir, std::string& file);
bool CheckVersion(std::string const& config_file);
- bool CheckVersionFile(std::string const& version_file);
+ bool CheckVersionFile(std::string const& version_file,
+ std::string& result_version);
bool SearchPrefix(std::string const& prefix);
bool SearchFrameworkPrefix(std::string const& prefix_in);
bool SearchAppBundlePrefix(std::string const& prefix_in);
@@ -137,6 +138,9 @@ private:
std::vector<std::string> Names;
std::vector<std::string> Configs;
std::set<std::string> IgnoredPaths;
+
+ struct ConfigFileInfo { std::string filename; std::string version; };
+ std::vector<ConfigFileInfo> ConsideredConfigs;
};
#endif
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 944c1fc..c6d05b0 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -1845,6 +1845,38 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
}
}
+//----------------------------------------------------------------------------
+const char* cmGlobalGenerator::GetPredefinedTargetsFolder()
+{
+ const char* prop =
+ this->GetCMakeInstance()->GetProperty("PREDEFINED_TARGETS_FOLDER");
+
+ if (prop)
+ {
+ return prop;
+ }
+
+ return "CMakePredefinedTargets";
+}
+
+//----------------------------------------------------------------------------
+bool cmGlobalGenerator::UseFolderProperty()
+{
+ const char* prop = this->GetCMakeInstance()->GetProperty("USE_FOLDERS");
+
+ // If this property is defined, let the setter turn this on or off...
+ //
+ if (prop)
+ {
+ return cmSystemTools::IsOn(prop);
+ }
+
+ // By default, this feature is ON:
+ //
+ return true;
+}
+
+//----------------------------------------------------------------------------
cmTarget cmGlobalGenerator::CreateGlobalTarget(
const char* name, const char* message,
const cmCustomCommandLines* commandLines,
@@ -1874,6 +1906,14 @@ cmTarget cmGlobalGenerator::CreateGlobalTarget(
{
target.AddUtility(dit->c_str());
}
+
+ // Organize in the "predefined targets" folder:
+ //
+ if (this->UseFolderProperty())
+ {
+ target.SetProperty("FOLDER", this->GetPredefinedTargetsFolder());
+ }
+
return target;
}
diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h
index 9793619..2aec19f 100644
--- a/Source/cmGlobalGenerator.h
+++ b/Source/cmGlobalGenerator.h
@@ -322,6 +322,9 @@ protected:
// All targets in the entire project.
std::map<cmStdString,cmTarget *> TotalTargets;
+ virtual const char* GetPredefinedTargetsFolder();
+ virtual bool UseFolderProperty();
+
private:
float FirstTimeProgress;
// If you add a new map here, make sure it is copied
diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx
index 1a5c940..ba18687 100644
--- a/Source/cmGlobalVisualStudio71Generator.cxx
+++ b/Source/cmGlobalVisualStudio71Generator.cxx
@@ -111,6 +111,13 @@ void cmGlobalVisualStudio71Generator
OrderedTargetDependSet orderedProjectTargets(projectTargets);
this->WriteTargetsToSolution(fout, root, orderedProjectTargets);
+
+ bool useFolderProperty = this->UseFolderProperty();
+ if (useFolderProperty)
+ {
+ this->WriteFolders(fout);
+ }
+
// Write out the configurations information for the solution
fout << "Global\n";
// Write out the configurations for the solution
@@ -120,6 +127,15 @@ void cmGlobalVisualStudio71Generator
// Write out the configurations for all the targets in the project
this->WriteTargetConfigurations(fout, root, orderedProjectTargets);
fout << "\tEndGlobalSection\n";
+
+ if (useFolderProperty)
+ {
+ // Write out project folders
+ fout << "\tGlobalSection(NestedProjects) = preSolution\n";
+ this->WriteFoldersContent(fout);
+ fout << "\tEndGlobalSection\n";
+ }
+
// Write the footer for the SLN file
this->WriteSLNFooter(fout);
}
diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx
index f59de40..751dc24 100644
--- a/Source/cmGlobalVisualStudio7Generator.cxx
+++ b/Source/cmGlobalVisualStudio7Generator.cxx
@@ -300,6 +300,48 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
cmLocalGenerator::START_OUTPUT);
this->WriteProject(fout, vcprojName, dir.c_str(),
*target);
+
+ // Create "solution folder" information from FOLDER target property
+ //
+ if (this->UseFolderProperty())
+ {
+ const char *targetFolder = target->GetProperty("FOLDER");
+ if (targetFolder)
+ {
+ std::vector<cmsys::String> tokens =
+ cmSystemTools::SplitString(targetFolder, '/', false);
+
+ std::string cumulativePath = "";
+
+ for(std::vector<cmsys::String>::iterator iter = tokens.begin();
+ iter != tokens.end(); ++iter)
+ {
+ if(!iter->size())
+ {
+ continue;
+ }
+
+ if (cumulativePath.empty())
+ {
+ cumulativePath = *iter;
+ }
+ else
+ {
+ VisualStudioFolders[cumulativePath].insert(
+ cumulativePath + "/" + *iter);
+
+ cumulativePath = cumulativePath + "/" + *iter;
+ }
+
+ this->CreateGUID(cumulativePath.c_str());
+ }
+
+ if (!cumulativePath.empty())
+ {
+ VisualStudioFolders[cumulativePath].insert(target->GetName());
+ }
+ }
+ }
}
}
}
@@ -327,6 +369,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetDepends(
}
}
+//----------------------------------------------------------------------------
// Write a SLN file to the stream
void cmGlobalVisualStudio7Generator
::WriteSLNFile(std::ostream& fout,
@@ -344,6 +387,13 @@ void cmGlobalVisualStudio7Generator
OrderedTargetDependSet orderedProjectTargets(projectTargets);
this->WriteTargetsToSolution(fout, root, orderedProjectTargets);
+
+ bool useFolderProperty = this->UseFolderProperty();
+ if (useFolderProperty)
+ {
+ this->WriteFolders(fout);
+ }
+
// Write out the configurations information for the solution
fout << "Global\n"
<< "\tGlobalSection(SolutionConfiguration) = preSolution\n";
@@ -361,6 +411,14 @@ void cmGlobalVisualStudio7Generator
this->WriteTargetDepends(fout, orderedProjectTargets);
fout << "\tEndGlobalSection\n";
+ if (useFolderProperty)
+ {
+ // Write out project folders
+ fout << "\tGlobalSection(NestedProjects) = preSolution\n";
+ this->WriteFoldersContent(fout);
+ fout << "\tEndGlobalSection\n";
+ }
+
// Write out the configurations for all the targets in the project
fout << "\tGlobalSection(ProjectConfiguration) = postSolution\n";
this->WriteTargetConfigurations(fout, root, orderedProjectTargets);
@@ -371,6 +429,47 @@ void cmGlobalVisualStudio7Generator
}
//----------------------------------------------------------------------------
+void cmGlobalVisualStudio7Generator::WriteFolders(std::ostream& fout)
+{
+ std::string guidProjectTypeFolder = "2150E333-8FDC-42A3-9474-1A3956D46DE8";
+ for(std::map<std::string,std::set<std::string> >::iterator iter =
+ VisualStudioFolders.begin(); iter != VisualStudioFolders.end(); ++iter)
+ {
+ std::string fullName = iter->first;
+ std::string guid = this->GetGUID(fullName.c_str());
+ std::string nameOnly = cmSystemTools::GetFilenameName(fullName);
+ cmSystemTools::ReplaceString(fullName, "/", "\\");
+
+ fout << "Project(\"{" <<
+ guidProjectTypeFolder << "}\") = \"" <<
+ nameOnly << "\", \"" <<
+ fullName << "\", \"{" <<
+ guid <<
+ "}\"\nEndProject\n";
+ }
+}
+
+//----------------------------------------------------------------------------
+void cmGlobalVisualStudio7Generator::WriteFoldersContent(std::ostream& fout)
+{
+ for(std::map<std::string,std::set<std::string> >::iterator iter =
+ VisualStudioFolders.begin(); iter != VisualStudioFolders.end(); ++iter)
+ {
+ std::string key(iter->first);
+ std::string guidParent(this->GetGUID(key.c_str()));
+
+ for(std::set<std::string>::iterator it = iter->second.begin();
+ it != iter->second.end(); ++it)
+ {
+ std::string value(*it);
+ std::string guid(this->GetGUID(value.c_str()));
+
+ fout << "\t\t{" << guid << "} = {" << guidParent << "}\n";
+ }
+ }
+}
+
+//----------------------------------------------------------------------------
std::string
cmGlobalVisualStudio7Generator::ConvertToSolutionPath(const char* path)
{
diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h
index b89fa1c..b6c84e8 100644
--- a/Source/cmGlobalVisualStudio7Generator.h
+++ b/Source/cmGlobalVisualStudio7Generator.h
@@ -143,6 +143,10 @@ protected:
std::vector<std::string> Configurations;
std::map<cmStdString, cmStdString> GUIDMap;
+ virtual void WriteFolders(std::ostream& fout);
+ virtual void WriteFoldersContent(std::ostream& fout);
+ std::map<std::string,std::set<std::string> > VisualStudioFolders;
+
// Set during OutputSLNFile with the name of the current project.
// There is one SLN file per project.
std::string CurrentProject;
diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx
index 2612a08..c5c9d5c 100644
--- a/Source/cmGlobalVisualStudio8Generator.cxx
+++ b/Source/cmGlobalVisualStudio8Generator.cxx
@@ -137,6 +137,13 @@ void cmGlobalVisualStudio8Generator::AddCheckTarget()
no_working_directory, no_depends,
noCommandLines);
+ // Organize in the "predefined targets" folder:
+ //
+ if (this->UseFolderProperty())
+ {
+ tgt->SetProperty("FOLDER", this->GetPredefinedTargetsFolder());
+ }
+
// Create a list of all stamp files for this project.
std::vector<std::string> stamps;
std::string stampList = cmake::GetCMakeFilesDirectoryPostSlash();
diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx
index 3493b1d..bae18a3 100644
--- a/Source/cmGlobalVisualStudioGenerator.cxx
+++ b/Source/cmGlobalVisualStudioGenerator.cxx
@@ -56,6 +56,21 @@ void cmGlobalVisualStudioGenerator::Generate()
AddUtilityCommand("ALL_BUILD", true, no_working_dir,
no_depends, no_commands, false,
"Build all projects");
+
+#if 0
+ // Can't activate this code because we want ALL_BUILD
+ // selected as the default "startup project" when first
+ // opened in Visual Studio... And if it's nested in a
+ // folder, then that doesn't happen.
+ //
+ // Organize in the "predefined targets" folder:
+ //
+ if (this->UseFolderProperty())
+ {
+ allBuild->SetProperty("FOLDER", this->GetPredefinedTargetsFolder());
+ }
+#endif
+
// Now make all targets depend on the ALL_BUILD target
cmTargets targets;
for(std::vector<cmLocalGenerator*>::iterator i = gen.begin();
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 45ba358..9611912 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -854,10 +854,19 @@ void cmTarget::DefineProperties(cmake *cm)
"set_source_files_properties command.");
cm->DefineProperty
+ ("FOLDER", cmProperty::TARGET,
+ "Set the folder name. Use to organize targets in an IDE.",
+ "Targets with no FOLDER property will appear as top level "
+ "entities in IDEs like Visual Studio. Targets with the same "
+ "FOLDER property value will appear next to each other in a "
+ "folder of that name. To nest folders, use FOLDER values such "
+ "as 'GUI/Dialogs' with '/' characters separating folder levels.");
+
+ cm->DefineProperty
("PROJECT_LABEL", cmProperty::TARGET,
"Change the name of a target in an IDE.",
"Can be used to change the name of the target in an IDE "
- "like visual stuido. ");
+ "like Visual Studio. ");
cm->DefineProperty
("VS_KEYWORD", cmProperty::TARGET,
"Visual Studio project keyword.",
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 0f9ef1b..e6c7bb0 100644
--- a/Source/cmake.cxx
+++ b/Source/cmake.cxx
@@ -3483,6 +3483,23 @@ void cmake::DefineProperties(cmake *cm)
"the value of this property. "
"Non-Makefile generators currently ignore this property.");
+ cm->DefineProperty
+ ("USE_FOLDERS", cmProperty::GLOBAL,
+ "Use the FOLDER target property to organize targets into folders.",
+ "If not set, CMake treats this property as ON by default. "
+ "CMake generators that are capable of organizing into a "
+ "hierarchy of folders use the values of the FOLDER target "
+ "property to name those folders. See also the documentation "
+ "for the FOLDER target property.");
+
+ cm->DefineProperty
+ ("PREDEFINED_TARGETS_FOLDER", cmProperty::GLOBAL,
+ "Name of FOLDER for targets that are added automatically by CMake.",
+ "If not set, CMake uses \"CMakePredefinedTargets\" as a default "
+ "value for this property. Targets such as INSTALL, PACKAGE and "
+ "RUN_TESTS will be organized into this FOLDER. See also the "
+ "documentation for the FOLDER target property.");
+
// ================================================================
// define variables as well
// ================================================================
diff --git a/Source/ctest.cxx b/Source/ctest.cxx
index 24921c4..3937d8d 100644
--- a/Source/ctest.cxx
+++ b/Source/ctest.cxx
@@ -152,7 +152,7 @@ static const char * cmDocumentationOptions[][3] =
"popups and interactive "
"debugging."},
{"--no-label-summary", "Disable timing summary information for labels.",
- "This option tells ctest to not print summary information for each label "
+ "This option tells ctest not to print summary information for each label "
"associated with the tests run. If there are no labels on the "
"tests, nothing extra is printed."},
{"--build-and-test", "Configure, build and run a test.",
@@ -229,6 +229,9 @@ static const char * cmDocumentationOptions[][3] =
"This flag will turn off automatic compression of test output. Use this "
"to maintain compatibility with an older version of CDash which doesn't "
"support compressed test output."},
+ {"--print-labels", "Print all available test labels.",
+ "This option will not run any tests, it will simply print the list of "
+ "all labels associated with the test set."},
{"--help-command <cmd> [<file>]", "Show help for a single command and exit.",
"Prints the help for the command to stdout or to the specified file." },
{"--help-command-list [<file>]", "List available commands and exit.",
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index df9690a..5816ea8 100644
--- a/Source/kwsys/kwsysDateStamp.cmake
+++ b/Source/kwsys/kwsysDateStamp.cmake
@@ -18,4 +18,4 @@ SET(KWSYS_DATE_STAMP_YEAR 2010)
SET(KWSYS_DATE_STAMP_MONTH 09)
# KWSys version date day component. Format is DD.
-SET(KWSYS_DATE_STAMP_DAY 02)
+SET(KWSYS_DATE_STAMP_DAY 08)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 5383bda..8e8d0ca 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -1315,6 +1315,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
--output-log "${CMake_BINARY_DIR}/Tests/CTestTestParallel/testOutput.log"
)
+ ADD_TEST(CTestTestPrintLabels ${CMAKE_CTEST_COMMAND} --print-labels)
+ SET_TESTS_PROPERTIES(CTestTestPrintLabels PROPERTIES LABELS "Label1;Label2")
+ SET_TESTS_PROPERTIES(CTestTestPrintLabels PROPERTIES PASS_REGULAR_EXPRESSION
+ "All Labels:.* Label1.* Label2")
+
CONFIGURE_FILE(
"${CMake_SOURCE_DIR}/Tests/CTestTestResourceLock/test.cmake.in"
"${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/test.cmake"
diff --git a/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt
index 587cf57..bf90a52 100644
--- a/Tests/ExternalProject/CMakeLists.txt
+++ b/Tests/ExternalProject/CMakeLists.txt
@@ -7,6 +7,9 @@ find_package(CVS)
find_package(Subversion)
find_package(Git)
+set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER
+ "CMakePredefinedTargets-in-ExternalProjectTest")
+
set(base "${CMAKE_BINARY_DIR}/CMakeExternals")
set(binary_base "${base}/Build")
set_property(DIRECTORY PROPERTY EP_BASE ${base})
@@ -42,6 +45,22 @@ endif()
# Empty projects that test all the known ExternalProject_Add argument key words:
#
+set(proj AAA-TestAlphabetization)
+ExternalProject_Add(${proj}
+ BUILD_COMMAND ""
+ CONFIGURE_COMMAND ""
+ DOWNLOAD_COMMAND ""
+ INSTALL_COMMAND ""
+)
+
+set(proj ZZZ-TestAlphabetization)
+ExternalProject_Add(${proj}
+ BUILD_COMMAND ""
+ CONFIGURE_COMMAND ""
+ DOWNLOAD_COMMAND ""
+ INSTALL_COMMAND ""
+)
+
set(proj MinimalNoOpProject)
ExternalProject_Add(${proj}
BUILD_COMMAND ""
@@ -71,6 +90,7 @@ ExternalProject_Add(${proj}
URL_MD5 ""
UPDATE_COMMAND ""
)
+set_property(TARGET ${proj} PROPERTY FOLDER "")
# Local DIR:
@@ -83,6 +103,7 @@ if(can_build_tutorial_step5)
TEST_BEFORE_INSTALL 1
LOG_INSTALL 1
)
+ set_property(TARGET ${proj} PROPERTY FOLDER "Local")
ExternalProject_Get_Property(${proj} install_dir)
set(TutorialStep5_install_dir ${install_dir})
@@ -93,6 +114,7 @@ if(can_build_tutorial_step5)
TEST_AFTER_INSTALL 1
LOG_TEST 1
)
+ set_property(TARGET ${proj} PROPERTY FOLDER "Local")
endif()
@@ -110,6 +132,7 @@ ExternalProject_Add(${proj}
INSTALL_COMMAND ""
LOG_CONFIGURE 1
)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local/TAR")
set(proj TutorialStep1-LocalNoDirTAR)
ExternalProject_Add(${proj}
@@ -120,6 +143,7 @@ ExternalProject_Add(${proj}
-DTEST_LIST:STRING=1@@2@@3
INSTALL_COMMAND ""
)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local/TAR")
ExternalProject_Add_Step(${proj} mypatch
COMMAND ${CMAKE_COMMAND} -E echo "This is a custom external project step."
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/Step1Patch.cmake
@@ -139,6 +163,7 @@ ExternalProject_Add(${proj}
INSTALL_COMMAND ""
LOG_BUILD 1
)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local/TGZ")
set(proj TutorialStep1-LocalNoDirTGZ)
ExternalProject_Add(${proj}
@@ -148,6 +173,7 @@ ExternalProject_Add(${proj}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR>
INSTALL_COMMAND ""
)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local/TGZ")
# Local BZ2:
@@ -164,6 +190,7 @@ ExternalProject_Add(${proj}
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local/BZ2")
set(proj TutorialStep1-LocalNoDirBZ2)
ExternalProject_Add(${proj}
@@ -172,6 +199,7 @@ ExternalProject_Add(${proj}
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local/BZ2")
# Local ZIP:
@@ -188,6 +216,7 @@ ExternalProject_Add(${proj}
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local/ZIP")
set(proj TutorialStep1-LocalNoDirZIP)
ExternalProject_Add(${proj}
@@ -196,6 +225,7 @@ ExternalProject_Add(${proj}
BUILD_COMMAND ""
INSTALL_COMMAND ""
)
+set_property(TARGET ${proj} PROPERTY FOLDER "Local/ZIP")
# CVS-based tests:
@@ -227,6 +257,8 @@ if(do_cvs_tests)
CONFIGURE_COMMAND "${CVS_EXECUTABLE}" --version
INSTALL_COMMAND ""
)
+ set_property(TARGET ${proj}
+ PROPERTY FOLDER "SetupRepos/Local/Deeply/Nested/For/Testing")
# CVS by date stamp:
#
@@ -241,6 +273,7 @@ if(do_cvs_tests)
INSTALL_COMMAND ""
DEPENDS "SetupLocalCVSRepository"
)
+ set_property(TARGET ${proj} PROPERTY FOLDER "CVS")
# CVS by tag:
#
@@ -255,6 +288,7 @@ if(do_cvs_tests)
INSTALL_COMMAND ""
DEPENDS "SetupLocalCVSRepository"
)
+ set_property(TARGET ${proj} PROPERTY FOLDER "CVS")
# Live CVS / HEAD (no CVS_TAG):
#
@@ -274,6 +308,7 @@ if(do_cvs_tests)
DEPENDS "TutorialStep1-CVS-20090626"
DEPENDS "TutorialStep1-CVS-testtag1"
)
+ set_property(TARGET ${proj} PROPERTY FOLDER "CVS")
endif()
@@ -326,6 +361,8 @@ if(do_svn_tests)
CONFIGURE_COMMAND "${Subversion_SVN_EXECUTABLE}" --version
INSTALL_COMMAND ""
)
+ set_property(TARGET ${proj}
+ PROPERTY FOLDER "SetupRepos/Local/Deeply/Nested/For/Testing")
# SVN by date stamp:
#
@@ -339,6 +376,7 @@ if(do_svn_tests)
INSTALL_COMMAND ""
DEPENDS "SetupLocalSVNRepository"
)
+ set_property(TARGET ${proj} PROPERTY FOLDER "SVN")
# SVN by revision number:
#
@@ -352,6 +390,7 @@ if(do_svn_tests)
INSTALL_COMMAND ""
DEPENDS "SetupLocalSVNRepository"
)
+ set_property(TARGET ${proj} PROPERTY FOLDER "SVN")
# Live SVN / trunk (no SVN_REVISION):
#
@@ -364,6 +403,7 @@ if(do_svn_tests)
DEPENDS "SetupLocalSVNRepository"
LOG_DOWNLOAD 1
)
+ set_property(TARGET ${proj} PROPERTY FOLDER "SVN")
endif()
@@ -401,6 +441,8 @@ if(do_git_tests)
CONFIGURE_COMMAND "${GIT_EXECUTABLE}" --version
INSTALL_COMMAND ""
)
+ set_property(TARGET ${proj}
+ PROPERTY FOLDER "SetupRepos/Local/Deeply/Nested/For/Testing")
# git by commit id:
#
@@ -414,6 +456,7 @@ if(do_git_tests)
INSTALL_COMMAND ""
DEPENDS "SetupLocalGITRepository"
)
+ set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
# git by explicit branch/tag name:
#
@@ -427,6 +470,7 @@ if(do_git_tests)
INSTALL_COMMAND ""
DEPENDS "SetupLocalGITRepository"
)
+ set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
# Live git / master (no GIT_TAG):
#
@@ -439,6 +483,7 @@ if(do_git_tests)
DEPENDS "SetupLocalGITRepository"
LOG_UPDATE 1
)
+ set_property(TARGET ${proj} PROPERTY FOLDER "GIT")
endif()