summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt35
-rw-r--r--Modules/BundleUtilities.cmake9
-rw-r--r--Modules/CMakeGenericSystem.cmake102
-rw-r--r--Modules/CTestTargets.cmake2
-rw-r--r--Modules/FindCUDA.cmake25
-rw-r--r--Modules/FindGTK2.cmake11
-rw-r--r--Modules/FindPackageHandleStandardArgs.cmake172
-rw-r--r--Modules/FindSubversion.cmake14
-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.cxx10
-rw-r--r--Source/cmCTest.h3
-rw-r--r--Source/cmELF.cxx3
-rw-r--r--Source/cmExportCommand.cxx12
-rw-r--r--Source/cmFileCommand.cxx103
-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.cxx11
-rw-r--r--Source/cmGlobalVisualStudioGenerator.cxx15
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx20
-rw-r--r--Source/cmLocalGenerator.cxx38
-rw-r--r--Source/cmLocalVisualStudio6Generator.cxx3
-rw-r--r--Source/cmMakefile.cxx36
-rw-r--r--Source/cmMakefile.h6
-rw-r--r--Source/cmSourceFile.cxx15
-rw-r--r--Source/cmSourceFile.h4
-rw-r--r--Source/cmSystemTools.cxx15
-rw-r--r--Source/cmTarget.cxx33
-rw-r--r--Source/cmake.cxx17
-rw-r--r--Source/ctest.cxx5
-rw-r--r--Source/kwsys/MD5.c9
-rw-r--r--Source/kwsys/kwsysDateStamp.cmake2
-rw-r--r--Tests/CMakeLists.txt10
-rw-r--r--Tests/ExternalProject/CMakeLists.txt45
-rw-r--r--Tests/MissingSourceFile/CMakeLists.txt3
-rw-r--r--Utilities/cmbzip2/bzlib_private.h3
-rw-r--r--Utilities/cmcurl/setup.h4
-rw-r--r--Utilities/cmlibarchive/libarchive/archive_check_magic.c2
-rwxr-xr-xbootstrap2
53 files changed, 1003 insertions, 327 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/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake
index 7d2d8cd..b5d3072 100644
--- a/Modules/CMakeGenericSystem.cmake
+++ b/Modules/CMakeGenericSystem.cmake
@@ -52,6 +52,94 @@ IF(CMAKE_GENERATOR MATCHES "Makefiles")
ENDIF(DEFINED CMAKE_RULE_MESSAGES)
ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
+
+# GetDefaultWindowsPrefixBase
+#
+# Compute the base directory for CMAKE_INSTALL_PREFIX based on:
+# - is this 32-bit or 64-bit Windows
+# - is this 32-bit or 64-bit CMake running
+# - what architecture targets will be built
+#
+function(GetDefaultWindowsPrefixBase var)
+
+ # Try to guess what architecture targets will end up being built as,
+ # even if CMAKE_SIZEOF_VOID_P is not computed yet... We need to know
+ # the architecture of the targets being built to choose the right
+ # default value for CMAKE_INSTALL_PREFIX.
+ #
+ if("${CMAKE_GENERATOR}" MATCHES "Win64")
+ set(arch_hint "x64")
+ elseif("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
+ set(arch_hint "x64")
+ elseif("$ENV{LIB}" MATCHES "(amd64|ia64)")
+ set(arch_hint "x64")
+ endif()
+
+ if(NOT arch_hint)
+ set(arch_hint "x86")
+ endif()
+
+ # default env in a 64-bit app on Win64:
+ # ProgramFiles=C:\Program Files
+ # ProgramFiles(x86)=C:\Program Files (x86)
+ # ProgramW6432=C:\Program Files
+ #
+ # default env in a 32-bit app on Win64:
+ # ProgramFiles=C:\Program Files (x86)
+ # ProgramFiles(x86)=C:\Program Files (x86)
+ # ProgramW6432=C:\Program Files
+ #
+ # default env in a 32-bit app on Win32:
+ # ProgramFiles=C:\Program Files
+ # ProgramFiles(x86) NOT DEFINED
+ # ProgramW6432 NOT DEFINED
+
+ # By default, use the ProgramFiles env var as the base value of
+ # CMAKE_INSTALL_PREFIX:
+ #
+ set(_PREFIX_ENV_VAR "ProgramFiles")
+
+ if ("$ENV{ProgramW6432}" STREQUAL "")
+ # running on 32-bit Windows
+ # must be a 32-bit CMake, too...
+ #message("guess: this is a 32-bit CMake running on 32-bit Windows")
+ else()
+ # running on 64-bit Windows
+ if ("$ENV{ProgramW6432}" STREQUAL "$ENV{ProgramFiles}")
+ # 64-bit CMake
+ #message("guess: this is a 64-bit CMake running on 64-bit Windows")
+ if(NOT "${arch_hint}" STREQUAL "x64")
+ # building 32-bit targets
+ set(_PREFIX_ENV_VAR "ProgramFiles(x86)")
+ endif()
+ else()
+ # 32-bit CMake
+ #message("guess: this is a 32-bit CMake running on 64-bit Windows")
+ if("${arch_hint}" STREQUAL "x64")
+ # building 64-bit targets
+ set(_PREFIX_ENV_VAR "ProgramW6432")
+ endif()
+ endif()
+ endif()
+
+ #if("${arch_hint}" STREQUAL "x64")
+ # message("guess: you are building a 64-bit app")
+ #else()
+ # message("guess: you are building a 32-bit app")
+ #endif()
+
+ if(NOT "$ENV{${_PREFIX_ENV_VAR}}" STREQUAL "")
+ file(TO_CMAKE_PATH "$ENV{${_PREFIX_ENV_VAR}}" _base)
+ elseif(NOT "$ENV{SystemDrive}" STREQUAL "")
+ set(_base "$ENV{SystemDrive}/Program Files")
+ else()
+ set(_base "C:/Program Files")
+ endif()
+
+ set(${var} "${_base}" PARENT_SCOPE)
+endfunction()
+
+
# Set a variable to indicate whether the value of CMAKE_INSTALL_PREFIX
# was initialized by the block below. This is useful for user
# projects to change the default prefix while still allowing the
@@ -65,23 +153,11 @@ IF(CMAKE_HOST_UNIX)
SET(CMAKE_INSTALL_PREFIX "/usr/local"
CACHE PATH "Install path prefix, prepended onto install directories.")
ELSE(CMAKE_HOST_UNIX)
- IF("$ENV{ProgramFiles}" MATCHES "^$")
- IF("$ENV{SystemDrive}" MATCHES "^$")
- SET(CMAKE_GENERIC_PROGRAM_FILES "C:/Program Files")
- ELSE("$ENV{SystemDrive}" MATCHES "^$")
- SET(CMAKE_GENERIC_PROGRAM_FILES "$ENV{SystemDrive}/Program Files")
- ENDIF("$ENV{SystemDrive}" MATCHES "^$")
- ELSE("$ENV{ProgramFiles}" MATCHES "^$")
- SET(CMAKE_GENERIC_PROGRAM_FILES "$ENV{ProgramFiles}")
- ENDIF("$ENV{ProgramFiles}" MATCHES "^$")
+ GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
SET(CMAKE_INSTALL_PREFIX
"${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
CACHE PATH "Install path prefix, prepended onto install directories.")
SET(CMAKE_GENERIC_PROGRAM_FILES)
-
- # Make sure the prefix uses forward slashes.
- STRING(REGEX REPLACE "\\\\" "/"
- CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
ENDIF(CMAKE_HOST_UNIX)
MARK_AS_ADVANCED(
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/FindCUDA.cmake b/Modules/FindCUDA.cmake
index d9b9d54..dad5709 100644
--- a/Modules/FindCUDA.cmake
+++ b/Modules/FindCUDA.cmake
@@ -514,11 +514,19 @@ set (CUDA_INCLUDE_DIRS ${CUDA_TOOLKIT_INCLUDE})
macro(FIND_LIBRARY_LOCAL_FIRST _var _names _doc)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
- set(_cuda_64bit_lib_dir "${CUDA_TOOLKIT_ROOT_DIR}/lib64")
+ # CUDA 3.2+ on Windows moved the library directoryies, so we need the new
+ # and old paths.
+ set(_cuda_64bit_lib_dir
+ "${CUDA_TOOLKIT_ROOT_DIR}/lib/x64"
+ "${CUDA_TOOLKIT_ROOT_DIR}/lib64"
+ )
endif()
+ # CUDA 3.2+ on Windows moved the library directories, so we need to new
+ # (lib/Win32) and the old path (lib).
find_library(${_var}
NAMES ${_names}
PATHS ${_cuda_64bit_lib_dir}
+ "${CUDA_TOOLKIT_ROOT_DIR}/lib/Win32"
"${CUDA_TOOLKIT_ROOT_DIR}/lib"
ENV CUDA_LIB_PATH
DOC ${_doc}
@@ -578,9 +586,20 @@ macro(FIND_CUDA_HELPER_LIBS _name)
mark_as_advanced(CUDA_${_name}_LIBRARY)
endmacro(FIND_CUDA_HELPER_LIBS)
+#######################
+# Disable emulation for v3.1 onward
+if(CUDA_VERSION VERSION_GREATER "3.0")
+ if(CUDA_BUILD_EMULATION)
+ message(FATAL_ERROR "CUDA_BUILD_EMULATION is not supported in version 3.1 and onwards. You must disable it to proceed. You have version ${CUDA_VERSION}.")
+ endif()
+endif()
+
# Search for cufft and cublas libraries.
-find_cuda_helper_libs(cufftemu)
-find_cuda_helper_libs(cublasemu)
+if(CUDA_VERSION VERSION_LESS "3.1")
+ # Emulation libraries aren't available in version 3.1 onward.
+ find_cuda_helper_libs(cufftemu)
+ find_cuda_helper_libs(cublasemu)
+endif()
find_cuda_helper_libs(cufft)
find_cuda_helper_libs(cublas)
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/FindSubversion.cmake b/Modules/FindSubversion.cmake
index 9bad3b1..daf3d87 100644
--- a/Modules/FindSubversion.cmake
+++ b/Modules/FindSubversion.cmake
@@ -8,18 +8,22 @@
# The minimum required version of Subversion can be specified using the
# standard syntax, e.g. FIND_PACKAGE(Subversion 1.4)
#
-# If the command line client executable is found the macro
+# If the command line client executable is found two macros are defined:
# Subversion_WC_INFO(<dir> <var-prefix>)
-# is defined to extract information of a subversion working copy at
-# a given location. The macro defines the following variables:
+# Subversion_WC_LOG(<dir> <var-prefix>)
+# Subversion_WC_INFO extracts information of a subversion working copy at
+# a given location. This macro defines the following variables:
# <var-prefix>_WC_URL - url of the repository (at <dir>)
# <var-prefix>_WC_ROOT - root url of the repository
# <var-prefix>_WC_REVISION - current revision
# <var-prefix>_WC_LAST_CHANGED_AUTHOR - author of last commit
# <var-prefix>_WC_LAST_CHANGED_DATE - date of last commit
# <var-prefix>_WC_LAST_CHANGED_REV - revision of last commit
-# <var-prefix>_WC_LAST_CHANGED_LOG - last log of base revision
# <var-prefix>_WC_INFO - output of command `svn info <dir>'
+# Subversion_WC_LOG retrieves the log message of the base revision of a
+# subversion working copy at a given location. This macro defines the
+# variable:
+# <var-prefix>_LAST_CHANGED_LOG - last log of base revision
# Example usage:
# FIND_PACKAGE(Subversion)
# IF(SUBVERSION_FOUND)
@@ -74,6 +78,8 @@ IF(Subversion_SVN_EXECUTABLE)
STRING(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*"
"\\2" ${prefix}_WC_URL "${${prefix}_WC_INFO}")
+ STRING(REGEX REPLACE "^(.*\n)?Repository Root: ([^\n]+).*"
+ "\\2" ${prefix}_WC_ROOT "${${prefix}_WC_INFO}")
STRING(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*"
"\\2" ${prefix}_WC_REVISION "${${prefix}_WC_INFO}")
STRING(REGEX REPLACE "^(.*\n)?Last Changed Author: ([^\n]+).*"
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..2e05883 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;
@@ -489,10 +490,6 @@ int cmCTest::Initialize(const char* binary_dir, cmCTestStartCommand* command)
return 0;
}
- // call this so that the information is cached up front
- // and not the first time EndTest is called.
- this->ShouldCompressTestOutput();
-
if ( this->ProduceXML )
{
// Verify "Testing" directory exists:
@@ -1877,6 +1874,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/cmELF.cxx b/Source/cmELF.cxx
index c198727..1158fc0 100644
--- a/Source/cmELF.cxx
+++ b/Source/cmELF.cxx
@@ -687,7 +687,8 @@ cmELFInternalImpl<Types>::GetDynamicSectionString(int tag)
// The value has been read successfully. Report it.
se.Position = static_cast<unsigned long>(strtab.sh_offset + first);
se.Size = last - first;
- se.IndexInSection = static_cast<int>(di - this->DynamicSectionEntries.begin());
+ se.IndexInSection =
+ static_cast<int>(di - this->DynamicSectionEntries.begin());
return &se;
}
}
diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx
index 48c5c6e..cb614d4 100644
--- a/Source/cmExportCommand.cxx
+++ b/Source/cmExportCommand.cxx
@@ -152,11 +152,10 @@ bool cmExportCommand
ebfg.SetCommand(this);
// Compute the set of configurations exported.
- if(const char* types =
- this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
+ std::vector<std::string> configurationTypes;
+ this->Makefile->GetConfigurations(configurationTypes);
+ if(!configurationTypes.empty())
{
- std::vector<std::string> configurationTypes;
- cmSystemTools::ExpandListArgument(types, configurationTypes);
for(std::vector<std::string>::const_iterator
ci = configurationTypes.begin();
ci != configurationTypes.end(); ++ci)
@@ -164,11 +163,6 @@ bool cmExportCommand
ebfg.AddConfiguration(ci->c_str());
}
}
- else if(const char* config =
- this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"))
- {
- ebfg.AddConfiguration(config);
- }
else
{
ebfg.AddConfiguration("");
diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx
index 133c1a1..8ebd41f 100644
--- a/Source/cmFileCommand.cxx
+++ b/Source/cmFileCommand.cxx
@@ -2571,8 +2571,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
std::vector<std::string>::const_iterator i = args.begin();
if(args.size() < 3)
{
- this->SetError("FILE(DOWNLOAD url file) must be called with "
- "at least three arguments.");
+ this->SetError("DOWNLOAD must be called with at least three arguments.");
return false;
}
++i; // Get rid of subcommand
@@ -2598,8 +2597,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
}
else
{
- this->SetError("FILE(DOWNLOAD url file TIMEOUT time) missing "
- "time for TIMEOUT.");
+ this->SetError("DOWNLOAD missing time for TIMEOUT.");
return false;
}
}
@@ -2608,8 +2606,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
++i;
if( i == args.end())
{
- this->SetError("FILE(DOWNLOAD url file LOG VAR) missing "
- "VAR for LOG.");
+ this->SetError("DOWNLOAD missing VAR for LOG.");
return false;
}
verboseLog = *i;
@@ -2619,8 +2616,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
++i;
if( i == args.end())
{
- this->SetError("FILE(DOWNLOAD url file STATUS VAR) missing "
- "VAR for STATUS.");
+ this->SetError("DOWNLOAD missing VAR for STATUS.");
return false;
}
statusVar = *i;
@@ -2630,8 +2626,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
++i;
if( i == args.end())
{
- this->SetError("FILE(DOWNLOAD url file EXPECTED_MD5 sum) missing "
- "sum value for EXPECTED_MD5.");
+ this->SetError("DOWNLOAD missing sum value for EXPECTED_MD5.");
return false;
}
expectedMD5sum = cmSystemTools::LowerCase(*i);
@@ -2654,8 +2649,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
if (!cmSystemTools::ComputeFileMD5(file.c_str(), computedMD5))
{
- this->SetError("FILE(DOWNLOAD ) error; cannot compute MD5 sum on "
- "pre-existing file");
+ this->SetError("DOWNLOAD cannot compute MD5 sum on pre-existing file");
return false;
}
@@ -2665,7 +2659,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
if (expectedMD5sum == actualMD5sum)
{
this->Makefile->DisplayStatus(
- "FILE(DOWNLOAD ) returning early: file already exists with "
+ "FILE(DOWNLOAD) returning early: file already exists with "
"expected MD5 sum", -1);
if(statusVar.size())
@@ -2698,8 +2692,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
std::ofstream fout(file.c_str(), std::ios::binary);
if(!fout)
{
- this->SetError("FILE(DOWNLOAD url file TIMEOUT time) can not open "
- "file for write.");
+ this->SetError("DOWNLOAD cannot open file for write.");
return false;
}
@@ -2708,8 +2701,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
curl = ::curl_easy_init();
if(!curl)
{
- this->SetError("FILE(DOWNLOAD ) error "
- "initializing curl.");
+ this->SetError("DOWNLOAD error initializing curl.");
return false;
}
@@ -2718,9 +2710,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
::CURLcode res = ::curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set url: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set url: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
@@ -2728,10 +2720,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
cmFileCommandWriteMemoryCallback);
if (res != CURLE_OK)
{
- std::string errstring =
- "FILE(DOWNLOAD ) error; cannot set write function: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set write function: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
@@ -2739,10 +2730,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
cmFileCommandCurlDebugCallback);
if (res != CURLE_OK)
{
- std::string errstring =
- "FILE(DOWNLOAD ) error; cannot set debug function: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set debug function: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
@@ -2752,27 +2742,27 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set write data: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set write data: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
res = ::curl_easy_setopt(curl, CURLOPT_DEBUGDATA, (void *)&chunkDebug);
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set debug data: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set debug data: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
res = ::curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1L);
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set follow-redirect option: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set follow-redirect option: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
@@ -2782,9 +2772,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set verbose: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set verbose: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
}
@@ -2795,9 +2785,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set timeout: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set timeout: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
}
@@ -2815,9 +2805,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
CURLOPT_NOPROGRESS, 0);
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set noprogress value: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set noprogress value: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
@@ -2825,9 +2815,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
CURLOPT_PROGRESSFUNCTION, cmFileCommandCurlProgressCallback);
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set progress function: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set progress function: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
@@ -2835,9 +2825,9 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
CURLOPT_PROGRESSDATA, reinterpret_cast<void*>(&helper));
if (res != CURLE_OK)
{
- std::string errstring = "FILE(DOWNLOAD ) error; cannot set progress data: ";
- errstring += ::curl_easy_strerror(res);
- this->SetError(errstring.c_str());
+ std::string e = "DOWNLOAD cannot set progress data: ";
+ e += ::curl_easy_strerror(res);
+ this->SetError(e.c_str());
return false;
}
}
@@ -2871,8 +2861,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
if (!cmSystemTools::ComputeFileMD5(file.c_str(), computedMD5))
{
- this->SetError("FILE(DOWNLOAD ) error; cannot compute MD5 sum on "
- "downloaded file");
+ this->SetError("DOWNLOAD cannot compute MD5 sum on downloaded file");
return false;
}
@@ -2882,8 +2871,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
if (expectedMD5sum != actualMD5sum)
{
cmOStringStream oss;
- oss << "FILE(DOWNLOAD ) error; expected and actual MD5 sums differ"
- << std::endl
+ oss << "DOWNLOAD MD5 mismatch" << std::endl
<< " for file: [" << file << "]" << std::endl
<< " expected MD5 sum: [" << expectedMD5sum << "]" << std::endl
<< " actual MD5 sum: [" << actualMD5sum << "]" << std::endl
@@ -2913,8 +2901,7 @@ cmFileCommand::HandleDownloadCommand(std::vector<std::string>
return true;
#else
- this->SetError("FILE(DOWNLOAD ) "
- "not supported in bootstrap cmake ");
+ this->SetError("DOWNLOAD not supported by bootstrap cmake.");
return false;
#endif
}
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..7c65c32 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();
@@ -253,8 +260,8 @@ cmGlobalVisualStudio8Generator
for(std::vector<std::string>::iterator i = this->Configurations.begin();
i != this->Configurations.end(); ++i)
{
- fout << "\t\t" << *i << "|" << this->GetPlatformName() << " = " << *i << "|"
- << this->GetPlatformName() << "\n";
+ fout << "\t\t" << *i << "|" << this->GetPlatformName()
+ << " = " << *i << "|" << this->GetPlatformName() << "\n";
}
fout << "\tEndGlobalSection\n";
}
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/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 537a88f..c63b403 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -722,26 +722,10 @@ void cmGlobalXCodeGenerator::SetCurrentLocalGenerator(cmLocalGenerator* gen)
// Select the current set of configuration types.
this->CurrentConfigurationTypes.clear();
- if(this->XcodeVersion > 20)
- {
- if(const char* types =
- this->CurrentMakefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(types,
- this->CurrentConfigurationTypes);
- }
- }
+ this->CurrentMakefile->GetConfigurations(this->CurrentConfigurationTypes);
if(this->CurrentConfigurationTypes.empty())
{
- if(const char* buildType =
- this->CurrentMakefile->GetDefinition("CMAKE_BUILD_TYPE"))
- {
- this->CurrentConfigurationTypes.push_back(buildType);
- }
- else
- {
- this->CurrentConfigurationTypes.push_back("");
- }
+ this->CurrentConfigurationTypes.push_back("");
}
}
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index bac0223..5bffd52 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -278,16 +278,8 @@ void cmLocalGenerator::GenerateTestFiles()
// Compute the set of configurations.
std::vector<std::string> configurationTypes;
- if(const char* types =
- this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(types, configurationTypes);
- }
- const char* config = 0;
- if(configurationTypes.empty())
- {
- config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
- }
+ const char* config =
+ this->Makefile->GetConfigurations(configurationTypes, false);
std::string file = this->Makefile->GetStartOutputDirectory();
file += "/";
@@ -383,16 +375,8 @@ void cmLocalGenerator::GenerateInstallRules()
// Compute the set of configurations.
std::vector<std::string> configurationTypes;
- if(const char* types =
- this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(types, configurationTypes);
- }
- const char* config = 0;
- if(configurationTypes.empty())
- {
- config = this->Makefile->GetDefinition("CMAKE_BUILD_TYPE");
- }
+ const char* config =
+ this->Makefile->GetConfigurations(configurationTypes, false);
// Choose a default install configuration.
const char* default_config = config;
@@ -546,19 +530,7 @@ void cmLocalGenerator::GenerateTargetManifest()
{
// Collect the set of configuration types.
std::vector<std::string> configNames;
- if(const char* configurationTypes =
- this->Makefile->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(configurationTypes, configNames);
- }
- else if(const char* buildType =
- this->Makefile->GetDefinition("CMAKE_BUILD_TYPE"))
- {
- if(*buildType)
- {
- configNames.push_back(buildType);
- }
- }
+ this->Makefile->GetConfigurations(configNames);
// Add our targets to the manifest for each configuration.
cmTargets& targets = this->Makefile->GetTargets();
diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx
index 539816d..01fcafd 100644
--- a/Source/cmLocalVisualStudio6Generator.cxx
+++ b/Source/cmLocalVisualStudio6Generator.cxx
@@ -1304,7 +1304,8 @@ void cmLocalVisualStudio6Generator
optionsRelease);
this->ComputeLinkOptions(target, "MinSizeRel", extraLinkOptionsMinSizeRel,
optionsMinSizeRel);
- this->ComputeLinkOptions(target, "RelWithDebInfo", extraLinkOptionsRelWithDebInfo,
+ this->ComputeLinkOptions(target, "RelWithDebInfo",
+ extraLinkOptionsRelWithDebInfo,
optionsRelWithDebInfo);
}
diff --git a/Source/cmMakefile.cxx b/Source/cmMakefile.cxx
index 8eece6b..c64053a 100644
--- a/Source/cmMakefile.cxx
+++ b/Source/cmMakefile.cxx
@@ -1436,16 +1436,7 @@ void cmMakefile::InitializeFromParent()
this->SetProperty("COMPILE_DEFINITIONS",
parent->GetProperty("COMPILE_DEFINITIONS"));
std::vector<std::string> configs;
- if(const char* configTypes =
- this->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(configTypes, configs);
- }
- else if(const char* buildType =
- this->GetDefinition("CMAKE_BUILD_TYPE"))
- {
- configs.push_back(buildType);
- }
+ this->GetConfigurations(configs);
for(std::vector<std::string>::const_iterator ci = configs.begin();
ci != configs.end(); ++ci)
{
@@ -2367,6 +2358,31 @@ void cmMakefile::AddDefaultDefinitions()
cmake::GetCMakeFilesDirectory());
}
+//----------------------------------------------------------------------------
+const char*
+cmMakefile::GetConfigurations(std::vector<std::string>& configs,
+ bool single) const
+{
+ if(this->LocalGenerator->GetGlobalGenerator()->IsMultiConfig())
+ {
+ if(const char* configTypes =
+ this->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
+ {
+ cmSystemTools::ExpandListArgument(configTypes, configs);
+ }
+ return 0;
+ }
+ else
+ {
+ const char* buildType = this->GetDefinition("CMAKE_BUILD_TYPE");
+ if(single && buildType && *buildType)
+ {
+ configs.push_back(buildType);
+ }
+ return buildType;
+ }
+}
+
#if defined(CMAKE_BUILD_WITH_CMAKE)
/**
* Find a source group whose regular expression matches the filename
diff --git a/Source/cmMakefile.h b/Source/cmMakefile.h
index 4fae7ee..8b8a3f8 100644
--- a/Source/cmMakefile.h
+++ b/Source/cmMakefile.h
@@ -309,7 +309,11 @@ public:
{
return this->ProjectName.c_str();
}
-
+
+ /** Get the configurations to be generated. */
+ const char* GetConfigurations(std::vector<std::string>& configs,
+ bool single = true) const;
+
/**
* Set the name of the library.
*/
diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx
index bc52d7f..b793cd5 100644
--- a/Source/cmSourceFile.cxx
+++ b/Source/cmSourceFile.cxx
@@ -101,11 +101,11 @@ cmSourceFileLocation const& cmSourceFile::GetLocation() const
}
//----------------------------------------------------------------------------
-std::string const& cmSourceFile::GetFullPath()
+std::string const& cmSourceFile::GetFullPath(std::string* error)
{
if(this->FullPath.empty())
{
- if(this->FindFullPath())
+ if(this->FindFullPath(error))
{
this->CheckExtension();
}
@@ -120,7 +120,7 @@ std::string const& cmSourceFile::GetFullPath() const
}
//----------------------------------------------------------------------------
-bool cmSourceFile::FindFullPath()
+bool cmSourceFile::FindFullPath(std::string* error)
{
// If thie method has already failed once do not try again.
if(this->FindFullPathFailed)
@@ -199,7 +199,14 @@ bool cmSourceFile::FindFullPath()
{
e << " ." << *ext;
}
- this->Location.GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str());
+ if(error)
+ {
+ *error = e.str();
+ }
+ else
+ {
+ this->Location.GetMakefile()->IssueMessage(cmake::FATAL_ERROR, e.str());
+ }
this->FindFullPathFailed = true;
return false;
}
diff --git a/Source/cmSourceFile.h b/Source/cmSourceFile.h
index 937e4b7..2dc8488 100644
--- a/Source/cmSourceFile.h
+++ b/Source/cmSourceFile.h
@@ -60,7 +60,7 @@ public:
* horrible interface, but is necessary for backwards
* compatibility).
*/
- std::string const& GetFullPath();
+ std::string const& GetFullPath(std::string* error = 0);
std::string const& GetFullPath() const;
/**
@@ -108,7 +108,7 @@ private:
std::string FullPath;
bool FindFullPathFailed;
- bool FindFullPath();
+ bool FindFullPath(std::string* error);
bool TryFullPath(const char* tryPath, const char* ext);
void CheckExtension();
void CheckLanguage(std::string const& ext);
diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
index 8378922..7bc89a4 100644
--- a/Source/cmSystemTools.cxx
+++ b/Source/cmSystemTools.cxx
@@ -1176,7 +1176,8 @@ bool cmSystemTools::ComputeFileMD5(const char* source, char* md5out)
// Should be efficient enough on most system:
const int bufferSize = 4096;
char buffer[bufferSize];
- unsigned char const* buffer_uc = reinterpret_cast<unsigned char const*>(buffer);
+ unsigned char const* buffer_uc =
+ reinterpret_cast<unsigned char const*>(buffer);
// This copy loop is very sensitive on certain platforms with
// slightly broken stream libraries (like HPUX). Normally, it is
// incorrect to not check the error condition on the fin.read()
@@ -1931,12 +1932,20 @@ bool extract_tar(const char* outFileName, bool verbose,
}
if(extract)
{
+ r = archive_write_disk_set_options(ext, ARCHIVE_EXTRACT_TIME);
+ if (r != ARCHIVE_OK)
+ {
+ cmSystemTools::Error(
+ "Problem with archive_write_disk_set_options(): ",
+ archive_error_string(ext));
+ }
+
r = archive_write_header(ext, entry);
if (r != ARCHIVE_OK)
{
cmSystemTools::Error("Problem with archive_write_header(): ",
- archive_error_string(a));
- cmSystemTools::Error("Curren file:",
+ archive_error_string(ext));
+ cmSystemTools::Error("Current file:",
archive_entry_pathname(entry));
}
else
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 45ba358..458d1a5 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.",
@@ -1031,18 +1040,7 @@ void cmTarget::SetMakefile(cmMakefile* mf)
// Collect the set of configuration types.
std::vector<std::string> configNames;
- if(const char* configurationTypes =
- mf->GetDefinition("CMAKE_CONFIGURATION_TYPES"))
- {
- cmSystemTools::ExpandListArgument(configurationTypes, configNames);
- }
- else if(const char* buildType = mf->GetDefinition("CMAKE_BUILD_TYPE"))
- {
- if(*buildType)
- {
- configNames.push_back(buildType);
- }
- }
+ mf->GetConfigurations(configNames);
// Setup per-configuration property default values.
const char* configProps[] = {
@@ -1430,8 +1428,15 @@ bool cmTarget::FindSourceFiles()
si = this->SourceFiles.begin();
si != this->SourceFiles.end(); ++si)
{
- if((*si)->GetFullPath().empty())
+ std::string e;
+ if((*si)->GetFullPath(&e).empty())
{
+ if(!e.empty())
+ {
+ cmake* cm = this->Makefile->GetCMakeInstance();
+ cm->IssueMessage(cmake::FATAL_ERROR, e,
+ this->GetBacktrace());
+ }
return false;
}
}
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/MD5.c b/Source/kwsys/MD5.c
index 1ea0a66..56776a3 100644
--- a/Source/kwsys/MD5.c
+++ b/Source/kwsys/MD5.c
@@ -29,6 +29,11 @@
it in a single source file instead of a separate header and
implementation file. */
+#if defined(__clang__)
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored "-Wcast-align"
+#endif
+
/*
Copyright (C) 1999, 2000, 2002 Aladdin Enterprises. All rights reserved.
@@ -428,6 +433,10 @@ static void md5_finish(md5_state_t *pms, md5_byte_t digest[16])
digest[i] = (md5_byte_t)(pms->abcd[i >> 2] >> ((i & 3) << 3));
}
+#if defined(__clang__)
+# pragma clang diagnostic pop
+#endif
+
/*--------------------------------------------------------------------------*/
/* Wrap up the MD5 state in our opaque structure. */
struct kwsysMD5_s
diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake
index df9690a..99c8b27 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 14)
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt
index 5383bda..5e88b5c 100644
--- a/Tests/CMakeLists.txt
+++ b/Tests/CMakeLists.txt
@@ -129,6 +129,9 @@ IF(BUILD_TESTING)
ADD_TEST_MACRO(MathTest MathTest)
ADD_TEST_MACRO(Simple Simple)
ADD_TEST_MACRO(PreOrder PreOrder)
+ ADD_TEST_MACRO(MissingSourceFile MissingSourceFile)
+ SET_TESTS_PROPERTIES(MissingSourceFile PROPERTIES
+ PASS_REGULAR_EXPRESSION "CMake Error at CMakeLists.txt:3 \\(add_executable\\):[ \r\n]*Cannot find source file \"MissingSourceFile.c\"")
ADD_TEST_MACRO(COnly COnly)
ADD_TEST_MACRO(CxxOnly CxxOnly)
ADD_TEST_MACRO(IPO COnly/COnly)
@@ -1315,6 +1318,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"
@@ -1625,7 +1633,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
ENDIF()
IF(NOT CMAKE_TEST_GENERATOR MATCHES "Xcode")
- INCLUDE(FindJava)
+ find_package(Java QUIET)
IF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW)
GET_FILENAME_COMPONENT(JNIPATH ${JAVA_COMPILE} PATH)
FIND_FILE(JNI_H jni.h
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()
diff --git a/Tests/MissingSourceFile/CMakeLists.txt b/Tests/MissingSourceFile/CMakeLists.txt
new file mode 100644
index 0000000..42b7c51
--- /dev/null
+++ b/Tests/MissingSourceFile/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8)
+project(MissingSourceFile C)
+add_executable(MissingSourceFile MissingSourceFile.c)
diff --git a/Utilities/cmbzip2/bzlib_private.h b/Utilities/cmbzip2/bzlib_private.h
index 147dbb8..02a667f 100644
--- a/Utilities/cmbzip2/bzlib_private.h
+++ b/Utilities/cmbzip2/bzlib_private.h
@@ -47,6 +47,9 @@
/* warning C4127: conditional expression is constant*/
# pragma warning(disable:4127)
#endif
+#if defined(__clang__)
+# pragma clang diagnostic ignored "-Wcast-align"
+#endif
/*-- General stuff. --*/
diff --git a/Utilities/cmcurl/setup.h b/Utilities/cmcurl/setup.h
index c49e63d..e302f35 100644
--- a/Utilities/cmcurl/setup.h
+++ b/Utilities/cmcurl/setup.h
@@ -42,6 +42,10 @@
#define WIN32
#endif
+#if defined(__clang__)
+# pragma clang diagnostic ignored "-Wcast-align"
+#endif
+
/*
* Include configuration script results or hand-crafted
* configuration file for platforms which lack config tool.
diff --git a/Utilities/cmlibarchive/libarchive/archive_check_magic.c b/Utilities/cmlibarchive/libarchive/archive_check_magic.c
index a9177d7..e9dbe51 100644
--- a/Utilities/cmlibarchive/libarchive/archive_check_magic.c
+++ b/Utilities/cmlibarchive/libarchive/archive_check_magic.c
@@ -69,7 +69,7 @@ diediedie(void)
/* Cause a breakpoint exception */
DebugBreak();
#endif
- *(char *)0 = 1; /* Deliberately segfault and force a coredump. */
+ *(char *)1 = 1; /* Deliberately segfault and force a coredump. */
_exit(1); /* If that didn't work, just exit with an error. */
}
diff --git a/bootstrap b/bootstrap
index 01d9e15..0da868d 100755
--- a/bootstrap
+++ b/bootstrap
@@ -839,7 +839,7 @@ mkdir "${cmake_bootstrap_dir}/${TMPFILE}"
cd "${cmake_bootstrap_dir}/${TMPFILE}"
echo '
test: test.c
- "'"${cmake_c_compiler}"'" -o test test.c
+ "'"${cmake_c_compiler}"'" '"${cmake_ld_flags} ${cmake_c_flags}"' -o test test.c
'>"Makefile"
echo '
#include <stdio.h>