From f811470a964147fefc6e09ddcf71545e3cce24a7 Mon Sep 17 00:00:00 2001 From: Michael Wild Date: Fri, 21 May 2010 22:29:16 +0200 Subject: [PATCH 001/152] Improve documentation of BundleUtilities.cmake Put the function documentation into the header-comment, improve formatting and list the user-relevant functions first. Signed-off-by: Michael Wild --- Modules/BundleUtilities.cmake | 219 ++++++++++++++++------------------ 1 file changed, 103 insertions(+), 116 deletions(-) diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index d9c41f48a..136171fc8 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -1,9 +1,10 @@ -# BundleUtilities.cmake +# - A collection of CMake utility functions useful for dealing with .app +# bundles on the Mac and bundle-like directories on any OS. # -# A collection of CMake utility functions useful for dealing with .app bundles -# on the Mac and bundle-like directories on any OS. -# -# The following functions are provided by this script: +# The following functions are provided by this module: +# fixup_bundle +# copy_and_fixup_bundle +# verify_app # get_bundle_main_executable # get_dotapp_dir # get_bundle_and_executable @@ -14,14 +15,108 @@ # get_bundle_keys # copy_resolved_item_into_bundle # fixup_bundle_item -# fixup_bundle -# copy_and_fixup_bundle # verify_bundle_prerequisites # verify_bundle_symlinks -# verify_app # # Requires CMake 2.6 or greater because it uses function, break and # PARENT_SCOPE. Also depends on GetPrerequisites.cmake. +# +# FIXUP_BUNDLE( ) +# Fix up a bundle in-place and make it standalone, such that it can be +# drag-n-drop copied to another machine and run on that machine as long as all +# of the system libraries are compatible. +# +# Gather all the keys for all the executables and libraries in a bundle, and +# then, for each key, copy each prerequisite into the bundle. Then fix each one +# up according to its own list of prerequisites. +# +# Then clear all the keys and call verify_app on the final bundle to ensure +# that it is truly standalone. +# +# COPY_AND_FIXUP_BUNDLE( ) +# Makes a copy of the bundle at location and then fixes up the +# new copied bundle in-place at ... +# +# VERIFY_APP() +# Verifies that an application appears valid based on running analysis +# tools on it. Calls "message(FATAL_ERROR" if the application is not verified. +# +# GET_BUNDLE_MAIN_EXECUTABLE( ) +# The result will be the full path name of the bundle's main executable file +# or an "error:" prefixed string if it could not be determined. +# +# GET_DOTAPP_DIR( ) +# Returns the nearest parent dir whose name ends with ".app" given the full +# path to an executable. If there is no such parent dir, then return a dir at +# the same level as the executable, named with the executable's base name and +# ending with ".app" +# +# The returned directory may or may not exist. +# +# GET_BUNDLE_AND_EXECUTABLE( ) +# Takes either a ".app" directory name or the name of an executable +# nested inside a ".app" directory and returns the path to the ".app" +# directory in and the path to its main executable in +# +# +# GET_BUNDLE_ALL_EXECUTABLES( ) +# Scans the given bundle recursively for all executable files and accumulates +# them into a variable. +# +# GET_ITEM_KEY( ) +# Given a file (item) name, generate a key that should be unique considering +# the set of libraries that need copying or fixing up to make a bundle +# standalone. This is essentially the file name including extension with "." +# replaced by "_" +# +# This key is used as a prefix for CMake variables so that we can associate a +# set of variables with a given item based on its key. +# +# CLEAR_BUNDLE_KEYS() +# Loop over the list of keys, clearing all the variables associated with each +# key. After the loop, clear the list of keys itself. +# +# Caller of get_bundle_keys should call clear_bundle_keys when done with list +# of keys. +# +# SET_BUNDLE_KEY_VALUES( +# ) +# Add a key to the list (if necessary) for the given item. If added, +# also set all the variables associated with that key. +# +# GET_BUNDLE_KEYS( ) +# Loop over all the executable and library files within the bundle (and given +# as extra ) and accumulate a list of keys representing them. Set +# values associated with each key such that we can loop over all of them and +# copy prerequisite libs into the bundle and then do appropriate +# install_name_tool fixups. +# +# COPY_RESOLVED_ITEM_INTO_BUNDLE( ) +# Copy a resolved item into the bundle if necessary. Copy is not necessary if +# the resolved_item is "the same as" the resolved_embedded_item. +# +# FIXUP_BUNDLE_ITEM( ) +# Get the direct/non-system prerequisites of the resolved embedded item. For +# each prerequisite, change the way it is referenced to the value of the +# _EMBEDDED_ITEM keyed variable for that prerequisite. (Most likely changing to +# an "@executable_path" style reference.) +# +# Also, change the id of the item being fixed up to its own _EMBEDDED_ITEM +# value. +# +# 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. +# +# VERIFY_BUNDLE_PREREQUISITES( ) +# 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 +# everywhere. +# +# VERIFY_BUNDLE_SYMLINKS( ) +# Verifies that any symlinks found in the bundle point to other files that are +# already also in the bundle... Anything that points to an external file causes +# this function to fail the verification. +# #============================================================================= # Copyright 2008-2009 Kitware, Inc. @@ -43,11 +138,6 @@ get_filename_component(BundleUtilities_cmake_dir "${CMAKE_CURRENT_LIST_FILE}" PA include("${BundleUtilities_cmake_dir}/GetPrerequisites.cmake") -# get_bundle_main_executable -# -# The result will be the full path name of the bundle's main executable file -# or an "error:" prefixed string if it could not be determined. -# function(get_bundle_main_executable bundle result_var) set(result "error: '${bundle}/Contents/Info.plist' file does not exist") @@ -109,15 +199,6 @@ function(get_bundle_main_executable bundle result_var) endfunction(get_bundle_main_executable) -# get_dotapp_dir -# -# Returns the nearest parent dir whose name ends with ".app" given the full path -# to an executable. If there is no such parent dir, then return a dir at the same -# level as the executable, named with the executable's base name and ending with -# ".app" -# -# The returned directory may or may not exist. -# function(get_dotapp_dir exe dotapp_dir_var) set(s "${exe}") @@ -155,13 +236,6 @@ function(get_dotapp_dir exe dotapp_dir_var) endfunction(get_dotapp_dir) -# get_bundle_and_executable -# -# Takes either a ".app" directory name or the name of an executable -# nested inside a ".app" directory and returns the path to the ".app" -# directory in ${bundle_var} and the path to its main executable in -# ${executable_var} -# function(get_bundle_and_executable app bundle_var executable_var valid_var) set(valid 0) @@ -215,11 +289,6 @@ function(get_bundle_and_executable app bundle_var executable_var valid_var) endfunction(get_bundle_and_executable) -# get_bundle_all_executables -# -# Scans the given bundle recursively for all executable files and accumulates -# them into a variable. -# function(get_bundle_all_executables bundle exes_var) set(exes "") @@ -235,15 +304,6 @@ function(get_bundle_all_executables bundle exes_var) endfunction(get_bundle_all_executables) -# get_item_key -# -# Given a file (item) name, generate a key that should be unique considering the set of -# libraries that need copying or fixing up to make a bundle standalone. This is -# essentially the file name including extension with "." replaced by "_" -# -# This key is used as a prefix for CMake variables so that we can associate a set -# of variables with a given item based on its key. -# function(get_item_key item key_var) get_filename_component(item_name "${item}" NAME) if(WIN32) @@ -254,14 +314,6 @@ function(get_item_key item key_var) endfunction(get_item_key) -# clear_bundle_keys -# -# Loop over the list of keys, clearing all the variables associated with each -# key. After the loop, clear the list of keys itself. -# -# Caller of get_bundle_keys should call clear_bundle_keys when done with list -# of keys. -# function(clear_bundle_keys keys_var) foreach(key ${${keys_var}}) set(${key}_ITEM PARENT_SCOPE) @@ -275,11 +327,6 @@ function(clear_bundle_keys keys_var) endfunction(clear_bundle_keys) -# set_bundle_key_values -# -# Add a key to the list (if necessary) for the given item. If added, -# also set all the variables associated with that key. -# function(set_bundle_key_values keys_var context item exepath dirs copyflag) get_filename_component(item_name "${item}" NAME) @@ -335,14 +382,6 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag) endfunction(set_bundle_key_values) -# get_bundle_keys -# -# Loop over all the executable and library files within the bundle (and given as -# extra "${libs}") and accumulate a list of keys representing them. Set values -# associated with each key such that we can loop over all of them and copy -# prerequisite libs into the bundle and then do appropriate install_name_tool -# fixups. -# function(get_bundle_keys app libs dirs keys_var) set(${keys_var} PARENT_SCOPE) @@ -405,11 +444,6 @@ function(get_bundle_keys app libs dirs keys_var) endfunction(get_bundle_keys) -# copy_resolved_item_into_bundle -# -# Copy a resolved item into the bundle if necessary. Copy is not necessary if -# the resolved_item is "the same as" the resolved_embedded_item. -# function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item) if(WIN32) # ignore case on Windows @@ -433,18 +467,6 @@ function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item) endfunction(copy_resolved_item_into_bundle) -# fixup_bundle_item -# -# Get the direct/non-system prerequisites of the resolved embedded item. For each -# prerequisite, change the way it is referenced to the value of the _EMBEDDED_ITEM -# keyed variable for that prerequisite. (Most likely changing to an "@executable_path" -# style reference.) -# -# Also, change the id of the item being fixed up to its own _EMBEDDED_ITEM value. -# -# 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. -# function(fixup_bundle_item resolved_embedded_item exepath dirs) # This item's key is "ikey": # @@ -476,19 +498,6 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs) endfunction(fixup_bundle_item) -# fixup_bundle -# -# Fix up a bundle in-place and make it standalone, such that it can be drag-n-drop -# copied to another machine and run on that machine as long as all of the system -# libraries are compatible. -# -# Gather all the keys for all the executables and libraries in a bundle, and then, -# for each key, copy each prerequisite into the bundle. Then fix each one up according -# to its own list of prerequisites. -# -# Then clear all the keys and call verify_app on the final bundle to ensure that -# it is truly standalone. -# function(fixup_bundle app libs dirs) message(STATUS "fixup_bundle") message(STATUS " app='${app}'") @@ -557,23 +566,12 @@ function(fixup_bundle app libs dirs) endfunction(fixup_bundle) -# copy_and_fixup_bundle -# -# Makes a copy of the bundle "src" at location "dst" and then fixes up the -# new copied bundle in-place at "dst"... -# function(copy_and_fixup_bundle src dst libs dirs) execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${src}" "${dst}") fixup_bundle("${dst}" "${libs}" "${dirs}") endfunction(copy_and_fixup_bundle) -# verify_bundle_prerequisites -# -# 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 -# everywhere. -# function(verify_bundle_prerequisites bundle result_var info_var) set(result 1) set(info "") @@ -635,12 +633,6 @@ function(verify_bundle_prerequisites bundle result_var info_var) endfunction(verify_bundle_prerequisites) -# verify_bundle_symlinks -# -# Verifies that any symlinks found in the bundle point to other files that are -# already also in the bundle... Anything that points to an external file causes -# this function to fail the verification. -# function(verify_bundle_symlinks bundle result_var info_var) set(result 1) set(info "") @@ -654,11 +646,6 @@ function(verify_bundle_symlinks bundle result_var info_var) endfunction(verify_bundle_symlinks) -# verify_app -# -# Verifies that an application appears valid based on running analysis tools on it. -# Calls message/FATAL_ERROR if the application is not verified. -# function(verify_app app) set(verified 0) set(info "") From 51cc86167b91a187bff816dd4ddf39503fc4ca51 Mon Sep 17 00:00:00 2001 From: Michael Wild Date: Fri, 21 May 2010 22:29:16 +0200 Subject: [PATCH 002/152] Improve documentation of GetPrerequisites.cmake Put the function documentation into the header-comment, improve formatting and list the user-relevant functions first. Signed-off-by: Michael Wild --- Modules/GetPrerequisites.cmake | 201 +++++++++++++++------------------ 1 file changed, 91 insertions(+), 110 deletions(-) diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 24cee55f9..3dcfa3508 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -1,14 +1,15 @@ -# GetPrerequisites.cmake -# -# This script provides functions to list the .dll, .dylib or .so files that an -# executable or shared library file depends on. (Its prerequisites.) +# - This script provides functions to list the .dll, .dylib or .so files that +# an executable or shared library file depends on. (Its prerequisites.) # # It uses various tools to obtain the list of required shared library files: # dumpbin (Windows) # ldd (Linux/Unix) # otool (Mac OSX) # -# The following functions are provided by this script: +# The following functions are provided by this module: +# get_prerequisites +# list_prerequisites +# list_prerequisites_by_glob # gp_append_unique # is_file_executable # gp_item_default_embedded_path @@ -18,12 +19,94 @@ # gp_resolved_file_type # (projects can override with gp_resolved_file_type_override) # gp_file_type -# get_prerequisites -# list_prerequisites -# list_prerequisites_by_glob # # Requires CMake 2.6 or greater because it uses function, break, return and # PARENT_SCOPE. +# +# GET_PREREQUISITES( +# ) +# Get the list of shared library files required by . The list in +# the variable named should be empty on first entry to +# this function. On exit, will contain the list of +# required shared library files. +# +# is the full path to an executable file. is the +# name of a CMake variable to contain the results. must be 0 +# or 1 indicating whether to include or exclude "system" prerequisites. If +# is set to 1 all prerequisites will be found recursively, if set to +# 0 only direct prerequisites are listed. is the path to the top +# level executable used for @executable_path replacment on the Mac. is +# a list of paths where libraries might be found: these paths are searched +# first when a target without any path info is given. Then standard system +# locations are also searched: PATH, Framework locations, /usr/lib... +# +# LIST_PREREQUISITES( [ [ []]]) +# Print a message listing the prerequisites of . +# +# is the name of a shared library or executable target or the full +# path to a shared library or executable file. If is set to 1 all +# prerequisites will be found recursively, if set to 0 only direct +# prerequisites are listed. must be 0 or 1 indicating whether +# to include or exclude "system" prerequisites. With set to 0 only +# the full path names of the prerequisites are printed, set to 1 extra +# informatin will be displayed. +# +# LIST_PREREQUISITES_BY_GLOB( ) +# Print the prerequisites of shared library and executable files matching a +# globbing pattern. is GLOB or GLOB_RECURSE and is a +# globbing expression used with "file(GLOB" or "file(GLOB_RECURSE" to retrieve +# a list of matching files. If a matching file is executable, its prerequisites +# are listed. +# +# Any additional (optional) arguments provided are passed along as the +# optional arguments to the list_prerequisites calls. +# +# GP_APPEND_UNIQUE( ) +# Append to the list variable only if the value is not +# already in the list. +# +# IS_FILE_EXECUTABLE( ) +# Return 1 in if is a binary executable, 0 otherwise. +# +# GP_ITEM_DEFAULT_EMBEDDED_PATH( ) +# Return the path that others should refer to the item by when the item +# is embedded inside a bundle. +# +# Override on a per-project basis by providing a project-specific +# gp_item_default_embedded_path_override function. +# +# GP_RESOLVE_ITEM( ) +# Resolve an item into an existing full path file. +# +# Override on a per-project basis by providing a project-specific +# gp_resolve_item_override function. +# +# GP_RESOLVED_FILE_TYPE( ) +# Return the type of with respect to . String +# describing type of prerequisite is returned in variable named . +# +# Use and if necessary to resolve non-absolute +# values -- but only for non-embedded items. +# +# Possible types are: +# system +# local +# embedded +# other +# +# Override on a per-project basis by providing a project-specific +# gp_resolved_file_type_override function. +# +# GP_FILE_TYPE( ) +# Return the type of with respect to . String +# describing type of prerequisite is returned in variable named . +# +# Possible types are: +# system +# local +# embedded +# other +# #============================================================================= # Copyright 2008-2009 Kitware, Inc. @@ -38,11 +121,6 @@ # (To distributed this file outside of CMake, substitute the full # License text for the above reference.) -# gp_append_unique list_var value -# -# Append value to the list variable ${list_var} only if the value is not -# already in the list. -# function(gp_append_unique list_var value) set(contains 0) @@ -59,12 +137,6 @@ function(gp_append_unique list_var value) endfunction(gp_append_unique) -# is_file_executable file result_var -# -# Return 1 in ${result_var} if ${file} is a binary executable. -# -# Return 0 in ${result_var} otherwise. -# function(is_file_executable file result_var) # # A file is not executable until proven otherwise: @@ -132,14 +204,6 @@ function(is_file_executable file result_var) endfunction(is_file_executable) -# gp_item_default_embedded_path item default_embedded_path_var -# -# Return the path that others should refer to the item by when the item -# is embedded inside a bundle. -# -# Override on a per-project basis by providing a project-specific -# gp_item_default_embedded_path_override function. -# function(gp_item_default_embedded_path item default_embedded_path_var) # On Windows and Linux, "embed" prerequisites in the same directory @@ -193,13 +257,6 @@ function(gp_item_default_embedded_path item default_embedded_path_var) endfunction(gp_item_default_embedded_path) -# gp_resolve_item context item exepath dirs resolved_item_var -# -# Resolve an item into an existing full path file. -# -# Override on a per-project basis by providing a project-specific -# gp_resolve_item_override function. -# function(gp_resolve_item context item exepath dirs resolved_item_var) set(resolved 0) set(resolved_item "${item}") @@ -332,23 +389,6 @@ warning: cannot resolve item '${item}' endfunction(gp_resolve_item) -# gp_resolved_file_type original_file file exepath dirs type_var -# -# Return the type of ${file} with respect to ${original_file}. String -# describing type of prerequisite is returned in variable named ${type_var}. -# -# Use ${exepath} and ${dirs} if necessary to resolve non-absolute ${file} -# values -- but only for non-embedded items. -# -# Possible types are: -# system -# local -# embedded -# other -# -# Override on a per-project basis by providing a project-specific -# gp_resolved_file_type_override function. -# function(gp_resolved_file_type original_file file exepath dirs type_var) #message(STATUS "**") @@ -445,17 +485,6 @@ function(gp_resolved_file_type original_file file exepath dirs type_var) endfunction() -# gp_file_type original_file file type_var -# -# Return the type of ${file} with respect to ${original_file}. String -# describing type of prerequisite is returned in variable named ${type_var}. -# -# Possible types are: -# system -# local -# embedded -# other -# function(gp_file_type original_file file type_var) if(NOT IS_ABSOLUTE "${original_file}") message(STATUS "warning: gp_file_type expects absolute full path for first arg original_file") @@ -470,30 +499,6 @@ function(gp_file_type original_file file type_var) endfunction(gp_file_type) -# get_prerequisites target prerequisites_var exclude_system recurse dirs -# -# Get the list of shared library files required by ${target}. The list in -# the variable named ${prerequisites_var} should be empty on first entry to -# this function. On exit, ${prerequisites_var} will contain the list of -# required shared library files. -# -# target is the full path to an executable file -# -# prerequisites_var is the name of a CMake variable to contain the results -# -# exclude_system is 0 or 1: 0 to include "system" prerequisites , 1 to -# exclude them -# -# recurse is 0 or 1: 0 for direct prerequisites only, 1 for all prerequisites -# recursively -# -# exepath is the path to the top level executable used for @executable_path -# replacment on the Mac -# -# dirs is a list of paths where libraries might be found: these paths are -# searched first when a target without any path info is given. Then standard -# system locations are also searched: PATH, Framework locations, /usr/lib... -# function(get_prerequisites target prerequisites_var exclude_system recurse exepath dirs) set(verbose 0) set(eol_char "E") @@ -706,19 +711,6 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa endfunction(get_prerequisites) -# list_prerequisites target all exclude_system verbose -# -# ARGV0 (target) is the full path to an executable file -# -# optional ARGV1 (all) is 0 or 1: 0 for direct prerequisites only, -# 1 for all prerequisites recursively -# -# optional ARGV2 (exclude_system) is 0 or 1: 0 to include "system" -# prerequisites , 1 to exclude them -# -# optional ARGV3 (verbose) is 0 or 1: 0 to print only full path -# names of prerequisites, 1 to print extra information -# function(list_prerequisites target) if("${ARGV1}" STREQUAL "") set(all 1) @@ -771,17 +763,6 @@ function(list_prerequisites target) endfunction(list_prerequisites) -# list_prerequisites_by_glob glob_arg glob_exp -# -# glob_arg is GLOB or GLOB_RECURSE -# -# glob_exp is a globbing expression used with "file(GLOB" to retrieve a list -# of matching files. If a matching file is executable, its prerequisites are -# listed. -# -# Any additional (optional) arguments provided are passed along as the -# optional arguments to the list_prerequisites calls. -# function(list_prerequisites_by_glob glob_arg glob_exp) message(STATUS "=============================================================================") message(STATUS "List prerequisites of executables matching ${glob_arg} '${glob_exp}'") From ed78a72a9b3b199e2c3ae55da7e8fe37b07a65ca Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Thu, 19 Aug 2010 21:33:37 -0400 Subject: [PATCH 003/152] 11041: Improve FindCxxTest to use Python or Perl automatically; custom flags Included patch by Simone Rossetto to check if either Python or Perl are present in the system. Whichever intepreter that is detected is now used to run the test generator program. If both interpreters are detected, the CXXTEST_USE_PYTHON variable is obeyed. Also added support for CXXTEST_TESTGEN_ARGS, for manually specifying options to the CxxTest code generator. --- Modules/FindCxxTest.cmake | 102 +++++++++++++++++++++++++++++--------- 1 file changed, 79 insertions(+), 23 deletions(-) diff --git a/Modules/FindCxxTest.cmake b/Modules/FindCxxTest.cmake index 759b4fd7b..6a66d2161 100644 --- a/Modules/FindCxxTest.cmake +++ b/Modules/FindCxxTest.cmake @@ -5,20 +5,37 @@ # # INPUT Variables # -# CXXTEST_USE_PYTHON -# If true, the CXXTEST_ADD_TEST macro will use -# the Python test generator instead of Perl. +# CXXTEST_USE_PYTHON [deprecated since 1.3] +# Only used in the case both Python & Perl +# are detected on the system to control +# which CxxTest code generator is used. +# +# NOTE: In older versions of this Find Module, +# this variable controlled if the Python test +# generator was used instead of the Perl one, +# regardless of which scripting language the +# user had installed. +# +# CXXTEST_TESTGEN_ARGS (since CMake 2.8.3) +# Specify a list of options to pass to the CxxTest code +# generator. If not defined, --error-printer is +# passed. # # OUTPUT Variables # # CXXTEST_FOUND # True if the CxxTest framework was found -# CXXTEST_INCLUDE_DIR +# CXXTEST_INCLUDE_DIRS # Where to find the CxxTest include directory # CXXTEST_PERL_TESTGEN_EXECUTABLE -# The perl-based test generator. +# The perl-based test generator # CXXTEST_PYTHON_TESTGEN_EXECUTABLE -# The python-based test generator. +# The python-based test generator +# CXXTEST_TESTGEN_EXECUTABLE (since CMake 2.8.3) +# The test generator that is actually used (chosen using user preferences +# and interpreters found in the system) +# CXXTEST_TESTGEN_INTERPRETER (since CMake 2.8.3) +# The full path to the Perl or Python executable on the system # # MACROS for optional use by CMake users: # @@ -26,9 +43,11 @@ # Creates a CxxTest runner and adds it to the CTest testing suite # Parameters: # test_name The name of the test -# gen_source_file The generated source filename to be generated by CxxTest +# gen_source_file The generated source filename to be +# generated by CxxTest # input_files_to_testgen The list of header files containing the -# CxxTest::TestSuite's to be included in this runner +# CxxTest::TestSuite's to be included in +# this runner # # #============== # Example Usage: @@ -65,8 +84,8 @@ # #============================================================================= -# Copyright 2008-2009 Kitware, Inc. -# Copyright 2008-2009 Philip Lowman +# Copyright 2008-2010 Kitware, Inc. +# Copyright 2008-2010 Philip Lowman # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -78,6 +97,14 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +# Version 1.3 (8/19/10) (CMake 2.8.3) +# Included patch by Simone Rossetto to check if either Python or Perl +# are present in the system. Whichever intepreter that is detected +# is now used to run the test generator program. If both interpreters +# are detected, the CXXTEST_USE_PYTHON variable is obeyed. +# +# Also added support for CXXTEST_TESTGEN_ARGS, for manually specifying +# options to the CxxTest code generator. # Version 1.2 (3/2/08) # Included patch from Tyler Roscoe to have the perl & python binaries # detected based on CXXTEST_INCLUDE_DIR @@ -95,17 +122,12 @@ #============================================================= macro(CXXTEST_ADD_TEST _cxxtest_testname _cxxtest_outfname) set(_cxxtest_real_outfname ${CMAKE_CURRENT_BINARY_DIR}/${_cxxtest_outfname}) - if(CXXTEST_USE_PYTHON) - set(_cxxtest_executable ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE}) - else() - set(_cxxtest_executable ${CXXTEST_PERL_TESTGEN_EXECUTABLE}) - endif() add_custom_command( OUTPUT ${_cxxtest_real_outfname} DEPENDS ${ARGN} - COMMAND ${_cxxtest_executable} - --error-printer -o ${_cxxtest_real_outfname} ${ARGN} + COMMAND ${CXXTEST_TESTGEN_INTERPRETER} + ${CXXTEST_TESTGEN_EXECUTABLE} ${CXXTEST_TESTGEN_ARGS} -o ${_cxxtest_real_outfname} ${ARGN} ) set_source_files_properties(${_cxxtest_real_outfname} PROPERTIES GENERATED true) @@ -124,14 +146,48 @@ endmacro(CXXTEST_ADD_TEST) #============================================================= # main() #============================================================= +if(NOT DEFINED CXXTEST_TESTGEN_ARGS) + set(CXXTEST_TESTGEN_ARGS --error-printer) +endif() + +find_package(PythonInterp QUIET) +find_package(Perl QUIET) find_path(CXXTEST_INCLUDE_DIR cxxtest/TestSuite.h) -find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl - PATHS ${CXXTEST_INCLUDE_DIR}) find_program(CXXTEST_PYTHON_TESTGEN_EXECUTABLE cxxtestgen.py - PATHS ${CXXTEST_INCLUDE_DIR}) + PATHS ${CXXTEST_INCLUDE_DIR}) +find_program(CXXTEST_PERL_TESTGEN_EXECUTABLE cxxtestgen.pl + PATHS ${CXXTEST_INCLUDE_DIR}) -include(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG CXXTEST_INCLUDE_DIR) +if(PYTHONINTERP_FOUND OR PERL_FOUND) + include(FindPackageHandleStandardArgs) -set(CXXTEST_INCLUDE_DIRS ${CXXTEST_INCLUDE_DIR}) + if(PYTHONINTERP_FOUND AND (CXXTEST_USE_PYTHON OR NOT PERL_FOUND)) + set(CXXTEST_TESTGEN_EXECUTABLE ${CXXTEST_PYTHON_TESTGEN_EXECUTABLE}) + set(CXXTEST_TESTGEN_INTERPRETER ${PYTHON_EXECUTABLE}) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG + CXXTEST_INCLUDE_DIR CXXTEST_PYTHON_TESTGEN_EXECUTABLE) + + elseif(PERL_FOUND) + set(CXXTEST_TESTGEN_EXECUTABLE ${CXXTEST_PERL_TESTGEN_EXECUTABLE}) + set(CXXTEST_TESTGEN_INTERPRETER ${PERL_EXECUTABLE}) + FIND_PACKAGE_HANDLE_STANDARD_ARGS(CxxTest DEFAULT_MSG + CXXTEST_INCLUDE_DIR CXXTEST_PERL_TESTGEN_EXECUTABLE) + endif() + + if(CXXTEST_FOUND) + set(CXXTEST_INCLUDE_DIRS ${CXXTEST_INCLUDE_DIR}) + endif() + +else() + + set(CXXTEST_FOUND false) + if(NOT CxxTest_FIND_QUIETLY) + if(CxxTest_FIND_REQUIRED) + message(FATAL_ERROR "Neither Python nor Perl found, cannot use CxxTest, aborting!") + else() + message(STATUS "Neither Python nor Perl found, CxxTest will not be used.") + endif() + endif() + +endif() From a53b47a77c100a2081042d6711e2de95f28ec7ee Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Thu, 19 Aug 2010 21:49:29 -0400 Subject: [PATCH 004/152] 10241: FindBISON.cmake clears wrong variable --- Modules/FindBISON.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindBISON.cmake b/Modules/FindBISON.cmake index 0c622fb53..6021b1202 100644 --- a/Modules/FindBISON.cmake +++ b/Modules/FindBISON.cmake @@ -96,7 +96,7 @@ IF(BISON_EXECUTABLE) # MACRO(BISON_TARGET Name BisonInput BisonOutput) SET(BISON_TARGET_output_header "") - SET(BISON_TARGET_command_opt "") + SET(BISON_TARGET_cmdopt "") SET(BISON_TARGET_outputs "${BisonOutput}") IF(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7) MESSAGE(SEND_ERROR "Usage") From 78289320dd40065864666432e0f7527e9b637157 Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Thu, 19 Aug 2010 22:03:44 -0400 Subject: [PATCH 005/152] 10688: FindGTK2.cmake doesn't auto-detect macports --- Modules/FindGTK2.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake index 3b99ae226..4f341e7ca 100644 --- a/Modules/FindGTK2.cmake +++ b/Modules/FindGTK2.cmake @@ -66,7 +66,9 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -# Version 1.0 (8/12/2010) +# 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) # * Add support for detecting new pangommconfig.h header file # (Thanks to Sune Vuorela & the Debian Project for the patch) # * Add support for detecting fontconfig.h header @@ -184,6 +186,8 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr) /usr/openwin/lib /sw/include /sw/lib + /opt/local/include + /opt/local/lib $ENV{GTKMM_BASEPATH}/include $ENV{GTKMM_BASEPATH}/lib [HKEY_CURRENT_USER\\SOFTWARE\\gtkmm\\2.4;Path]/include From 40dc97dc73b67d76442b386b73c57437fa72db34 Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Mon, 23 Aug 2010 16:14:40 +0200 Subject: [PATCH 006/152] CPack Backward-compatibly enforce DESTDIR for DEB and RPM --- Source/CPack/cmCPackDebGenerator.cxx | 5 ++++- Source/CPack/cmCPackGenerator.cxx | 16 ++++++++++++++-- Source/CPack/cmCPackRPMGenerator.cxx | 6 +++++- Source/cmSystemTools.cxx | 17 ++++++++++++++++- Source/cmSystemTools.h | 6 ++++++ 5 files changed, 45 insertions(+), 5 deletions(-) diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index 58c6dc3dd..ac2e151c5 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -43,7 +43,10 @@ cmCPackDebGenerator::~cmCPackDebGenerator() int cmCPackDebGenerator::InitializeInternal() { this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr"); - + if (cmSystemTools::IsOff(this->GetOption("CPACK_SET_DESTDIR"))) + { + this->SetOption("CPACK_SET_DESTDIR", "I_ON"); + } return this->Superclass::InitializeInternal(); } diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 4ae2d1fe6..e44fa7b44 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -171,7 +171,8 @@ int cmCPackGenerator::InstallProject() std::string bareTempInstallDirectory = this->GetOption("CPACK_TEMPORARY_INSTALL_DIRECTORY"); std::string tempInstallDirectoryStr = bareTempInstallDirectory; - bool setDestDir = cmSystemTools::IsOn(this->GetOption("CPACK_SET_DESTDIR")); + bool setDestDir = cmSystemTools::IsOn(this->GetOption("CPACK_SET_DESTDIR")) + | cmSystemTools::IsInternallyOn(this->GetOption("CPACK_SET_DESTDIR")); if (!setDestDir) { tempInstallDirectoryStr += this->GetPackagingInstallPrefix(); @@ -414,7 +415,8 @@ int cmCPackGenerator::InstallProjectViaInstallScript( // underneath the tempInstallDirectory. The value of the project's // CMAKE_INSTALL_PREFIX is sent in here as the value of the // CPACK_INSTALL_PREFIX variable. - std::string dir; + + std::string dir; if (this->GetOption("CPACK_INSTALL_PREFIX")) { dir += this->GetOption("CPACK_INSTALL_PREFIX"); @@ -643,6 +645,16 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( // value of the project's CMAKE_INSTALL_PREFIX is sent in here as // the value of the CPACK_INSTALL_PREFIX variable. // + // If DESTDIR has been 'internally set ON' this means that + // the underlying CPack specific generator did ask for that + // In this case we may overrode CPACK_INSTALL_PREFIX with + // CPACK_PACKAGING_INSTALL_PREFIX + // I know this is tricky and awkward but it's the price for + // CPACK_SET_DESTDIR backward compatibility. + if (cmSystemTools::IsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"))) + { + this->SetOption("CPACK_INSTALL_PREFIX",this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX")); + } std::string dir; if (this->GetOption("CPACK_INSTALL_PREFIX")) { diff --git a/Source/CPack/cmCPackRPMGenerator.cxx b/Source/CPack/cmCPackRPMGenerator.cxx index 01b6b0605..0641418b4 100644 --- a/Source/CPack/cmCPackRPMGenerator.cxx +++ b/Source/CPack/cmCPackRPMGenerator.cxx @@ -11,6 +11,7 @@ ============================================================================*/ #include "cmCPackRPMGenerator.h" #include "cmCPackLog.h" +#include "cmSystemTools.h" //---------------------------------------------------------------------- cmCPackRPMGenerator::cmCPackRPMGenerator() @@ -26,7 +27,10 @@ cmCPackRPMGenerator::~cmCPackRPMGenerator() int cmCPackRPMGenerator::InitializeInternal() { this->SetOptionIfNotSet("CPACK_PACKAGING_INSTALL_PREFIX", "/usr"); - + if (cmSystemTools::IsOff(this->GetOption("CPACK_SET_DESTDIR"))) + { + this->SetOption("CPACK_SET_DESTDIR", "I_ON"); + } return this->Superclass::InitializeInternal(); } diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 271a66263..837892214 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -283,7 +283,22 @@ void cmSystemTools::ReportLastSystemError(const char* msg) cmSystemTools::Error(m.c_str()); } - +bool cmSystemTools::IsInternallyOn(const char* val) +{ + if (!val) + { + return false; + } + std::basic_string v = val; + + for(std::basic_string::iterator c = v.begin(); + c != v.end(); c++) + { + *c = static_cast(toupper(*c)); + } + return (v == "I_ON" || v == "i_on"); +} + bool cmSystemTools::IsOn(const char* val) { if (!val) diff --git a/Source/cmSystemTools.h b/Source/cmSystemTools.h index 6a9d849b1..6f9147c31 100644 --- a/Source/cmSystemTools.h +++ b/Source/cmSystemTools.h @@ -103,6 +103,12 @@ public: cmSystemTools::s_ErrorOccured = false; } + /** + * Does a string indicates that CMake/CPack/CTest internally + * forced this value. This is not the same as On, but this + * may be considered as "internally switched on". + */ + static bool IsInternallyOn(const char* val); /** * does a string indicate a true or on value ? This is not the same * as ifdef. From 6a521f8604ee4e6a757109e731a36fdc5575f6c8 Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Mon, 23 Aug 2010 17:38:33 +0200 Subject: [PATCH 007/152] CPack Enable better handling of absolute installed files The idea of the patch is to let the install generator define CPACK_ABSOLUTE_INSTALL_FILES then when CMake is installing project he will concatenate the list of files and give it to specific CPack Generator by defining CPACK_ABSOLUTE_INSTALL_FILES to be the list of ALL files that were installed using absolute destination. An example of use has been applied to RPM generator which now tries to automatically build a relocatable package. --- Modules/CPackRPM.cmake | 47 +++++++++++++++++++++++++------ Source/CPack/cmCPackGenerator.cxx | 11 ++++++++ Source/cmInstallGenerator.cxx | 20 +++++++++++++ 3 files changed, 70 insertions(+), 8 deletions(-) diff --git a/Modules/CPackRPM.cmake b/Modules/CPackRPM.cmake index 439ab4f13..3ade3aa2f 100644 --- a/Modules/CPackRPM.cmake +++ b/Modules/CPackRPM.cmake @@ -83,13 +83,12 @@ # May be used to set RPM packages that are obsoleted by this one. # CPACK_RPM_PACKAGE_RELOCATABLE # Mandatory : NO -# Default : - +# Default : CPACK_PACKAGE_RELOCATABLE # If this variable is set to TRUE or ON CPackRPM will try # to build a relocatable RPM package. A relocatable RPM may # be installed using rpm --prefix or --relocate in order to # install it at an alternate place see rpm(8). -# Note that currently this may fail if the package contains -# files installed with absolute path or CPACK_SET_DESTDIR is set to ON. +# Note that currently this may fail if CPACK_SET_DESTDIR is set to ON. # If CPACK_SET_DESTDIR is set then you will get a warning message # but if there is file installed with absolute path you'll get # unexpected behavior. @@ -331,15 +330,18 @@ ELSE(CPACK_RPM_COMPRESSION_TYPE) SET(CPACK_RPM_COMPRESSION_TYPE_TMP "") ENDIF(CPACK_RPM_COMPRESSION_TYPE) +if(CPACK_PACKAGE_RELOCATABLE) + set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE) +endif(CPACK_PACKAGE_RELOCATABLE) if(CPACK_RPM_PACKAGE_RELOCATABLE) if(CPACK_RPM_PACKAGE_DEBUG) - message("CPackRPM:Debug: Trying to build a relocatable package") + message("CPackRPM:Debug: Trying to build a relocatable package") endif(CPACK_RPM_PACKAGE_DEBUG) - if(CPACK_SET_DESTDIR) - message(SEND_ERROR "CPackRPM:Warning: CPACK_SET_DESTDIR is set while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.") - else(CPACK_SET_DESTDIR) + if(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON")) + message("CPackRPM:Warning: CPACK_SET_DESTDIR is set (=${CPACK_SET_DESTDIR}) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.") + else(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON")) set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX}) - endif(CPACK_SET_DESTDIR) + endif(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON")) endif(CPACK_RPM_PACKAGE_RELOCATABLE) # check if additional fields for RPM spec header are given @@ -463,6 +465,34 @@ EXECUTE_PROCESS(COMMAND find -type f -o -type l WORKING_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}" OUTPUT_VARIABLE CPACK_RPM_INSTALL_FILES) +if (CPACK_ABSOLUTE_DESTINATION_FILES) + IF(CPACK_RPM_PACKAGE_DEBUG) + message("CPackRPM:Debug: Handling Absolute Destination Files: ${CPACK_ABSOLUTE_DESTINATION_FILES}") + ENDIF(CPACK_RPM_PACKAGE_DEBUG) + # Remove trailing space + string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST) + # Transform endline separated - string into CMake List + string(REPLACE "\n" ";" CPACK_RPM_INSTALL_FILES_LIST "${CPACK_RPM_INSTALL_FILES_LIST}") + # Remove unecessary quotes + string(REPLACE "\"" "" CPACK_RPM_INSTALL_FILES_LIST "${CPACK_RPM_INSTALL_FILES_LIST}") + # Remove ABSOLUTE install file from INSTALL FILE LIST + list(REMOVE_ITEM CPACK_RPM_INSTALL_FILES_LIST ${CPACK_ABSOLUTE_DESTINATION_FILES}) + # Rebuild INSTALL_FILES + set(CPACK_RPM_INSTALL_FILES "") + foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST) + set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n") + endforeach(F) + # Build ABSOLUTE_INSTALL_FILES + set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "") + foreach(F IN LISTS CPACK_ABSOLUTE_DESTINATION_FILES) + set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "${CPACK_RPM_ABSOLUTE_INSTALL_FILES}%config \"${F}\"\n") + endforeach(F) + IF(CPACK_RPM_PACKAGE_DEBUG) + message("CPackRPM:Debug: CPACK_RPM_ABSOLUTE_INSTALL_FILES=${CPACK_RPM_ABSOLUTE_INSTALL_FILES}") + message("CPackRPM:Debug: CPACK_RPM_INSTALL_FILES=${CPACK_RPM_INSTALL_FILES}") + ENDIF(CPACK_RPM_PACKAGE_DEBUG) +endif(CPACK_ABSOLUTE_DESTINATION_FILES) + # The name of the final spec file to be used by rpmbuild SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}.spec") @@ -547,6 +577,7 @@ fi %files %defattr(-,root,root,-) ${CPACK_RPM_INSTALL_FILES} +${CPACK_RPM_ABSOLUTE_INSTALL_FILES} %changelog \@CPACK_RPM_SPEC_CHANGELOG\@ diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index e44fa7b44..8ffcedcbf 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -461,6 +461,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( = this->GetOption("CPACK_INSTALL_CMAKE_PROJECTS"); const char* cmakeGenerator = this->GetOption("CPACK_CMAKE_GENERATOR"); + std::string absoluteDestFiles; if ( cmakeProjects && *cmakeProjects ) { if ( !cmakeGenerator ) @@ -735,6 +736,15 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( mf->AddDefinition("CMAKE_INSTALL_DO_STRIP", "1"); } int res = mf->ReadListFile(0, installFile.c_str()); + if (NULL !=mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES")) { + if (absoluteDestFiles.length()>0) { + absoluteDestFiles +=";"; + } + absoluteDestFiles += mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES"); + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Got some ABSOLUTE DESTINATION FILES: " + << absoluteDestFiles << std::endl); + } if ( cmSystemTools::GetErrorOccuredFlag() || !res ) { return 0; @@ -742,6 +752,7 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( } } } + this->SetOption("CPACK_ABSOLUTE_DESTINATION_FILES",absoluteDestFiles.c_str()); return 1; } diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx index 47ca769fe..9d5e416b8 100644 --- a/Source/cmInstallGenerator.cxx +++ b/Source/cmInstallGenerator.cxx @@ -60,6 +60,26 @@ void cmInstallGenerator } os << indent; std::string dest = this->GetInstallDestination(); + if (cmSystemTools::FileIsFullPath(dest.c_str())) + { + os << "list(APPEND CPACK_ABSOLUTE_DESTINATION_FILES\n"; + os << indent << " \""; + for(std::vector::const_iterator fi = files.begin(); + fi != files.end(); ++fi) + { + if (fi!=files.begin()) os << ";"; + os << dest << cmSystemTools::ConvertToOutputPath("/"); + if (rename && *rename) + { + os << rename; + } + else + { + os << cmSystemTools::GetFilenameName(*fi); + } + } + os << "\")\n"; + } os << "FILE(INSTALL DESTINATION \"" << dest << "\" TYPE " << stype.c_str(); if(optional) { From 63fbb2f67e9415981a00dbc09b39eddee40e6d3c Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 24 Aug 2010 10:53:19 -0400 Subject: [PATCH 008/152] Clarify install(TARGETS) docs for EXPORT option Explicitly state that a call to install(EXPORT) is also needed. --- Source/cmInstallCommand.h | 1 + 1 file changed, 1 insertion(+) diff --git a/Source/cmInstallCommand.h b/Source/cmInstallCommand.h index ea0a1ece3..8f6232272 100644 --- a/Source/cmInstallCommand.h +++ b/Source/cmInstallCommand.h @@ -175,6 +175,7 @@ public: "The EXPORT option associates the installed target files with an " "export called . " "It must appear before any RUNTIME, LIBRARY, or ARCHIVE options. " + "To actually install the export file itself, call install(EXPORT). " "See documentation of the install(EXPORT ...) signature below for " "details." "\n" From 2756311a9aa9b17bc451a1293d2cfb7e6e8e719b Mon Sep 17 00:00:00 2001 From: Clinton Stimpson Date: Tue, 24 Aug 2010 12:41:14 -0600 Subject: [PATCH 009/152] Make sure moc parameters file goes in binary directory. Fix bug 11120. Parameters files previously went into source directory when qt4_generate_moc() was given relative paths. Also simplified some logic for absolute paths. --- Modules/Qt4Macros.cmake | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Modules/Qt4Macros.cmake b/Modules/Qt4Macros.cmake index 10cf1d14b..700d3a246 100644 --- a/Modules/Qt4Macros.cmake +++ b/Modules/Qt4Macros.cmake @@ -129,7 +129,11 @@ MACRO (QT4_GENERATE_MOC infile outfile ) # get include dirs and flags QT4_GET_MOC_FLAGS(moc_flags) GET_FILENAME_COMPONENT(abs_infile ${infile} ABSOLUTE) - QT4_CREATE_MOC_COMMAND(${abs_infile} ${outfile} "${moc_flags}" "") + SET(_outfile "${outfile}") + IF(NOT IS_ABSOLUTE "${outfile}") + SET(_outfile "${CMAKE_CURRENT_BINARY_DIR}/${outfile}") + ENDIF(NOT IS_ABSOLUTE "${outfile}") + QT4_CREATE_MOC_COMMAND(${abs_infile} ${_outfile} "${moc_flags}" "") SET_SOURCE_FILES_PROPERTIES(${outfile} PROPERTIES SKIP_AUTOMOC TRUE) # dont run automoc on this file ENDMACRO (QT4_GENERATE_MOC) @@ -187,10 +191,9 @@ MACRO (QT4_ADD_RESOURCES outfiles ) SET(_RC_DEPENDS) FOREACH(_RC_FILE ${_RC_FILES}) STRING(REGEX REPLACE "^]*>" "" _RC_FILE "${_RC_FILE}") - STRING(REGEX MATCH "^/|([A-Za-z]:/)" _ABS_PATH_INDICATOR "${_RC_FILE}") - IF(NOT _ABS_PATH_INDICATOR) + IF(NOT IS_ABSOLUTE "${_RC_FILE}") SET(_RC_FILE "${rc_path}/${_RC_FILE}") - ENDIF(NOT _ABS_PATH_INDICATOR) + ENDIF(NOT IS_ABSOLUTE "${_RC_FILE}") SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}") ENDFOREACH(_RC_FILE) ADD_CUSTOM_COMMAND(OUTPUT ${outfile} From 33338781db35e5f86d2d11ae3b48be57a9d5e376 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Tue, 24 Aug 2010 21:24:54 +0200 Subject: [PATCH 010/152] Log the required package version and major improvement to FeatureSummary find_package() now also stores the required version automatically, so it can be used by FeatureSummary.cmake. This was one of the requested features for setting up nightly builds for KDE, since with this functionality it will be possible to write a file at the end of each project which lists all required packages and their versions. This file could then be compared for equality with an older one and if something has changed the build maintainer can be emailed. In FeatureSummary.cmake there is now a new function feature_summary(), which also allows to print the log to a file or into a variable. It also allows to specify whether to append to a file or to write a new one, and what information to log. Docs are still missing. Alex --- Modules/FeatureSummary.cmake | 91 ++++++++++++++++++++++++++++----- Source/cmFindPackageCommand.cxx | 14 +++++ 2 files changed, 91 insertions(+), 14 deletions(-) diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake index c4a97d582..8c14bc88b 100644 --- a/Modules/FeatureSummary.cmake +++ b/Modules/FeatureSummary.cmake @@ -9,13 +9,13 @@ # # PRINT_DISABLED_FEATURES() # Same as PRINT_ENABLED_FEATURES(), but for disabled features. It can -# be extended the same way by adding to the global property +# be extended the same way by adding to the global property # DISABLED_FEATURES. # # SET_FEATURE_INFO(NAME DESCRIPTION [URL [COMMENT] ] ) # Use this macro to set up information about the named feature, which will # then be displayed by PRINT_ENABLED/DISABLED_FEATURES(). -# Example: SET_FEATURE_INFO(LibXml2 "XML processing library." +# Example: SET_FEATURE_INFO(LibXml2 "XML processing library." # "http://xmlsoft.org/") # @@ -32,47 +32,110 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +INCLUDE(CMakeParseArguments) + FUNCTION(SET_FEATURE_INFO _name _desc) SET(_url "${ARGV2}") SET(_comment "${ARGV3}") - SET_PROPERTY(GLOBAL PROPERTY ${_name}_DESCRIPTION "${_desc}" ) + SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" ) IF(_url MATCHES ".+") - SET_PROPERTY(GLOBAL PROPERTY ${_name}_URL "${_url}" ) + SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_URL "${_url}" ) ENDIF(_url MATCHES ".+") IF(_comment MATCHES ".+") - SET_PROPERTY(GLOBAL PROPERTY ${_name}_COMMENT "${_comment}" ) + SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_COMMENT "${_comment}" ) ENDIF(_comment MATCHES ".+") ENDFUNCTION(SET_FEATURE_INFO) -FUNCTION(_PRINT_FEATURES _property _text) - SET(_currentFeatureText "${_text}") +FUNCTION(_FS_GET_FEATURE_SUMMARY _property _var) + SET(_currentFeatureText "") GET_PROPERTY(_EnabledFeatures GLOBAL PROPERTY ${_property}) FOREACH(_currentFeature ${_EnabledFeatures}) SET(_currentFeatureText "${_currentFeatureText}\n${_currentFeature}") - GET_PROPERTY(_info GLOBAL PROPERTY ${_currentFeature}_DESCRIPTION) + GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_REQUIRED_VERSION) + IF(_info) + SET(_currentFeatureText "${_currentFeatureText} (required version ${_info})") + ENDIF(_info) + GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_DESCRIPTION) IF(_info) SET(_currentFeatureText "${_currentFeatureText} , ${_info}") ENDIF(_info) - GET_PROPERTY(_info GLOBAL PROPERTY ${_currentFeature}_URL) + GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_URL) IF(_info) SET(_currentFeatureText "${_currentFeatureText} , <${_info}>") ENDIF(_info) - GET_PROPERTY(_info GLOBAL PROPERTY ${_currentFeature}_COMMENT) + GET_PROPERTY(_info GLOBAL PROPERTY _CMAKE_${_currentFeature}_COMMENT) IF(_info) SET(_currentFeatureText "${_currentFeatureText} , ${_info}") ENDIF(_info) ENDFOREACH(_currentFeature) - MESSAGE(STATUS "${_currentFeatureText}\n") -ENDFUNCTION(_PRINT_FEATURES) + SET(${_var} "${_currentFeatureText}" PARENT_SCOPE) +ENDFUNCTION(_FS_GET_FEATURE_SUMMARY) FUNCTION(PRINT_ENABLED_FEATURES) - _PRINT_FEATURES( ENABLED_FEATURES "Enabled features:") + FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:") ENDFUNCTION(PRINT_ENABLED_FEATURES) FUNCTION(PRINT_DISABLED_FEATURES) - _PRINT_FEATURES( DISABLED_FEATURES "Disabled features:") + FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:") ENDFUNCTION(PRINT_DISABLED_FEATURES) +# feature_summary(FILENAME foo.log +# APPEND TRUE +# VAR +# DESCRIPTION "Found packages:" +# WHAT [ALL PACKAGES_FOUND PACKAGES_NOT_FOUND ENABLED_FEATURES DISABLED_FEATURES] +# ) + + +FUNCTION(FEATURE_SUMMARY) +# CMAKE_PARSE_ARGUMENTS( args...) + SET(options APPEND) + SET(oneValueArgs FILENAME VAR DESCRIPTION WHAT) + SET(multiValueArgs ) # none + + CMAKE_PARSE_ARGUMENTS(_FS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${_FIRST_ARG} ${ARGN}) + + IF(_FS_UNPARSED_ARGUMENTS) + MESSAGE(FATAL_ERROR "Unknown keywords given to FEATURE_SUMMARY(): \"${_FS_UNPARSED_ARGUMENTS}\"") + ENDIF(_FS_UNPARSED_ARGUMENTS) + + IF(NOT _FS_WHAT) + MESSAGE(FATAL_ERROR "The call to FEATURE_SUMMAY() doesn't set the required WHAT argument.") + ENDIF(NOT _FS_WHAT) + + IF( "${_FS_WHAT}" STREQUAL "ENABLED_FEATURES" + OR "${_FS_WHAT}" STREQUAL "DISABLED_FEATURES" + OR "${_FS_WHAT}" STREQUAL "PACKAGES_FOUND" + OR "${_FS_WHAT}" STREQUAL "PACKAGES_NOT_FOUND") + _FS_GET_FEATURE_SUMMARY( ${_FS_WHAT} _featureSummary) + ELSEIF("${_FS_WHAT}" STREQUAL "ALL") + _FS_GET_FEATURE_SUMMARY( PACKAGES_FOUND _tmp1) + _FS_GET_FEATURE_SUMMARY( PACKAGES_NOT_FOUND _tmp2) + SET(_featureSummary "${_tmp1}${_tmp2}") + ELSE() + MESSAGE(FATAL_ERROR "The WHAT argument of FEATURE_SUMMARY() is set to ${_FS_WHAT}, which is not a valid value.") + ENDIF() + + SET(_fullText "${_FS_DESCRIPTION}${_featureSummary}\n") + + IF(_FS_FILENAME) + IF(_FS_APPEND) + FILE(WRITE "${_FS_FILENAME}" "${_fullText}") + ELSE(_FS_APPEND) + FILE(APPEND "${_FS_FILENAME}" "${_fullText}") + ENDIF(_FS_APPEND) + + ELSE(_FS_FILENAME) + IF(NOT _FS_VAR) + MESSAGE(STATUS "${_fullText}") + ENDIF(NOT _FS_VAR) + ENDIF(_FS_FILENAME) + + IF(_FS_VAR) + SET(${_FS_VAR} "${_fullText}" PARENT_SCOPE) + ENDIF(_FS_VAR) + +ENDFUNCTION(FEATURE_SUMMARY) diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index eb860143e..5c05ecbb0 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -1083,6 +1083,20 @@ void cmFindPackageCommand::AppendSuccessInformation() } } + // set a global property to record the required version of this package + std::string versionInfoPropName = "_CMAKE_"; + versionInfoPropName += this->Name; + versionInfoPropName += "_REQUIRED_VERSION"; + std::string versionInfo; + if(!this->Version.empty()) + { + versionInfo = this->VersionExact ? "==" : ">="; + versionInfo += " "; + versionInfo += this->Version; + } + this->Makefile->GetCMakeInstance()->SetProperty(versionInfoPropName.c_str(), + versionInfo.c_str()); + // Restore original state of "_FIND_" variables we set. this->RestoreFindDefinitions(); } From 36a550ae7a6d903bae2eaf950a18131251ffce03 Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Tue, 24 Aug 2010 21:41:32 +0200 Subject: [PATCH 011/152] CPackArchiveGenerator use cmArchiveWrite wrapper --- Source/CPack/cmCPackArchiveGenerator.cxx | 226 +++---------------- Source/CPack/cmCPackArchiveGenerator.h | 13 +- Source/CPack/cmCPackTGZGenerator.cxx | 4 +- Source/CPack/cmCPackTarBZip2Generator.cxx | 4 +- Source/CPack/cmCPackTarCompressGenerator.cxx | 4 +- Source/CPack/cmCPackZIPGenerator.cxx | 4 +- 6 files changed, 47 insertions(+), 208 deletions(-) diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 8799330ca..01a6cf1e7 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -25,8 +25,8 @@ #include //---------------------------------------------------------------------- -cmCPackArchiveGenerator::cmCPackArchiveGenerator(CompressType t, - ArchiveType at) +cmCPackArchiveGenerator::cmCPackArchiveGenerator(cmArchiveWrite::Compress t, + cmArchiveWrite::Type at) { this->Compress = t; this->Archive = at; @@ -37,126 +37,6 @@ cmCPackArchiveGenerator::~cmCPackArchiveGenerator() { } -static const size_t cmCPackTGZ_Data_BlockSize = 16384; - -// make this an anonymous namespace so that archive.h does not -// have to be included in the .h file for this class -namespace -{ -bool SetArchiveType(struct archive* a, - cmCPackArchiveGenerator::CompressType ct, - cmCPackArchiveGenerator::ArchiveType at) -{ - int res = 0; - // pick the archive type - switch(at) - { - case cmCPackArchiveGenerator::TAR: - // maybe this: - res = archive_write_set_format_pax_restricted(a); - break; - case cmCPackArchiveGenerator::ZIP: - res = archive_write_set_format_zip(a); - break; - } - if(res != ARCHIVE_OK) - { - return false; - } - - // pick a compression type - switch(ct) - { - case cmCPackArchiveGenerator::GZIP: - res = archive_write_set_compression_gzip(a); - break; - case cmCPackArchiveGenerator::BZIP2: - res = archive_write_set_compression_bzip2(a); - break; - case cmCPackArchiveGenerator::COMPRESS: - res = archive_write_set_compression_compress(a); - break; - case cmCPackArchiveGenerator::LZMA: - res = archive_write_set_compression_lzma(a); - break; - case cmCPackArchiveGenerator::NONE: - default: - res = archive_write_set_compression_none(a); - } - if(res != ARCHIVE_OK) - { - return false; - } - // do not pad the last block!! - res = archive_write_set_bytes_in_last_block(a, 1); - if(res != ARCHIVE_OK) - { - return false; - } - - return true; -} - -struct StreamData -{ - StreamData(cmGeneratedFileStream* gfs, - cmCPackArchiveGenerator* ag) - { - this->GeneratedFileStream = gfs; - this->Generator = ag; - } - cmGeneratedFileStream* GeneratedFileStream; - cmCPackArchiveGenerator* Generator; -}; - - -extern "C" -{ -int OpenArchive(struct archive *, void *client_data) -{ - struct StreamData *data = (StreamData*)client_data; - if(data->GeneratedFileStream && - *data->GeneratedFileStream) - { - if(data->Generator-> - GenerateHeader(data->GeneratedFileStream)) - { - return ARCHIVE_OK; - } - } - return (ARCHIVE_FATAL); -} - -__LA_SSIZE_T WriteArchive(struct archive *, - void *client_data, - const void *buff, - size_t n) -{ - struct StreamData *data = (StreamData*)client_data; - data->GeneratedFileStream-> - write(reinterpret_cast(buff),n); - if(!data->GeneratedFileStream->bad()) - { - return n; - } - return 0; -} - - -int CloseArchive(struct archive *, void *client_data) -{ - struct StreamData *data = (StreamData*)client_data; - if(data->GeneratedFileStream->Close()) - { - delete data->GeneratedFileStream; - return ARCHIVE_OK; - } - return ARCHIVE_FATAL; -} -} //extern C -} // anon name space - - //---------------------------------------------------------------------- int cmCPackArchiveGenerator::InitializeInternal() { @@ -166,93 +46,51 @@ int cmCPackArchiveGenerator::InitializeInternal() int cmCPackArchiveGenerator::PackageFiles() { - int res = ARCHIVE_OK; -#define CHECK_ARCHIVE_ERROR(res, msg) \ - if(res != ARCHIVE_OK) \ - {\ - cmCPackLogger(cmCPackLog::LOG_ERROR, msg \ - << archive_error_string(a) \ - << cmSystemTools::GetLastSystemError() \ - << " " << res \ - << "\n"); \ - } cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: " << toplevel << std::endl); - // create a new archive - struct archive* a = archive_write_new(); - // Set the compress and archive types for the archive - SetArchiveType(a, this->Compress, this->Archive); // Open binary stream - cmGeneratedFileStream* gf = new cmGeneratedFileStream; - gf->Open(packageFileNames[0].c_str(), false, true); - StreamData data(gf, this); - // pass callbacks to archive_write_open to handle stream - res = archive_write_open(a, - &data, - OpenArchive, - WriteArchive, - CloseArchive); - CHECK_ARCHIVE_ERROR(res, "archive_write_open:"); - // create a new disk struct - struct archive* disk = archive_read_disk_new(); -#if !defined(_WIN32) || defined(__CYGWIN__) - res = archive_read_disk_set_standard_lookup(disk); -#endif - CHECK_ARCHIVE_ERROR(res, "archive_read_disk_set_standard_lookup:"); + cmGeneratedFileStream gf; + gf.Open(packageFileNames[0].c_str(), false, true); + // Add an eventual header to the archive + if (!GenerateHeader(&gf)) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem to generate Header for archive < " + << packageFileNames[0] + << ">." << std::endl); + } + // create a new archive + cmArchiveWrite archive(gf,this->Compress, this->Archive); + if (!archive) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem to create archive < " + << packageFileNames[0] + << ">. ERROR =" + << archive.GetError() + << std::endl); + return 0; + } std::vector::const_iterator fileIt; std::string dir = cmSystemTools::GetCurrentWorkingDirectory(); cmSystemTools::ChangeDirectory(toplevel.c_str()); for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt ) { - // create a new entry for each file - struct archive_entry *entry = archive_entry_new(); // Get the relative path to the file std::string rp = cmSystemTools::RelativePath(toplevel.c_str(), fileIt->c_str()); - // Set the name of the entry to the file name - archive_entry_set_pathname(entry, rp.c_str()); - res = archive_read_disk_entry_from_file(disk, entry, -1, 0); - CHECK_ARCHIVE_ERROR(res, "archive_read_disk_entry_from_file:"); - // write entry header - res = archive_write_header(a, entry); - CHECK_ARCHIVE_ERROR(res, "archive_write_header:"); - // the entry size can be 0 if it is a symlink - if(archive_entry_size(entry) > 0) + archive.Add(rp); + if(!archive) { - // now copy contents of file into archive a - FILE* file = fopen(fileIt->c_str(), "rb"); - if(!file) - { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem with fopen(): " - << fileIt->c_str() - << strerror(errno) - << std::endl); - return 0; - } - char buff[cmCPackTGZ_Data_BlockSize]; - size_t len = fread(buff, 1, sizeof(buff), file); - while (len > 0) - { - size_t wlen = archive_write_data(a, buff, len); - if(wlen != len) - { - cmCPackLogger(cmCPackLog::LOG_ERROR, "archive_write_data(): " - << "tried to write " << len << "\n" - << "write " << wlen << "\n"); - return 0; - } - len = fread(buff, 1, sizeof(buff), file); - } - // close the file and free the entry - fclose(file); + cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem while adding file< " + << *fileIt + << "> to archive <" + << packageFileNames[0] << "> .ERROR =" + << archive.GetError() + << std::endl); + return 0; } - archive_entry_free(entry); } cmSystemTools::ChangeDirectory(dir.c_str()); - // close the archive and finish the write - archive_write_close(a); - archive_write_finish(a); - archive_read_finish(disk); + // The destructor of cmArchiveWrite will close and finish the write return 1; } diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h index d3409ae46..49ae11279 100644 --- a/Source/CPack/cmCPackArchiveGenerator.h +++ b/Source/CPack/cmCPackArchiveGenerator.h @@ -13,24 +13,25 @@ #ifndef cmCPackArchiveGenerator_h #define cmCPackArchiveGenerator_h +#include "cmArchiveWrite.h" #include "cmCPackGenerator.h" /** \class cmCPackArchiveGenerator - * \brief A generator base for libarchive generation + * \brief A generator base for libarchive generation. + * The generator itself uses the libarchive wrapper + * \ref cmArchiveWrite. * */ class cmCPackArchiveGenerator : public cmCPackGenerator { public: - enum CompressType{ GZIP, BZIP2, COMPRESS, LZMA, NONE}; - enum ArchiveType{ TAR, ZIP}; cmTypeMacro(cmCPackArchiveGenerator, cmCPackGenerator); /** * Construct generator */ - cmCPackArchiveGenerator(CompressType, ArchiveType); + cmCPackArchiveGenerator(cmArchiveWrite::Compress, cmArchiveWrite::Type); virtual ~cmCPackArchiveGenerator(); // Used to add a header to the archive virtual int GenerateHeader(std::ostream* os); @@ -39,8 +40,8 @@ protected: virtual int InitializeInternal(); int PackageFiles(); virtual const char* GetOutputExtension() = 0; - CompressType Compress; - ArchiveType Archive; + cmArchiveWrite::Compress Compress; + cmArchiveWrite::Type Archive; }; #endif diff --git a/Source/CPack/cmCPackTGZGenerator.cxx b/Source/CPack/cmCPackTGZGenerator.cxx index c6ef8ae1e..509c7f80a 100644 --- a/Source/CPack/cmCPackTGZGenerator.cxx +++ b/Source/CPack/cmCPackTGZGenerator.cxx @@ -14,8 +14,8 @@ //---------------------------------------------------------------------- cmCPackTGZGenerator::cmCPackTGZGenerator() - :cmCPackArchiveGenerator(cmCPackArchiveGenerator::GZIP, - cmCPackArchiveGenerator::TAR) + :cmCPackArchiveGenerator(cmArchiveWrite::CompressGZip, + cmArchiveWrite::TypeTAR) { } diff --git a/Source/CPack/cmCPackTarBZip2Generator.cxx b/Source/CPack/cmCPackTarBZip2Generator.cxx index 52826dc18..971d16667 100644 --- a/Source/CPack/cmCPackTarBZip2Generator.cxx +++ b/Source/CPack/cmCPackTarBZip2Generator.cxx @@ -13,8 +13,8 @@ #include "cmCPackTarBZip2Generator.h" //---------------------------------------------------------------------- cmCPackTarBZip2Generator::cmCPackTarBZip2Generator() - :cmCPackArchiveGenerator(cmCPackArchiveGenerator::BZIP2, - cmCPackArchiveGenerator::TAR) + :cmCPackArchiveGenerator(cmArchiveWrite::CompressBZip2, + cmArchiveWrite::TypeTAR) { } diff --git a/Source/CPack/cmCPackTarCompressGenerator.cxx b/Source/CPack/cmCPackTarCompressGenerator.cxx index e9b5e2e87..7a8f697c0 100644 --- a/Source/CPack/cmCPackTarCompressGenerator.cxx +++ b/Source/CPack/cmCPackTarCompressGenerator.cxx @@ -14,8 +14,8 @@ //---------------------------------------------------------------------- cmCPackTarCompressGenerator::cmCPackTarCompressGenerator() - :cmCPackArchiveGenerator(cmCPackArchiveGenerator::COMPRESS, - cmCPackArchiveGenerator::TAR) + :cmCPackArchiveGenerator(cmArchiveWrite::CompressCompress, + cmArchiveWrite::TypeTAR) { } diff --git a/Source/CPack/cmCPackZIPGenerator.cxx b/Source/CPack/cmCPackZIPGenerator.cxx index e195f83c7..e6e4e77d0 100644 --- a/Source/CPack/cmCPackZIPGenerator.cxx +++ b/Source/CPack/cmCPackZIPGenerator.cxx @@ -14,8 +14,8 @@ //---------------------------------------------------------------------- cmCPackZIPGenerator::cmCPackZIPGenerator() - :cmCPackArchiveGenerator(cmCPackArchiveGenerator::NONE, - cmCPackArchiveGenerator::ZIP) + :cmCPackArchiveGenerator(cmArchiveWrite::CompressNone, + cmArchiveWrite::TypeZIP) { } From 654683adc7ebd504b200332d2fbb387668b70cb2 Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Tue, 24 Aug 2010 21:42:21 +0200 Subject: [PATCH 012/152] CPackArchiveGenerator add component supports --- Source/CPack/cmCPackArchiveGenerator.cxx | 204 +++++++++++++++++++++-- Source/CPack/cmCPackArchiveGenerator.h | 32 +++- Source/CPack/cmCPackGenerator.cxx | 10 +- 3 files changed, 223 insertions(+), 23 deletions(-) diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 01a6cf1e7..532cba302 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -22,6 +22,7 @@ #include #include +#include #include //---------------------------------------------------------------------- @@ -43,33 +44,198 @@ int cmCPackArchiveGenerator::InitializeInternal() this->SetOptionIfNotSet("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", "1"); return this->Superclass::InitializeInternal(); } +//---------------------------------------------------------------------- +int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive, + cmCPackComponent* component) +{ + cmCPackLogger(cmCPackLog::LOG_VERBOSE, " - packaging component: " + << component->Name + << std::endl); + // Add the files of this component to the archive + std::string localToplevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY")); + localToplevel += "/"+ component->Name; + std::string dir = cmSystemTools::GetCurrentWorkingDirectory(); + // Change to local toplevel + cmSystemTools::ChangeDirectory(localToplevel.c_str()); + std::vector::const_iterator fileIt; + for (fileIt = component->Files.begin(); fileIt != component->Files.end(); ++fileIt ) + { + cmCPackLogger(cmCPackLog::LOG_DEBUG,"Adding file: " << (*fileIt) << std::endl); + archive.Add(*fileIt); + if (!archive) + { + cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: " + << archive.GetError() + << std::endl); + return 0; + } + } + // Go back to previous dir + cmSystemTools::ChangeDirectory(dir.c_str()); + return 1; +} +/* + * The macro will open/create a file 'filename' + * an declare and open the associated + * cmArchiveWrite 'archive' object. + */ +#define DECLARE_AND_OPEN_ARCHIVE(filename,archive) \ +cmGeneratedFileStream gf; \ +gf.Open(filename.c_str(), false, true); \ +if (!GenerateHeader(&gf)) \ + { \ + cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem to generate Header for archive < " \ + << filename \ + << ">." << std::endl); \ + return 0; \ + } \ +cmArchiveWrite archive(gf,this->Compress, this->Archive); \ +if (!archive) \ + { \ + cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem to create archive < " \ + << filename \ + << ">. ERROR =" \ + << archive.GetError() \ + << std::endl); \ + return 0; \ + } + +//---------------------------------------------------------------------- +int cmCPackArchiveGenerator::PackageComponents(bool ignoreComponentGroup) +{ + packageFileNames.clear(); + // The default behavior is to have one package by component group + // unless CPACK_COMPONENTS_IGNORE_GROUP is specified. + if (!ignoreComponentGroup) + { + std::map::iterator compGIt; + for (compGIt=this->ComponentGroups.begin(); + compGIt!=this->ComponentGroups.end(); ++compGIt) + { + cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging component group: " + << compGIt->first + << std::endl); + // Begin the archive for this group + std::string packageFileName= std::string(toplevel); + packageFileName += "/"+std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))+"-"+compGIt->first + this->GetOutputExtension(); + // open a block in order to automatically close archive + // at the end of the block + { + DECLARE_AND_OPEN_ARCHIVE(packageFileName,archive); + // now iterate over the component of this group + std::vector::iterator compIt; + for (compIt=(compGIt->second).Components.begin(); + compIt!=(compGIt->second).Components.end(); + ++compIt) + { + // Add the files of this component to the archive + addOneComponentToArchive(archive,*compIt); + } + } + // add the generated package to package file names list + packageFileNames.push_back(packageFileName); + } + } + // CPACK_COMPONENTS_IGNORE_GROUPS is set + // We build 1 package per component + else + { + std::map::iterator compIt; + for (compIt=this->Components.begin();compIt!=this->Components.end(); ++compIt ) + { + std::string localToplevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY")); + std::string packageFileName = std::string(toplevel); + + localToplevel += "/"+ compIt->first; + packageFileName += "/"+std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))+"-"+compIt->first + this->GetOutputExtension(); + { + DECLARE_AND_OPEN_ARCHIVE(packageFileName,archive); + // Add the files of this component to the archive + addOneComponentToArchive(archive,&(compIt->second)); + } + // add the generated package to package file names list + packageFileNames.push_back(packageFileName); + } + } + return 1; +} + +//---------------------------------------------------------------------- +int cmCPackArchiveGenerator::PackageComponentsAllInOne(bool allComponentInOne) +{ + // reset the package file names + packageFileNames.clear(); + packageFileNames.push_back(std::string(toplevel)); + packageFileNames[0] += "/"+std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))+"-ALL" + this->GetOutputExtension(); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging all groups in one package...(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE is set)" + << std::endl); + DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0],archive); + + // The ALL GROUP in ONE package case + if (! allComponentInOne) { + // iterate over the component groups + std::map::iterator compGIt; + for (compGIt=this->ComponentGroups.begin(); + compGIt!=this->ComponentGroups.end(); ++compGIt) + { + cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging component group: " + << compGIt->first + << std::endl); + // now iterate over the component of this group + std::vector::iterator compIt; + for (compIt=(compGIt->second).Components.begin(); + compIt!=(compGIt->second).Components.end(); + ++compIt) + { + // Add the files of this component to the archive + addOneComponentToArchive(archive,*compIt); + } + } + } + // The ALL COMPONENT in ONE package case + else + { + std::map::iterator compIt; + for (compIt=this->Components.begin();compIt!=this->Components.end(); ++compIt ) + { + // Add the files of this component to the archive + addOneComponentToArchive(archive,&(compIt->second)); + } + } + // archive goes out of scope so it will finalized and closed. + return 1; +} + +//---------------------------------------------------------------------- int cmCPackArchiveGenerator::PackageFiles() { cmCPackLogger(cmCPackLog::LOG_DEBUG, "Toplevel: " << toplevel << std::endl); - // Open binary stream - cmGeneratedFileStream gf; - gf.Open(packageFileNames[0].c_str(), false, true); - // Add an eventual header to the archive - if (!GenerateHeader(&gf)) + // The default behavior is to create 1 package by component group + // unless the user asked to put all COMPONENTS in a single package + bool allGroupInOne = (NULL != (this->GetOption("CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE"))); + bool allComponentInOne = (NULL != (this->GetOption("CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE"))); + bool ignoreComponentGroup = ( NULL != (this->GetOption("CPACK_COMPONENTS_IGNORE_GROUPS"))); + // CASE 1 : COMPONENT ALL-IN-ONE package + // If ALL GROUPS or ALL COMPONENTS in ONE package has been requested + // then the package file is unique and should be open here. + if ((allComponentInOne || allGroupInOne) && (!this->ComponentGroups.empty())) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem to generate Header for archive < " - << packageFileNames[0] - << ">." << std::endl); + return PackageComponentsAllInOne(allComponentInOne); } - // create a new archive - cmArchiveWrite archive(gf,this->Compress, this->Archive); - if (!archive) + // CASE 2 : COMPONENT CLASSICAL package(s) (i.e. not all-in-one) + // There will be 1 package for each component group + // however one may require to ignore component group and + // in this case you'll get 1 package for each component. + else if (!this->ComponentGroups.empty()) { - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem to create archive < " - << packageFileNames[0] - << ">. ERROR =" - << archive.GetError() - << std::endl); - return 0; + return PackageComponents(ignoreComponentGroup); } + + // CASE 3 : NON COMPONENT package. + DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0],archive); std::vector::const_iterator fileIt; std::string dir = cmSystemTools::GetCurrentWorkingDirectory(); cmSystemTools::ChangeDirectory(toplevel.c_str()); @@ -99,3 +265,7 @@ int cmCPackArchiveGenerator::GenerateHeader(std::ostream*) { return 1; } + +bool cmCPackArchiveGenerator::SupportsComponentInstallation() const { + return true; +} diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h index 49ae11279..ae545c888 100644 --- a/Source/CPack/cmCPackArchiveGenerator.h +++ b/Source/CPack/cmCPackArchiveGenerator.h @@ -24,7 +24,7 @@ * */ class cmCPackArchiveGenerator : public cmCPackGenerator -{ + { public: cmTypeMacro(cmCPackArchiveGenerator, cmCPackGenerator); @@ -35,13 +35,39 @@ public: virtual ~cmCPackArchiveGenerator(); // Used to add a header to the archive virtual int GenerateHeader(std::ostream* os); - + // component support + virtual bool SupportsComponentInstallation() const; protected: virtual int InitializeInternal(); + /** + * Add the files belonging to the specified component + * to the provided (already opened) archive. + * @param[in,out] archive the archive object + * @param[in] component the component whose file will be added to archive + */ + int addOneComponentToArchive(cmArchiveWrite& archive, cmCPackComponent* component); + + /** + * The main package file method. + * If component install was required this + * method will call either PackageComponents or + * PackageComponentsAllInOne. + */ int PackageFiles(); + /** + * The method used to package files when component + * install is used. This will create one + * archive for each component group. + */ + int PackageComponents(bool ignoreComponentGroup); + /** + * Special case of component install where all + * components will be put in a single installer. + */ + int PackageComponentsAllInOne(bool allComponentInOne); virtual const char* GetOutputExtension() = 0; cmArchiveWrite::Compress Compress; cmArchiveWrite::Type Archive; -}; + }; #endif diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 4ae2d1fe6..ca3f0748c 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -828,8 +828,8 @@ int cmCPackGenerator::DoPackage() return 0; } - cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Compress package" << std::endl); - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Compress files to: " + cmCPackLogger(cmCPackLog::LOG_OUTPUT, "Create package" << std::endl); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Package files to: " << (tempPackageFileName ? tempPackageFileName : "(NULL)") << std::endl); if ( cmSystemTools::FileExists(tempPackageFileName) ) { @@ -853,7 +853,10 @@ int cmCPackGenerator::DoPackage() std::vector::const_iterator it; for ( it = files.begin(); it != files.end(); ++ it ) { - std::string fileN = cmSystemTools::RelativePath(tempDirectory, + // beware we cannot just use tempDirectory as before + // because some generator will "CPACK_INCLUDE_TOPLEVEL_DIRECTORY" + // we really want "CPACK_TEMPORARY_DIRECTORY" + std::string fileN = cmSystemTools::RelativePath(this->GetOption("CPACK_TEMPORARY_DIRECTORY"), it->c_str()); // Determine which component we are in. @@ -864,6 +867,7 @@ int cmCPackGenerator::DoPackage() // Add this file to the list of files for the component. this->Components[componentName].Files.push_back(fileN); + cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file <" < to component <"<"< Date: Tue, 24 Aug 2010 21:42:54 +0200 Subject: [PATCH 013/152] CPackArchiveGenerator improve usability and robustness Handle the "no group defined" case Implement the idea from Rolf Eike Beer to have a single var CPACK_COMPONENTS_GROUPING with several values --- Source/CPack/cmCPackArchiveGenerator.cxx | 48 +++++++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 532cba302..79ccdd9e9 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -218,10 +218,54 @@ int cmCPackArchiveGenerator::PackageFiles() bool allGroupInOne = (NULL != (this->GetOption("CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE"))); bool allComponentInOne = (NULL != (this->GetOption("CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE"))); bool ignoreComponentGroup = ( NULL != (this->GetOption("CPACK_COMPONENTS_IGNORE_GROUPS"))); + + std::string groupingType; + + // Second way to specify grouping + if (NULL != this->GetOption("CPACK_COMPONENTS_GROUPING")) { + groupingType = this->GetOption("CPACK_COMPONENTS_GROUPING"); + } + + if (groupingType.length()>0) + { + cmCPackLogger(cmCPackLog::LOG_VERBOSE, "[" + << this->Name << "]" + << " requested component grouping = "<< groupingType <Name << "]" + << " requested component grouping type <"<< groupingType + << "> UNKNOWN not in (ALL_GROUP_IN_ONE,ALL_COMPONENT_IN_ONE,IGNORE)" <ComponentGroups.empty() && (!this->Components.empty()) && (!ignoreComponentGroup)) { + cmCPackLogger(cmCPackLog::LOG_WARNING, "[" + << this->Name << "]" + << " Some Components defined but NO component group:" + << " Ignoring component group." + << std::endl); + ignoreComponentGroup = true; + } // CASE 1 : COMPONENT ALL-IN-ONE package // If ALL GROUPS or ALL COMPONENTS in ONE package has been requested // then the package file is unique and should be open here. - if ((allComponentInOne || allGroupInOne) && (!this->ComponentGroups.empty())) + if (allComponentInOne || (allGroupInOne && (!this->ComponentGroups.empty()))) { return PackageComponentsAllInOne(allComponentInOne); } @@ -229,7 +273,7 @@ int cmCPackArchiveGenerator::PackageFiles() // There will be 1 package for each component group // however one may require to ignore component group and // in this case you'll get 1 package for each component. - else if (!this->ComponentGroups.empty()) + else if ((!this->ComponentGroups.empty()) || (ignoreComponentGroup)) { return PackageComponents(ignoreComponentGroup); } From 6fc88b26b6c7b9733714ae99a4cc20680ef8ba36 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Tue, 24 Aug 2010 22:59:01 +0200 Subject: [PATCH 014/152] Improve documentation. Alex --- Modules/FeatureSummary.cmake | 78 ++++++++++++++++++++++++++---------- 1 file changed, 57 insertions(+), 21 deletions(-) diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake index 8c14bc88b..f578649a6 100644 --- a/Modules/FeatureSummary.cmake +++ b/Modules/FeatureSummary.cmake @@ -1,23 +1,65 @@ # - Macros for generating a summary of enabled/disabled features # -# PRINT_ENABLED_FEATURES() -# Print a summary of all enabled features. By default all successfull -# FIND_PACKAGE() calls will appear here, except the ones which used the -# QUIET keyword. Additional features can be added by appending an entry -# to the global ENABLED_FEATURES property. If SET_FEATURE_INFO() is -# used for that feature, the output will be much more informative. +# FEATURE_SUMMARY( [FILENAME ] +# [APPEND] +# [VAR ] +# [DESCRIPTION "Found packages:"] +# WHAT (ALL | PACKAGES_FOUND | PACKAGES_NOT_FOUND | ENABLED_FEATURES | DISABLED_FEATURES] +# ) # -# PRINT_DISABLED_FEATURES() -# Same as PRINT_ENABLED_FEATURES(), but for disabled features. It can -# be extended the same way by adding to the global property -# DISABLED_FEATURES. +# The FEATURE_SUMMARY() macro can be used to print information about enabled +# or disabled features or packages of a project. +# By default, only the names of the features/packages will be printed and their +# required version when one was specified. Use SET_FEATURE_INFO() to add more +# useful information, like e.g. a download URL for the respective package. # -# SET_FEATURE_INFO(NAME DESCRIPTION [URL [COMMENT] ] ) -# Use this macro to set up information about the named feature, which will -# then be displayed by PRINT_ENABLED/DISABLED_FEATURES(). -# Example: SET_FEATURE_INFO(LibXml2 "XML processing library." -# "http://xmlsoft.org/") +# The WHAT option is the only mandatory option. Here you specify what information +# will be printed: +# ENABLED_FEATURES: the list of all packages which have been found, excluding the QUIET ones +# DISABLED_FEATURES: the list of all packages which have not been found, excluding the QUIET ones +# PACKAGES_FOUND: the list of all packages which have been found, including the QUIET ones +# PACKAGES_NOT_FOUND: the list of all packages which have not been found, including the QUIET ones +# ALL: this will give all packages which have or have not been found # +# If a FILENAME is given, the information is printed into this file. If APPEND +# is used, it is appended to this file, otherwise the file is overwritten if +# it already existed. +# If the VAR option is used, the information is "printed" into the specified +# variable. +# If FILENAME is not used, the information is printed to the terminal. +# Using the DESCRIPTION option a description or headline can be set which will +# be printed above the actual content. +# +# Example 1, append everything to a file: +# FEATURE_SUMMARY(WHAT ALL +# FILENAME ${CMAKE_BINARY_DIR}/all.log APPEND) +# +# Example 2, print the enabled features into the variable enabledFeaturesText: +# FEATURE_SUMMARY(WHAT ENABLED_FEATURES +# DESCRIPTION "Enabled Features:" +# VAR enabledFeaturesText) +# MESSAGE(STATUS "${enabledFeaturesText}") +# +# +# +# SET_FEATURE_INFO(NAME DESCRIPTION [URL [COMMENT] ] ) +# Use this macro to set up information about the named feature, which can +# then be displayed via FEATURE_SUMMARY() or PRINT_ENABLED/DISABLED_FEATURES(). +# This can be done either directly in the Find-module or in the project +# which uses the module after the FIND_PACKAGE() call. +# The features for which information can be set are added automatically by the +# find_package() command. If you want to add additional features, you can add +# them by appending them to the global ENABLED_FEATURES, DISABLED_FEATURES, +# PACKAGES_FOUND and PACKAGES_NOT_FOUND properties. +# +# Example: +# SET_FEATURE_INFO(LibXml2 "XML processing library." "http://xmlsoft.org/") +# +# PRINT_ENABLED_FEATURES() +# Does the same as FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:") +# +# PRINT_DISABLED_FEATURES() +# Does the same as FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:") #============================================================================= # Copyright 2007-2009 Kitware, Inc. @@ -82,12 +124,6 @@ FUNCTION(PRINT_DISABLED_FEATURES) FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:") ENDFUNCTION(PRINT_DISABLED_FEATURES) -# feature_summary(FILENAME foo.log -# APPEND TRUE -# VAR -# DESCRIPTION "Found packages:" -# WHAT [ALL PACKAGES_FOUND PACKAGES_NOT_FOUND ENABLED_FEATURES DISABLED_FEATURES] -# ) FUNCTION(FEATURE_SUMMARY) From b35352464c9eee0f4b07fef23a7920225e1928e0 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Tue, 24 Aug 2010 23:08:41 +0200 Subject: [PATCH 015/152] Improve wording of the documentation. Alex --- Modules/FeatureSummary.cmake | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake index f578649a6..065c31160 100644 --- a/Modules/FeatureSummary.cmake +++ b/Modules/FeatureSummary.cmake @@ -15,8 +15,8 @@ # # The WHAT option is the only mandatory option. Here you specify what information # will be printed: -# ENABLED_FEATURES: the list of all packages which have been found, excluding the QUIET ones -# DISABLED_FEATURES: the list of all packages which have not been found, excluding the QUIET ones +# ENABLED_FEATURES: the list of all features and packages which have been found, excluding the QUIET ones +# DISABLED_FEATURES: the list of all features and packages which have not been found, excluding the QUIET ones # PACKAGES_FOUND: the list of all packages which have been found, including the QUIET ones # PACKAGES_NOT_FOUND: the list of all packages which have not been found, including the QUIET ones # ALL: this will give all packages which have or have not been found @@ -49,15 +49,17 @@ # which uses the module after the FIND_PACKAGE() call. # The features for which information can be set are added automatically by the # find_package() command. If you want to add additional features, you can add -# them by appending them to the global ENABLED_FEATURES, DISABLED_FEATURES, -# PACKAGES_FOUND and PACKAGES_NOT_FOUND properties. +# them by appending them to the global ENABLED_FEATURES or DISABLED_FEATURES properties. # -# Example: +# Example for setting the info for a package: +# FIND_PACKAGE(LibXml2) # SET_FEATURE_INFO(LibXml2 "XML processing library." "http://xmlsoft.org/") # +# # PRINT_ENABLED_FEATURES() # Does the same as FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:") # +# # PRINT_DISABLED_FEATURES() # Does the same as FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:") From 807fca4ce67e4c95133082060b82fdecca30fcde Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Mon, 16 Aug 2010 21:49:14 +0200 Subject: [PATCH 016/152] VS: Convert PlatformName member to a virtual method --- Source/cmGlobalVisualStudio10Generator.cxx | 2 +- Source/cmGlobalVisualStudio10Win64Generator.cxx | 1 - Source/cmGlobalVisualStudio10Win64Generator.h | 2 ++ Source/cmGlobalVisualStudio8Generator.cxx | 14 +++++++------- Source/cmGlobalVisualStudio8Generator.h | 5 ++--- Source/cmGlobalVisualStudio8Win64Generator.cxx | 3 +-- Source/cmGlobalVisualStudio8Win64Generator.h | 2 ++ Source/cmGlobalVisualStudio9Generator.cxx | 1 + Source/cmGlobalVisualStudio9Win64Generator.cxx | 3 +-- Source/cmGlobalVisualStudio9Win64Generator.h | 2 ++ 10 files changed, 19 insertions(+), 16 deletions(-) diff --git a/Source/cmGlobalVisualStudio10Generator.cxx b/Source/cmGlobalVisualStudio10Generator.cxx index 691502f1a..403507f98 100644 --- a/Source/cmGlobalVisualStudio10Generator.cxx +++ b/Source/cmGlobalVisualStudio10Generator.cxx @@ -40,7 +40,7 @@ void cmGlobalVisualStudio10Generator::WriteSLNHeader(std::ostream& fout) cmLocalGenerator *cmGlobalVisualStudio10Generator::CreateLocalGenerator() { cmLocalVisualStudio10Generator* lg = new cmLocalVisualStudio10Generator; - lg->SetPlatformName(this->PlatformName.c_str()); + lg->SetPlatformName(this->GetPlatformName()); lg->SetGlobalGenerator(this); return lg; } diff --git a/Source/cmGlobalVisualStudio10Win64Generator.cxx b/Source/cmGlobalVisualStudio10Win64Generator.cxx index 1004fa98f..109b60d1f 100644 --- a/Source/cmGlobalVisualStudio10Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio10Win64Generator.cxx @@ -16,7 +16,6 @@ //---------------------------------------------------------------------------- cmGlobalVisualStudio10Win64Generator::cmGlobalVisualStudio10Win64Generator() { - this->PlatformName = "x64"; } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudio10Win64Generator.h b/Source/cmGlobalVisualStudio10Win64Generator.h index 98ba03ceb..39c9d081b 100644 --- a/Source/cmGlobalVisualStudio10Win64Generator.h +++ b/Source/cmGlobalVisualStudio10Win64Generator.h @@ -27,6 +27,8 @@ public: return cmGlobalVisualStudio10Win64Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 10 Win64";} + virtual const char* GetPlatformName() const {return "x64";} + /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index 6e0f0480e..c4de91efc 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -21,7 +21,6 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator() { this->FindMakeProgramFile = "CMakeVS8FindMake.cmake"; this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; - this->PlatformName = "Win32"; } //---------------------------------------------------------------------------- @@ -30,6 +29,7 @@ cmLocalGenerator *cmGlobalVisualStudio8Generator::CreateLocalGenerator() { cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion8(); + lg->SetPlatformName(this->GetPlatformName()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); lg->SetGlobalGenerator(this); return lg; @@ -252,8 +252,8 @@ cmGlobalVisualStudio8Generator for(std::vector::iterator i = this->Configurations.begin(); i != this->Configurations.end(); ++i) { - fout << "\t\t" << *i << "|" << this->PlatformName << " = " << *i << "|" - << this->PlatformName << "\n"; + fout << "\t\t" << *i << "|" << this->GetPlatformName() << " = " << *i << "|" + << this->GetPlatformName() << "\n"; } fout << "\tEndGlobalSection\n"; } @@ -269,13 +269,13 @@ cmGlobalVisualStudio8Generator i != this->Configurations.end(); ++i) { fout << "\t\t{" << guid << "}." << *i - << "|" << this->PlatformName << ".ActiveCfg = " - << *i << "|" << this->PlatformName << "\n"; + << "|" << this->GetPlatformName() << ".ActiveCfg = " + << *i << "|" << this->GetPlatformName() << "\n"; if(partOfDefaultBuild) { fout << "\t\t{" << guid << "}." << *i - << "|" << this->PlatformName << ".Build.0 = " - << *i << "|" << this->PlatformName << "\n"; + << "|" << this->GetPlatformName() << ".Build.0 = " + << *i << "|" << this->GetPlatformName() << "\n"; } } } diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index 9d836bda3..ceee53bcc 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -32,14 +32,14 @@ public: return cmGlobalVisualStudio8Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 8 2005";} + virtual const char* GetPlatformName() const {return "Win32";} + /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; ///! Create a local generator appropriate to this Global Generator virtual cmLocalGenerator *CreateLocalGenerator(); - std::string const& GetPlatformName() const { return this->PlatformName; } - /** * Override Configure and Generate to add the build-system check * target. @@ -78,6 +78,5 @@ protected: virtual void WriteProjectConfigurations(std::ostream& fout, const char* name, bool partOfDefaultBuild); - std::string PlatformName; // Win32 or x64 }; #endif diff --git a/Source/cmGlobalVisualStudio8Win64Generator.cxx b/Source/cmGlobalVisualStudio8Win64Generator.cxx index d5558bb91..ea2c65f3a 100644 --- a/Source/cmGlobalVisualStudio8Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio8Win64Generator.cxx @@ -19,7 +19,6 @@ cmGlobalVisualStudio8Win64Generator::cmGlobalVisualStudio8Win64Generator() { - this->PlatformName = "x64"; } ///! Create a local generator appropriate to this Global Generator @@ -27,7 +26,7 @@ cmLocalGenerator *cmGlobalVisualStudio8Win64Generator::CreateLocalGenerator() { cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion8(); - lg->SetPlatformName(this->PlatformName.c_str()); + lg->SetPlatformName(this->GetPlatformName()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); lg->SetGlobalGenerator(this); return lg; diff --git a/Source/cmGlobalVisualStudio8Win64Generator.h b/Source/cmGlobalVisualStudio8Win64Generator.h index 44c237cd4..084ba697c 100644 --- a/Source/cmGlobalVisualStudio8Win64Generator.h +++ b/Source/cmGlobalVisualStudio8Win64Generator.h @@ -33,6 +33,8 @@ public: return cmGlobalVisualStudio8Win64Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 8 2005 Win64";} + virtual const char* GetPlatformName() const {return "x64";} + /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index f6ae70599..98acf0f89 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -42,6 +42,7 @@ cmLocalGenerator *cmGlobalVisualStudio9Generator::CreateLocalGenerator() { cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion9(); + lg->SetPlatformName(this->GetPlatformName()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); lg->SetGlobalGenerator(this); return lg; diff --git a/Source/cmGlobalVisualStudio9Win64Generator.cxx b/Source/cmGlobalVisualStudio9Win64Generator.cxx index c5b9babfd..67c0bf612 100644 --- a/Source/cmGlobalVisualStudio9Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio9Win64Generator.cxx @@ -16,7 +16,6 @@ cmGlobalVisualStudio9Win64Generator::cmGlobalVisualStudio9Win64Generator() { - this->PlatformName = "x64"; } ///! Create a local generator appropriate to this Global Generator @@ -24,7 +23,7 @@ cmLocalGenerator *cmGlobalVisualStudio9Win64Generator::CreateLocalGenerator() { cmLocalVisualStudio7Generator *lg = new cmLocalVisualStudio7Generator; lg->SetVersion9(); - lg->SetPlatformName(this->PlatformName.c_str()); + lg->SetPlatformName(this->GetPlatformName()); lg->SetExtraFlagTable(this->GetExtraFlagTableVS8()); lg->SetGlobalGenerator(this); return lg; diff --git a/Source/cmGlobalVisualStudio9Win64Generator.h b/Source/cmGlobalVisualStudio9Win64Generator.h index 55abcfc56..f6dcc03cd 100644 --- a/Source/cmGlobalVisualStudio9Win64Generator.h +++ b/Source/cmGlobalVisualStudio9Win64Generator.h @@ -33,6 +33,8 @@ public: return cmGlobalVisualStudio9Win64Generator::GetActualName();} static const char* GetActualName() {return "Visual Studio 9 2008 Win64";} + virtual const char* GetPlatformName() const {return "x64";} + /** Get the documentation entry for this generator. */ virtual void GetDocumentation(cmDocumentationEntry& entry) const; From be491298d4150888d452d95bbc76db6921cda40c Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Tue, 17 Aug 2010 21:28:52 +0200 Subject: [PATCH 017/152] VS: Add more TargetMachine option values --- Source/cmLocalVisualStudio7Generator.cxx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index e411d3e54..296674518 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -480,6 +480,21 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = {"OptimizeReferences", "OPT:REF", "Eliminate unreferenced data", "2", 0}, {"TargetMachine", "MACHINE:I386", "Machine x86", "1", 0}, {"TargetMachine", "MACHINE:X86", "Machine x86", "1", 0}, + {"TargetMachine", "MACHINE:AM33", "Machine AM33", "2", 0}, + {"TargetMachine", "MACHINE:ARM", "Machine ARM", "3", 0}, + {"TargetMachine", "MACHINE:EBC", "Machine EBC", "4", 0}, + {"TargetMachine", "MACHINE:IA64", "Machine IA64", "5", 0}, + {"TargetMachine", "MACHINE:M32R", "Machine M32R", "6", 0}, + {"TargetMachine", "MACHINE:MIPS", "Machine MIPS", "7", 0}, + {"TargetMachine", "MACHINE:MIPS16", "Machine MIPS16", "8", 0}, + {"TargetMachine", "MACHINE:MIPSFPU)", "Machine MIPSFPU", "9", 0}, + {"TargetMachine", "MACHINE:MIPSFPU16", "Machine MIPSFPU16", "10", 0}, + {"TargetMachine", "MACHINE:MIPSR41XX", "Machine MIPSR41XX", "11", 0}, + {"TargetMachine", "MACHINE:SH3", "Machine SH3", "12", 0}, + {"TargetMachine", "MACHINE:SH3DSP", "Machine SH3DSP", "13", 0}, + {"TargetMachine", "MACHINE:SH4", "Machine SH4", "14", 0}, + {"TargetMachine", "MACHINE:SH5", "Machine SH5", "15", 0}, + {"TargetMachine", "MACHINE:THUMB", "Machine THUMB", "16", 0}, {"TargetMachine", "MACHINE:X64", "Machine x64", "17", 0}, {"ModuleDefinitionFile", "DEF:", "add an export def file", "", cmVS7FlagTable::UserValue}, From 6bea84353c76d392a9da11557ab888fa18ea1955 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 24 Aug 2010 18:12:44 -0400 Subject: [PATCH 018/152] Factor out global generator ComputeTargetDepends method Put the global dependency analysis in its own method so individual generators can hook into this point. --- Source/cmGlobalGenerator.cxx | 28 ++++++++++++++++++---------- Source/cmGlobalGenerator.h | 2 ++ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index bd26b5fca..bd0d199ad 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -863,19 +863,10 @@ void cmGlobalGenerator::Generate() } // Compute the inter-target dependencies. - { - cmComputeTargetDepends ctd(this); - if(!ctd.Compute()) + if(!this->ComputeTargetDepends()) { return; } - std::vector const& targets = ctd.GetTargets(); - for(std::vector::const_iterator ti = targets.begin(); - ti != targets.end(); ++ti) - { - ctd.GetTargetDirectDepends(*ti, this->TargetDependencies[*ti]); - } - } // Create a map from local generator to the complete set of targets // it builds by default. @@ -907,6 +898,23 @@ void cmGlobalGenerator::Generate() this->CMakeInstance->UpdateProgress("Generating done", -1); } +//---------------------------------------------------------------------------- +bool cmGlobalGenerator::ComputeTargetDepends() +{ + cmComputeTargetDepends ctd(this); + if(!ctd.Compute()) + { + return false; + } + std::vector const& targets = ctd.GetTargets(); + for(std::vector::const_iterator ti = targets.begin(); + ti != targets.end(); ++ti) + { + ctd.GetTargetDirectDepends(*ti, this->TargetDependencies[*ti]); + } + return true; +} + //---------------------------------------------------------------------------- bool cmGlobalGenerator::CheckTargets() { diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 878be1143..ea370877b 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -275,6 +275,8 @@ protected: void SetLanguageEnabledMaps(const char* l, cmMakefile* mf); void FillExtensionToLanguageMap(const char* l, cmMakefile* mf); + virtual bool ComputeTargetDepends(); + virtual bool CheckALLOW_DUPLICATE_CUSTOM_TARGETS(); bool CheckTargets(); From 325bdb2a92bbbbe18ae2cbffc000bd6e0dd0367a Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 24 Aug 2010 18:39:36 -0400 Subject: [PATCH 019/152] Factor out duplicate VS target dependency code Compute VS target dependencies in cmGlobalVisualStudioGenerator when the main global dependency analysis is done. Use these results in each of the VS generators instead of duplicating the analysis. --- Source/cmGlobalVisualStudio6Generator.cxx | 42 +++----------- Source/cmGlobalVisualStudio71Generator.cxx | 62 ++++----------------- Source/cmGlobalVisualStudio7Generator.cxx | 64 +++++----------------- Source/cmGlobalVisualStudioGenerator.cxx | 58 ++++++++++++++++++++ Source/cmGlobalVisualStudioGenerator.h | 5 ++ 5 files changed, 96 insertions(+), 135 deletions(-) diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index d053ca2c3..fa7afc58a 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -274,42 +274,14 @@ void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout, fout << "Package=<5>\n{{{\n}}}\n\n"; fout << "Package=<4>\n"; fout << "{{{\n"; - - // insert Begin Project Dependency Project_Dep_Name project stuff here - if (target.GetType() != cmTarget::STATIC_LIBRARY) + VSDependSet const& depends = this->VSTargetDepends[&target]; + for(VSDependSet::const_iterator di = depends.begin(); + di != depends.end(); ++di) { - cmTarget::LinkLibraryVectorType::const_iterator j, jend; - j = target.GetLinkLibraries().begin(); - jend = target.GetLinkLibraries().end(); - for(;j!= jend; ++j) - { - if(j->first != dspname) - { - // is the library part of this DSW ? If so add dependency - if(this->FindTarget(0, j->first.c_str())) - { - fout << "Begin Project Dependency\n"; - fout << "Project_Dep_Name " - << GetVS6TargetName(j->first.c_str()) << "\n"; - fout << "End Project Dependency\n"; - } - } - } - } - - std::set::const_iterator i, end; - // write utility dependencies. - i = target.GetUtilities().begin(); - end = target.GetUtilities().end(); - for(;i!= end; ++i) - { - if(*i != dspname) - { - std::string depName = this->GetUtilityForTarget(target, i->c_str()); - fout << "Begin Project Dependency\n"; - fout << "Project_Dep_Name " << GetVS6TargetName(depName) << "\n"; - fout << "End Project Dependency\n"; - } + const char* name = di->c_str(); + fout << "Begin Project Dependency\n"; + fout << "Project_Dep_Name " << GetVS6TargetName(name) << "\n"; + fout << "End Project Dependency\n"; } fout << "}}}\n\n"; } diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 119157549..ac1bfa515 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -185,59 +185,21 @@ cmGlobalVisualStudio71Generator const char* dspname, const char*, cmTarget& target) { -#if 0 - // Create inter-target dependencies in the solution file. For VS - // 7.1 and below we cannot let static libraries depend directly on - // targets to which they "link" because the librarian tool will copy - // the targets into the static library. See - // cmGlobalVisualStudioGenerator::FixUtilityDependsForTarget for a - // work-around. VS 8 and above do not have this problem. - if (!this->VSLinksDependencies() || - target.GetType() != cmTarget::STATIC_LIBRARY); -#else - if (target.GetType() != cmTarget::STATIC_LIBRARY) -#endif + VSDependSet const& depends = this->VSTargetDepends[&target]; + for(VSDependSet::const_iterator di = depends.begin(); + di != depends.end(); ++di) { - cmTarget::LinkLibraryVectorType::const_iterator j, jend; - j = target.GetLinkLibraries().begin(); - jend = target.GetLinkLibraries().end(); - for(;j!= jend; ++j) + const char* name = di->c_str(); + std::string guid = this->GetGUID(name); + if(guid.size() == 0) { - if(j->first != dspname) - { - // is the library part of this SLN ? If so add dependency - // find target anywhere because all depend libraries are - // brought in as well - if(this->FindTarget(0, j->first.c_str())) - { - fout << "\t\t{" << this->GetGUID(j->first.c_str()) << "} = {" - << this->GetGUID(j->first.c_str()) << "}\n"; - } - } - } - } - - std::set::const_iterator i, end; - // write utility dependencies. - i = target.GetUtilities().begin(); - end = target.GetUtilities().end(); - for(;i!= end; ++i) - { - if(*i != dspname) - { - std::string name = this->GetUtilityForTarget(target, i->c_str()); - std::string guid = this->GetGUID(name.c_str()); - if(guid.size() == 0) - { - std::string m = "Target: "; - m += target.GetName(); - m += " depends on unknown target: "; - m += name; - cmSystemTools::Error(m.c_str()); - } - - fout << "\t\t{" << guid << "} = {" << guid << "}\n"; + std::string m = "Target: "; + m += target.GetName(); + m += " depends on unknown target: "; + m += name; + cmSystemTools::Error(m.c_str()); } + fout << "\t\t{" << guid << "} = {" << guid << "}\n"; } } diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index 9631e9a31..de88131ff 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -422,59 +422,23 @@ cmGlobalVisualStudio7Generator const char*, cmTarget& target) { int depcount = 0; - // insert Begin Project Dependency Project_Dep_Name project stuff here - if (target.GetType() != cmTarget::STATIC_LIBRARY) + std::string dspguid = this->GetGUID(dspname); + VSDependSet const& depends = this->VSTargetDepends[&target]; + for(VSDependSet::const_iterator di = depends.begin(); + di != depends.end(); ++di) { - cmTarget::LinkLibraryVectorType::const_iterator j, jend; - j = target.GetLinkLibraries().begin(); - jend = target.GetLinkLibraries().end(); - for(;j!= jend; ++j) + const char* name = di->c_str(); + std::string guid = this->GetGUID(name); + if(guid.size() == 0) { - if(j->first != dspname) - { - // is the library part of this SLN ? If so add dependency - if(this->FindTarget(0, j->first.c_str())) - { - std::string guid = this->GetGUID(j->first.c_str()); - if(guid.size() == 0) - { - std::string m = "Target: "; - m += dspname; - m += " depends on unknown target: "; - m += j->first.c_str(); - cmSystemTools::Error(m.c_str()); - } - fout << "\t\t{" << this->GetGUID(dspname) << "}." - << depcount << " = {" << guid << "}\n"; - depcount++; - } - } - } - } - - std::set::const_iterator i, end; - // write utility dependencies. - i = target.GetUtilities().begin(); - end = target.GetUtilities().end(); - for(;i!= end; ++i) - { - if(*i != dspname) - { - std::string name = this->GetUtilityForTarget(target, i->c_str()); - std::string guid = this->GetGUID(name.c_str()); - if(guid.size() == 0) - { - std::string m = "Target: "; - m += dspname; - m += " depends on unknown target: "; - m += name.c_str(); - cmSystemTools::Error(m.c_str()); - } - - fout << "\t\t{" << this->GetGUID(dspname) << "}." << depcount << " = {" - << guid << "}\n"; - depcount++; + std::string m = "Target: "; + m += target.GetName(); + m += " depends on unknown target: "; + m += name; + cmSystemTools::Error(m.c_str()); } + fout << "\t\t{" << dspguid << "}." << depcount << " = {" << guid << "}\n"; + depcount++; } } diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 85b4a7139..1007953b1 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -352,6 +352,64 @@ cmGlobalVisualStudioGenerator::CreateUtilityDependTarget(cmTarget& target) } } +//---------------------------------------------------------------------------- +bool cmGlobalVisualStudioGenerator::ComputeTargetDepends() +{ + if(!this->cmGlobalGenerator::ComputeTargetDepends()) + { + return false; + } + std::map >::iterator it; + for(it = this->ProjectMap.begin(); it!= this->ProjectMap.end(); ++it) + { + std::vector& gen = it->second; + for(std::vector::iterator i = gen.begin(); + i != gen.end(); ++i) + { + cmTargets& targets = (*i)->GetMakefile()->GetTargets(); + for(cmTargets::iterator ti = targets.begin(); + ti != targets.end(); ++ti) + { + this->ComputeVSTargetDepends(ti->second); + } + } + } + return true; +} + +//---------------------------------------------------------------------------- +void cmGlobalVisualStudioGenerator::ComputeVSTargetDepends(cmTarget& target) +{ + if(this->VSTargetDepends.find(&target) != this->VSTargetDepends.end()) + { + return; + } + VSDependSet& vsTargetDepend = this->VSTargetDepends[&target]; + if(target.GetType() != cmTarget::STATIC_LIBRARY) + { + cmTarget::LinkLibraryVectorType const& libs = target.GetLinkLibraries(); + for(cmTarget::LinkLibraryVectorType::const_iterator j = libs.begin(); + j != libs.end(); ++j) + { + if(j->first != target.GetName() && + this->FindTarget(0, j->first.c_str())) + { + vsTargetDepend.insert(j->first); + } + } + } + std::set const& utils = target.GetUtilities(); + for(std::set::const_iterator i = utils.begin(); + i != utils.end(); ++i) + { + if(*i != target.GetName()) + { + std::string name = this->GetUtilityForTarget(target, i->c_str()); + vsTargetDepend.insert(name); + } + } +} + //---------------------------------------------------------------------------- bool cmGlobalVisualStudioGenerator::CheckTargetLinks(cmTarget& target, const char* name) diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index b0be0871d..3d499e38f 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -93,6 +93,11 @@ protected: virtual void GetTargetSets(TargetDependSet& projectTargets, TargetDependSet& originalTargets, cmLocalGenerator* root, GeneratorVector const&); + virtual bool ComputeTargetDepends(); + class VSDependSet: public std::set {}; + class VSDependMap: public std::map {}; + VSDependMap VSTargetDepends; + void ComputeVSTargetDepends(cmTarget&); bool CheckTargetLinks(cmTarget& target, const char* name); private: From 79a88c35f886258a43ee6169d2d7b4f2e1eb0b95 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 24 Aug 2010 18:47:56 -0400 Subject: [PATCH 020/152] Refactor VS <= 7.1 utility-depends workaround Commit 438a7e2f (Fix utility dependencies for static libraries in VS generators, 2007-04-04) implemented utility-only dependencies between linkable targets by introducing an intermediate non-linkable target. We convert a dependency of the form foo -> bar to the form foo -> bar_UTILITY -> bar to prevent foo from including bar on its link line. Previously we added the extra "_UTILITY" targets explicitly among the project targets before dependency analysis was performed. Now we generate them separately at the last moment so that cmGlobalGenerator need not be aware of them. --- Source/cmGlobalVisualStudio6Generator.cxx | 61 +++++++ Source/cmGlobalVisualStudio6Generator.h | 1 + Source/cmGlobalVisualStudio71Generator.cxx | 19 +- Source/cmGlobalVisualStudio7Generator.cxx | 74 ++++++++ Source/cmGlobalVisualStudio7Generator.h | 1 + Source/cmGlobalVisualStudioGenerator.cxx | 191 +++------------------ Source/cmGlobalVisualStudioGenerator.h | 14 +- 7 files changed, 186 insertions(+), 175 deletions(-) diff --git a/Source/cmGlobalVisualStudio6Generator.cxx b/Source/cmGlobalVisualStudio6Generator.cxx index fa7afc58a..203ca778d 100644 --- a/Source/cmGlobalVisualStudio6Generator.cxx +++ b/Source/cmGlobalVisualStudio6Generator.cxx @@ -13,6 +13,7 @@ #include "cmLocalVisualStudio6Generator.h" #include "cmMakefile.h" #include "cmake.h" +#include "cmGeneratedFileStream.h" // Utility function to make a valid VS6 *.dsp filename out // of a CMake target name: @@ -284,6 +285,23 @@ void cmGlobalVisualStudio6Generator::WriteProject(std::ostream& fout, fout << "End Project Dependency\n"; } fout << "}}}\n\n"; + + UtilityDependsMap::iterator ui = this->UtilityDepends.find(&target); + if(ui != this->UtilityDepends.end()) + { + const char* uname = ui->second.c_str(); + fout << "Project: \"" << uname << "\"=" + << dir << "\\" << uname << ".dsp - Package Owner=<4>\n\n"; + fout << + "Package=<5>\n{{{\n}}}\n\n" + "Package=<4>\n" + "{{{\n" + "Begin Project Dependency\n" + "Project_Dep_Name " << dspname << "\n" + "End Project Dependency\n" + "}}}\n\n"; + ; + } } @@ -339,6 +357,49 @@ void cmGlobalVisualStudio6Generator::WriteDSWHeader(std::ostream& fout) fout << "# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!\n\n"; } +//---------------------------------------------------------------------------- +std::string +cmGlobalVisualStudio6Generator::WriteUtilityDepend(cmTarget* target) +{ + std::string pname = target->GetName(); + pname += "_UTILITY"; + pname = GetVS6TargetName(pname.c_str()); + std::string fname = target->GetMakefile()->GetStartOutputDirectory(); + fname += "/"; + fname += pname; + fname += ".dsp"; + cmGeneratedFileStream fout(fname.c_str()); + fout.SetCopyIfDifferent(true); + fout << + "# Microsoft Developer Studio Project File - Name=\"" + << pname << "\" - Package Owner=<4>\n" + "# Microsoft Developer Studio Generated Build File, Format Version 6.00\n" + "# ** DO NOT EDIT **\n" + "\n" + "# TARGTYPE \"Win32 (x86) Generic Project\" 0x010a\n" + "\n" + "CFG=" << pname << " - Win32 Debug\n" + "!MESSAGE \"" << pname << " - Win32 Debug\"" + " (based on \"Win32 (x86) Generic Project\")\n" + "!MESSAGE \"" << pname << " - Win32 Release\" " + "(based on \"Win32 (x86) Generic Project\")\n" + "!MESSAGE \"" << pname << " - Win32 MinSizeRel\" " + "(based on \"Win32 (x86) Generic Project\")\n" + "!MESSAGE \"" << pname << " - Win32 RelWithDebInfo\" " + "(based on \"Win32 (x86) Generic Project\")\n" + "\n" + "# Begin Project\n" + "# Begin Target\n" + "# Name \"" << pname << " - Win32 Debug\"\n" + "# Name \"" << pname << " - Win32 Release\"\n" + "# Name \"" << pname << " - Win32 MinSizeRel\"\n" + "# Name \"" << pname << " - Win32 RelWithDebInfo\"\n" + "# End Target\n" + "# End Project\n" + ; + return pname; +} + //---------------------------------------------------------------------------- void cmGlobalVisualStudio6Generator ::GetDocumentation(cmDocumentationEntry& entry) const diff --git a/Source/cmGlobalVisualStudio6Generator.h b/Source/cmGlobalVisualStudio6Generator.h index 553c7beaf..77d537075 100644 --- a/Source/cmGlobalVisualStudio6Generator.h +++ b/Source/cmGlobalVisualStudio6Generator.h @@ -96,6 +96,7 @@ private: const char* name, const char* path, const std::set& dependencies); void WriteDSWFooter(std::ostream& fout); + virtual std::string WriteUtilityDepend(cmTarget* target); }; #endif diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index ac1bfa515..4f5901cda 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -163,16 +163,31 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, ext = targetExt; } + std::string guid = this->GetGUID(dspname); fout << project << dspname << "\", \"" << this->ConvertToSolutionPath(dir) - << "\\" << dspname << ext << "\", \"{" - << this->GetGUID(dspname) << "}\"\n"; + << "\\" << dspname << ext << "\", \"{" << guid << "}\"\n"; fout << "\tProjectSection(ProjectDependencies) = postProject\n"; this->WriteProjectDepends(fout, dspname, dir, t); fout << "\tEndProjectSection\n"; fout <<"EndProject\n"; + + UtilityDependsMap::iterator ui = this->UtilityDepends.find(&t); + if(ui != this->UtilityDepends.end()) + { + const char* uname = ui->second.c_str(); + fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" + << uname << "\", \"" + << this->ConvertToSolutionPath(dir) + << "\\" << uname << ".vcproj" << "\", \"{" + << this->GetGUID(uname) << "}\"\n" + << "\tProjectSection(ProjectDependencies) = postProject\n" + << "\t\t{" << guid << "} = {" << guid << "}\n" + << "\tEndProjectSection\n" + << "EndProject\n"; + } } //---------------------------------------------------------------------------- diff --git a/Source/cmGlobalVisualStudio7Generator.cxx b/Source/cmGlobalVisualStudio7Generator.cxx index de88131ff..f59de40d3 100644 --- a/Source/cmGlobalVisualStudio7Generator.cxx +++ b/Source/cmGlobalVisualStudio7Generator.cxx @@ -408,6 +408,18 @@ void cmGlobalVisualStudio7Generator::WriteProject(std::ostream& fout, << this->ConvertToSolutionPath(dir) << "\\" << dspname << ext << "\", \"{" << this->GetGUID(dspname) << "}\"\nEndProject\n"; + + UtilityDependsMap::iterator ui = this->UtilityDepends.find(&target); + if(ui != this->UtilityDepends.end()) + { + const char* uname = ui->second.c_str(); + fout << "Project(\"{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}\") = \"" + << uname << "\", \"" + << this->ConvertToSolutionPath(dir) + << "\\" << uname << ".vcproj" << "\", \"{" + << this->GetGUID(uname) << "}\"\n" + << "EndProject\n"; + } } @@ -440,6 +452,13 @@ cmGlobalVisualStudio7Generator fout << "\t\t{" << dspguid << "}." << depcount << " = {" << guid << "}\n"; depcount++; } + + UtilityDependsMap::iterator ui = this->UtilityDepends.find(&target); + if(ui != this->UtilityDepends.end()) + { + const char* uname = ui->second.c_str(); + fout << "\t\t{" << this->GetGUID(uname) << "}.0 = {" << dspguid << "}\n"; + } } @@ -501,6 +520,61 @@ void cmGlobalVisualStudio7Generator::WriteSLNHeader(std::ostream& fout) fout << "Microsoft Visual Studio Solution File, Format Version 7.00\n"; } +//---------------------------------------------------------------------------- +std::string +cmGlobalVisualStudio7Generator::WriteUtilityDepend(cmTarget* target) +{ + std::string pname = target->GetName(); + pname += "_UTILITY"; + std::string fname = target->GetMakefile()->GetStartOutputDirectory(); + fname += "/"; + fname += pname; + fname += ".vcproj"; + cmGeneratedFileStream fout(fname.c_str()); + fout.SetCopyIfDifferent(true); + this->CreateGUID(pname.c_str()); + std::string guid = this->GetGUID(pname.c_str()); + + fout << + "\n" + "GetIDEVersion() << "0\"\n" + "\tName=\"" << pname << "\"\n" + "\tProjectGUID=\"{" << guid << "}\"\n" + "\tKeyword=\"Win32Proj\">\n" + "\t\n" + "\t\n" + ; + for(std::vector::iterator i = this->Configurations.begin(); + i != this->Configurations.end(); ++i) + { + fout << + "\t\t\n" + "\t\t\n" + ; + } + fout << + "\t\n" + "\t\n" + "\t\n" + "\n" + ; + + if(fout.Close()) + { + this->FileReplacedDuringGenerate(fname); + } + return pname; +} + std::string cmGlobalVisualStudio7Generator::GetGUID(const char* name) { std::string guidStoreName = name; diff --git a/Source/cmGlobalVisualStudio7Generator.h b/Source/cmGlobalVisualStudio7Generator.h index 85ba24495..b89fa1cd0 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -113,6 +113,7 @@ protected: bool partOfDefaultBuild); virtual void WriteSLNFooter(std::ostream& fout); virtual void WriteSLNHeader(std::ostream& fout); + virtual std::string WriteUtilityDepend(cmTarget* target); virtual void AddPlatformDefinitions(cmMakefile* mf); virtual void WriteTargetsToSolution( diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 1007953b1..3493b1d6b 100644 --- a/Source/cmGlobalVisualStudioGenerator.cxx +++ b/Source/cmGlobalVisualStudioGenerator.cxx @@ -74,9 +74,6 @@ void cmGlobalVisualStudioGenerator::Generate() } } - // Fix utility dependencies to avoid linking to libraries. - this->FixUtilityDepends(); - // Configure CMake Visual Studio macros, for this user on this version // of Visual Studio. this->ConfigureCMakeVisualStudioMacros(); @@ -224,134 +221,6 @@ std::string cmGlobalVisualStudioGenerator::GetUserMacrosRegKeyBase() return ""; } -//---------------------------------------------------------------------------- -void cmGlobalVisualStudioGenerator::FixUtilityDepends() -{ - // Skip for VS versions 8 and above. - if(!this->VSLinksDependencies()) - { - return; - } - - // For VS versions before 8: - // - // When a target that links contains a project-level dependency on a - // library target that library is automatically linked. In order to - // allow utility-style project-level dependencies that do not - // actually link we need to automatically insert an intermediate - // custom target. - // - // Here we edit the utility dependencies of a target to add the - // intermediate custom target when necessary. - for(unsigned i = 0; i < this->LocalGenerators.size(); ++i) - { - cmTargets* targets = - &(this->LocalGenerators[i]->GetMakefile()->GetTargets()); - for(cmTargets::iterator tarIt = targets->begin(); - tarIt != targets->end(); ++tarIt) - { - this->FixUtilityDependsForTarget(tarIt->second); - } - } -} - -//---------------------------------------------------------------------------- -void -cmGlobalVisualStudioGenerator::FixUtilityDependsForTarget(cmTarget& target) -{ - // Only targets that link need to be fixed. - if(target.GetType() != cmTarget::STATIC_LIBRARY && - target.GetType() != cmTarget::SHARED_LIBRARY && - target.GetType() != cmTarget::MODULE_LIBRARY && - target.GetType() != cmTarget::EXECUTABLE) - { - return; - } - -#if 0 - // This feature makes a mess in SLN files for VS 7.1 and below. It - // creates an extra target for every target that is "linked" by a - // static library. Without this feature static libraries do not - // wait until their "link" dependencies are built to build. This is - // not a problem 99.9% of the time, and projects that do have the - // problem can enable this work-around by using add_dependencies. - - // Static libraries cannot depend directly on the targets to which - // they link because VS will copy those targets into the library - // (for VS < 8). To work around the problem we copy the - // dependencies to be utility dependencies so that the work-around - // below is used. - if(target.GetType() == cmTarget::STATIC_LIBRARY) - { - cmTarget::LinkLibraryVectorType const& libs = target.GetLinkLibraries(); - for(cmTarget::LinkLibraryVectorType::const_iterator i = libs.begin(); - i != libs.end(); ++i) - { - if(cmTarget* depTarget = this->FindTarget(0, i->first.c_str(), false)) - { - target.AddUtility(depTarget->GetName()); - } - } - } -#endif - - // Look at each utility dependency. - for(std::set::const_iterator ui = - target.GetUtilities().begin(); - ui != target.GetUtilities().end(); ++ui) - { - if(cmTarget* depTarget = this->FindTarget(0, ui->c_str())) - { - if(depTarget->GetType() == cmTarget::STATIC_LIBRARY || - depTarget->GetType() == cmTarget::SHARED_LIBRARY || - depTarget->GetType() == cmTarget::MODULE_LIBRARY) - { - // This utility dependency will cause an attempt to link. If - // the depender does not already link the dependee we need an - // intermediate target. - if(!this->CheckTargetLinks(target, ui->c_str())) - { - this->CreateUtilityDependTarget(*depTarget); - } - } - } - } -} - -//---------------------------------------------------------------------------- -void -cmGlobalVisualStudioGenerator::CreateUtilityDependTarget(cmTarget& target) -{ - // This target is a library on which a utility dependency exists. - // We need to create an intermediate custom target to hook up the - // dependency without causing a link. - const char* altName = target.GetProperty("ALTERNATIVE_DEPENDENCY_NAME"); - if(!altName) - { - // Create the intermediate utility target. - std::string altNameStr = target.GetName(); - altNameStr += "_UTILITY"; - const std::vector no_depends; - cmCustomCommandLines no_commands; - const char* no_working_dir = 0; - const char* no_comment = 0; - target.GetMakefile()->AddUtilityCommand(altNameStr.c_str(), true, - no_working_dir, no_depends, - no_commands, false, no_comment); - target.SetProperty("ALTERNATIVE_DEPENDENCY_NAME", altNameStr.c_str()); - - // Most targets have a GUID created in ConfigureFinalPass. Since - // that has already been called, create one for this target now. - this->CreateGUID(altNameStr.c_str()); - - // The intermediate target should depend on the original target. - if(cmTarget* alt = this->FindTarget(0, altNameStr.c_str())) - { - alt->AddUtility(target.GetName()); - } - } -} - //---------------------------------------------------------------------------- bool cmGlobalVisualStudioGenerator::ComputeTargetDepends() { @@ -433,10 +302,28 @@ bool cmGlobalVisualStudioGenerator::CheckTargetLinks(cmTarget& target, } //---------------------------------------------------------------------------- -const char* +std::string cmGlobalVisualStudioGenerator::GetUtilityDepend(cmTarget* target) +{ + UtilityDependsMap::iterator i = this->UtilityDepends.find(target); + if(i == this->UtilityDepends.end()) + { + std::string name = this->WriteUtilityDepend(target); + UtilityDependsMap::value_type entry(target, name); + i = this->UtilityDepends.insert(entry).first; + } + return i->second; +} + +//---------------------------------------------------------------------------- +std::string cmGlobalVisualStudioGenerator::GetUtilityForTarget(cmTarget& target, const char* name) { + if(!this->VSLinksDependencies()) + { + return name; + } + // Possibly depend on an intermediate utility target to avoid // linking. if(target.GetType() == cmTarget::STATIC_LIBRARY || @@ -444,19 +331,19 @@ cmGlobalVisualStudioGenerator::GetUtilityForTarget(cmTarget& target, target.GetType() == cmTarget::MODULE_LIBRARY || target.GetType() == cmTarget::EXECUTABLE) { - // The depender is a target that links. Lookup the dependee to - // see if it provides an alternative dependency name. + // The depender is a target that links. if(cmTarget* depTarget = this->FindTarget(0, name)) { - // Check for an alternative name created by FixUtilityDepends. - if(const char* altName = - depTarget->GetProperty("ALTERNATIVE_DEPENDENCY_NAME")) + if(depTarget->GetType() == cmTarget::STATIC_LIBRARY || + depTarget->GetType() == cmTarget::SHARED_LIBRARY || + depTarget->GetType() == cmTarget::MODULE_LIBRARY) { - // The alternative name is needed only if the depender does - // not really link to the dependee. + // This utility dependency will cause an attempt to link. If + // the depender does not already link the dependee we need an + // intermediate target. if(!this->CheckTargetLinks(target, name)) { - return altName; + return this->GetUtilityDepend(depTarget); } } } @@ -466,30 +353,6 @@ cmGlobalVisualStudioGenerator::GetUtilityForTarget(cmTarget& target, return name; } -//---------------------------------------------------------------------------- -void cmGlobalVisualStudioGenerator::GetTargetSets( - TargetDependSet& projectTargets, TargetDependSet& originalTargets, - cmLocalGenerator* root, GeneratorVector const& generators - ) -{ - this->cmGlobalGenerator::GetTargetSets(projectTargets, originalTargets, - root, generators); - - // Add alternative dependency targets created by FixUtilityDepends. - for(TargetDependSet::iterator ti = projectTargets.begin(); - ti != projectTargets.end(); ++ti) - { - cmTarget* tgt = *ti; - if(const char* altName = tgt->GetProperty("ALTERNATIVE_DEPENDENCY_NAME")) - { - if(cmTarget* alt = tgt->GetMakefile()->FindTarget(altName)) - { - projectTargets.insert(alt); - } - } - } -} - //---------------------------------------------------------------------------- #include diff --git a/Source/cmGlobalVisualStudioGenerator.h b/Source/cmGlobalVisualStudioGenerator.h index 3d499e38f..daa6b3a20 100644 --- a/Source/cmGlobalVisualStudioGenerator.h +++ b/Source/cmGlobalVisualStudioGenerator.h @@ -61,7 +61,6 @@ public: // return true if target is fortran only bool TargetIsFortranOnly(cmTarget& t); - const char* GetUtilityForTarget(cmTarget& target, const char*); /** Get the top-level registry key for this VS version. */ std::string GetRegistryBase(); @@ -71,8 +70,6 @@ public: virtual bool IsMultiConfig() { return true; } protected: - void FixUtilityDepends(); - // Does this VS version link targets to each other if there are // dependencies in the SLN file? This was done for VS versions // below 8. @@ -90,9 +87,6 @@ protected: OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const&); }; - virtual void GetTargetSets(TargetDependSet& projectTargets, - TargetDependSet& originalTargets, - cmLocalGenerator* root, GeneratorVector const&); virtual bool ComputeTargetDepends(); class VSDependSet: public std::set {}; class VSDependMap: public std::map {}; @@ -100,9 +94,11 @@ protected: void ComputeVSTargetDepends(cmTarget&); bool CheckTargetLinks(cmTarget& target, const char* name); -private: - void FixUtilityDependsForTarget(cmTarget& target); - void CreateUtilityDependTarget(cmTarget& target); + std::string GetUtilityForTarget(cmTarget& target, const char*); + virtual std::string WriteUtilityDepend(cmTarget*) = 0; + std::string GetUtilityDepend(cmTarget* target); + typedef std::map UtilityDependsMap; + UtilityDependsMap UtilityDepends; }; #endif From a986dafd7f84f0c260d2a34480f8c36e7f4f313a Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Wed, 25 Aug 2010 11:04:49 +0200 Subject: [PATCH 021/152] CPack fix broken compilation for CygwinSource generator --- Source/CPack/cmCPackCygwinSourceGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/CPack/cmCPackCygwinSourceGenerator.cxx b/Source/CPack/cmCPackCygwinSourceGenerator.cxx index f4ae35f10..597972992 100644 --- a/Source/CPack/cmCPackCygwinSourceGenerator.cxx +++ b/Source/CPack/cmCPackCygwinSourceGenerator.cxx @@ -59,7 +59,7 @@ int cmCPackCygwinSourceGenerator::PackageFiles() // skip one parent up to the cmCPackTarBZip2Generator // to create tar.bz2 file with the list of source // files - this->Compress = BZIP2; + this->Compress = cmArchiveWrite::CompressBZip2; if ( !this->cmCPackTarBZip2Generator::PackageFiles() ) { return 0; From 90add6b50436070605975b0c8188d4fe4b9ddbfa Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 25 Aug 2010 14:58:31 -0400 Subject: [PATCH 022/152] Refine formatting for cmake --help-module output. Also refer to self as module, not script. --- Modules/BundleUtilities.cmake | 5 ++--- Modules/GetPrerequisites.cmake | 10 ++++------ 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index 2e23ab635..b48c61eab 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -1,4 +1,5 @@ -# - A collection of CMake utility functions useful for dealing with .app +# - Functions to help assemble a standalone bundle application. +# A collection of CMake utility functions useful for dealing with .app # bundles on the Mac and bundle-like directories on any OS. # # The following functions are provided by this module: @@ -18,7 +19,6 @@ # fixup_bundle_item # verify_bundle_prerequisites # verify_bundle_symlinks -# # Requires CMake 2.6 or greater because it uses function, break and # PARENT_SCOPE. Also depends on GetPrerequisites.cmake. # @@ -127,7 +127,6 @@ # Verifies that any symlinks found in the bundle point to other files that are # already also in the bundle... Anything that points to an external file causes # this function to fail the verification. -# #============================================================================= # Copyright 2008-2009 Kitware, Inc. diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index f6b3a54a2..847db347b 100644 --- a/Modules/GetPrerequisites.cmake +++ b/Modules/GetPrerequisites.cmake @@ -1,11 +1,12 @@ -# - This script provides functions to list the .dll, .dylib or .so files that -# an executable or shared library file depends on. (Its prerequisites.) +# - Functions to analyze and list executable file prerequisites. +# This module provides functions to list the .dll, .dylib or .so +# files that an executable or shared library file depends on. (Its +# prerequisites.) # # It uses various tools to obtain the list of required shared library files: # dumpbin (Windows) # ldd (Linux/Unix) # otool (Mac OSX) -# # The following functions are provided by this module: # get_prerequisites # list_prerequisites @@ -19,7 +20,6 @@ # gp_resolved_file_type # (projects can override with gp_resolved_file_type_override) # gp_file_type -# # Requires CMake 2.6 or greater because it uses function, break, return and # PARENT_SCOPE. # @@ -93,7 +93,6 @@ # local # embedded # other -# # Override on a per-project basis by providing a project-specific # gp_resolved_file_type_override function. # @@ -106,7 +105,6 @@ # local # embedded # other -# #============================================================================= # Copyright 2008-2009 Kitware, Inc. From 9e62ac0b400c5aff953b74c8f8187ba9f4f71969 Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 25 Aug 2010 15:23:18 -0400 Subject: [PATCH 023/152] Improve documentation of OPTION command. Point via see also phrasing to the CMakeDependentOption module. --- Source/cmOptionCommand.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Source/cmOptionCommand.h b/Source/cmOptionCommand.h index 8670fc420..fa5abd87c 100644 --- a/Source/cmOptionCommand.h +++ b/Source/cmOptionCommand.h @@ -59,7 +59,10 @@ public: " option( \"help string describing option\"\n" " [initial value])\n" "Provide an option for the user to select as ON or OFF. If no " - "initial value is provided, OFF is used."; + "initial value is provided, OFF is used.\n" + "If you have options that depend on the values of other " + "options, see the module help for CMakeDependentOption." + ; } /** From 88e6447e1914d87670269092b3021b8ea3d0dba1 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Wed, 25 Aug 2010 21:53:16 +0200 Subject: [PATCH 024/152] Add macro ADD_FEATURE_INFO() and improve docs. ADD_FEATURE_INFO() can be used to set the info for a feature, e.g. an option(). set_feature_info() has been renamed to set_package_info(), since this is about found or not found packages. For compatiblity set_feature_info() is still provided. Alex --- Modules/FeatureSummary.cmake | 90 ++++++++++++++++++++++++++++-------- 1 file changed, 70 insertions(+), 20 deletions(-) diff --git a/Modules/FeatureSummary.cmake b/Modules/FeatureSummary.cmake index 065c31160..594e2e75a 100644 --- a/Modules/FeatureSummary.cmake +++ b/Modules/FeatureSummary.cmake @@ -1,11 +1,28 @@ # - Macros for generating a summary of enabled/disabled features # +# This module provides the macros feature_summary(), set_package_info() and +# add_feature_info(). +# For compatiblity it also still provides set_feature_info(), +# print_enabled_features() and print_disabled_features. +# +# These macros can be used to generate a summary of enabled and disabled +# packages and/or feature for a build tree: +# +# -- Enabled features: +# LibXml2 (required version >= 2.4) , XML processing library. , +# PNG , A PNG image library. , +# -- Disabled features: +# Lua51 , The Lua scripting language. , +# Foo , Foo provides cool stuff. +# +# # FEATURE_SUMMARY( [FILENAME ] # [APPEND] # [VAR ] # [DESCRIPTION "Found packages:"] -# WHAT (ALL | PACKAGES_FOUND | PACKAGES_NOT_FOUND | ENABLED_FEATURES | DISABLED_FEATURES] -# ) +# WHAT (ALL | PACKAGES_FOUND | PACKAGES_NOT_FOUND +# | ENABLED_FEATURES | DISABLED_FEATURES] +# ) # # The FEATURE_SUMMARY() macro can be used to print information about enabled # or disabled features or packages of a project. @@ -15,10 +32,12 @@ # # The WHAT option is the only mandatory option. Here you specify what information # will be printed: -# ENABLED_FEATURES: the list of all features and packages which have been found, excluding the QUIET ones -# DISABLED_FEATURES: the list of all features and packages which have not been found, excluding the QUIET ones -# PACKAGES_FOUND: the list of all packages which have been found, including the QUIET ones -# PACKAGES_NOT_FOUND: the list of all packages which have not been found, including the QUIET ones +# ENABLED_FEATURES: the list of all features and packages which are enabled, +# excluding the QUIET packages +# DISABLED_FEATURES: the list of all features and packages which are disabled, +# excluding the QUIET packages +# PACKAGES_FOUND: the list of all packages which have been found +# PACKAGES_NOT_FOUND: the list of all packages which have not been found # ALL: this will give all packages which have or have not been found # # If a FILENAME is given, the information is printed into this file. If APPEND @@ -31,37 +50,51 @@ # be printed above the actual content. # # Example 1, append everything to a file: -# FEATURE_SUMMARY(WHAT ALL +# feature_summary(WHAT ALL # FILENAME ${CMAKE_BINARY_DIR}/all.log APPEND) # # Example 2, print the enabled features into the variable enabledFeaturesText: -# FEATURE_SUMMARY(WHAT ENABLED_FEATURES +# feature_summary(WHAT ENABLED_FEATURES # DESCRIPTION "Enabled Features:" # VAR enabledFeaturesText) -# MESSAGE(STATUS "${enabledFeaturesText}") +# message(STATUS "${enabledFeaturesText}") # # -# -# SET_FEATURE_INFO(NAME DESCRIPTION [URL [COMMENT] ] ) -# Use this macro to set up information about the named feature, which can -# then be displayed via FEATURE_SUMMARY() or PRINT_ENABLED/DISABLED_FEATURES(). +# SET_PACKAGE_INFO( [ [] ] ) +# Use this macro to set up information about the named package, which can +# then be displayed via FEATURE_SUMMARY(). # This can be done either directly in the Find-module or in the project # which uses the module after the FIND_PACKAGE() call. # The features for which information can be set are added automatically by the -# find_package() command. If you want to add additional features, you can add -# them by appending them to the global ENABLED_FEATURES or DISABLED_FEATURES properties. +# find_package() command. # # Example for setting the info for a package: -# FIND_PACKAGE(LibXml2) -# SET_FEATURE_INFO(LibXml2 "XML processing library." "http://xmlsoft.org/") +# find_package(LibXml2) +# set_package_info(LibXml2 "XML processing library." "http://xmlsoft.org/") # # +# ADD_FEATURE_INFO( ) +# Use this macro to add information about a feature with the given . +# contains whether this feature is enabled or not, +# is a text descibing the feature. +# The information can be displayed using feature_summary() for ENABLED_FEATURES +# and DISABLED_FEATURES respectively. +# +# Example for setting the info for a feature: +# option(WITH_FOO "Help for foo" ON) +# add_feature_info(Foo WITH_FOO "The Foo feature provides very cool stuff.") +# +# +# The following macros are provided for compatibility with previous CMake versions: +# # PRINT_ENABLED_FEATURES() # Does the same as FEATURE_SUMMARY(WHAT ENABLED_FEATURES DESCRIPTION "Enabled features:") # -# # PRINT_DISABLED_FEATURES() # Does the same as FEATURE_SUMMARY(WHAT DISABLED_FEATURES DESCRIPTION "Disabled features:") +# +# SET_FEATURE_INFO( [ [] ] ) +# Does the same as SET_PACKAGE_INFO( ) #============================================================================= # Copyright 2007-2009 Kitware, Inc. @@ -78,7 +111,24 @@ INCLUDE(CMakeParseArguments) -FUNCTION(SET_FEATURE_INFO _name _desc) + +FUNCTION(ADD_FEATURE_INFO _name _enabled _desc) + IF (${_enabled}) + SET_PROPERTY(GLOBAL APPEND PROPERTY ENABLED_FEATURES "${_name}") + ELSE () + SET_PROPERTY(GLOBAL APPEND PROPERTY DISABLED_FEATURES "${_name}") + ENDIF () + + SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" ) +ENDFUNCTION(SET_FEATURE_INFO) + + +FUNCTION(SET_FEATURE_INFO) + SET_PACKAGE_INFO(${ARGN}) +ENDFUNCTION(SET_FEATURE_INFO) + + +FUNCTION(SET_PACKAGE_INFO _name _desc) SET(_url "${ARGV2}") SET(_comment "${ARGV3}") SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_DESCRIPTION "${_desc}" ) @@ -88,7 +138,7 @@ FUNCTION(SET_FEATURE_INFO _name _desc) IF(_comment MATCHES ".+") SET_PROPERTY(GLOBAL PROPERTY _CMAKE_${_name}_COMMENT "${_comment}" ) ENDIF(_comment MATCHES ".+") -ENDFUNCTION(SET_FEATURE_INFO) +ENDFUNCTION(SET_PACKAGE_INFO) FUNCTION(_FS_GET_FEATURE_SUMMARY _property _var) From 95b3bb5dbcb6021f07329f5bc400b1a205386970 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 20 Aug 2010 13:16:43 -0400 Subject: [PATCH 025/152] Restore GetTargetDirectDepends const return The returned set should never be modified. Restore 'const' correctness unnecessarily removed by commit 6903d2df (remove const, 2008-01-30). --- Source/cmGlobalGenerator.cxx | 4 ++-- Source/cmGlobalGenerator.h | 2 +- Source/cmVisualStudio10TargetGenerator.cxx | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index bd26b5fca..fbc578b26 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1487,7 +1487,7 @@ void cmGlobalGenerator::FillLocalGeneratorToTargetMap() // Add dependencies of the included target. An excluded // target may still be included if it is a dependency of a // non-excluded target. - TargetDependSet & tgtdeps = this->GetTargetDirectDepends(target); + TargetDependSet const& tgtdeps = this->GetTargetDirectDepends(target); for(TargetDependSet::const_iterator ti = tgtdeps.begin(); ti != tgtdeps.end(); ++ti) { @@ -1879,7 +1879,7 @@ void cmGlobalGenerator::AppendDirectoryForConfig(const char*, const char*, } //---------------------------------------------------------------------------- -cmGlobalGenerator::TargetDependSet & +cmGlobalGenerator::TargetDependSet const& cmGlobalGenerator::GetTargetDirectDepends(cmTarget & target) { return this->TargetDependencies[&target]; diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index 878be1143..9d5aa57a0 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -238,7 +238,7 @@ public: // what targets does the specified target depend on directly // via a target_link_libraries or add_dependencies - TargetDependSet & GetTargetDirectDepends(cmTarget & target); + TargetDependSet const& GetTargetDirectDepends(cmTarget & target); const std::map >& GetProjectMap() const {return this->ProjectMap;} diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 59e20d50c..2af70366e 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -1413,7 +1413,7 @@ void cmVisualStudio10TargetGenerator::WriteEvent( void cmVisualStudio10TargetGenerator::WriteProjectReferences() { - cmGlobalGenerator::TargetDependSet& depends + cmGlobalGenerator::TargetDependSet const& depends = this->GlobalGenerator->GetTargetDirectDepends(*this->Target); this->WriteString("\n", 1); for( cmGlobalGenerator::TargetDependSet::const_iterator i = depends.begin(); From 7be2617b5a52529ce0ca33e6c878a0294e1e2781 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 20 Aug 2010 14:11:18 -0400 Subject: [PATCH 026/152] Split notion of node lists and edge lists --- Source/cmComputeComponentGraph.cxx | 8 ++++---- Source/cmComputeComponentGraph.h | 3 ++- Source/cmComputeLinkDepends.cxx | 20 ++++++++++---------- Source/cmComputeLinkDepends.h | 1 + Source/cmComputeTargetDepends.cxx | 16 ++++++++-------- Source/cmComputeTargetDepends.h | 1 + Source/cmGraphAdjacencyList.h | 3 ++- 7 files changed, 28 insertions(+), 24 deletions(-) diff --git a/Source/cmComputeComponentGraph.cxx b/Source/cmComputeComponentGraph.cxx index 3f2a361dc..165af1042 100644 --- a/Source/cmComputeComponentGraph.cxx +++ b/Source/cmComputeComponentGraph.cxx @@ -71,8 +71,8 @@ void cmComputeComponentGraph::TarjanVisit(int i) this->TarjanStack.push(i); // Follow outgoing edges. - NodeList const& nl = this->InputGraph[i]; - for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) + EdgeList const& nl = this->InputGraph[i]; + for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) { int j = *ni; @@ -142,8 +142,8 @@ void cmComputeComponentGraph::TransferEdges() for(int i=0; i < n; ++i) { int i_component = this->TarjanComponents[i]; - NodeList const& nl = this->InputGraph[i]; - for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) + EdgeList const& nl = this->InputGraph[i]; + for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) { int j = *ni; int j_component = this->TarjanComponents[j]; diff --git a/Source/cmComputeComponentGraph.h b/Source/cmComputeComponentGraph.h index 855a141f4..a2ce946c1 100644 --- a/Source/cmComputeComponentGraph.h +++ b/Source/cmComputeComponentGraph.h @@ -33,6 +33,7 @@ class cmComputeComponentGraph public: // Represent the graph with an adjacency list. typedef cmGraphNodeList NodeList; + typedef cmGraphEdgeList EdgeList; typedef cmGraphAdjacencyList Graph; cmComputeComponentGraph(Graph const& input); @@ -41,7 +42,7 @@ public: /** Get the adjacency list of the component graph. */ Graph const& GetComponentGraph() const { return this->ComponentGraph; } - NodeList const& GetComponentGraphEdges(int c) const + EdgeList const& GetComponentGraphEdges(int c) const { return this->ComponentGraph[c]; } /** Get map from component index to original node indices. */ diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 24410ec3a..4b0214e2f 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -285,7 +285,7 @@ cmComputeLinkDepends::AllocateLinkEntry(std::string const& item) lei = this->LinkEntryIndex.insert(index_entry).first; this->EntryList.push_back(LinkEntry()); this->InferredDependSets.push_back(0); - this->EntryConstraintGraph.push_back(NodeList()); + this->EntryConstraintGraph.push_back(EdgeList()); return lei; } @@ -669,7 +669,7 @@ void cmComputeLinkDepends::CleanConstraintGraph() cmsys_stl::sort(i->begin(), i->end()); // Make the edge list unique. - NodeList::iterator last = cmsys_stl::unique(i->begin(), i->end()); + EdgeList::iterator last = cmsys_stl::unique(i->begin(), i->end()); i->erase(last, i->end()); } } @@ -681,9 +681,9 @@ void cmComputeLinkDepends::DisplayConstraintGraph() cmOStringStream e; for(unsigned int i=0; i < this->EntryConstraintGraph.size(); ++i) { - NodeList const& nl = this->EntryConstraintGraph[i]; + EdgeList const& nl = this->EntryConstraintGraph[i]; e << "item " << i << " is [" << this->EntryList[i].Item << "]\n"; - for(NodeList::const_iterator j = nl.begin(); j != nl.end(); ++j) + for(EdgeList::const_iterator j = nl.begin(); j != nl.end(); ++j) { e << " item " << *j << " must follow it\n"; } @@ -758,8 +758,8 @@ cmComputeLinkDepends::DisplayComponents() fprintf(stderr, " item %d [%s]\n", i, this->EntryList[i].Item.c_str()); } - NodeList const& ol = this->CCG->GetComponentGraphEdges(c); - for(NodeList::const_iterator oi = ol.begin(); oi != ol.end(); ++oi) + EdgeList const& ol = this->CCG->GetComponentGraphEdges(c); + for(EdgeList::const_iterator oi = ol.begin(); oi != ol.end(); ++oi) { fprintf(stderr, " followed by Component (%d)\n", *oi); } @@ -784,8 +784,8 @@ void cmComputeLinkDepends::VisitComponent(unsigned int c) // Visit the neighbors of the component first. // Run in reverse order so the topological order will preserve the // original order where there are no constraints. - NodeList const& nl = this->CCG->GetComponentGraphEdges(c); - for(NodeList::const_reverse_iterator ni = nl.rbegin(); + EdgeList const& nl = this->CCG->GetComponentGraphEdges(c); + for(EdgeList::const_reverse_iterator ni = nl.rbegin(); ni != nl.rend(); ++ni) { this->VisitComponent(*ni); @@ -856,8 +856,8 @@ void cmComputeLinkDepends::VisitEntry(int index) // are now pending. if(completed) { - NodeList const& ol = this->CCG->GetComponentGraphEdges(component); - for(NodeList::const_iterator oi = ol.begin(); oi != ol.end(); ++oi) + EdgeList const& ol = this->CCG->GetComponentGraphEdges(component); + for(EdgeList::const_iterator oi = ol.begin(); oi != ol.end(); ++oi) { // This entire component is now pending no matter whether it has // been partially seen already. diff --git a/Source/cmComputeLinkDepends.h b/Source/cmComputeLinkDepends.h index a08afb69c..e196e00ca 100644 --- a/Source/cmComputeLinkDepends.h +++ b/Source/cmComputeLinkDepends.h @@ -117,6 +117,7 @@ private: // Ordering constraint graph adjacency list. typedef cmGraphNodeList NodeList; + typedef cmGraphEdgeList EdgeList; typedef cmGraphAdjacencyList Graph; Graph EntryConstraintGraph; void CleanConstraintGraph(); diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 94b8527f0..e82606cab 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -150,8 +150,8 @@ cmComputeTargetDepends::GetTargetDirectDepends(cmTarget* t, int i = tii->second; // Get its final dependencies. - NodeList const& nl = this->FinalGraph[i]; - for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) + EdgeList const& nl = this->FinalGraph[i]; + for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) { deps.insert(this->Targets[*ni]); } @@ -283,11 +283,11 @@ cmComputeTargetDepends::DisplayGraph(Graph const& graph, const char* name) int n = static_cast(graph.size()); for(int depender_index = 0; depender_index < n; ++depender_index) { - NodeList const& nl = graph[depender_index]; + EdgeList const& nl = graph[depender_index]; cmTarget* depender = this->Targets[depender_index]; fprintf(stderr, "target %d is [%s]\n", depender_index, depender->GetName()); - for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) + for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) { int dependee_index = *ni; cmTarget* dependee = this->Targets[dependee_index]; @@ -383,8 +383,8 @@ cmComputeTargetDepends << cmTarget::TargetTypeNames[depender->GetType()] << "\n"; // List its dependencies that are inside the component. - NodeList const& nl = this->InitialGraph[i]; - for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) + EdgeList const& nl = this->InitialGraph[i]; + for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) { int j = *ni; if(cmap[j] == c) @@ -425,8 +425,8 @@ cmComputeTargetDepends for(int depender_component=0; depender_component < n; ++depender_component) { int depender_component_tail = components[depender_component].back(); - NodeList const& nl = cgraph[depender_component]; - for(NodeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) + EdgeList const& nl = cgraph[depender_component]; + for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) { int dependee_component = *ni; int dependee_component_head = components[dependee_component].front(); diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h index 68e3e47cb..b18a053dc 100644 --- a/Source/cmComputeTargetDepends.h +++ b/Source/cmComputeTargetDepends.h @@ -59,6 +59,7 @@ private: // top-level index corresponds to a depender whose dependencies are // listed. typedef cmGraphNodeList NodeList; + typedef cmGraphEdgeList EdgeList; typedef cmGraphAdjacencyList Graph; Graph InitialGraph; Graph FinalGraph; diff --git a/Source/cmGraphAdjacencyList.h b/Source/cmGraphAdjacencyList.h index 779484012..41411c42b 100644 --- a/Source/cmGraphAdjacencyList.h +++ b/Source/cmGraphAdjacencyList.h @@ -14,7 +14,8 @@ #include "cmStandardIncludes.h" +struct cmGraphEdgeList: public std::vector {}; struct cmGraphNodeList: public std::vector {}; -struct cmGraphAdjacencyList: public std::vector {}; +struct cmGraphAdjacencyList: public std::vector {}; #endif From 681cf011dde81c08c0404569289110f9585c6daf Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 25 Aug 2010 10:07:25 -0400 Subject: [PATCH 027/152] Distinguish "strong" and "weak" target dependency edges Utility dependencies are "strong" because they must be enforced to generate a working build. Link dependencies are "weak" because they can be broken in the case of a static library cycle. --- Source/cmComputeComponentGraph.cxx | 5 ++++- Source/cmComputeLinkDepends.cxx | 3 ++- Source/cmComputeTargetDepends.cxx | 26 ++++++++++++++++---------- Source/cmGraphAdjacencyList.h | 21 ++++++++++++++++++++- 4 files changed, 42 insertions(+), 13 deletions(-) diff --git a/Source/cmComputeComponentGraph.cxx b/Source/cmComputeComponentGraph.cxx index 165af1042..5bec6a1ec 100644 --- a/Source/cmComputeComponentGraph.cxx +++ b/Source/cmComputeComponentGraph.cxx @@ -149,7 +149,10 @@ void cmComputeComponentGraph::TransferEdges() int j_component = this->TarjanComponents[j]; if(i_component != j_component) { - this->ComponentGraph[i_component].push_back(j_component); + // We do not attempt to combine duplicate edges, but instead + // store the inter-component edges with suitable multiplicity. + this->ComponentGraph[i_component].push_back( + cmGraphEdge(j_component, ni->IsStrong())); } } } diff --git a/Source/cmComputeLinkDepends.cxx b/Source/cmComputeLinkDepends.cxx index 4b0214e2f..342c217d8 100644 --- a/Source/cmComputeLinkDepends.cxx +++ b/Source/cmComputeLinkDepends.cxx @@ -761,7 +761,8 @@ cmComputeLinkDepends::DisplayComponents() EdgeList const& ol = this->CCG->GetComponentGraphEdges(c); for(EdgeList::const_iterator oi = ol.begin(); oi != ol.end(); ++oi) { - fprintf(stderr, " followed by Component (%d)\n", *oi); + int i = *oi; + fprintf(stderr, " followed by Component (%d)\n", i); } fprintf(stderr, " topo order index %d\n", this->ComponentOrder[c]); diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index e82606cab..2b6b5ecc8 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -195,15 +195,13 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index) // Get the depender. cmTarget* depender = this->Targets[depender_index]; - // Keep track of dependencies already listed. - std::set emitted; - - // A target should not depend on itself. - emitted.insert(depender->GetName()); - // Loop over all targets linked directly. + { cmTarget::LinkLibraryVectorType const& tlibs = depender->GetOriginalLinkLibraries(); + std::set emitted; + // A target should not depend on itself. + emitted.insert(depender->GetName()); for(cmTarget::LinkLibraryVectorType::const_iterator lib = tlibs.begin(); lib != tlibs.end(); ++lib) { @@ -213,9 +211,14 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index) this->AddTargetDepend(depender_index, lib->first.c_str(), true); } } + } // Loop over all utility dependencies. + { std::set const& tutils = depender->GetUtilities(); + std::set emitted; + // A target should not depend on itself. + emitted.insert(depender->GetName()); for(std::set::const_iterator util = tutils.begin(); util != tutils.end(); ++util) { @@ -225,6 +228,7 @@ void cmComputeTargetDepends::CollectTargetDepends(int depender_index) this->AddTargetDepend(depender_index, util->c_str(), false); } } + } } //---------------------------------------------------------------------------- @@ -272,7 +276,8 @@ void cmComputeTargetDepends::AddTargetDepend(int depender_index, int dependee_index = tii->second; // Add this entry to the dependency graph. - this->InitialGraph[depender_index].push_back(dependee_index); + this->InitialGraph[depender_index].push_back( + cmGraphEdge(dependee_index, !linking)); } //---------------------------------------------------------------------------- @@ -291,8 +296,8 @@ cmComputeTargetDepends::DisplayGraph(Graph const& graph, const char* name) { int dependee_index = *ni; cmTarget* dependee = this->Targets[dependee_index]; - fprintf(stderr, " depends on target %d [%s]\n", dependee_index, - dependee->GetName()); + fprintf(stderr, " depends on target %d [%s] (%s)\n", dependee_index, + dependee->GetName(), ni->IsStrong()? "strong" : "weak"); } } fprintf(stderr, "\n"); @@ -390,7 +395,8 @@ cmComputeTargetDepends if(cmap[j] == c) { cmTarget* dependee = this->Targets[j]; - e << " depends on \"" << dependee->GetName() << "\"\n"; + e << " depends on \"" << dependee->GetName() << "\"" + << " (" << (ni->IsStrong()? "strong" : "weak") << ")\n"; } } } diff --git a/Source/cmGraphAdjacencyList.h b/Source/cmGraphAdjacencyList.h index 41411c42b..0149d33bd 100644 --- a/Source/cmGraphAdjacencyList.h +++ b/Source/cmGraphAdjacencyList.h @@ -14,7 +14,26 @@ #include "cmStandardIncludes.h" -struct cmGraphEdgeList: public std::vector {}; +/** + * Graph edge representation. Most use cases just need the + * destination vertex, so we support conversion to/from an int. We + * also store boolean to indicate whether an edge is "strong". + */ +class cmGraphEdge +{ +public: + cmGraphEdge(): Dest(0), Strong(true) {} + cmGraphEdge(int n): Dest(n), Strong(true) {} + cmGraphEdge(int n, bool s): Dest(n), Strong(s) {} + cmGraphEdge(cmGraphEdge const& r): Dest(r.Dest), Strong(r.Strong) {} + operator int() const { return this->Dest; } + + bool IsStrong() const { return this->Strong; } +private: + int Dest; + bool Strong; +}; +struct cmGraphEdgeList: public std::vector {}; struct cmGraphNodeList: public std::vector {}; struct cmGraphAdjacencyList: public std::vector {}; From adb58d5e36e482e7cc2c0b1a37d94b21da9234df Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 25 Aug 2010 10:14:31 -0400 Subject: [PATCH 028/152] Honor strong intra-component target dependencies Strong dependencies (created by add_dependencies) must be honored when linearizing a strongly-connected component of the target dependency graph. The initial graph edges have strong/weak labels and can contain cycles that do not consist exclusively of strong edges. The final graph never contains cycles so all edges can be strong. --- Source/cmComputeTargetDepends.cxx | 107 +++++++++++++++++++++------ Source/cmComputeTargetDepends.h | 10 ++- Tests/Dependency/Four/CMakeLists.txt | 3 + Tests/Dependency/Four/FourSrc.c | 1 + 4 files changed, 97 insertions(+), 24 deletions(-) diff --git a/Source/cmComputeTargetDepends.cxx b/Source/cmComputeTargetDepends.cxx index 2b6b5ecc8..313c680e5 100644 --- a/Source/cmComputeTargetDepends.cxx +++ b/Source/cmComputeTargetDepends.cxx @@ -129,7 +129,10 @@ bool cmComputeTargetDepends::Compute() } // Compute the final dependency graph. - this->ComputeFinalDepends(ccg); + if(!this->ComputeFinalDepends(ccg)) + { + return false; + } if(this->DebugMode) { this->DisplayGraph(this->FinalGraph, "final"); @@ -368,7 +371,8 @@ cmComputeTargetDepends //---------------------------------------------------------------------------- void cmComputeTargetDepends -::ComplainAboutBadComponent(cmComputeComponentGraph const& ccg, int c) +::ComplainAboutBadComponent(cmComputeComponentGraph const& ccg, int c, + bool strong) { // Construct the error message. cmOStringStream e; @@ -400,7 +404,15 @@ cmComputeTargetDepends } } } - if(this->NoCycles) + if(strong) + { + // Custom command executable dependencies cannot occur within a + // component of static libraries. The cycle must appear in calls + // to add_dependencies. + e << "The component contains at least one cycle consisting of strong " + << "dependencies (created by add_dependencies) that cannot be broken."; + } + else if(this->NoCycles) { e << "The GLOBAL_DEPENDS_NO_CYCLES global property is enabled, so " << "cyclic dependencies are not allowed even among static libraries."; @@ -414,7 +426,49 @@ cmComputeTargetDepends } //---------------------------------------------------------------------------- -void +bool +cmComputeTargetDepends +::IntraComponent(std::vector const& cmap, int c, int i, int* head, + std::set& emitted, std::set& visited) +{ + if(!visited.insert(i).second) + { + // Cycle in utility depends! + return false; + } + if(emitted.insert(i).second) + { + // Honor strong intra-component edges in the final order. + EdgeList const& el = this->InitialGraph[i]; + for(EdgeList::const_iterator ei = el.begin(); ei != el.end(); ++ei) + { + int j = *ei; + if(cmap[j] == c && ei->IsStrong()) + { + this->FinalGraph[i].push_back(j); + if(!this->IntraComponent(cmap, c, j, head, emitted, visited)) + { + return false; + } + } + } + + // Prepend to a linear linked-list of intra-component edges. + if(*head >= 0) + { + this->FinalGraph[i].push_back(*head); + } + else + { + this->ComponentTail[c] = i; + } + *head = i; + } + return true; +} + +//---------------------------------------------------------------------------- +bool cmComputeTargetDepends ::ComputeFinalDepends(cmComputeComponentGraph const& ccg) { @@ -426,34 +480,43 @@ cmComputeTargetDepends this->FinalGraph.resize(0); this->FinalGraph.resize(this->InitialGraph.size()); + // Choose intra-component edges to linearize dependencies. + std::vector const& cmap = ccg.GetComponentMap(); + this->ComponentHead.resize(components.size()); + this->ComponentTail.resize(components.size()); + int nc = static_cast(components.size()); + for(int c=0; c < nc; ++c) + { + int head = -1; + std::set emitted; + NodeList const& nl = components[c]; + for(NodeList::const_reverse_iterator ni = nl.rbegin(); + ni != nl.rend(); ++ni) + { + std::set visited; + if(!this->IntraComponent(cmap, c, *ni, &head, emitted, visited)) + { + // Cycle in add_dependencies within component! + this->ComplainAboutBadComponent(ccg, c, true); + return false; + } + } + this->ComponentHead[c] = head; + } + // Convert inter-component edges to connect component tails to heads. int n = static_cast(cgraph.size()); for(int depender_component=0; depender_component < n; ++depender_component) { - int depender_component_tail = components[depender_component].back(); + int depender_component_tail = this->ComponentTail[depender_component]; EdgeList const& nl = cgraph[depender_component]; for(EdgeList::const_iterator ni = nl.begin(); ni != nl.end(); ++ni) { int dependee_component = *ni; - int dependee_component_head = components[dependee_component].front(); + int dependee_component_head = this->ComponentHead[dependee_component]; this->FinalGraph[depender_component_tail] .push_back(dependee_component_head); } } - - // Compute intra-component edges. - int nc = static_cast(components.size()); - for(int c=0; c < nc; ++c) - { - // Within the component each target depends on that following it. - NodeList const& nl = components[c]; - NodeList::const_iterator ni = nl.begin(); - int last_i = *ni; - for(++ni; ni != nl.end(); ++ni) - { - int i = *ni; - this->FinalGraph[last_i].push_back(i); - last_i = i; - } - } + return true; } diff --git a/Source/cmComputeTargetDepends.h b/Source/cmComputeTargetDepends.h index b18a053dc..240de7670 100644 --- a/Source/cmComputeTargetDepends.h +++ b/Source/cmComputeTargetDepends.h @@ -45,7 +45,7 @@ private: void CollectTargetDepends(int depender_index); void AddTargetDepend(int depender_index, const char* dependee_name, bool linking); - void ComputeFinalDepends(cmComputeComponentGraph const& ccg); + bool ComputeFinalDepends(cmComputeComponentGraph const& ccg); cmGlobalGenerator* GlobalGenerator; bool DebugMode; @@ -68,7 +68,13 @@ private: // Deal with connected components. void DisplayComponents(cmComputeComponentGraph const& ccg); bool CheckComponents(cmComputeComponentGraph const& ccg); - void ComplainAboutBadComponent(cmComputeComponentGraph const& ccg, int c); + void ComplainAboutBadComponent(cmComputeComponentGraph const& ccg, int c, + bool strong = false); + + std::vector ComponentHead; + std::vector ComponentTail; + bool IntraComponent(std::vector const& cmap, int c, int i, int* head, + std::set& emitted, std::set& visited); }; #endif diff --git a/Tests/Dependency/Four/CMakeLists.txt b/Tests/Dependency/Four/CMakeLists.txt index ba3711fe6..df0f1624e 100644 --- a/Tests/Dependency/Four/CMakeLists.txt +++ b/Tests/Dependency/Four/CMakeLists.txt @@ -1,3 +1,6 @@ +INCLUDE_DIRECTORIES(${Dependency_BINARY_DIR}/Two) ADD_LIBRARY( Four FourSrc.c ) TARGET_LINK_LIBRARIES( Four One Two NoDepA ) +# TwoCustom must build before Four. +ADD_DEPENDENCIES(Four TwoCustom) diff --git a/Tests/Dependency/Four/FourSrc.c b/Tests/Dependency/Four/FourSrc.c index e8fefcda2..23a66a49a 100644 --- a/Tests/Dependency/Four/FourSrc.c +++ b/Tests/Dependency/Four/FourSrc.c @@ -1,3 +1,4 @@ +#include /* Requires TwoCustom to be built first. */ void NoDepAFunction(); void OneFunction(); void TwoFunction(); From 737261785a85f365c28ce4fb3da7695f8c09e139 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 26 Aug 2010 00:01:04 -0400 Subject: [PATCH 029/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 8691e1a53..329b7df0a 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 08) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 25) +SET(KWSYS_DATE_STAMP_DAY 26) From 43f96eaf93541b6e820ca1ebc15802aaa38427e2 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Thu, 26 Aug 2010 21:01:58 +0200 Subject: [PATCH 030/152] Remove trailing whitespace Alex --- Source/cmTargetLinkLibrariesCommand.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index f1f76c88c..d99426093 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -57,7 +57,7 @@ bool cmTargetLinkLibrariesCommand // specification when the keyword is encountered. this->DoingInterface = false; - // add libraries, nothe that there is an optional prefix + // add libraries, nothe that there is an optional prefix // of debug and optimized than can be used for(unsigned int i=1; i < args.size(); ++i) { @@ -118,7 +118,7 @@ bool cmTargetLinkLibrariesCommand llt = cmTarget::GENERAL; std::string linkType = args[0]; linkType += "_LINK_TYPE"; - const char* linkTypeString = + const char* linkTypeString = this->Makefile->GetDefinition( linkType.c_str() ); if(linkTypeString) { @@ -133,7 +133,7 @@ bool cmTargetLinkLibrariesCommand } this->HandleLibrary(args[i].c_str(), llt); } - } + } // Make sure the last argument was not a library type specifier. if(haveLLT) From c7866351494885cee1d1d5747ec2bc03fe845f6f Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Thu, 26 Aug 2010 21:02:40 +0200 Subject: [PATCH 031/152] Make target_link_libraries() complain if bad target name is used target_link_libraries() did not complain if there was only one argument, and this one (first) argument wasn't a valid target name, e.g. add_executable(hello main.cpp) target_link_libraries(-static-intel) Here the target "hello" was forgotten in the tll() call, but cmake didn't complain. With this commit it does. Alex --- Source/cmTargetLinkLibrariesCommand.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index d99426093..390e39b3b 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -29,12 +29,6 @@ bool cmTargetLinkLibrariesCommand return false; } - // but we might not have any libs after variable expansion - if(args.size() < 2) - { - return true; - } - // Lookup the target for which libraries are specified. this->Target = this->Makefile->GetCMakeInstance() @@ -49,6 +43,12 @@ bool cmTargetLinkLibrariesCommand return true; } + // but we might not have any libs after variable expansion + if(args.size() < 2) + { + return true; + } + // Keep track of link configuration specifiers. cmTarget::LinkLibraryType llt = cmTarget::GENERAL; bool haveLLT = false; From 6aef6d84d7faa5e5f0e93237f991a8ef134ddff9 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Thu, 26 Aug 2010 21:54:43 +0200 Subject: [PATCH 032/152] Just warn in case of a bad target as only argument for t_l_l() As discussed on cmake-devel, if target_link_libraries() is called with only one argument, and this one argument is not a valid target, just print a warning but don't fail, since otherwise probably some existing code somewhere might stop building. Alex --- Source/cmTargetLinkLibrariesCommand.cxx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 390e39b3b..e92a8fa9e 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -38,8 +38,18 @@ bool cmTargetLinkLibrariesCommand cmOStringStream e; e << "Cannot specify link libraries for target \"" << args[0] << "\" " << "which is not built by this project."; - this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); - cmSystemTools::SetFatalErrorOccured(); + // The bad target is the only argument, just warn, don't fail, because + // there is probably some code out there which would stop building + // otherwise: + if (args.size() < 2) + { + this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str()); + } + else + { + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); + cmSystemTools::SetFatalErrorOccured(); + } return true; } From 4fec681fa7cdc89a4aa40c95fa0156c566ff8722 Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Sun, 22 Aug 2010 21:14:17 +0200 Subject: [PATCH 033/152] VS: Map /ENTRY linker option to EntryPointSymbol --- Source/cmLocalVisualStudio7Generator.cxx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx index 296674518..cb34bb6cf 100644 --- a/Source/cmLocalVisualStudio7Generator.cxx +++ b/Source/cmLocalVisualStudio7Generator.cxx @@ -466,6 +466,8 @@ cmVS7FlagTable cmLocalVisualStudio7GeneratorLinkFlagTable[] = {"GenerateManifest", "MANIFEST", "enable manifest generation", "TRUE", 0}, {"LinkIncremental", "INCREMENTAL:NO", "link incremental", "1", 0}, {"LinkIncremental", "INCREMENTAL:YES", "link incremental", "2", 0}, + {"EntryPointSymbol", "ENTRY:", "sets the starting address", "", + cmVS7FlagTable::UserValue}, {"IgnoreDefaultLibraryNames", "NODEFAULTLIB:", "default libs to ignore", "", cmVS7FlagTable::UserValue | cmVS7FlagTable::SemicolonAppendable}, {"IgnoreAllDefaultLibraries", "NODEFAULTLIB", "ignore all default libs", From ef4394defa22ba4288731ae65285c2f33e9e360a Mon Sep 17 00:00:00 2001 From: Patrick Gansterer Date: Sun, 22 Aug 2010 21:23:11 +0200 Subject: [PATCH 034/152] VS: Add ArchitectureId to VS 8 and 9 generators Avoid duplicate architecture string literals. --- Source/cmGlobalVisualStudio8Generator.cxx | 5 +++-- Source/cmGlobalVisualStudio8Generator.h | 2 ++ Source/cmGlobalVisualStudio8Win64Generator.cxx | 3 +-- Source/cmGlobalVisualStudio9Generator.cxx | 4 ++-- Source/cmGlobalVisualStudio9Win64Generator.cxx | 3 +-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index c4de91efc..2612a08b2 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -21,6 +21,7 @@ cmGlobalVisualStudio8Generator::cmGlobalVisualStudio8Generator() { this->FindMakeProgramFile = "CMakeVS8FindMake.cmake"; this->ProjectConfigurationSectionName = "ProjectConfigurationPlatforms"; + this->ArchitectureId = "X86"; } //---------------------------------------------------------------------------- @@ -55,8 +56,8 @@ void cmGlobalVisualStudio8Generator //---------------------------------------------------------------------------- void cmGlobalVisualStudio8Generator::AddPlatformDefinitions(cmMakefile* mf) { - mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86"); - mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "X86"); + mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", this->ArchitectureId); + mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", this->ArchitectureId); mf->AddDefinition("MSVC80", "1"); } diff --git a/Source/cmGlobalVisualStudio8Generator.h b/Source/cmGlobalVisualStudio8Generator.h index ceee53bcc..e0d5d8044 100644 --- a/Source/cmGlobalVisualStudio8Generator.h +++ b/Source/cmGlobalVisualStudio8Generator.h @@ -78,5 +78,7 @@ protected: virtual void WriteProjectConfigurations(std::ostream& fout, const char* name, bool partOfDefaultBuild); + + const char* ArchitectureId; }; #endif diff --git a/Source/cmGlobalVisualStudio8Win64Generator.cxx b/Source/cmGlobalVisualStudio8Win64Generator.cxx index ea2c65f3a..3469b1710 100644 --- a/Source/cmGlobalVisualStudio8Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio8Win64Generator.cxx @@ -19,6 +19,7 @@ cmGlobalVisualStudio8Win64Generator::cmGlobalVisualStudio8Win64Generator() { + this->ArchitectureId = "x64"; } ///! Create a local generator appropriate to this Global Generator @@ -47,6 +48,4 @@ void cmGlobalVisualStudio8Win64Generator { this->cmGlobalVisualStudio8Generator::AddPlatformDefinitions(mf); mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE"); - mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "x64"); - mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "x64"); } diff --git a/Source/cmGlobalVisualStudio9Generator.cxx b/Source/cmGlobalVisualStudio9Generator.cxx index 98acf0f89..f8ceea0b0 100644 --- a/Source/cmGlobalVisualStudio9Generator.cxx +++ b/Source/cmGlobalVisualStudio9Generator.cxx @@ -25,8 +25,8 @@ cmGlobalVisualStudio9Generator::cmGlobalVisualStudio9Generator() //---------------------------------------------------------------------------- void cmGlobalVisualStudio9Generator::AddPlatformDefinitions(cmMakefile* mf) { - mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "X86"); - mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "X86"); + mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", this->ArchitectureId); + mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", this->ArchitectureId); mf->AddDefinition("MSVC90", "1"); } diff --git a/Source/cmGlobalVisualStudio9Win64Generator.cxx b/Source/cmGlobalVisualStudio9Win64Generator.cxx index 67c0bf612..ff4fd4f5d 100644 --- a/Source/cmGlobalVisualStudio9Win64Generator.cxx +++ b/Source/cmGlobalVisualStudio9Win64Generator.cxx @@ -16,6 +16,7 @@ cmGlobalVisualStudio9Win64Generator::cmGlobalVisualStudio9Win64Generator() { + this->ArchitectureId = "x64"; } ///! Create a local generator appropriate to this Global Generator @@ -44,6 +45,4 @@ void cmGlobalVisualStudio9Win64Generator { cmGlobalVisualStudio9Generator::AddPlatformDefinitions(mf); mf->AddDefinition("CMAKE_FORCE_WIN64", "TRUE"); - mf->AddDefinition("MSVC_C_ARCHITECTURE_ID", "x64"); - mf->AddDefinition("MSVC_CXX_ARCHITECTURE_ID", "x64"); } From d8ccd1760c39ba836dc8daf3c0ea4f313be663cc Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Fri, 27 Aug 2010 00:01:05 -0400 Subject: [PATCH 035/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 329b7df0a..7fe952b33 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 08) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 26) +SET(KWSYS_DATE_STAMP_DAY 27) From e87b6bbddb2a7a7e3a2772645ee1d28531993cd5 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 27 Aug 2010 09:15:29 -0400 Subject: [PATCH 036/152] libarchive: Remove SCHILY dev,ino,nlink attributes (#11176) At least one version of GNU tar (1.15.1 with Fedora patches) does not recognize these attributes and exits with error. Do not generate them. Patch from upstream libarchive svn r2563. --- .../libarchive/archive_write_set_format_pax.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/Utilities/cmlibarchive/libarchive/archive_write_set_format_pax.c b/Utilities/cmlibarchive/libarchive/archive_write_set_format_pax.c index c09710815..ecd7871ad 100644 --- a/Utilities/cmlibarchive/libarchive/archive_write_set_format_pax.c +++ b/Utilities/cmlibarchive/libarchive/archive_write_set_format_pax.c @@ -813,16 +813,6 @@ archive_write_pax_header(struct archive_write *a, add_pax_attr_w(&(pax->pax_header), "SCHILY.acl.default", wp); - /* Include star-compatible metadata info. */ - /* Note: "SCHILY.dev{major,minor}" are NOT the - * major/minor portions of "SCHILY.dev". */ - add_pax_attr_int(&(pax->pax_header), "SCHILY.dev", - archive_entry_dev(entry_main)); - add_pax_attr_int(&(pax->pax_header), "SCHILY.ino", - archive_entry_ino64(entry_main)); - add_pax_attr_int(&(pax->pax_header), "SCHILY.nlink", - archive_entry_nlink(entry_main)); - /* Store extended attributes */ archive_write_pax_header_xattrs(pax, entry_original); } From a99f6208349c6ef93cd2fe558d3a6e9aa1194251 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 27 Aug 2010 09:56:00 -0400 Subject: [PATCH 037/152] Fix unused parameter warning in VS 7.1 generator The cmGlobalVisualStudio71Generator::WriteProjectDepends method no longer uses its 'dspname' parameter. Leave off the name to avoid the unused parameter warning. Later we should refactor the method to avoid passing the argument altogether. --- Source/cmGlobalVisualStudio71Generator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmGlobalVisualStudio71Generator.cxx b/Source/cmGlobalVisualStudio71Generator.cxx index 4f5901cda..1a5c94093 100644 --- a/Source/cmGlobalVisualStudio71Generator.cxx +++ b/Source/cmGlobalVisualStudio71Generator.cxx @@ -197,7 +197,7 @@ cmGlobalVisualStudio71Generator::WriteProject(std::ostream& fout, void cmGlobalVisualStudio71Generator ::WriteProjectDepends(std::ostream& fout, - const char* dspname, + const char*, const char*, cmTarget& target) { VSDependSet const& depends = this->VSTargetDepends[&target]; From 4746365e0312693b754e59f51e692285c046fa89 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 27 Aug 2010 10:06:28 -0400 Subject: [PATCH 038/152] KWSys: Avoid empty string dereference in SplitString --- Source/kwsys/SystemTools.cxx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index bcdb193d1..5002a063f 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -1405,6 +1405,10 @@ kwsys_stl::vector SystemTools::SplitString(const char* p, char se { kwsys_stl::string path = p; kwsys_stl::vector paths; + if(path.empty()) + { + return paths; + } if(isPath && path[0] == '/') { path.erase(path.begin()); From 3bf1869c93daf131e8040e88f20986cf01bb9779 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 27 Aug 2010 10:15:16 -0400 Subject: [PATCH 039/152] KWSys: Improve SplitPath method documentation Document explicitly that the first component always exists. Fix the documentation of SplitPathRootComponent to note that home directory roots (~/ and ~u/) always have a trailing slash. --- Source/kwsys/SystemTools.hxx.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/kwsys/SystemTools.hxx.in b/Source/kwsys/SystemTools.hxx.in index ec70320d4..cf4792304 100644 --- a/Source/kwsys/SystemTools.hxx.in +++ b/Source/kwsys/SystemTools.hxx.in @@ -372,8 +372,8 @@ public: * "c:/" = Windows full path (can be any drive letter) * "c:" = Windows drive-letter relative path (can be any drive letter) * "//" = Network path - * "~" = Home path for current user - * "~u" = Home path for user 'u' + * "~/" = Home path for current user + * "~u/" = Home path for user 'u' * "" = Relative path * * A pointer to the rest of the path after the root component is @@ -385,7 +385,7 @@ public: /** * Split a path name into its basic components. The first component - * is one of the roots returned by SplitPathRootComponent. + * always exists and is the root returned by SplitPathRootComponent. * The remaining components form the path. If there is a trailing * slash then the last component is the empty string. The * components can be recombined as "c[0]c[1]/c[2]/.../c[n]" to From 735a8c26d749d3a1e7a539386161ed98e22c9005 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 27 Aug 2010 10:46:35 -0400 Subject: [PATCH 040/152] KWSys: Use SplitPath in GetActualCaseForPath Avoid using the old SplitString method in favor of the more robust SplitPath method. --- Source/kwsys/SystemTools.cxx | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Source/kwsys/SystemTools.cxx b/Source/kwsys/SystemTools.cxx index 5002a063f..8aa99ebe9 100644 --- a/Source/kwsys/SystemTools.cxx +++ b/Source/kwsys/SystemTools.cxx @@ -3063,30 +3063,35 @@ kwsys_stl::string SystemTools::RelativePath(const char* local, const char* remot static int GetCasePathName(const kwsys_stl::string & pathIn, kwsys_stl::string & casePath) { - kwsys_stl::vector path_components = - SystemTools::SplitString(pathIn.c_str(), '/', true); - if(path_components.empty()) + kwsys_stl::vector path_components; + SystemTools::SplitPath(pathIn.c_str(), path_components); + if(path_components[0].empty()) // First component always exists. { + // Relative paths cannot be converted. casePath = ""; return 0; } + + // Start with root component. kwsys_stl::vector::size_type idx = 0; - // assume always absolute path, so just take first casePath = path_components[idx++]; + const char* sep = ""; + // If network path, fill casePath with server/share so FindFirstFile // will work after that. Maybe someday call other APIs to get // actual case of servers and shares. - if(path_components.size() > 2 && pathIn.size() >= 2 && - pathIn[0] == '/' && pathIn[1] == '/') + if(path_components.size() > 2 && path_components[0] == "//") { casePath += path_components[idx++]; casePath += "/"; casePath += path_components[idx++]; + sep = "/"; } for(; idx < path_components.size(); idx++) { - casePath += "/"; + casePath += sep; + sep = "/"; kwsys_stl::string test_str = casePath; test_str += path_components[idx]; From 216aa24d9296d3c9af607aea59e38c51c482838b Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sat, 28 Aug 2010 00:01:04 -0400 Subject: [PATCH 041/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 7fe952b33..a4e8a4130 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 08) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 27) +SET(KWSYS_DATE_STAMP_DAY 28) From da033b10d26c3b25c44547dec6b398cabe864510 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sat, 28 Aug 2010 16:01:49 +0200 Subject: [PATCH 042/152] Remove trailing whitespace Alex --- Source/cmPolicies.cxx | 47 ++++++++++++++++++++++--------------------- Source/cmPolicies.h | 6 +++--- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index 69d3e5197..fb8473877 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -15,8 +15,8 @@ const char* cmPolicies::PolicyStatusNames[] = { class cmPolicy { -public: - cmPolicy(cmPolicies::PolicyID iD, +public: + cmPolicy(cmPolicies::PolicyID iD, const char *idString, const char *shortDescription, const char *longDescription, @@ -55,7 +55,7 @@ public: return v.str(); } - bool IsPolicyNewerThan(unsigned int majorV, + bool IsPolicyNewerThan(unsigned int majorV, unsigned int minorV, unsigned int patchV, unsigned int tweakV) @@ -86,7 +86,7 @@ public: } return (tweakV < this->TweakVersionIntroduced); } - + cmPolicies::PolicyID ID; std::string IDString; std::string ShortDescription; @@ -285,12 +285,12 @@ cmPolicies::cmPolicies() "The NEW behavior for this policy is to produce an error if a bundle " "target is installed without a BUNDLE DESTINATION.", 2,6,0,0, cmPolicies::WARN); - + this->DefinePolicy( CMP0007, "CMP0007", "list command no longer ignores empty elements.", "This policy determines whether the list command will " - "ignore empty elements in the list. " + "ignore empty elements in the list. " "CMake 2.4 and below list commands ignored all empty elements" " in the list. For example, a;b;;c would have length 3 and not 4. " "The OLD behavior for this policy is to ignore empty list elements. " @@ -426,7 +426,7 @@ cmPolicies::cmPolicies() this->DefinePolicy( CMP0015, "CMP0015", "link_directories() treats paths relative to the source dir.", - "In CMake 2.6.4 and lower the link_directories() command passed relative " + "In CMake 2.8.0 and lower the link_directories() command passed relative " "paths unchanged to the linker. " "In CMake 2.8.1 and above the link_directories() command prefers to " "interpret relative paths with respect to CMAKE_CURRENT_SOURCE_DIR, " @@ -437,12 +437,13 @@ cmPolicies::cmPolicies() "absolute paths by appending the relative path to " "CMAKE_CURRENT_SOURCE_DIR.", 2,8,1,0, cmPolicies::WARN); + } cmPolicies::~cmPolicies() { // free the policies - std::map::iterator i + std::map::iterator i = this->Policies.begin(); for (;i != this->Policies.end(); ++i) { @@ -451,7 +452,7 @@ cmPolicies::~cmPolicies() } void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD, - const char *idString, + const char *idString, const char *shortDescription, const char *longDescription, unsigned int majorVersionIntroduced, @@ -467,7 +468,7 @@ void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD, "ID ", this->GetPolicyIDString(iD).c_str()); return; } - + this->Policies[iD] = new cmPolicy(iD, idString, shortDescription, longDescription, @@ -480,7 +481,7 @@ void cmPolicies::DefinePolicy(cmPolicies::PolicyID iD, } //---------------------------------------------------------------------------- -bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf, +bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf, const char *version) { std::string ver = "2.4.0"; @@ -505,7 +506,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf, mf->IssueMessage(cmake::FATAL_ERROR, e.str()); return false; } - + // it is an error if the policy version is less than 2.4 if (majorVer < 2 || (majorVer == 2 && minorVer < 4)) { @@ -547,7 +548,7 @@ bool cmPolicies::ApplyPolicyVersion(cmMakefile *mf, // now loop over all the policies and set them as appropriate std::vector ancientPolicies; - std::map::iterator i + std::map::iterator i = this->Policies.begin(); for (;i != this->Policies.end(); ++i) { @@ -589,7 +590,7 @@ bool cmPolicies::GetPolicyID(const char *id, cmPolicies::PolicyID &pid) { return false; } - std::map::iterator pos = + std::map::iterator pos = this->PolicyStringMap.find(id); if (pos == this->PolicyStringMap.end()) { @@ -601,7 +602,7 @@ bool cmPolicies::GetPolicyID(const char *id, cmPolicies::PolicyID &pid) std::string cmPolicies::GetPolicyIDString(cmPolicies::PolicyID pid) { - std::map::iterator pos = + std::map::iterator pos = this->Policies.find(pid); if (pos == this->Policies.end()) { @@ -614,7 +615,7 @@ std::string cmPolicies::GetPolicyIDString(cmPolicies::PolicyID pid) ///! return a warning string for a given policy std::string cmPolicies::GetPolicyWarning(cmPolicies::PolicyID id) { - std::map::iterator pos = + std::map::iterator pos = this->Policies.find(id); if (pos == this->Policies.end()) { @@ -633,12 +634,12 @@ std::string cmPolicies::GetPolicyWarning(cmPolicies::PolicyID id) "and suppress this warning."; return msg.str(); } - - + + ///! return an error string for when a required policy is unspecified std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id) { - std::map::iterator pos = + std::map::iterator pos = this->Policies.find(id); if (pos == this->Policies.end()) { @@ -664,25 +665,25 @@ std::string cmPolicies::GetRequiredPolicyError(cmPolicies::PolicyID id) } ///! Get the default status for a policy -cmPolicies::PolicyStatus +cmPolicies::PolicyStatus cmPolicies::GetPolicyStatus(cmPolicies::PolicyID id) { // if the policy is not know then what? - std::map::iterator pos = + std::map::iterator pos = this->Policies.find(id); if (pos == this->Policies.end()) { // TODO is this right? return cmPolicies::WARN; } - + return pos->second->Status; } void cmPolicies::GetDocumentation(std::vector& v) { // now loop over all the policies and set them as appropriate - std::map::iterator i + std::map::iterator i = this->Policies.begin(); for (;i != this->Policies.end(); ++i) { diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index 23064dc34..eb714c13a 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -60,10 +60,10 @@ public: ///! convert a string policy ID into a number bool GetPolicyID(const char *id, /* out */ cmPolicies::PolicyID &pid); std::string GetPolicyIDString(cmPolicies::PolicyID pid); - + ///! Get the default status for a policy cmPolicies::PolicyStatus GetPolicyStatus(cmPolicies::PolicyID id); - + ///! Define a Policy for CMake void DefinePolicy(cmPolicies::PolicyID id, const char *stringID, @@ -80,7 +80,7 @@ public: ///! return a warning string for a given policy std::string GetPolicyWarning(cmPolicies::PolicyID id); - + ///! return an error string for when a required policy is unspecified std::string GetRequiredPolicyError(cmPolicies::PolicyID id); From 6acc71c09df80e9530ff643fb4e37ebe145b46ad Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sat, 28 Aug 2010 16:06:45 +0200 Subject: [PATCH 043/152] New CMP0016 for deciding whether an unknown target in TLL() is an error. When set to OLD, target_link_libraries() silently accepts if it is called with only one argument and this one argument is not a target. When set to NEW, this is an error. By default it is a warning now. Alex --- Source/cmPolicies.cxx | 8 +++++ Source/cmPolicies.h | 1 + Source/cmTargetLinkLibrariesCommand.cxx | 45 +++++++++++++++++++++---- 3 files changed, 47 insertions(+), 7 deletions(-) diff --git a/Source/cmPolicies.cxx b/Source/cmPolicies.cxx index fb8473877..3fe92de7c 100644 --- a/Source/cmPolicies.cxx +++ b/Source/cmPolicies.cxx @@ -438,6 +438,14 @@ cmPolicies::cmPolicies() "CMAKE_CURRENT_SOURCE_DIR.", 2,8,1,0, cmPolicies::WARN); + this->DefinePolicy( + CMP0016, "CMP0016", + "target_link_libraries() reports error if only argument is not a target.", + "In CMake 2.8.2 and lower the target_link_libraries() command silently " + "ignored if it was called with only one argument, and this argument " + "wasn't a valid target. " + "In CMake 2.8.3 and above it reports an error in this case.", + 2,8,3,0, cmPolicies::WARN); } cmPolicies::~cmPolicies() diff --git a/Source/cmPolicies.h b/Source/cmPolicies.h index eb714c13a..fce33ac04 100644 --- a/Source/cmPolicies.h +++ b/Source/cmPolicies.h @@ -51,6 +51,7 @@ public: CMP0013, // Duplicate binary directories not allowed CMP0014, // Input directories must have CMakeLists.txt CMP0015, // link_directories() treats paths relative to source dir + CMP0016, // target_link_libraries() fails if only argument is not a target // Always the last entry. Useful mostly to avoid adding a comma // the last policy when adding a new one. diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index e92a8fa9e..805959def 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -35,20 +35,51 @@ bool cmTargetLinkLibrariesCommand ->GetGlobalGenerator()->FindTarget(0, args[0].c_str()); if(!this->Target) { + cmake::MessageType t = cmake::FATAL_ERROR; // fail by default cmOStringStream e; e << "Cannot specify link libraries for target \"" << args[0] << "\" " << "which is not built by this project."; - // The bad target is the only argument, just warn, don't fail, because - // there is probably some code out there which would stop building - // otherwise: + // The bad target is the only argument. Check how policy CMP0016 is set, + // and accept, warn or fail respectively: if (args.size() < 2) { - this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str()); + switch (this->Makefile->GetPolicyStatus(cmPolicies::CMP0016)) + { + case cmPolicies::WARN: + t = cmake::AUTHOR_WARNING; + // Print the warning. + e << "\n" + << "CMake does not support this but it used to work accidentally " + << "and is being allowed for compatibility." + << "\n" << this->Makefile->GetPolicies()-> + GetPolicyWarning(cmPolicies::CMP0016); + break; + case cmPolicies::OLD: // OLD behavior does not warn. + t = cmake::MESSAGE; + break; + case cmPolicies::REQUIRED_IF_USED: + case cmPolicies::REQUIRED_ALWAYS: + e << "\n" << this->Makefile->GetPolicies()-> + GetRequiredPolicyError(cmPolicies::CMP0016); + break; + case cmPolicies::NEW: // NEW behavior prints the error. + default: + break; + } } - else + + // now actually print the message + switch(t) { - this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); - cmSystemTools::SetFatalErrorOccured(); + case cmake::AUTHOR_WARNING: + this->Makefile->IssueMessage(cmake::AUTHOR_WARNING, e.str()); + break; + case cmake::FATAL_ERROR: + this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str()); + cmSystemTools::SetFatalErrorOccured(); + break; + default: + break; } return true; } From 013e0039eeb7e8bf213c3851161ce9a18f7b940d Mon Sep 17 00:00:00 2001 From: Eric NOULARD Date: Sat, 28 Aug 2010 16:50:06 +0200 Subject: [PATCH 044/152] CPack handle symlinks in CPACK_INSTALLED_DIRECTORIES fix for bug5430 The proposed solution is to avoid to CopyIfDifferent any links found in CPACK_INSTALLED_DIRECTORIES but memorize them instead then at the end of the processing for each dir do re-create the link in the installed tree. Current patch should work if the link are "local" to the directory. --- Source/CPack/cmCPackGenerator.cxx | 44 ++++++++++++++++++++++++++++++- 1 file changed, 43 insertions(+), 1 deletion(-) diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 4ae2d1fe6..2204ab585 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -329,6 +329,7 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( it != installDirectoriesVector.end(); ++it ) { + std::list > symlinkedFiles; cmCPackLogger(cmCPackLog::LOG_DEBUG, "Find files" << std::endl); cmsys::Glob gl; std::string top = it->c_str(); @@ -372,7 +373,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(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: " @@ -380,6 +392,36 @@ int cmCPackGenerator::InstallProjectViaInstalledDirectories( return 0; } } + /* rebuild symlinks in the installed tree */ + if (symlinkedFiles.size()>0) + { + std::list< std::pair >::iterator symlinkedIt; + std::string curDir = cmSystemTools::GetCurrentWorkingDirectory(); + std::string goToDir = tempDir; + goToDir += "/"+subdir; + cmCPackLogger(cmCPackLog::LOG_DEBUG, + "Change dir to: " << goToDir <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 < Date: Sun, 29 Aug 2010 00:01:04 -0400 Subject: [PATCH 045/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index a4e8a4130..ac37aa615 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 08) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 28) +SET(KWSYS_DATE_STAMP_DAY 29) From dfe9c95129b9ca05ea8ca98e69d973c9c40e5a4e Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sun, 29 Aug 2010 17:07:39 +0200 Subject: [PATCH 046/152] Record all considered Config files and their versions. As suggested on cmake-devel, find_package in Config-mode now records all considered config-files and their versions in _CONSIDERED_CONFIGS and _CONSIDERED_VERSIONS respectively. Alex --- Source/cmFindPackageCommand.cxx | 76 ++++++++++++++++++++++++++++----- Source/cmFindPackageCommand.h | 5 ++- 2 files changed, 70 insertions(+), 11 deletions(-) diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index eb860143e..b8dcb3d13 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 _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 _CONSIDERED_CONFIGS, " + "the associated versions in _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,9 @@ bool cmFindPackageCommand::FindModule(bool& found) //---------------------------------------------------------------------------- bool cmFindPackageCommand::HandlePackageMode() { + this->ConsideredConfigFiles.clear(); + this->ConsideredVersions.clear(); + // Support old capitalization behavior. std::string upperDir = cmSystemTools::UpperCase(this->Name); std::string upperFound = cmSystemTools::UpperCase(this->Name); @@ -897,6 +905,35 @@ bool cmFindPackageCommand::HandlePackageMode() } #endif + std::string consideredConfigsVar = this->Name; + consideredConfigsVar += "_CONSIDERED_CONFIGS"; + std::string consideredVersionsVar = this->Name; + consideredVersionsVar += "_CONSIDERED_VERSIONS"; + + std::string consideredConfigFiles; + for(std::vector::const_iterator + it = this->ConsideredConfigFiles.begin(); + it != this->ConsideredConfigFiles.end(); ++it) + { + consideredConfigFiles += *it; + consideredConfigFiles += ";"; + } + + std::string consideredVersions; + for(std::vector::const_iterator + it = this->ConsideredVersions.begin(); + it != this->ConsideredVersions.end(); ++it) + { + consideredVersions += *it; + consideredVersions += ";"; + } + + this->Makefile->AddDefinition(consideredConfigsVar.c_str(), + consideredConfigFiles.c_str()); + + this->Makefile->AddDefinition(consideredVersionsVar.c_str(), + consideredVersions.c_str()); + return result; } @@ -1467,6 +1504,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); @@ -1474,31 +1515,40 @@ 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; + this->ConsideredConfigFiles.push_back(config_file); + this->ConsideredVersions.push_back(version); + + 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); @@ -1571,6 +1621,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 53ea4fc09..2495d6c55 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,8 @@ private: std::vector Names; std::vector Configs; std::set IgnoredPaths; + std::vector ConsideredConfigFiles; + std::vector ConsideredVersions; }; #endif From 130b0e21958535a4f4f408cf7392fa9b3ee336fe Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sun, 29 Aug 2010 17:43:45 +0200 Subject: [PATCH 047/152] Improve error message in Config-mode when no appropriate version was found If in config-mode config files have been found by find_package(), but their version didn't match the requested version, now all considered files and their versions are printed (instead of saying "didn't find config file) Alex --- Source/cmFindPackageCommand.cxx | 90 +++++++++++++++++++-------------- 1 file changed, 52 insertions(+), 38 deletions(-) diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index b8dcb3d13..90fcf6903 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -817,36 +817,56 @@ bool cmFindPackageCommand::HandlePackageMode() { // The variable is not set. cmOStringStream e; - e << "Could not find "; - if(!this->NoModule) + // If there are files in ConsideredConfigs, it means that FooConfig.cmake + // have been found, but they didn't have appropriate versions. + if (this->ConsideredConfigFiles.size() > 0) { - 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 << "The file will have one of the following names:\n"; - for(std::vector::const_iterator ci = this->Configs.begin(); - ci != this->Configs.end(); ++ci) + e << "Could not find configuration file for package " << this->Name + << " with " << (this->VersionExact ? "exact " : "at least ") + << "version " << this->Version << " .\n" + << "Found the following files:\n"; + for(std::vector::size_type i=0; + iConsideredConfigFiles.size(); i++) { - e << " " << *ci << "\n"; + e << " " << this->ConsideredConfigFiles[i] + << ", version: " << this->ConsideredVersions[i] << "\n"; } } + else + { + 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 << "The file will have one of the following names:\n"; + for(std::vector::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()); } @@ -911,20 +931,14 @@ bool cmFindPackageCommand::HandlePackageMode() consideredVersionsVar += "_CONSIDERED_VERSIONS"; std::string consideredConfigFiles; - for(std::vector::const_iterator - it = this->ConsideredConfigFiles.begin(); - it != this->ConsideredConfigFiles.end(); ++it) - { - consideredConfigFiles += *it; - consideredConfigFiles += ";"; - } - std::string consideredVersions; - for(std::vector::const_iterator - it = this->ConsideredVersions.begin(); - it != this->ConsideredVersions.end(); ++it) + + for(std::vector::size_type i=0; + iConsideredConfigFiles.size(); i++) { - consideredVersions += *it; + consideredConfigFiles += this->ConsideredConfigFiles[i]; + consideredConfigFiles += ";"; + consideredVersions += this->ConsideredVersions[i]; consideredVersions += ";"; } From 0367245f0c1a665d44b7169cc0f24eda5dbb4de3 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sun, 29 Aug 2010 17:51:44 +0200 Subject: [PATCH 048/152] Replace the two vector with one vector Before this patch there were two separate vectors, and the code made sure they always had the same size. With this patch the code doesn't have to ensure this anymore, there is only one vector now. Alex --- Source/cmFindPackageCommand.cxx | 27 ++++++++++++++------------- Source/cmFindPackageCommand.h | 5 +++-- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 90fcf6903..48122a85f 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -726,8 +726,7 @@ bool cmFindPackageCommand::FindModule(bool& found) //---------------------------------------------------------------------------- bool cmFindPackageCommand::HandlePackageMode() { - this->ConsideredConfigFiles.clear(); - this->ConsideredVersions.clear(); + this->ConsideredConfigs.clear(); // Support old capitalization behavior. std::string upperDir = cmSystemTools::UpperCase(this->Name); @@ -819,17 +818,17 @@ bool cmFindPackageCommand::HandlePackageMode() cmOStringStream e; // If there are files in ConsideredConfigs, it means that FooConfig.cmake // have been found, but they didn't have appropriate versions. - if (this->ConsideredConfigFiles.size() > 0) + if (this->ConsideredConfigs.size() > 0) { e << "Could not find configuration file for package " << this->Name << " with " << (this->VersionExact ? "exact " : "at least ") << "version " << this->Version << " .\n" << "Found the following files:\n"; - for(std::vector::size_type i=0; - iConsideredConfigFiles.size(); i++) + for(std::vector::size_type i=0; + iConsideredConfigs.size(); i++) { - e << " " << this->ConsideredConfigFiles[i] - << ", version: " << this->ConsideredVersions[i] << "\n"; + e << " " << this->ConsideredConfigs[i].filename + << ", version: " << this->ConsideredConfigs[i].version << "\n"; } } else @@ -933,12 +932,12 @@ bool cmFindPackageCommand::HandlePackageMode() std::string consideredConfigFiles; std::string consideredVersions; - for(std::vector::size_type i=0; - iConsideredConfigFiles.size(); i++) + for(std::vector::size_type i=0; + iConsideredConfigs.size(); i++) { - consideredConfigFiles += this->ConsideredConfigFiles[i]; + consideredConfigFiles += this->ConsideredConfigs[i].filename; consideredConfigFiles += ";"; - consideredVersions += this->ConsideredVersions[i]; + consideredVersions += this->ConsideredConfigs[i].version; consideredVersions += ";"; } @@ -1554,8 +1553,10 @@ bool cmFindPackageCommand::CheckVersion(std::string const& config_file) haveResult = true; } - this->ConsideredConfigFiles.push_back(config_file); - this->ConsideredVersions.push_back(version); + ConfigFileInfo configFileInfo; + configFileInfo.filename = config_file; + configFileInfo.version = version; + this->ConsideredConfigs.push_back(configFileInfo); return result; } diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h index 2495d6c55..57aeab969 100644 --- a/Source/cmFindPackageCommand.h +++ b/Source/cmFindPackageCommand.h @@ -138,8 +138,9 @@ private: std::vector Names; std::vector Configs; std::set IgnoredPaths; - std::vector ConsideredConfigFiles; - std::vector ConsideredVersions; + + struct ConfigFileInfo { std::string filename; std::string version; }; + std::vector ConsideredConfigs; }; #endif From 6bbf2a0e8e983b193e48ad1b227c46cf6ea9a85b Mon Sep 17 00:00:00 2001 From: "Miguel A. Figueroa-Villanueva" Date: Sun, 29 Aug 2010 12:22:18 -0400 Subject: [PATCH 049/152] ENH: #9775 Added support for new wxWidgets 2.9 libraries. Added support for new libraries in wxWidgets 2.9 that are part of the main distribution. These are: wxPropertyGrid, wxSTC, wxScintilla, and wxRibbon. --- Modules/FindwxWidgets.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 687ae7c21..b7af94acb 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -252,7 +252,7 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32") # FIXME: What if both regex libs are available. regex should be # found outside the loop and only wx${LIB}${_UCD}${_DBG}. # Find wxWidgets common libraries. - FOREACH(LIB ${wxWidgets_COMMON_LIBRARIES}) + FOREACH(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla) FIND_LIBRARY(WX_${LIB}${_DBG} NAMES wx${LIB}${_UCD}${_DBG} # for regex @@ -303,7 +303,8 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32") MARK_AS_ADVANCED(WX_mono${_DBG}) # Find wxWidgets multilib libraries. - FOREACH(LIB core adv aui html media xrc dbgrid gl qa richtext) + FOREACH(LIB core adv aui html media xrc dbgrid gl qa richtext + stc ribbon propgrid) FIND_LIBRARY(WX_${LIB}${_DBG} NAMES wxmsw${_UNV}29${_UCD}${_DBG}_${LIB} From cc955a042b582a12238cc94507bf50dd9bce1220 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sun, 29 Aug 2010 18:55:25 +0200 Subject: [PATCH 050/152] Small cleanup of FindPackageHandleStandardArgs.cmake -remove unnecessary arguments _VAR1 -move code for deciding the type of the message into helper macro _FPHSA_FAILURE_MESSAGE() Alex --- Modules/FindPackageHandleStandardArgs.cmake | 38 +++++++++------------ 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index c698480be..db3af114d 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -71,7 +71,18 @@ INCLUDE(FindPackageMessage) INCLUDE(CMakeParseArguments) -FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG _VAR1) +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) + + +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: @@ -83,11 +94,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}\"") @@ -112,7 +123,7 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG _VAR1) STRING(TOUPPER ${_NAME} _NAME_UPPER) - # 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 "") @@ -183,24 +194,9 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG _VAR1) 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) - + _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG} (found ${${_FIRST_REQUIRED_VAR}})") 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) + _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE} (missing: ${MISSING_VARS}) ${VERSION_MSG}") ENDIF(NOT VERSION_OK) ENDIF (${_NAME_UPPER}_FOUND) From b4b8f963917b9473be283d5b844faee4a018945d Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sun, 29 Aug 2010 19:50:51 +0200 Subject: [PATCH 051/152] Don't create an empty element at the end of Foo_CONSIDERED_CONFIGS/VERSIONS Alex --- Source/cmFindPackageCommand.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 48122a85f..8ee8fc718 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -935,10 +935,13 @@ bool cmFindPackageCommand::HandlePackageMode() for(std::vector::size_type i=0; iConsideredConfigs.size(); i++) { + if (i>0) + { + consideredConfigFiles += ";"; + consideredVersions += ";"; + } consideredConfigFiles += this->ConsideredConfigs[i].filename; - consideredConfigFiles += ";"; consideredVersions += this->ConsideredConfigs[i].version; - consideredVersions += ";"; } this->Makefile->AddDefinition(consideredConfigsVar.c_str(), From e8ae504c0e13a641660ae78a05d5a5184f352800 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Sun, 29 Aug 2010 19:53:43 +0200 Subject: [PATCH 052/152] Add option CONFIG_MODE to FPHSA() When this option is used for FPHSA(), it automatically handles the information created by a preceding find_package(NO_MODULE) all and creates a proper success/error message. Alex --- Modules/FindPackageHandleStandardArgs.cmake | 64 ++++++++++++++++++--- 1 file changed, 55 insertions(+), 9 deletions(-) diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index db3af114d..a83f60155 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 ...] # [VERSION_VAR +# [CONFIG_MODE] # [FAIL_MESSAGE "Custom failure message"] ) # # As above, if through are all valid, _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,7 +85,7 @@ INCLUDE(FindPackageMessage) INCLUDE(CMakeParseArguments) - +# internal helper macro MACRO(_FPHSA_FAILURE_MESSAGE _msg) IF (${_NAME}_FIND_REQUIRED) MESSAGE(FATAL_ERROR "${_msg}") @@ -86,7 +101,7 @@ 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} ) @@ -115,6 +130,12 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) SET(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}") ENDIF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG") + 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) @@ -122,6 +143,7 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) 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 # user knows better what went wrong (#6375) @@ -193,11 +215,35 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) IF (${_NAME_UPPER}_FOUND) FIND_PACKAGE_MESSAGE(${_NAME} "Found ${_NAME}: ${${_FIRST_REQUIRED_VAR}} ${VERSION_MSG}" "${DETAILS}") ELSE (${_NAME_UPPER}_FOUND) - 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) + + IF(FPHSA_CONFIG_MODE) + IF(${_NAME}_CONFIG) + _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found ${${_NAME}_CONFIG} ${VERSION_MSG}, but missing: ${MISSING_VARS}") + ELSE(${_NAME}_CONFIG) + # if _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version + 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) + _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG}(found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake)") + ENDIF(${_NAME}_CONSIDERED_CONFIGS) + ENDIF(${_NAME}_CONFIG) + + 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) From aac1680648634a87dd4eee3ae603aef387798244 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 30 Aug 2010 00:01:03 -0400 Subject: [PATCH 053/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index ac37aa615..d6f54cf47 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 08) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 29) +SET(KWSYS_DATE_STAMP_DAY 30) From 1cbc53f022ba4a37fa2c633bd1e8cb856ae6fff0 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 30 Aug 2010 11:19:39 -0400 Subject: [PATCH 054/152] Add whitespace=tab-in-indent attribute for sources Tell Git 1.7.2 and later to reject indentation with TABs. --- .gitattributes | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.gitattributes b/.gitattributes index 878221f9b..43676a97f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -12,3 +12,9 @@ configure crlf=input *.dsw -crlf *.sln -crlf *.vcproj -crlf + +*.c whitespace=tab-in-indent +*.h whitespace=tab-in-indent +*.cxx whitespace=tab-in-indent +*.txt whitespace=tab-in-indent +*.cmake whitespace=tab-in-indent From 4969c3b5bbf929d3f59e98c90849a85aadb7351a Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Mon, 30 Aug 2010 22:42:58 +0200 Subject: [PATCH 055/152] Improve version notice in the generated message Now the version number is also printed if no required version was specified, but a version number was detected (showing more information shouldn't hurt). The code for generating the failure message in config-mode is moved into a separate helper macro, it was becoming too much. Alex --- Modules/FindPackageHandleStandardArgs.cmake | 114 +++++++++++--------- 1 file changed, 61 insertions(+), 53 deletions(-) diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index a83f60155..cd33aa3bb 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -97,6 +97,33 @@ MACRO(_FPHSA_FAILURE_MESSAGE _msg) ENDMACRO(_FPHSA_FAILURE_MESSAGE _msg) +# internal helper macro to generate the failure message when used in CONFIG_MODE: +MACRO(_FPHSA_HANDLE_FAILURE_CONFIG_MODE) + # _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 @@ -130,6 +157,8 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) SET(FPHSA_FAIL_MESSAGE "Could NOT find ${_NAME}") ENDIF("${FPHSA_FAIL_MESSAGE}" STREQUAL "DEFAULT_MSG") + # In config-mode, we rely on the variable _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) @@ -164,44 +193,42 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) # 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 _FIND_VERSION - IF (${_NAME_UPPER}_FOUND) - SET(VERSION ${${FPHSA_VERSION_VAR}} ) + IF(VERSION) - 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}") - 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(${_NAME}_FIND_VERSION_EXACT) - 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}\")") + 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) - ENDIF (${_NAME_UPPER}_FOUND) + + 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}\")") + ELSE(${_NAME}_FIND_VERSION_EXACT) + SET(VERSION_MSG "(Required is at least version \"${${_NAME}_FIND_VERSION}\")") + ENDIF(${_NAME}_FIND_VERSION_EXACT) + + ENDIF(VERSION) + ELSE (${_NAME}_FIND_VERSION) + IF(VERSION) + SET(VERSION_MSG "(found version \"${VERSION}\")") + ENDIF(VERSION) ENDIF (${_NAME}_FIND_VERSION) IF(VERSION_OK) @@ -217,26 +244,7 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG) ELSE (${_NAME_UPPER}_FOUND) IF(FPHSA_CONFIG_MODE) - IF(${_NAME}_CONFIG) - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: found ${${_NAME}_CONFIG} ${VERSION_MSG}, but missing: ${MISSING_VARS}") - ELSE(${_NAME}_CONFIG) - # if _CONSIDERED_CONFIGS is set, the config-file has been found, but no suitable version - 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) - _FPHSA_FAILURE_MESSAGE("${FPHSA_FAIL_MESSAGE}: ${VERSION_MSG}(found neither ${_NAME}Config.cmake nor ${_NAME_LOWER}-config.cmake)") - ENDIF(${_NAME}_CONSIDERED_CONFIGS) - ENDIF(${_NAME}_CONFIG) - + _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}})") From f51eb9cb0c3bc2a38f0c00780f0d8d050d00891f Mon Sep 17 00:00:00 2001 From: "Miguel A. Figueroa-Villanueva" Date: Mon, 30 Aug 2010 19:38:45 -0400 Subject: [PATCH 056/152] BUG: #9775 Fixed patch FindwxWidgets-fixed-bug-9775. Forgot to add new libraries in list of libs to be cleared. --- Modules/FindwxWidgets.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index b7af94acb..90818bc64 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -331,7 +331,7 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32") # Clear all debug or release library paths (arguments are "d" or ""). MACRO(WX_CLEAR_ALL_LIBS _DBG) # Clear wxWidgets common libraries. - FOREACH(LIB ${wxWidgets_COMMON_LIBRARIES}) + FOREACH(LIB ${wxWidgets_COMMON_LIBRARIES} scintilla) WX_CLEAR_LIB(WX_${LIB}${_DBG}) ENDFOREACH(LIB) @@ -345,7 +345,8 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32") WX_CLEAR_LIB(WX_mono${_DBG}) # Clear wxWidgets multilib libraries. - FOREACH(LIB core adv aui html media xrc dbgrid gl qa richtext) + FOREACH(LIB core adv aui html media xrc dbgrid gl qa richtext + stc ribbon propgrid) WX_CLEAR_LIB(WX_${LIB}${_DBG}) ENDFOREACH(LIB) ENDMACRO(WX_CLEAR_ALL_LIBS) From 81a76fedd7abdbc8ce840ff7c8ecc7a8c68e26bf Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 31 Aug 2010 00:01:04 -0400 Subject: [PATCH 057/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index d6f54cf47..80029397b 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 08) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 30) +SET(KWSYS_DATE_STAMP_DAY 31) From 32242affea45eb3c3ffa2691657e970eaac49799 Mon Sep 17 00:00:00 2001 From: Zach Mullen Date: Tue, 31 Aug 2010 10:41:23 -0400 Subject: [PATCH 058/152] Added CTest command --print-labels This command allows a user to quickly see the list of all available test labels. The labels are also printed in verbose show only mode, alongside their corresponding tests. --- Source/CTest/cmCTestMultiProcessHandler.cxx | 42 +++++++++++++++++++++ Source/CTest/cmCTestMultiProcessHandler.h | 1 + Source/CTest/cmCTestTestHandler.cxx | 9 ++++- Source/cmCTest.cxx | 6 +++ Source/cmCTest.h | 3 ++ Source/ctest.cxx | 5 ++- Tests/CMakeLists.txt | 5 +++ 7 files changed, 68 insertions(+), 3 deletions(-) diff --git a/Source/CTest/cmCTestMultiProcessHandler.cxx b/Source/CTest/cmCTestMultiProcessHandler.cxx index d50eaaa81..0d14c2d74 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::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 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::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 cc330f7a6..1483440c6 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* passed, std::vector* failed) diff --git a/Source/CTest/cmCTestTestHandler.cxx b/Source/CTest/cmCTestTestHandler.cxx index a4a48633e..6dd348def 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 &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 d12fde0f8..dcdc8e15b 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -304,6 +304,7 @@ cmCTest::cmCTest() this->ShowOnly = false; this->RunConfigurationScript = false; this->UseHTTP10 = false; + this->PrintLabels = false; this->CompressTestOutput = true; this->ComputedCompressOutput = false; this->TestModel = cmCTest::EXPERIMENTAL; @@ -1877,6 +1878,11 @@ void cmCTest::HandleCommandLineArguments(size_t &i, this->CompressTestOutput = false; } + if(this->CheckArgument(arg, "--print-labels")) + { + this->PrintLabels = true; + } + if(this->CheckArgument(arg, "--http1.0")) { this->UseHTTP10 = true; diff --git a/Source/cmCTest.h b/Source/cmCTest.h index 3d7d1179b..e54a205c3 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/ctest.cxx b/Source/ctest.cxx index 24921c428..3937d8d17 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 []", "Show help for a single command and exit.", "Prints the help for the command to stdout or to the specified file." }, {"--help-command-list []", "List available commands and exit.", diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 5383bda97..8e8d0ca6f 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1315,6 +1315,11 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --output-log "${CMake_BINARY_DIR}/Tests/CTestTestParallel/testOutput.log" ) + ADD_TEST(CTestTestPrintLabels ${CMAKE_CTEST_COMMAND} --print-labels) + SET_TESTS_PROPERTIES(CTestTestPrintLabels PROPERTIES LABELS "Label1;Label2") + SET_TESTS_PROPERTIES(CTestTestPrintLabels PROPERTIES PASS_REGULAR_EXPRESSION + "All Labels:.* Label1.* Label2") + CONFIGURE_FILE( "${CMake_SOURCE_DIR}/Tests/CTestTestResourceLock/test.cmake.in" "${CMake_BINARY_DIR}/Tests/CTestTestResourceLock/test.cmake" From 5cdfc9c8ea675658c14d21848917f0e2d9ab93da Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Tue, 31 Aug 2010 21:10:00 +0200 Subject: [PATCH 059/152] Improve wording of the error message of find_package() in config-mode As suggested by Brad, this improves the wording of the error message in config-mode when config-files were found, but no suitable version. The patch also contains the small loop-optimization suggested by Brad. Alex --- Source/cmFindPackageCommand.cxx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/Source/cmFindPackageCommand.cxx b/Source/cmFindPackageCommand.cxx index 8ee8fc718..55c7cb915 100644 --- a/Source/cmFindPackageCommand.cxx +++ b/Source/cmFindPackageCommand.cxx @@ -820,10 +820,12 @@ bool cmFindPackageCommand::HandlePackageMode() // have been found, but they didn't have appropriate versions. if (this->ConsideredConfigs.size() > 0) { - e << "Could not find configuration file for package " << this->Name - << " with " << (this->VersionExact ? "exact " : "at least ") - << "version " << this->Version << " .\n" - << "Found the following files:\n"; + 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::size_type i=0; iConsideredConfigs.size(); i++) { @@ -932,16 +934,15 @@ bool cmFindPackageCommand::HandlePackageMode() std::string consideredConfigFiles; std::string consideredVersions; + const char* sep = ""; for(std::vector::size_type i=0; iConsideredConfigs.size(); i++) { - if (i>0) - { - consideredConfigFiles += ";"; - consideredVersions += ";"; - } + consideredConfigFiles += sep; + consideredVersions += sep; consideredConfigFiles += this->ConsideredConfigs[i].filename; consideredVersions += this->ConsideredConfigs[i].version; + sep = ";"; } this->Makefile->AddDefinition(consideredConfigsVar.c_str(), From 4948536d610b213a536ef739e6d6ee1900d8afa5 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 1 Sep 2010 00:01:04 -0400 Subject: [PATCH 060/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 80029397b..27fe2b181 100644 --- a/Source/kwsys/kwsysDateStamp.cmake +++ b/Source/kwsys/kwsysDateStamp.cmake @@ -15,7 +15,7 @@ SET(KWSYS_DATE_STAMP_YEAR 2010) # KWSys version date month component. Format is MM. -SET(KWSYS_DATE_STAMP_MONTH 08) +SET(KWSYS_DATE_STAMP_MONTH 09) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 31) +SET(KWSYS_DATE_STAMP_DAY 01) From 36c15a2f0bc0107074019901f3208891667a4546 Mon Sep 17 00:00:00 2001 From: "Miguel A. Figueroa-Villanueva" Date: Wed, 1 Sep 2010 00:15:07 -0400 Subject: [PATCH 061/152] BUG #10658: FindwxWidgets USE_FILE should not include .cmake extension. The wxWidgets_USE_FILE variable to be used with the include command should be set to UsewxWidgets; not UsewxWidgets.cmake. --- Modules/FindwxWidgets.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 90818bc64..cbc3e4b9a 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -188,7 +188,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") #===================================================================== From eae45a67e7901b9b5531a4cd49e9716e8edb3956 Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 31 Aug 2010 14:16:59 -0400 Subject: [PATCH 062/152] Search MacPorts /opt/local prefix on Mac Include this prefix in CMAKE_SYSTEM_PREFIX_PATH so that it will be used for all find* commands. Previously only find_library and find_path would look under /opt/local/lib and /opt/local/include, respectively. --- Modules/Platform/Darwin.cmake | 5 ++++- Modules/Platform/UnixPaths.cmake | 4 ++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index c8bcad1d0..db0642e99 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/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake index ae3c187f2..5ee7ddbd6 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 ) From 6cb14ebf160b156e842c644392377fd6460327c6 Mon Sep 17 00:00:00 2001 From: "Miguel A. Figueroa-Villanueva" Date: Wed, 1 Sep 2010 09:34:57 -0400 Subject: [PATCH 063/152] STYLE: Clarified/Fixed documentation of UsewxWidgets. --- Modules/UsewxWidgets.cmake | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake index 037b7159f..3a4a38269 100644 --- a/Modules/UsewxWidgets.cmake +++ b/Modules/UsewxWidgets.cmake @@ -1,15 +1,12 @@ -# - 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( ${wxWidgets_LIBRARIES}) +# FIND_PACKAGE(wxWidgets REQUIRED base core gl net) +# INCLUDE(${wxWidgets_USE_FILE}) +# # and for each of your dependant executable/library targets: +# TARGET_LINK_LIBRARIES( ${wxWidgets_LIBRARIES}) # # DEPRECATED # LINK_LIBRARIES is not called in favor of adding dependencies per target. From f46712ebe7b3fe60a02f5fc5cf08cc861287c42b Mon Sep 17 00:00:00 2001 From: "Miguel A. Figueroa-Villanueva" Date: Wed, 1 Sep 2010 10:40:01 -0400 Subject: [PATCH 064/152] BUG #11123: Generic include dir should come after config specific one. --- Modules/FindwxWidgets.cmake | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index cbc3e4b9a..4da4c8e77 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -563,23 +563,23 @@ IF(wxWidgets_FIND_STYLE STREQUAL "win32") # Get configuration parameters from the name. WX_GET_NAME_COMPONENTS(${wxWidgets_CONFIGURATION} UNV UCD DBG) + # Set wxWidgets lib setup include directory. + IF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) + SET(wxWidgets_INCLUDE_DIRS + ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}) + ELSE(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) + 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) - SET(wxWidgets_INCLUDE_DIRS ${WX_ROOT_DIR}/include) + 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) - # Set wxWidgets lib setup include directory. - IF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) - LIST(APPEND 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.") - SET(wxWidgets_FOUND FALSE) - ENDIF(EXISTS ${WX_LIB_DIR}/${wxWidgets_CONFIGURATION}/wx/setup.h) - # Find wxWidgets libraries. WX_FIND_LIBS("${UNV}" "${UCD}" "${DBG}") IF(WX_USE_REL_AND_DBG) From 3dbeeb77934d6dff85c71b001e07622c5ac6fe4c Mon Sep 17 00:00:00 2001 From: "Miguel A. Figueroa-Villanueva" Date: Wed, 1 Sep 2010 12:27:31 -0400 Subject: [PATCH 065/152] BUG #8184: Fixed FindwxWidgets wrong order of default libs for MinGW. Also fixed usage sample in comments, which can be misleading for MinGW users as demonstrated by mantis issue #10089. --- Modules/FindwxWidgets.cmake | 9 +++++---- Modules/UsewxWidgets.cmake | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 4da4c8e77..08b37c37d 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 @@ -54,7 +54,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 +63,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( ${wxWidgets_LIBRARIES}) @@ -213,7 +214,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) diff --git a/Modules/UsewxWidgets.cmake b/Modules/UsewxWidgets.cmake index 3a4a38269..9ecfff0cc 100644 --- a/Modules/UsewxWidgets.cmake +++ b/Modules/UsewxWidgets.cmake @@ -3,7 +3,8 @@ # flags, etc. INCLUDE_DIRECTORIES and LINK_DIRECTORIES are called. # # USAGE -# FIND_PACKAGE(wxWidgets REQUIRED base core gl net) +# # 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( ${wxWidgets_LIBRARIES}) From f9436016401416b21f6dfc30b5a548c909f649bb Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 2 Sep 2010 00:01:07 -0400 Subject: [PATCH 066/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 27fe2b181..df9690aab 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 01) +SET(KWSYS_DATE_STAMP_DAY 02) From ced61f5722d65525fd4b8dbf96d5ea8f254099c2 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 2 Sep 2010 11:56:40 -0400 Subject: [PATCH 067/152] Let CMake recognize .CPP .CXX and .C++ as c++ files. --- Modules/CMakeCXXCompiler.cmake.in | 4 ++-- Tests/CxxOnly/CMakeLists.txt | 2 +- Tests/CxxOnly/cxxonly.cxx | 4 ++++ Tests/CxxOnly/test.C++ | 1 + Tests/CxxOnly/test.CPP | 1 + Tests/CxxOnly/test.CXX | 1 + 6 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 Tests/CxxOnly/test.C++ create mode 100644 Tests/CxxOnly/test.CPP create mode 100644 Tests/CxxOnly/test.CXX diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index b264da1c9..e1b25d222 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -21,8 +21,8 @@ IF(CMAKE_COMPILER_IS_MINGW) SET(MINGW 1) ENDIF(CMAKE_COMPILER_IS_MINGW) SET(CMAKE_CXX_COMPILER_ID_RUN 1) -SET(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;H;o;O;obj;OBJ;def;DEF;rc;RC) -SET(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm) +SET(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) +SET(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;C++;CC;CPP;CXX) SET(CMAKE_CXX_LINKER_PREFERENCE 30) SET(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt index bfc827116..8418ad994 100644 --- a/Tests/CxxOnly/CMakeLists.txt +++ b/Tests/CxxOnly/CMakeLists.txt @@ -2,7 +2,7 @@ project (CxxOnly CXX) set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") -add_library(testcxx1 STATIC libcxx1.cxx) +add_library(testcxx1 STATIC libcxx1.cxx test.CPP test.CXX test.C++) add_library(testcxx2 SHARED libcxx2.cxx) add_executable (CxxOnly cxxonly.cxx) target_link_libraries(CxxOnly testcxx1 testcxx2) diff --git a/Tests/CxxOnly/cxxonly.cxx b/Tests/CxxOnly/cxxonly.cxx index 99ccf3b61..2996e65c8 100644 --- a/Tests/CxxOnly/cxxonly.cxx +++ b/Tests/CxxOnly/cxxonly.cxx @@ -1,10 +1,14 @@ #include "libcxx1.h" #include "libcxx2.h" +extern int testCPP; +extern int testCXX; +extern int testCplusplus; #include int main () { + testCPP = testCXX= testCplusplus = 1; if ( LibCxx1Class::Method() != 2.0 ) { printf("Problem with libcxx1\n"); diff --git a/Tests/CxxOnly/test.C++ b/Tests/CxxOnly/test.C++ new file mode 100644 index 000000000..6049ef12d --- /dev/null +++ b/Tests/CxxOnly/test.C++ @@ -0,0 +1 @@ +int testCplusplus; diff --git a/Tests/CxxOnly/test.CPP b/Tests/CxxOnly/test.CPP new file mode 100644 index 000000000..8a3cde262 --- /dev/null +++ b/Tests/CxxOnly/test.CPP @@ -0,0 +1 @@ +int testCPP; diff --git a/Tests/CxxOnly/test.CXX b/Tests/CxxOnly/test.CXX new file mode 100644 index 000000000..c05f7881a --- /dev/null +++ b/Tests/CxxOnly/test.CXX @@ -0,0 +1 @@ +int testCXX; From 3b7da5396d1c5085e4c55687877c89034e89c65e Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 2 Sep 2010 14:35:17 -0400 Subject: [PATCH 068/152] Fix for bug 10388, fix various default flags. --- Modules/Platform/Windows-wcl386.cmake | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake index 7fc345fee..e96ebb5cd 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 '' option caseexact file {} ${CMAKE_END_TEMP_FILE}") + SET(CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE}) # compile a C++ file into an object file From d26cd46989b4e1170cbebc97ae3b6b30395158db Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 2 Sep 2010 18:02:57 -0400 Subject: [PATCH 069/152] Only use .CPP .CXX and .C++ do not work by default with g+++. --- Modules/CMakeCXXCompiler.cmake.in | 2 +- Tests/CxxOnly/CMakeLists.txt | 2 +- Tests/CxxOnly/cxxonly.cxx | 4 +--- Tests/CxxOnly/test.C++ | 1 - Tests/CxxOnly/test.CXX | 1 - 5 files changed, 3 insertions(+), 7 deletions(-) delete mode 100644 Tests/CxxOnly/test.C++ delete mode 100644 Tests/CxxOnly/test.CXX diff --git a/Modules/CMakeCXXCompiler.cmake.in b/Modules/CMakeCXXCompiler.cmake.in index e1b25d222..d7ae8d994 100644 --- a/Modules/CMakeCXXCompiler.cmake.in +++ b/Modules/CMakeCXXCompiler.cmake.in @@ -22,7 +22,7 @@ IF(CMAKE_COMPILER_IS_MINGW) ENDIF(CMAKE_COMPILER_IS_MINGW) SET(CMAKE_CXX_COMPILER_ID_RUN 1) SET(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) -SET(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;C++;CC;CPP;CXX) +SET(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) SET(CMAKE_CXX_LINKER_PREFERENCE 30) SET(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt index 8418ad994..8258eb427 100644 --- a/Tests/CxxOnly/CMakeLists.txt +++ b/Tests/CxxOnly/CMakeLists.txt @@ -2,7 +2,7 @@ project (CxxOnly CXX) set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") -add_library(testcxx1 STATIC libcxx1.cxx test.CPP test.CXX test.C++) +add_library(testcxx1 STATIC libcxx1.cxx test.CPP) add_library(testcxx2 SHARED libcxx2.cxx) add_executable (CxxOnly cxxonly.cxx) target_link_libraries(CxxOnly testcxx1 testcxx2) diff --git a/Tests/CxxOnly/cxxonly.cxx b/Tests/CxxOnly/cxxonly.cxx index 2996e65c8..bd4fd5914 100644 --- a/Tests/CxxOnly/cxxonly.cxx +++ b/Tests/CxxOnly/cxxonly.cxx @@ -1,14 +1,12 @@ #include "libcxx1.h" #include "libcxx2.h" extern int testCPP; -extern int testCXX; -extern int testCplusplus; #include int main () { - testCPP = testCXX= testCplusplus = 1; + testCPP = 1; if ( LibCxx1Class::Method() != 2.0 ) { printf("Problem with libcxx1\n"); diff --git a/Tests/CxxOnly/test.C++ b/Tests/CxxOnly/test.C++ deleted file mode 100644 index 6049ef12d..000000000 --- a/Tests/CxxOnly/test.C++ +++ /dev/null @@ -1 +0,0 @@ -int testCplusplus; diff --git a/Tests/CxxOnly/test.CXX b/Tests/CxxOnly/test.CXX deleted file mode 100644 index c05f7881a..000000000 --- a/Tests/CxxOnly/test.CXX +++ /dev/null @@ -1 +0,0 @@ -int testCXX; From f68c08e1b4ebf5e7bfd996769866a26833d00121 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Fri, 3 Sep 2010 00:01:06 -0400 Subject: [PATCH 070/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index df9690aab..df4746c97 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 03) From e6ac0aacf6c3ce17141870e252fda77d994782d3 Mon Sep 17 00:00:00 2001 From: David Cole Date: Fri, 3 Sep 2010 13:53:22 -0400 Subject: [PATCH 071/152] Add FOLDER target property, for IDEs (#3796) This work was started from a patch by Thomas Schiffer. Thanks, Thomas! See the newly added documentation of the FOLDER target property for details. Also added global properties, USE_FOLDERS and PREDEFINED_TARGETS_FOLDER. See new docs here, too. By default, the FOLDER target property is used to organize targets into folders in IDEs that have support for such organization. This commit adds "solution folder" support to the Visual Studio generators. Currently works with versions 7 through 10. Also, use the new FOLDER property in the ExternalProject test and in the CMake project itself. --- CMakeLists.txt | 35 +++++++- Modules/CTestTargets.cmake | 2 + Source/cmGlobalGenerator.cxx | 40 +++++++++ Source/cmGlobalGenerator.h | 3 + Source/cmGlobalVisualStudio71Generator.cxx | 16 ++++ Source/cmGlobalVisualStudio7Generator.cxx | 99 ++++++++++++++++++++++ Source/cmGlobalVisualStudio7Generator.h | 4 + Source/cmGlobalVisualStudio8Generator.cxx | 7 ++ Source/cmGlobalVisualStudioGenerator.cxx | 15 ++++ Source/cmTarget.cxx | 11 ++- Source/cmake.cxx | 17 ++++ Tests/ExternalProject/CMakeLists.txt | 45 ++++++++++ 12 files changed, 292 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c6ad85ec6..dec502b04 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -173,6 +173,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 @@ -192,7 +204,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 @@ -221,6 +243,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) #--------------------------------------------------------------------- @@ -247,6 +270,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) #--------------------------------------------------------------------- @@ -255,6 +280,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() @@ -262,6 +288,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() IF(CMAKE_USE_SYSTEM_LIBARCHIVE) FIND_PACKAGE(libarchive) @@ -275,6 +302,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) @@ -292,6 +320,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) #--------------------------------------------------------------------- @@ -521,6 +550,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/CTestTargets.cmake b/Modules/CTestTargets.cmake index fc47ff8a0..c7f1394ad 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/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index bd26b5fca..8e77294ae 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -1837,6 +1837,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, @@ -1866,6 +1898,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 878be1143..554ee0f60 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -320,6 +320,9 @@ protected: // All targets in the entire project. std::map 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 119157549..897c3a2db 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 9631e9a31..f455810c2 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 tokens = + cmSystemTools::SplitString(targetFolder, '/', false); + + std::string cumulativePath = ""; + + for(std::vector::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); @@ -370,6 +428,47 @@ void cmGlobalVisualStudio7Generator this->WriteSLNFooter(fout); } +//---------------------------------------------------------------------------- +void cmGlobalVisualStudio7Generator::WriteFolders(std::ostream& fout) +{ + std::string guidProjectTypeFolder = "2150E333-8FDC-42A3-9474-1A3956D46DE8"; + for(std::map >::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 >::iterator iter = + VisualStudioFolders.begin(); iter != VisualStudioFolders.end(); ++iter) + { + std::string key(iter->first); + std::string guidParent(this->GetGUID(key.c_str())); + + for(std::set::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 85ba24495..b2c714115 100644 --- a/Source/cmGlobalVisualStudio7Generator.h +++ b/Source/cmGlobalVisualStudio7Generator.h @@ -142,6 +142,10 @@ protected: std::vector Configurations; std::map GUIDMap; + virtual void WriteFolders(std::ostream& fout); + virtual void WriteFoldersContent(std::ostream& fout); + std::map > 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 6e0f0480e..7a979f87e 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -136,6 +136,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 stamps; std::string stampList = cmake::GetCMakeFilesDirectoryPostSlash(); diff --git a/Source/cmGlobalVisualStudioGenerator.cxx b/Source/cmGlobalVisualStudioGenerator.cxx index 85b4a7139..e8a00bb8e 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::iterator i = gen.begin(); diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 45ba35844..961191269 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -853,11 +853,20 @@ void cmTarget::DefineProperties(cmake *cm) "The names returned are suitable for passing to the " "set_source_files_properties command."); + cm->DefineProperty + ("FOLDER", cmProperty::TARGET, + "Set the folder name. Use to organize targets in an IDE.", + "Targets with no FOLDER property will appear as top level " + "entities in IDEs like Visual Studio. Targets with the same " + "FOLDER property value will appear next to each other in a " + "folder of that name. To nest folders, use FOLDER values such " + "as 'GUI/Dialogs' with '/' characters separating folder levels."); + cm->DefineProperty ("PROJECT_LABEL", cmProperty::TARGET, "Change the name of a target in an IDE.", "Can be used to change the name of the target in an IDE " - "like visual stuido. "); + "like Visual Studio. "); cm->DefineProperty ("VS_KEYWORD", cmProperty::TARGET, "Visual Studio project keyword.", diff --git a/Source/cmake.cxx b/Source/cmake.cxx index cb2006902..37ff7c56d 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/Tests/ExternalProject/CMakeLists.txt b/Tests/ExternalProject/CMakeLists.txt index 99da9c466..00db5d484 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}) @@ -41,6 +44,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 "" @@ -69,6 +88,7 @@ ExternalProject_Add(${proj} URL_MD5 "" UPDATE_COMMAND "" ) +set_property(TARGET ${proj} PROPERTY FOLDER "") # Local DIR: @@ -80,6 +100,7 @@ if(can_build_tutorial_step5) CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= -G ${CMAKE_GENERATOR} TEST_BEFORE_INSTALL 1 ) + set_property(TARGET ${proj} PROPERTY FOLDER "Local") ExternalProject_Get_Property(${proj} install_dir) set(TutorialStep5_install_dir ${install_dir}) @@ -89,6 +110,7 @@ if(can_build_tutorial_step5) CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= -G ${CMAKE_GENERATOR} TEST_AFTER_INSTALL 1 ) + set_property(TARGET ${proj} PROPERTY FOLDER "Local") endif() @@ -105,6 +127,7 @@ ExternalProject_Add(${proj} -DTEST_LIST:STRING=A::B::C INSTALL_COMMAND "" ) +set_property(TARGET ${proj} PROPERTY FOLDER "Local/TAR") set(proj TutorialStep1-LocalNoDirTAR) ExternalProject_Add(${proj} @@ -115,6 +138,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 @@ -133,6 +157,7 @@ ExternalProject_Add(${proj} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= -G ${CMAKE_GENERATOR} INSTALL_COMMAND "" ) +set_property(TARGET ${proj} PROPERTY FOLDER "Local/TGZ") set(proj TutorialStep1-LocalNoDirTGZ) ExternalProject_Add(${proj} @@ -142,6 +167,7 @@ ExternalProject_Add(${proj} CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH= INSTALL_COMMAND "" ) +set_property(TARGET ${proj} PROPERTY FOLDER "Local/TGZ") # Local BZ2: @@ -158,6 +184,7 @@ ExternalProject_Add(${proj} BUILD_COMMAND "" INSTALL_COMMAND "" ) +set_property(TARGET ${proj} PROPERTY FOLDER "Local/BZ2") set(proj TutorialStep1-LocalNoDirBZ2) ExternalProject_Add(${proj} @@ -166,6 +193,7 @@ ExternalProject_Add(${proj} BUILD_COMMAND "" INSTALL_COMMAND "" ) +set_property(TARGET ${proj} PROPERTY FOLDER "Local/BZ2") # Local ZIP: @@ -182,6 +210,7 @@ ExternalProject_Add(${proj} BUILD_COMMAND "" INSTALL_COMMAND "" ) +set_property(TARGET ${proj} PROPERTY FOLDER "Local/ZIP") set(proj TutorialStep1-LocalNoDirZIP) ExternalProject_Add(${proj} @@ -190,6 +219,7 @@ ExternalProject_Add(${proj} BUILD_COMMAND "" INSTALL_COMMAND "" ) +set_property(TARGET ${proj} PROPERTY FOLDER "Local/ZIP") # CVS-based tests: @@ -221,6 +251,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: # @@ -235,6 +267,7 @@ if(do_cvs_tests) INSTALL_COMMAND "" DEPENDS "SetupLocalCVSRepository" ) + set_property(TARGET ${proj} PROPERTY FOLDER "CVS") # CVS by tag: # @@ -249,6 +282,7 @@ if(do_cvs_tests) INSTALL_COMMAND "" DEPENDS "SetupLocalCVSRepository" ) + set_property(TARGET ${proj} PROPERTY FOLDER "CVS") # Live CVS / HEAD (no CVS_TAG): # @@ -268,6 +302,7 @@ if(do_cvs_tests) DEPENDS "TutorialStep1-CVS-20090626" DEPENDS "TutorialStep1-CVS-testtag1" ) + set_property(TARGET ${proj} PROPERTY FOLDER "CVS") endif() @@ -320,6 +355,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: # @@ -333,6 +370,7 @@ if(do_svn_tests) INSTALL_COMMAND "" DEPENDS "SetupLocalSVNRepository" ) + set_property(TARGET ${proj} PROPERTY FOLDER "SVN") # SVN by revision number: # @@ -346,6 +384,7 @@ if(do_svn_tests) INSTALL_COMMAND "" DEPENDS "SetupLocalSVNRepository" ) + set_property(TARGET ${proj} PROPERTY FOLDER "SVN") # Live SVN / trunk (no SVN_REVISION): # @@ -357,6 +396,7 @@ if(do_svn_tests) INSTALL_COMMAND "" DEPENDS "SetupLocalSVNRepository" ) + set_property(TARGET ${proj} PROPERTY FOLDER "SVN") endif() @@ -394,6 +434,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: # @@ -407,6 +449,7 @@ if(do_git_tests) INSTALL_COMMAND "" DEPENDS "SetupLocalGITRepository" ) + set_property(TARGET ${proj} PROPERTY FOLDER "GIT") # git by explicit branch/tag name: # @@ -420,6 +463,7 @@ if(do_git_tests) INSTALL_COMMAND "" DEPENDS "SetupLocalGITRepository" ) + set_property(TARGET ${proj} PROPERTY FOLDER "GIT") # Live git / master (no GIT_TAG): # @@ -431,6 +475,7 @@ if(do_git_tests) INSTALL_COMMAND "" DEPENDS "SetupLocalGITRepository" ) + set_property(TARGET ${proj} PROPERTY FOLDER "GIT") endif() From c1675951a013aadbdc472d323c4ff4efb80a09fa Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Fri, 3 Sep 2010 22:05:09 -0400 Subject: [PATCH 072/152] Merge patch for detecting gdk-pixbuf library The gdk-pixbuf library was split off from core GTK in 2.21 so it could be used separately by people outside GTK. Now FindGTK searches and adds it to the library/include list. Thanks to Vincent Untz for the patch and Ricardo Cruz for the heads up. --- Modules/FindGTK2.cmake | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake index 4f341e7ca..e437e1ce2 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") From 8e0de9cc4590f25820e10c3b5813e0263300e660 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sat, 4 Sep 2010 00:01:03 -0400 Subject: [PATCH 073/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index df4746c97..8d24d60f0 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 03) +SET(KWSYS_DATE_STAMP_DAY 04) From 20f15c4321bf3cb9860cc6a59ad699a0447fb5ed Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sun, 5 Sep 2010 00:01:07 -0400 Subject: [PATCH 074/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 8d24d60f0..ab474f42b 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 04) +SET(KWSYS_DATE_STAMP_DAY 05) From ede24f817124293de7d1d22353c0e6e81f250ebe Mon Sep 17 00:00:00 2001 From: "Miguel A. Figueroa-Villanueva" Date: Sun, 5 Sep 2010 09:39:37 -0400 Subject: [PATCH 075/152] ENH #8993: FindwxWidgets add support for wx-config custom options. Added suport for setting a custom toolkit, refix, etc. when using wx-config. --- Modules/FindwxWidgets.cmake | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/Modules/FindwxWidgets.cmake b/Modules/FindwxWidgets.cmake index 08b37c37d..d991cd492 100644 --- a/Modules/FindwxWidgets.cmake +++ b/Modules/FindwxWidgets.cmake @@ -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: # @@ -615,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 @@ -643,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 @@ -675,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}) From 362ba97017b2cdbd1dae1f0f74fbab97bb026f76 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 6 Sep 2010 00:01:08 -0400 Subject: [PATCH 076/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index ab474f42b..bff308e52 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 05) +SET(KWSYS_DATE_STAMP_DAY 06) From 530ade6677ec2c12fe8f3db5f5d71ad0ffaa9e68 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 6 Sep 2010 12:06:43 -0400 Subject: [PATCH 077/152] Fix targets with . in the name for VS 10 IDE. --- Source/cmVisualStudio10TargetGenerator.cxx | 5 ++--- Tests/CxxOnly/CMakeLists.txt | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 70680ad76..477945b39 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -838,10 +838,10 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() *this->BuildFileStream << intermediateDir << "\n"; this->WritePlatformConfigTag("TargetName", config->c_str(), 3); - *this->BuildFileStream << cmSystemTools::GetFilenameWithoutExtension( + *this->BuildFileStream + << cmSystemTools::GetFilenameWithoutLastExtension( targetNameFull.c_str()) << "\n"; - this->WritePlatformConfigTag("TargetExt", config->c_str(), 3); *this->BuildFileStream << cmSystemTools::GetFilenameLastExtension( targetNameFull.c_str()) @@ -849,7 +849,6 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() this->OutputLinkIncremental(*config); } this->WriteString("\n", 2); - } diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt index 8258eb427..0b2c1c592 100644 --- a/Tests/CxxOnly/CMakeLists.txt +++ b/Tests/CxxOnly/CMakeLists.txt @@ -2,7 +2,7 @@ project (CxxOnly CXX) set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") -add_library(testcxx1 STATIC libcxx1.cxx test.CPP) +add_library(testcxx1.my STATIC libcxx1.cxx test.CPP) add_library(testcxx2 SHARED libcxx2.cxx) add_executable (CxxOnly cxxonly.cxx) -target_link_libraries(CxxOnly testcxx1 testcxx2) +target_link_libraries(CxxOnly testcxx1.my testcxx2) From ba0a8905395ec7e616bbedee33a83fcf15a86910 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 6 Sep 2010 12:43:57 -0400 Subject: [PATCH 078/152] Only test for .CPP on Microsoft compilers which will handle .CPP as c++. --- Tests/CxxOnly/CMakeLists.txt | 5 ++++- Tests/CxxOnly/cxxonly.cxx | 4 ++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt index 8258eb427..4654f44ec 100644 --- a/Tests/CxxOnly/CMakeLists.txt +++ b/Tests/CxxOnly/CMakeLists.txt @@ -2,7 +2,10 @@ project (CxxOnly CXX) set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") -add_library(testcxx1 STATIC libcxx1.cxx test.CPP) +if(MSVC) + set(EXTRA_SRCS test.CPP) +endif() +add_library(testcxx1 STATIC libcxx1.cxx ${EXTRA_SRCS}) add_library(testcxx2 SHARED libcxx2.cxx) add_executable (CxxOnly cxxonly.cxx) target_link_libraries(CxxOnly testcxx1 testcxx2) diff --git a/Tests/CxxOnly/cxxonly.cxx b/Tests/CxxOnly/cxxonly.cxx index bd4fd5914..9cf6f2d29 100644 --- a/Tests/CxxOnly/cxxonly.cxx +++ b/Tests/CxxOnly/cxxonly.cxx @@ -1,12 +1,16 @@ #include "libcxx1.h" #include "libcxx2.h" +#ifdef _MSC_VER extern int testCPP; +#endif #include int main () { +#ifdef _MSC_VER testCPP = 1; +#endif if ( LibCxx1Class::Method() != 2.0 ) { printf("Problem with libcxx1\n"); From 409c936ff44eb6aa82c052dc223adaa630242b23 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 7 Sep 2010 00:01:05 -0400 Subject: [PATCH 079/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index bff308e52..7ba03015d 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 06) +SET(KWSYS_DATE_STAMP_DAY 07) From 11a917d04ee93b239f0be07cf4437364a0c85efb Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 7 Sep 2010 08:44:19 -0400 Subject: [PATCH 080/152] HP-UX: Always add /usr/lib to rpath (#10571) Set CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH in the HP-UX platform file to tell CMake to pass -Wl,+b,/usr/lib no matter whether RPATH is enabled or not. This corrects the behavior of -Wl,+nodefaultrpath to look in this default library path as documented. --- Modules/Platform/HP-UX.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake index f8893d8d3..9d357c942 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") From 7944e4e0ac37cb1423da2de7a203557b77372aac Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 7 Sep 2010 09:14:57 -0400 Subject: [PATCH 081/152] Allow testing of .CPP on WIN32 as it is a case insensitive OS and should work. --- Tests/CxxOnly/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CxxOnly/CMakeLists.txt b/Tests/CxxOnly/CMakeLists.txt index 4654f44ec..d621499cc 100644 --- a/Tests/CxxOnly/CMakeLists.txt +++ b/Tests/CxxOnly/CMakeLists.txt @@ -2,7 +2,7 @@ project (CxxOnly CXX) set(CMAKE_DEBUG_POSTFIX "_test_debug_postfix") -if(MSVC) +if(WIN32) set(EXTRA_SRCS test.CPP) endif() add_library(testcxx1 STATIC libcxx1.cxx ${EXTRA_SRCS}) From e93a4b4d3421ced7b8c852b76c0dcb427f798df8 Mon Sep 17 00:00:00 2001 From: David Cole Date: Tue, 7 Sep 2010 21:29:43 -0400 Subject: [PATCH 082/152] Avoid adding self as prerequisite. (#10417) Thanks to Clinton Stimpson for the patch. --- Modules/BundleUtilities.cmake | 2 +- Modules/GetPrerequisites.cmake | 25 +++++++++++++++++++++++-- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index b48c61eab..b4755f143 100644 --- a/Modules/BundleUtilities.cmake +++ b/Modules/BundleUtilities.cmake @@ -412,7 +412,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}") diff --git a/Modules/GetPrerequisites.cmake b/Modules/GetPrerequisites.cmake index 847db347b..c83da4f81 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) From 88fed668b1a35f6bd1c0ab2cd4bc6f62576b9121 Mon Sep 17 00:00:00 2001 From: Mike McQuaid Date: Tue, 7 Sep 2010 22:49:32 -0400 Subject: [PATCH 083/152] Make bundle items writable before fixup (#9284) This ensures that any bundle items are made user writable before any attempt is made to alter them using install_name_tool. This is because MacPorts/Fink/Homebrew don't install libraries as writable. This fix is needed to allow fixup_bundle_item to work correctly when ingesting libraries installed by these package managers. --- Modules/BundleUtilities.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Modules/BundleUtilities.cmake b/Modules/BundleUtilities.cmake index b48c61eab..fad3b7852 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( ) # 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 @@ -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: # From 711c6103143fd55d029dace11cb14c2187c9d153 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 8 Sep 2010 00:01:03 -0400 Subject: [PATCH 084/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 7ba03015d..5816ea8a3 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 07) +SET(KWSYS_DATE_STAMP_DAY 08) From b06fb1668424514bf45794d40bfc9f88dd5d619c Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 8 Sep 2010 14:54:49 -0400 Subject: [PATCH 085/152] No CMAKE_CONFIGURATION_TYPES in single-config generators (#10202) Factor out reading of CMAKE_CONFIGURATION_TYPES and CMAKE_BUILD_TYPE into cmMakefile::GetConfigurations. Read the former only in multi-config generators. --- Source/cmExportCommand.cxx | 12 +++------- Source/cmGlobalXCodeGenerator.cxx | 20 ++-------------- Source/cmLocalGenerator.cxx | 38 ++++--------------------------- Source/cmMakefile.cxx | 36 +++++++++++++++++++++-------- Source/cmMakefile.h | 6 ++++- Source/cmTarget.cxx | 13 +---------- 6 files changed, 42 insertions(+), 83 deletions(-) diff --git a/Source/cmExportCommand.cxx b/Source/cmExportCommand.cxx index 48c5c6e6a..cb614d4f3 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 configurationTypes; + this->Makefile->GetConfigurations(configurationTypes); + if(!configurationTypes.empty()) { - std::vector configurationTypes; - cmSystemTools::ExpandListArgument(types, configurationTypes); for(std::vector::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/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index 537a88f30..c63b4034d 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 bac0223b5..5bffd5236 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -278,16 +278,8 @@ void cmLocalGenerator::GenerateTestFiles() // Compute the set of configurations. std::vector 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 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 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/cmMakefile.cxx b/Source/cmMakefile.cxx index 8eece6b5a..c64053aa7 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 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::const_iterator ci = configs.begin(); ci != configs.end(); ++ci) { @@ -2367,6 +2358,31 @@ void cmMakefile::AddDefaultDefinitions() cmake::GetCMakeFilesDirectory()); } +//---------------------------------------------------------------------------- +const char* +cmMakefile::GetConfigurations(std::vector& 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 4fae7eee2..8b8a3f858 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& configs, + bool single = true) const; + /** * Set the name of the library. */ diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 961191269..591b0d196 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1040,18 +1040,7 @@ void cmTarget::SetMakefile(cmMakefile* mf) // Collect the set of configuration types. std::vector 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[] = { From ffda17d9ef335cbc6d2429ea35fbb5a1f57e2a03 Mon Sep 17 00:00:00 2001 From: Zach Mullen Date: Wed, 8 Sep 2010 15:10:42 -0400 Subject: [PATCH 086/152] We shouldn't ask CDash for its version info until/unless we actually need it. --- Source/cmCTest.cxx | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Source/cmCTest.cxx b/Source/cmCTest.cxx index dcdc8e15b..2e05883e9 100644 --- a/Source/cmCTest.cxx +++ b/Source/cmCTest.cxx @@ -490,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: From fcbdd3129e7edec4b07f96662aa21371d671cb83 Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 8 Sep 2010 18:41:21 -0400 Subject: [PATCH 087/152] CMake: quote ':' in Windows NMake Makefiles (#9963) --- Source/kwsys/System.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/kwsys/System.c b/Source/kwsys/System.c index 5d178bfa2..99d5c05bf 100644 --- a/Source/kwsys/System.c +++ b/Source/kwsys/System.c @@ -84,7 +84,8 @@ static int kwsysSystem_Shell__CharNeedsQuotesOnUnix(char c) static int kwsysSystem_Shell__CharNeedsQuotesOnWindows(char c) { return ((c == '\'') || (c == '#') || (c == '&') || - (c == '<') || (c == '>') || (c == '|') || (c == '^')); + (c == '<') || (c == '>') || (c == '|') || + (c == '^') || (c == ':')); } /*--------------------------------------------------------------------------*/ From 42dbb43294a229dad30fa1a8d925bdd4c0f47d65 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 9 Sep 2010 00:01:04 -0400 Subject: [PATCH 088/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 5816ea8a3..35e6285bd 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 08) +SET(KWSYS_DATE_STAMP_DAY 09) From 2f98dac486726c67681ea51a57e19518d7119b1b Mon Sep 17 00:00:00 2001 From: David Cole Date: Thu, 9 Sep 2010 07:26:03 -0400 Subject: [PATCH 089/152] Correct CMAKE_INSTALL_PREFIX value for Win64 apps (#9992) The default value for CMAKE_INSTALL_PREFIX should be based on what architecture the built targets are, not what architecture CMake itself is. This fix merely guesses better what the built targets architecture is. It still may guess incorrectly in some cases. For those cases, it will have to be up to build scripts and developers on projects to pass in a correct value for CMAKE_INSTALL_PREFIX with -D on the command line or via 'force cache value' logic in CMakeLists.txt files. --- Modules/CMakeGenericSystem.cmake | 102 +++++++++++++++++++++++++++---- 1 file changed, 89 insertions(+), 13 deletions(-) diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake index 7d2d8cdc8..b5d30724a 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( From 2eab3b2cbb3464ae79ce3b39d924f1844b96bd8f Mon Sep 17 00:00:00 2001 From: David Cole Date: Thu, 9 Sep 2010 12:34:07 -0400 Subject: [PATCH 090/152] Revert commit: CMake: quote ':' in Windows NMake Makefiles (#9963) -- it was not the right fix and caused mucho other problemo --- Source/kwsys/System.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Source/kwsys/System.c b/Source/kwsys/System.c index 99d5c05bf..5d178bfa2 100644 --- a/Source/kwsys/System.c +++ b/Source/kwsys/System.c @@ -84,8 +84,7 @@ static int kwsysSystem_Shell__CharNeedsQuotesOnUnix(char c) static int kwsysSystem_Shell__CharNeedsQuotesOnWindows(char c) { return ((c == '\'') || (c == '#') || (c == '&') || - (c == '<') || (c == '>') || (c == '|') || - (c == '^') || (c == ':')); + (c == '<') || (c == '>') || (c == '|') || (c == '^')); } /*--------------------------------------------------------------------------*/ From 666f328858e5c47a0b2286af95cbc127f28a663b Mon Sep 17 00:00:00 2001 From: David Cole Date: Thu, 9 Sep 2010 12:57:14 -0400 Subject: [PATCH 091/152] Preserve timestamps on files on tar extract. Conversion to libarchive changed the behavior of cmake -E tar xzf. This commit fixes that oversight. --- Source/cmSystemTools.cxx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 837892214..531616d42 100644 --- a/Source/cmSystemTools.cxx +++ b/Source/cmSystemTools.cxx @@ -1931,12 +1931,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 From 20a6f6cf7ae0442e3687f0fdd4b151ba2c196674 Mon Sep 17 00:00:00 2001 From: David Cole Date: Thu, 9 Sep 2010 15:39:19 -0400 Subject: [PATCH 092/152] Use QUIET to avoid Java status messages. CMake devs mostly do not care when Java is found successfully. --- Tests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 8e8d0ca6f..eb86a34bb 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1630,7 +1630,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 From e79e412e70cb439354df589d83d3878c4dbe62fc Mon Sep 17 00:00:00 2001 From: David Cole Date: Thu, 9 Sep 2010 16:21:57 -0400 Subject: [PATCH 093/152] VS2010: Honor PROJECT_LABEL target property (#10611) --- Source/cmVisualStudio10TargetGenerator.cxx | 7 +++++++ Tests/FunctionTest/CMakeLists.txt | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 477945b39..b37457966 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -155,6 +155,13 @@ void cmVisualStudio10TargetGenerator::Generate() this->WriteString("Win32Proj\n", 2); this->WriteString("", 2); (*this->BuildFileStream) << this->Platform << "\n"; + const char* projLabel = this->Target->GetProperty("PROJECT_LABEL"); + if(!projLabel) + { + projLabel = this->Name.c_str(); + } + this->WriteString("", 2); + (*this->BuildFileStream) << projLabel << "\n"; this->WriteString("\n", 1); this->WriteString("\n", diff --git a/Tests/FunctionTest/CMakeLists.txt b/Tests/FunctionTest/CMakeLists.txt index ef5517349..5d4f42d4a 100644 --- a/Tests/FunctionTest/CMakeLists.txt +++ b/Tests/FunctionTest/CMakeLists.txt @@ -166,3 +166,11 @@ ELSE(DEFINED SUBDIR_DEFINED) ENDIF(DEFINED SUBDIR_DEFINED) ADD_EXECUTABLE(FunctionTest functionTest.c) + +# Use the PROJECT_LABEL property: in IDEs, the project label should appear +# in the UI rather than the target name. If this were a good test of the +# property rather than just a smoke test, it would verify that the label +# actually appears in the UI of the IDE... Or at least that the text appears +# somewhere in the generated project files. +SET_PROPERTY(TARGET miniFunctionTest + PROPERTY PROJECT_LABEL "Test de Fonctionnement") From de346204b823f79685fa6a0be5c3c376fdbb422b Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Fri, 10 Sep 2010 00:01:05 -0400 Subject: [PATCH 094/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 35e6285bd..4b0fb0242 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 09) +SET(KWSYS_DATE_STAMP_DAY 10) From f2b4a466779f5481c79d711ee2601d60ce41a6ad Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 10 Sep 2010 08:53:50 -0400 Subject: [PATCH 095/152] KWSys: Suppress -Wcast-align warning in MD5.c The code does contain a cast that increases alignment but only in a conditional that verifies the input is sufficiently aligned. --- Source/kwsys/MD5.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Source/kwsys/MD5.c b/Source/kwsys/MD5.c index 1ea0a66b1..56776a324 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 From 87fde60563a3915234b33192d7f20b2af0c37206 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 10 Sep 2010 08:56:37 -0400 Subject: [PATCH 096/152] Suppress -Wcast-align in curl and bzip2 Trust upstream developers of third-party code. --- Utilities/cmbzip2/bzlib_private.h | 3 +++ Utilities/cmcurl/setup.h | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/Utilities/cmbzip2/bzlib_private.h b/Utilities/cmbzip2/bzlib_private.h index 147dbb875..02a667f49 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 c49e63de7..e302f35be 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. From b9c41813d29be3a520d196ce3abfb533fb5c0dbb Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 10 Sep 2010 08:58:19 -0400 Subject: [PATCH 097/152] libarchive: Fix purposeful crash Dereferencing a 0-pointer is undefined behavior, not a deterministic crash. Use a 1-pointer instead. This also avoids a warning by Clang about the undefined behavior. --- Utilities/cmlibarchive/libarchive/archive_check_magic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/cmlibarchive/libarchive/archive_check_magic.c b/Utilities/cmlibarchive/libarchive/archive_check_magic.c index a9177d778..e9dbe5148 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. */ } From c7aa38ff39651479127a55c33935486d9d8fe6fb Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 10 Sep 2010 11:39:43 -0400 Subject: [PATCH 098/152] bootstrap: Honor CFLAGS during "make" test (#10545) --- bootstrap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bootstrap b/bootstrap index 01d9e152c..0da868d8f 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 From 4f0636e9795200985ed8906b3d8821da350a1bb3 Mon Sep 17 00:00:00 2001 From: James Bigler Date: Fri, 10 Sep 2010 11:48:38 -0600 Subject: [PATCH 099/152] Added CUDA 3.2 directory changes. Disable emulation mode for CUDA 3.1+. CUDA 3.2 on Windows systems changed the layout of the library paths. This adds the extra directories needed to locate the new files. I also explicitly disable emulation mode for CUDA 3.1+. This feature was deprecated in 3.0 and ultimately removed in 3.1. The script errors out if CUDA_BUILD_EMULATION is turned on. I didn't want to ignore emulation mode (even with a warning - which most people may not even see) and have users confused as to why it wasn't working. --- Modules/FindCUDA.cmake | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index d9b9d5427..dad5709e0 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) From 86025d3a38fb2dd6409e713b4633bf782975d5c3 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 10 Sep 2010 14:35:07 -0400 Subject: [PATCH 100/152] file(DOWNLOAD): Fix error message formatting The SetError method automatically starts the message with the name of the command. Fix up calls to it so that we get "file DOWNLOAD..." instead of "file FILE(DOWNLOAD ...". Also reduce length of long lines containing these calls. --- Source/cmFileCommand.cxx | 103 +++++++++++++++++---------------------- 1 file changed, 45 insertions(+), 58 deletions(-) diff --git a/Source/cmFileCommand.cxx b/Source/cmFileCommand.cxx index 133c1a196..8ebd41f92 100644 --- a/Source/cmFileCommand.cxx +++ b/Source/cmFileCommand.cxx @@ -2571,8 +2571,7 @@ cmFileCommand::HandleDownloadCommand(std::vector std::vector::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 } 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 ++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 ++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 ++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 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 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::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 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 ::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 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 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 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 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 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 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 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 CURLOPT_PROGRESSDATA, reinterpret_cast(&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 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 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 return true; #else - this->SetError("FILE(DOWNLOAD ) " - "not supported in bootstrap cmake "); + this->SetError("DOWNLOAD not supported by bootstrap cmake."); return false; #endif } From 9d21281b7d4c1cec9071489a8f0a6fe19fb7ad2c Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 10 Sep 2010 14:42:09 -0400 Subject: [PATCH 101/152] Fix line-too-long style errors --- Source/cmELF.cxx | 3 ++- Source/cmGlobalVisualStudio8Generator.cxx | 4 ++-- Source/cmLocalVisualStudio6Generator.cxx | 3 ++- Source/cmSystemTools.cxx | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Source/cmELF.cxx b/Source/cmELF.cxx index c19872748..1158fc0c0 100644 --- a/Source/cmELF.cxx +++ b/Source/cmELF.cxx @@ -687,7 +687,8 @@ cmELFInternalImpl::GetDynamicSectionString(int tag) // The value has been read successfully. Report it. se.Position = static_cast(strtab.sh_offset + first); se.Size = last - first; - se.IndexInSection = static_cast(di - this->DynamicSectionEntries.begin()); + se.IndexInSection = + static_cast(di - this->DynamicSectionEntries.begin()); return &se; } } diff --git a/Source/cmGlobalVisualStudio8Generator.cxx b/Source/cmGlobalVisualStudio8Generator.cxx index c5c9d5c1b..7c65c320e 100644 --- a/Source/cmGlobalVisualStudio8Generator.cxx +++ b/Source/cmGlobalVisualStudio8Generator.cxx @@ -260,8 +260,8 @@ cmGlobalVisualStudio8Generator for(std::vector::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/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 539816d3c..01fcafdb0 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/cmSystemTools.cxx b/Source/cmSystemTools.cxx index 837892214..069db7eae 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(buffer); + unsigned char const* buffer_uc = + reinterpret_cast(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() From 187976b1f35ee9cca95d67c87f0868f60201dc2b Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Fri, 10 Sep 2010 15:41:27 -0400 Subject: [PATCH 102/152] Fix release scripts to be able to build releases from tags. --- Utilities/Release/dash2win64_cygwin.cmake | 3 ++- Utilities/Release/release_cmake.cmake | 6 +++++- Utilities/Release/release_cmake.sh.in | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Utilities/Release/dash2win64_cygwin.cmake b/Utilities/Release/dash2win64_cygwin.cmake index d86689634..64099a969 100644 --- a/Utilities/Release/dash2win64_cygwin.cmake +++ b/Utilities/Release/dash2win64_cygwin.cmake @@ -6,12 +6,13 @@ set(HOST dash2win64) set(CPACK_BINARY_GENERATORS "CygwinBinary") set(CPACK_SOURCE_GENERATORS "CygwinSource") set(MAKE_PROGRAM "make") -set(CVS_COMMAND /usr/bin/cvs) set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release CMAKE_Fortran_COMPILER_FULLPATH:FILEPATH=FALSE ") set(CXX g++) set(CC gcc) set(SCRIPT_NAME dash2win64cygwin) +set(GIT_COMMAND git) +set(GIT_EXTRA "git config core.autocrlf true") get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) include(${path}/release_cmake.cmake) diff --git a/Utilities/Release/release_cmake.cmake b/Utilities/Release/release_cmake.cmake index 6fd137209..9a2ede778 100644 --- a/Utilities/Release/release_cmake.cmake +++ b/Utilities/Release/release_cmake.cmake @@ -34,7 +34,11 @@ if(NOT DEFINED CVS_COMMAND) set(CVS_COMMAND cvs) endif(NOT DEFINED CVS_COMMAND) -set(GIT_BRANCH ${CMAKE_CREATE_VERSION}) +if(${GIT_CREATE_VERSION} MATCHES "^(release|maint)$") + set(GIT_BRANCH origin/${CMAKE_CREATE_VERSION}) +else() + set(GIT_BRANCH ${CMAKE_CREATE_VERSION}) +endif() set( CMAKE_CHECKOUT "${CVS_COMMAND} -q -d ${CVSROOT} co -d ${CMAKE_CREATE_VERSION} ${CMAKE_CREATE_VERSION}") diff --git a/Utilities/Release/release_cmake.sh.in b/Utilities/Release/release_cmake.sh.in index 41897283a..8455e92c8 100755 --- a/Utilities/Release/release_cmake.sh.in +++ b/Utilities/Release/release_cmake.sh.in @@ -89,7 +89,7 @@ if [ ! -z "@GIT_COMMAND@" ]; then @GIT_EXTRA@ check_exit_value $? "git extra cmake source" || exit 1 # now checkout a copy on the local branch working - @GIT_COMMAND@ checkout -b working origin/@GIT_BRANCH@ + @GIT_COMMAND@ checkout -b working @GIT_BRANCH@ check_exit_value $? "git checkout" || exit 1 cd .. else From 269a4b876a34483c5cb664499dc6b1634fa453ff Mon Sep 17 00:00:00 2001 From: David Cole Date: Fri, 10 Sep 2010 16:17:39 -0400 Subject: [PATCH 103/152] Enable calling commands with : in argv[1] (#9963) The solution seems hackish, but it works: for NMake only, prepend a no-op command before each real command that begins with ". This is really a work-around for an NMake problem. When a command begins with ", nmake truncates the first argument to the command after the first : in that arg. It has a parsing problem. Workaround..., hackish..., but it should solve the issue for #9963 and its related friends. Also, modify the CustomCommand test to replicate the problem reported in issue #9963. Before the NMake specific code change, the test failed. Now, it passes. Ahhhhhh. --- Source/cmLocalUnixMakefileGenerator3.cxx | 11 +++++++++-- Tests/CMakeLists.txt | 2 +- Tests/CustomCommand/CMakeLists.txt | 17 +++++++++++------ 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/Source/cmLocalUnixMakefileGenerator3.cxx b/Source/cmLocalUnixMakefileGenerator3.cxx index 004d19a2d..f04d0a0ad 100644 --- a/Source/cmLocalUnixMakefileGenerator3.cxx +++ b/Source/cmLocalUnixMakefileGenerator3.cxx @@ -1062,9 +1062,16 @@ cmLocalUnixMakefileGenerator3 } } } - if (useCall && launcher.empty()) + if (launcher.empty()) { - cmd = "call " + cmd; + if (useCall) + { + cmd = "call " + cmd; + } + else if (this->NMake && cmd[0]=='"') + { + cmd = "echo >nul && " + cmd; + } } commands1.push_back(cmd); } diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 8e8d0ca6f..e4c979e12 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -376,7 +376,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-generator ${CMAKE_TEST_GENERATOR} --build-project CustomCommand --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} - --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin" + --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin dir" --test-command CustomCommand ) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand") diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index 4fc9fb5d4..6664fd6cd 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -9,12 +9,12 @@ ADD_SUBDIRECTORY(GeneratedHeader) # # Lib and exe path # -SET (LIBRARY_OUTPUT_PATH - ${PROJECT_BINARY_DIR}/bin/ CACHE INTERNAL +SET (LIBRARY_OUTPUT_PATH + "${PROJECT_BINARY_DIR}/bin dir" CACHE INTERNAL "Single output directory for building all libraries.") -SET (EXECUTABLE_OUTPUT_PATH - ${PROJECT_BINARY_DIR}/bin/ CACHE INTERNAL +SET (EXECUTABLE_OUTPUT_PATH + "${PROJECT_BINARY_DIR}/bin dir" CACHE INTERNAL "Single output directory for building all executables.") ################################################################ @@ -221,6 +221,7 @@ ADD_CUSTOM_COMMAND(OUTPUT gen_redirect.c # Test non-trivial command line arguments in custom commands. SET(EXPECTED_ARGUMENTS) SET(CHECK_ARGS + -DPATH=c:/posix/path c:/posix/path c:\\windows\\path 'single-quotes' @@ -273,6 +274,8 @@ SET(CHECK_ARGS |nopipe "#two-pounds#" "one#pound" + ":two-colons:" + "one:colon" "#nocomment" "c:/posix/path/with space" "c:\\windows\\path\\with space" @@ -359,13 +362,15 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in @ONLY IMMEDIATE) ADD_EXECUTABLE(check_command_line ${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c) +SET_PROPERTY(TARGET check_command_line + PROPERTY OUTPUT_NAME "check command line") # SET_TARGET_PROPERTIES(check_command_line PROPERTIES # COMPILE_FLAGS -DCHECK_COMMAND_LINE_VERBOSE) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/command_line_check COMMAND ${CMAKE_COMMAND} -DMARK_FILE=${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt -P ${CMAKE_CURRENT_SOURCE_DIR}/check_mark.cmake - COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/check_command_line + COMMAND "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/check command line" ${CHECK_ARGS} "" VERBATIM COMMENT "Checking custom command line escapes (single'quote)" @@ -375,7 +380,7 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/command_line_check ADD_CUSTOM_TARGET(do_check_command_line ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/command_line_check COMMAND ${CMAKE_COMMAND} -E echo "Checking custom target command escapes" - COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/check_command_line + COMMAND "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/check command line" ${CHECK_ARGS} "" VERBATIM COMMENT "Checking custom target command line escapes ($dollar-signs$)" From c36f501a6465e024f69c8e9bfb13ba37229fd2fd Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sat, 11 Sep 2010 00:01:11 -0400 Subject: [PATCH 104/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 4b0fb0242..5480376f2 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 10) +SET(KWSYS_DATE_STAMP_DAY 11) From 3665e69bc660fd3e872a141090d38650c6c271ac Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sun, 12 Sep 2010 00:01:04 -0400 Subject: [PATCH 105/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 5480376f2..e1f98cbfc 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 11) +SET(KWSYS_DATE_STAMP_DAY 12) From 9d2e6489bf8e5087957ef578174e3b0516c32a50 Mon Sep 17 00:00:00 2001 From: David Cole Date: Sun, 12 Sep 2010 05:01:35 -0400 Subject: [PATCH 106/152] No extra spaces in CustomCommand test (#9963) The nightly dashboard showed that the following platforms had difficulties dealing with "bin dir" and/or "check command line" as directory and file names: AIX Borland 5.5, 5.6 and 5.8 IRIX NMake 6.0 OpenBSD VS 7.1 Watcom Re-visit later, after the release, to use spaces in the bin dir and in the target name where possible. --- Tests/CMakeLists.txt | 2 +- Tests/CustomCommand/CMakeLists.txt | 15 ++++++++++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index e4c979e12..8e8d0ca6f 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -376,7 +376,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/ --build-generator ${CMAKE_TEST_GENERATOR} --build-project CustomCommand --build-makeprogram ${CMAKE_TEST_MAKEPROGRAM} - --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin dir" + --build-exe-dir "${CMake_BINARY_DIR}/Tests/CustomCommand/bin" --test-command CustomCommand ) LIST(APPEND TEST_BUILD_DIRS "${CMake_BINARY_DIR}/Tests/CustomCommand") diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index 6664fd6cd..c6f6a7f36 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -9,12 +9,16 @@ ADD_SUBDIRECTORY(GeneratedHeader) # # Lib and exe path # +IF(NOT DEFINED bin_dir) + SET(bin_dir "bin") +ENDIF() + SET (LIBRARY_OUTPUT_PATH - "${PROJECT_BINARY_DIR}/bin dir" CACHE INTERNAL + ${PROJECT_BINARY_DIR}/${bin_dir} CACHE INTERNAL "Single output directory for building all libraries.") SET (EXECUTABLE_OUTPUT_PATH - "${PROJECT_BINARY_DIR}/bin dir" CACHE INTERNAL + ${PROJECT_BINARY_DIR}/${bin_dir} CACHE INTERNAL "Single output directory for building all executables.") ################################################################ @@ -362,15 +366,16 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/check_command_line.c.in @ONLY IMMEDIATE) ADD_EXECUTABLE(check_command_line ${CMAKE_CURRENT_BINARY_DIR}/check_command_line.c) +SET(output_name "check_command_line") SET_PROPERTY(TARGET check_command_line - PROPERTY OUTPUT_NAME "check command line") + PROPERTY OUTPUT_NAME ${output_name}) # SET_TARGET_PROPERTIES(check_command_line PROPERTIES # COMPILE_FLAGS -DCHECK_COMMAND_LINE_VERBOSE) ADD_CUSTOM_COMMAND( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/command_line_check COMMAND ${CMAKE_COMMAND} -DMARK_FILE=${CMAKE_CURRENT_BINARY_DIR}/check_mark.txt -P ${CMAKE_CURRENT_SOURCE_DIR}/check_mark.cmake - COMMAND "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/check command line" + COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/${output_name} ${CHECK_ARGS} "" VERBATIM COMMENT "Checking custom command line escapes (single'quote)" @@ -380,7 +385,7 @@ SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_BINARY_DIR}/command_line_check ADD_CUSTOM_TARGET(do_check_command_line ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/command_line_check COMMAND ${CMAKE_COMMAND} -E echo "Checking custom target command escapes" - COMMAND "${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/check command line" + COMMAND ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/${output_name} ${CHECK_ARGS} "" VERBATIM COMMENT "Checking custom target command line escapes ($dollar-signs$)" From f3bc219adbbf10f3a75af1ac1db1f47b90102e19 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 13 Sep 2010 00:01:06 -0400 Subject: [PATCH 107/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index e1f98cbfc..cce79ef05 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 12) +SET(KWSYS_DATE_STAMP_DAY 13) From 80bad29af6dbff6ea284d7a56735f85fc7476e5a Mon Sep 17 00:00:00 2001 From: Marcel Loose Date: Mon, 13 Sep 2010 13:13:12 +0200 Subject: [PATCH 108/152] Issue 10199: Fixed code documentation and now set _WC_ROOT --- Modules/FindSubversion.cmake | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake index 9bad3b129..daf3d87f5 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( ) -# is defined to extract information of a subversion working copy at -# a given location. The macro defines the following variables: +# Subversion_WC_LOG( ) +# Subversion_WC_INFO extracts information of a subversion working copy at +# a given location. This macro defines the following variables: # _WC_URL - url of the repository (at ) # _WC_ROOT - root url of the repository # _WC_REVISION - current revision # _WC_LAST_CHANGED_AUTHOR - author of last commit # _WC_LAST_CHANGED_DATE - date of last commit # _WC_LAST_CHANGED_REV - revision of last commit -# _WC_LAST_CHANGED_LOG - last log of base revision # _WC_INFO - output of command `svn info ' +# 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: +# _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]+).*" From 297be5b524ecc22a9ac2deb069c3703946f3147c Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Mon, 13 Sep 2010 11:30:23 -0400 Subject: [PATCH 109/152] add next as an orgin based branch, and not a tag. --- Utilities/Release/release_cmake.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/Release/release_cmake.cmake b/Utilities/Release/release_cmake.cmake index 9a2ede778..44c44f7f9 100644 --- a/Utilities/Release/release_cmake.cmake +++ b/Utilities/Release/release_cmake.cmake @@ -34,7 +34,7 @@ if(NOT DEFINED CVS_COMMAND) set(CVS_COMMAND cvs) endif(NOT DEFINED CVS_COMMAND) -if(${GIT_CREATE_VERSION} MATCHES "^(release|maint)$") +if(${GIT_CREATE_VERSION} MATCHES "^(release|maint|next)$") set(GIT_BRANCH origin/${CMAKE_CREATE_VERSION}) else() set(GIT_BRANCH ${CMAKE_CREATE_VERSION}) From ed37fc3ea398b03bbba175ae337f14b6af58daee Mon Sep 17 00:00:00 2001 From: David Cole Date: Mon, 13 Sep 2010 13:29:10 -0400 Subject: [PATCH 110/152] VS2010: Set IntDir for utility and global targets. VS2010 uses IntDir as the location for writing log files for what happens during custom build steps. With no IntDir settings, all ExternalProject usage within the same CMakeLists.txt file would result in multiple utility targets all trying to use the same custom build log files. With parallel builds, they would try to use them simultaneously and result in file access errors, preventing the builds from completing successfully. Now each utility target has its own IntDir setting, and so, its own custom build rule log files. --- Source/cmVisualStudio10TargetGenerator.cxx | 73 +++++++++++++--------- 1 file changed, 45 insertions(+), 28 deletions(-) diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index b37457966..b290aed73 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -814,10 +814,12 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags( void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() { - if(this->Target->GetType() > cmTarget::MODULE_LIBRARY) + cmTarget::TargetType ttype = this->Target->GetType(); + if(ttype > cmTarget::GLOBAL_TARGET) { return; } + this->WriteString("\n", 2); this->WriteString("<_ProjectFileVersion>10.0.20506.1" "\n", 3); @@ -827,33 +829,48 @@ void cmVisualStudio10TargetGenerator::WritePathAndIncrementalLinkOptions() for(std::vector::iterator config = configs->begin(); config != configs->end(); ++config) { - std::string targetNameFull = - this->Target->GetFullName(config->c_str()); - std::string intermediateDir = this->LocalGenerator-> - GetTargetDirectory(*this->Target); - intermediateDir += "/"; - intermediateDir += *config; - intermediateDir += "/"; - this->ConvertToWindowsSlash(intermediateDir); - std::string outDir = this->Target->GetDirectory(config->c_str()); - this->ConvertToWindowsSlash(outDir); - this->WritePlatformConfigTag("OutDir", config->c_str(), 3); - *this->BuildFileStream << outDir - << "\\" - << "\n"; - this->WritePlatformConfigTag("IntDir", config->c_str(), 3); - *this->BuildFileStream << intermediateDir - << "\n"; - this->WritePlatformConfigTag("TargetName", config->c_str(), 3); - *this->BuildFileStream - << cmSystemTools::GetFilenameWithoutLastExtension( - targetNameFull.c_str()) - << "\n"; - this->WritePlatformConfigTag("TargetExt", config->c_str(), 3); - *this->BuildFileStream << cmSystemTools::GetFilenameLastExtension( - targetNameFull.c_str()) - << "\n"; - this->OutputLinkIncremental(*config); + if(ttype >= cmTarget::UTILITY) + { + this->WritePlatformConfigTag("IntDir", config->c_str(), 3); + *this->BuildFileStream + << "$(Platform)\\$(Configuration)\\$(ProjectName)\\" + << "\n"; + } + else + { + std::string targetNameFull = + this->Target->GetFullName(config->c_str()); + std::string intermediateDir = this->LocalGenerator-> + GetTargetDirectory(*this->Target); + intermediateDir += "/"; + intermediateDir += *config; + intermediateDir += "/"; + this->ConvertToWindowsSlash(intermediateDir); + std::string outDir = this->Target->GetDirectory(config->c_str()); + this->ConvertToWindowsSlash(outDir); + + this->WritePlatformConfigTag("OutDir", config->c_str(), 3); + *this->BuildFileStream << outDir + << "\\" + << "\n"; + + this->WritePlatformConfigTag("IntDir", config->c_str(), 3); + *this->BuildFileStream << intermediateDir + << "\n"; + + this->WritePlatformConfigTag("TargetName", config->c_str(), 3); + *this->BuildFileStream + << cmSystemTools::GetFilenameWithoutLastExtension( + targetNameFull.c_str()) + << "\n"; + + this->WritePlatformConfigTag("TargetExt", config->c_str(), 3); + *this->BuildFileStream + << cmSystemTools::GetFilenameLastExtension(targetNameFull.c_str()) + << "\n"; + + this->OutputLinkIncremental(*config); + } } this->WriteString("\n", 2); } From a6b5ead62fb4e69c053d752570f4c8af24e41857 Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 13 Sep 2010 15:56:06 -0400 Subject: [PATCH 111/152] Report missing source files with context of target Previously we reported only the CMakeLists.txt file in the directory that adds the target. --- Source/cmSourceFile.cxx | 15 +++++++++++---- Source/cmSourceFile.h | 4 ++-- Source/cmTarget.cxx | 9 ++++++++- Tests/CMakeLists.txt | 3 +++ Tests/MissingSourceFile/CMakeLists.txt | 3 +++ 5 files changed, 27 insertions(+), 7 deletions(-) create mode 100644 Tests/MissingSourceFile/CMakeLists.txt diff --git a/Source/cmSourceFile.cxx b/Source/cmSourceFile.cxx index bc52d7fd2..b793cd5fb 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 937e4b736..2dc848815 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/cmTarget.cxx b/Source/cmTarget.cxx index 961191269..042371ab1 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -1439,8 +1439,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/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index 8e8d0ca6f..3e92bdfc4 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) diff --git a/Tests/MissingSourceFile/CMakeLists.txt b/Tests/MissingSourceFile/CMakeLists.txt new file mode 100644 index 000000000..42b7c5123 --- /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) From becc11f72f36f689977440038253a0106a72e427 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 14 Sep 2010 00:01:05 -0400 Subject: [PATCH 112/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index cce79ef05..99c8b277a 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 13) +SET(KWSYS_DATE_STAMP_DAY 14) From 7d148d8036e2b2389f6e0cae55b34956c835e98d Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 14 Sep 2010 09:30:39 -0400 Subject: [PATCH 113/152] Fix the name of the variable being tested. --- Utilities/Release/release_cmake.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Utilities/Release/release_cmake.cmake b/Utilities/Release/release_cmake.cmake index 44c44f7f9..3a35ec3dd 100644 --- a/Utilities/Release/release_cmake.cmake +++ b/Utilities/Release/release_cmake.cmake @@ -34,7 +34,7 @@ if(NOT DEFINED CVS_COMMAND) set(CVS_COMMAND cvs) endif(NOT DEFINED CVS_COMMAND) -if(${GIT_CREATE_VERSION} MATCHES "^(release|maint|next)$") +if(${CMAKE_CREATE_VERSION} MATCHES "^(release|maint|next)$") set(GIT_BRANCH origin/${CMAKE_CREATE_VERSION}) else() set(GIT_BRANCH ${CMAKE_CREATE_VERSION}) From 9b4ab06c2c46244c158b4349f1b2865f44a11a42 Mon Sep 17 00:00:00 2001 From: David Cole Date: Tue, 14 Sep 2010 10:36:43 -0400 Subject: [PATCH 114/152] Avoid CustomCommand test failure on VS71 (#9963) The new first arg in the test is the critical one to prove that the new NMake specific code works. The additional colons in the middle of the arg stream work fine everywhere else, but not on dash1.kitware with Visual Studio 7.1. Just avoid the failure for now by removing the unnecessary new args from the test. --- Tests/CustomCommand/CMakeLists.txt | 2 -- 1 file changed, 2 deletions(-) diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index c6f6a7f36..d2a0cf722 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -278,8 +278,6 @@ SET(CHECK_ARGS |nopipe "#two-pounds#" "one#pound" - ":two-colons:" - "one:colon" "#nocomment" "c:/posix/path/with space" "c:\\windows\\path\\with space" From de7a090847b4e3113209cf518742cbc1988b3fd8 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 15 Sep 2010 00:01:12 -0400 Subject: [PATCH 115/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 99c8b277a..7fc2bbd7e 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 14) +SET(KWSYS_DATE_STAMP_DAY 15) From 390117435ad0595d9fcc9cf4c93f70f7939b8cf6 Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Wed, 15 Sep 2010 16:41:41 -0400 Subject: [PATCH 116/152] Fix KWStyle line length issues. --- Source/CPack/cmCPackArchiveGenerator.cxx | 52 +++++++++++++++++------- Source/CPack/cmCPackArchiveGenerator.h | 3 +- Source/CPack/cmCPackGenerator.cxx | 24 +++++++---- Source/CPack/cmCPackNSISGenerator.cxx | 3 +- Source/cmLocalVisualStudio6Generator.cxx | 3 +- 5 files changed, 59 insertions(+), 26 deletions(-) diff --git a/Source/CPack/cmCPackArchiveGenerator.cxx b/Source/CPack/cmCPackArchiveGenerator.cxx index 79ccdd9e9..c86434e46 100644 --- a/Source/CPack/cmCPackArchiveGenerator.cxx +++ b/Source/CPack/cmCPackArchiveGenerator.cxx @@ -58,9 +58,11 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive, // Change to local toplevel cmSystemTools::ChangeDirectory(localToplevel.c_str()); std::vector::const_iterator fileIt; - for (fileIt = component->Files.begin(); fileIt != component->Files.end(); ++fileIt ) + for (fileIt = component->Files.begin(); fileIt != component->Files.end(); + ++fileIt ) { - cmCPackLogger(cmCPackLog::LOG_DEBUG,"Adding file: " << (*fileIt) << std::endl); + cmCPackLogger(cmCPackLog::LOG_DEBUG,"Adding file: " + << (*fileIt) << std::endl); archive.Add(*fileIt); if (!archive) { @@ -85,7 +87,8 @@ cmGeneratedFileStream gf; \ gf.Open(filename.c_str(), false, true); \ if (!GenerateHeader(&gf)) \ { \ - cmCPackLogger(cmCPackLog::LOG_ERROR, "Problem to generate Header for archive < " \ + cmCPackLogger(cmCPackLog::LOG_ERROR, \ + "Problem to generate Header for archive < " \ << filename \ << ">." << std::endl); \ return 0; \ @@ -118,7 +121,9 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreComponentGroup) << std::endl); // Begin the archive for this group std::string packageFileName= std::string(toplevel); - packageFileName += "/"+std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))+"-"+compGIt->first + this->GetOutputExtension(); + packageFileName += "/" + +std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) + +"-"+compGIt->first + this->GetOutputExtension(); // open a block in order to automatically close archive // at the end of the block { @@ -142,13 +147,16 @@ int cmCPackArchiveGenerator::PackageComponents(bool ignoreComponentGroup) else { std::map::iterator compIt; - for (compIt=this->Components.begin();compIt!=this->Components.end(); ++compIt ) + for (compIt=this->Components.begin(); + compIt!=this->Components.end(); ++compIt ) { std::string localToplevel(this->GetOption("CPACK_TEMPORARY_DIRECTORY")); std::string packageFileName = std::string(toplevel); localToplevel += "/"+ compIt->first; - packageFileName += "/"+std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))+"-"+compIt->first + this->GetOutputExtension(); + packageFileName += "/" + +std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) + +"-"+compIt->first + this->GetOutputExtension(); { DECLARE_AND_OPEN_ARCHIVE(packageFileName,archive); // Add the files of this component to the archive @@ -167,8 +175,12 @@ int cmCPackArchiveGenerator::PackageComponentsAllInOne(bool allComponentInOne) // reset the package file names packageFileNames.clear(); packageFileNames.push_back(std::string(toplevel)); - packageFileNames[0] += "/"+std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME"))+"-ALL" + this->GetOutputExtension(); - cmCPackLogger(cmCPackLog::LOG_VERBOSE, "Packaging all groups in one package...(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE is set)" + packageFileNames[0] += "/" + +std::string(this->GetOption("CPACK_PACKAGE_FILE_NAME")) + +"-ALL" + this->GetOutputExtension(); + cmCPackLogger(cmCPackLog::LOG_VERBOSE, + "Packaging all groups in one package..." + "(CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE is set)" << std::endl); DECLARE_AND_OPEN_ARCHIVE(packageFileNames[0],archive); @@ -197,7 +209,8 @@ int cmCPackArchiveGenerator::PackageComponentsAllInOne(bool allComponentInOne) else { std::map::iterator compIt; - for (compIt=this->Components.begin();compIt!=this->Components.end(); ++compIt ) + for (compIt=this->Components.begin();compIt!=this->Components.end(); + ++compIt ) { // Add the files of this component to the archive addOneComponentToArchive(archive,&(compIt->second)); @@ -215,9 +228,15 @@ int cmCPackArchiveGenerator::PackageFiles() // The default behavior is to create 1 package by component group // unless the user asked to put all COMPONENTS in a single package - bool allGroupInOne = (NULL != (this->GetOption("CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE"))); - bool allComponentInOne = (NULL != (this->GetOption("CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE"))); - bool ignoreComponentGroup = ( NULL != (this->GetOption("CPACK_COMPONENTS_IGNORE_GROUPS"))); + bool allGroupInOne = (NULL != + (this->GetOption( + "CPACK_COMPONENTS_ALL_GROUPS_IN_ONE_PACKAGE"))); + bool allComponentInOne = (NULL != + (this->GetOption( + "CPACK_COMPONENTS_ALL_IN_ONE_PACKAGE"))); + bool ignoreComponentGroup = ( NULL != + (this->GetOption( + "CPACK_COMPONENTS_IGNORE_GROUPS"))); std::string groupingType; @@ -248,13 +267,15 @@ int cmCPackArchiveGenerator::PackageFiles() cmCPackLogger(cmCPackLog::LOG_WARNING, "[" << this->Name << "]" << " requested component grouping type <"<< groupingType - << "> UNKNOWN not in (ALL_GROUP_IN_ONE,ALL_COMPONENT_IN_ONE,IGNORE)" < UNKNOWN not in (ALL_GROUP_IN_ONE," + "ALL_COMPONENT_IN_ONE,IGNORE)" <ComponentGroups.empty() && (!this->Components.empty()) && (!ignoreComponentGroup)) { + if (this->ComponentGroups.empty() && (!this->Components.empty()) + && (!ignoreComponentGroup)) { cmCPackLogger(cmCPackLog::LOG_WARNING, "[" << this->Name << "]" << " Some Components defined but NO component group:" @@ -286,7 +307,8 @@ int cmCPackArchiveGenerator::PackageFiles() for ( fileIt = files.begin(); fileIt != files.end(); ++ fileIt ) { // Get the relative path to the file - std::string rp = cmSystemTools::RelativePath(toplevel.c_str(), fileIt->c_str()); + std::string rp = cmSystemTools::RelativePath(toplevel.c_str(), + fileIt->c_str()); archive.Add(rp); if(!archive) { diff --git a/Source/CPack/cmCPackArchiveGenerator.h b/Source/CPack/cmCPackArchiveGenerator.h index ae545c888..6e173bd9c 100644 --- a/Source/CPack/cmCPackArchiveGenerator.h +++ b/Source/CPack/cmCPackArchiveGenerator.h @@ -45,7 +45,8 @@ protected: * @param[in,out] archive the archive object * @param[in] component the component whose file will be added to archive */ - int addOneComponentToArchive(cmArchiveWrite& archive, cmCPackComponent* component); + int addOneComponentToArchive(cmArchiveWrite& archive, + cmCPackComponent* component); /** * The main package file method. diff --git a/Source/CPack/cmCPackGenerator.cxx b/Source/CPack/cmCPackGenerator.cxx index 7c3ff1d7c..c39aea4f2 100644 --- a/Source/CPack/cmCPackGenerator.cxx +++ b/Source/CPack/cmCPackGenerator.cxx @@ -172,7 +172,8 @@ int cmCPackGenerator::InstallProject() = this->GetOption("CPACK_TEMPORARY_INSTALL_DIRECTORY"); std::string tempInstallDirectoryStr = bareTempInstallDirectory; bool setDestDir = cmSystemTools::IsOn(this->GetOption("CPACK_SET_DESTDIR")) - | cmSystemTools::IsInternallyOn(this->GetOption("CPACK_SET_DESTDIR")); + | cmSystemTools::IsInternallyOn( + this->GetOption("CPACK_SET_DESTDIR")); if (!setDestDir) { tempInstallDirectoryStr += this->GetPackagingInstallPrefix(); @@ -694,9 +695,11 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( // CPACK_PACKAGING_INSTALL_PREFIX // I know this is tricky and awkward but it's the price for // CPACK_SET_DESTDIR backward compatibility. - if (cmSystemTools::IsInternallyOn(this->GetOption("CPACK_SET_DESTDIR"))) + if (cmSystemTools::IsInternallyOn( + this->GetOption("CPACK_SET_DESTDIR"))) { - this->SetOption("CPACK_INSTALL_PREFIX",this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX")); + this->SetOption("CPACK_INSTALL_PREFIX", + this->GetOption("CPACK_PACKAGING_INSTALL_PREFIX")); } std::string dir; if (this->GetOption("CPACK_INSTALL_PREFIX")) @@ -782,7 +785,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( if (absoluteDestFiles.length()>0) { absoluteDestFiles +=";"; } - absoluteDestFiles += mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES"); + absoluteDestFiles += + mf->GetDefinition("CPACK_ABSOLUTE_DESTINATION_FILES"); cmCPackLogger(cmCPackLog::LOG_DEBUG, "Got some ABSOLUTE DESTINATION FILES: " << absoluteDestFiles << std::endl); @@ -794,7 +798,8 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects( } } } - this->SetOption("CPACK_ABSOLUTE_DESTINATION_FILES",absoluteDestFiles.c_str()); + this->SetOption("CPACK_ABSOLUTE_DESTINATION_FILES", + absoluteDestFiles.c_str()); return 1; } @@ -921,8 +926,9 @@ int cmCPackGenerator::DoPackage() // beware we cannot just use tempDirectory as before // because some generator will "CPACK_INCLUDE_TOPLEVEL_DIRECTORY" // we really want "CPACK_TEMPORARY_DIRECTORY" - std::string fileN = cmSystemTools::RelativePath(this->GetOption("CPACK_TEMPORARY_DIRECTORY"), - it->c_str()); + std::string fileN = + cmSystemTools::RelativePath( + this->GetOption("CPACK_TEMPORARY_DIRECTORY"), it->c_str()); // Determine which component we are in. std::string componentName = fileN.substr(0, fileN.find('/')); @@ -932,7 +938,9 @@ int cmCPackGenerator::DoPackage() // Add this file to the list of files for the component. this->Components[componentName].Files.push_back(fileN); - cmCPackLogger(cmCPackLog::LOG_DEBUG, "Adding file <" < to component <"<"< to component <" + <"<c_str()); + std::string fileN = cmSystemTools::RelativePath(toplevel.c_str(), + sit->c_str()); if ( fileN.empty() ) { continue; diff --git a/Source/cmLocalVisualStudio6Generator.cxx b/Source/cmLocalVisualStudio6Generator.cxx index 01fcafdb0..eb4e4a4f2 100644 --- a/Source/cmLocalVisualStudio6Generator.cxx +++ b/Source/cmLocalVisualStudio6Generator.cxx @@ -1187,7 +1187,8 @@ void cmLocalVisualStudio6Generator extraLinkOptionsMinSizeRel += targetLinkFlags; } - if(const char* targetLinkFlags = target.GetProperty("LINK_FLAGS_RELWITHDEBINFO")) + if(const char* targetLinkFlags = + target.GetProperty("LINK_FLAGS_RELWITHDEBINFO")) { extraLinkOptionsRelWithDebInfo += " "; extraLinkOptionsRelWithDebInfo += targetLinkFlags; From 4a67481ed6045e8aebb2b5e169fcb55c953432be Mon Sep 17 00:00:00 2001 From: David Cole Date: Wed, 15 Sep 2010 18:17:29 -0400 Subject: [PATCH 117/152] Update release scripts. Remove scripts for machines that no longer build releases. Update comments in README. --- Utilities/Release/README | 31 ++++++++------------ Utilities/Release/create-cmake-release.cmake | 7 +---- Utilities/Release/dashsgi1_release.cmake | 11 ------- Utilities/Release/dashsgi1_release64.cmake | 15 ---------- Utilities/Release/destiny_release.cmake | 12 -------- Utilities/Release/muse_release.cmake | 10 ------- Utilities/Release/muse_release64.cmake | 14 --------- Utilities/Release/r15n65_aix_release.cmake | 22 -------------- Utilities/Release/r36n11_aix_release.cmake | 22 -------------- Utilities/Release/v20n17_aix_release.cmake | 22 -------------- Utilities/Release/v60n177_aix_release.cmake | 21 ------------- Utilities/Release/vogon_cygwin.cmake | 11 ------- Utilities/Release/vogon_release.cmake | 17 ----------- Utilities/Release/vogon_release_qt.cmake | 16 ---------- 14 files changed, 13 insertions(+), 218 deletions(-) delete mode 100644 Utilities/Release/dashsgi1_release.cmake delete mode 100644 Utilities/Release/dashsgi1_release64.cmake delete mode 100644 Utilities/Release/destiny_release.cmake delete mode 100644 Utilities/Release/muse_release.cmake delete mode 100644 Utilities/Release/muse_release64.cmake delete mode 100644 Utilities/Release/r15n65_aix_release.cmake delete mode 100644 Utilities/Release/r36n11_aix_release.cmake delete mode 100644 Utilities/Release/v20n17_aix_release.cmake delete mode 100644 Utilities/Release/v60n177_aix_release.cmake delete mode 100644 Utilities/Release/vogon_cygwin.cmake delete mode 100644 Utilities/Release/vogon_release.cmake delete mode 100644 Utilities/Release/vogon_release_qt.cmake diff --git a/Utilities/Release/README b/Utilities/Release/README index 75cdf4834..12eafe18f 100644 --- a/Utilities/Release/README +++ b/Utilities/Release/README @@ -1,28 +1,21 @@ -To create a cmake release, first test the branch: +To create a cmake release, make sure the "release" tag is pointing to the +expected git commit: -mkdir 2-4 -cd 2-4 -cmake -DCMAKE_CREATE_VERSION=CMake-2-4 -P ../create-cmake-release.cmake -./create-CMake-2-4.sh +http://cmake.org/gitweb?p=cmake.git;a=shortlog;h=refs/heads/release -If that works: -EDIT CMakeLists.txt and remove the RC setting! -commit that. +Then as kitware@hythloth, using an up-to-date CMake: -Then tag the minor release: -cvs tag 2-4-7 - -Then create a release from the tag: -mkdir 2-4-7 -cd 2-4-7 -cmake -DCMAKE_CREATE_VERSION=CMake-2-4-7 -P ../create-cmake-release.cmake -./create-CMake-2-4.sh + cd ~/CMakeReleases/cmake/Utilities/Release + mkdir 283rc1 + cd 283rc1 + ~/CMakeReleases/build/bin/cmake -DCMAKE_CREATE_VERSION=release -P ../create-cmake-release.cmake + ./create-release.sh -create-cmake-release.cmake: script to run to create release sh script -To add or remove machines this file should be edited. +create-cmake-release.cmake: script to run to create release sh scripts +Add or remove machines in create-cmake-release.cmake. Cygwin -> directory that contains cpack cygwin package files used in - CMakeCPack.cmake) + CMakeCPack.cmake machine_release.cmake : config files for each machine diff --git a/Utilities/Release/create-cmake-release.cmake b/Utilities/Release/create-cmake-release.cmake index 66753ce16..fd916659b 100644 --- a/Utilities/Release/create-cmake-release.cmake +++ b/Utilities/Release/create-cmake-release.cmake @@ -5,17 +5,14 @@ endif(NOT DEFINED CMAKE_CREATE_VERSION) set(RELEASE_SCRIPTS dashmacmini2_release.cmake # Mac Darwin universal dashsun1_release.cmake # SunOS - destiny_release.cmake # HPUX +# destiny_release.cmake # HPUX -- destiny is dead; long live destiny magrathea_release.cmake # Linux dash2win64_release.cmake # Windows # dash2win64_cygwin.cmake # Cygwin # blight_cygwin.cmake # Cygwin v20n250_aix_release.cmake # AIX 5.3 -# vogon_cygwin.cmake # Cygwin ferrari_sgi64_release.cmake # IRIX 64 ferrari_sgi_release.cmake # IRIX 64 -# r36n11_aix_release.cmake # AIX 5.3 -# r15n65_aix_release.cmake # AIX 5.2 ) file(WRITE create-${CMAKE_CREATE_VERSION}.sh "#!/bin/bash") @@ -29,5 +26,3 @@ ${CMAKE_COMMAND} -DCMAKE_CREATE_VERSION=${CMAKE_CREATE_VERSION} -P ${CMAKE_ROOT} endforeach(f) execute_process(COMMAND chmod a+x create-${CMAKE_CREATE_VERSION}.sh) message("Run ./create-${CMAKE_CREATE_VERSION}.sh") - - diff --git a/Utilities/Release/dashsgi1_release.cmake b/Utilities/Release/dashsgi1_release.cmake deleted file mode 100644 index 0af5ca7c8..000000000 --- a/Utilities/Release/dashsgi1_release.cmake +++ /dev/null @@ -1,11 +0,0 @@ -set(CMAKE_RELEASE_DIRECTORY "/usr/people/kitware/CMakeReleaseDirectory") -set(PROCESSORS 2) -set(HOST dashsgi1) -set(MAKE_PROGRAM "make") -set(MAKE "${MAKE_PROGRAM} -P") -set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release -CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE -CPACK_SYSTEM_NAME:STRING=IRIX64-n32 -") -get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) -include(${path}/release_cmake.cmake) diff --git a/Utilities/Release/dashsgi1_release64.cmake b/Utilities/Release/dashsgi1_release64.cmake deleted file mode 100644 index 133f4785a..000000000 --- a/Utilities/Release/dashsgi1_release64.cmake +++ /dev/null @@ -1,15 +0,0 @@ -set(CMAKE_RELEASE_DIRECTORY "/usr/people/kitware/CMakeReleaseDirectory64") -set(PROCESSORS 2) -set(CFLAGS "-64") -set(CXXFLAGS "-64") -set(LDFLAGS="-64") -set(HOST dashsgi1) -set(SCRIPT_NAME dashsgi164) -set(MAKE_PROGRAM "make") -set(MAKE "${MAKE_PROGRAM} -P") -set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release -CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE -CPACK_SYSTEM_NAME:STRING=IRIX64-64 -") -get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) -include(${path}/release_cmake.cmake) diff --git a/Utilities/Release/destiny_release.cmake b/Utilities/Release/destiny_release.cmake deleted file mode 100644 index 886909faa..000000000 --- a/Utilities/Release/destiny_release.cmake +++ /dev/null @@ -1,12 +0,0 @@ -set(PROCESSORS 1) -set(RUN_SHELL "/usr/local/bin/zsh -l -c /bin/sh") -set(CVS_COMMAND "/usr/local/bin/cvs") -set(HOST destiny) -set(MAKE_PROGRAM "/usr/local/bin/gmake") -set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release -CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE -CMAKE_EXE_LINKER_FLAGS:STRING=-Wl,-a,archive_shared -CMAKE_C_FLAGS:STRING=+DAportable -CMAKE_CXX_FLAGS:STRING=-Wl,+vnocompatwarnings +W740,749 +DAportable -D__HPACC_STRICTER_ANSI__") -get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) -include(${path}/release_cmake.cmake) diff --git a/Utilities/Release/muse_release.cmake b/Utilities/Release/muse_release.cmake deleted file mode 100644 index 9fd41c42a..000000000 --- a/Utilities/Release/muse_release.cmake +++ /dev/null @@ -1,10 +0,0 @@ -set(CMAKE_RELEASE_DIRECTORY "/home/collab/itk/CMakeReleaseDirectory" ) -set(PROCESSORS 20) -set(HOST muse) -set(MAKE_PROGRAM "gmake") -set(MAKE "${MAKE_PROGRAM} -j20") -set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release -CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE -") -get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) -include(${path}/release_cmake.cmake) diff --git a/Utilities/Release/muse_release64.cmake b/Utilities/Release/muse_release64.cmake deleted file mode 100644 index cd87f512a..000000000 --- a/Utilities/Release/muse_release64.cmake +++ /dev/null @@ -1,14 +0,0 @@ -set(CMAKE_RELEASE_DIRECTORY "/home/collab/itk/CMakeReleaseDirectory64" ) -set(PROCESSORS 20) -set(CFLAGS "-64") -set(CXXFLAGS "-64") -set(LDFLAGS="-64") -set(HOST muse) -set(SCRIPT_NAME muse64) -set(MAKE_PROGRAM "gmake") -set(MAKE "${MAKE_PROGRAM} -j20") -set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release -CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE -") -get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) -include(${path}/release_cmake.cmake) diff --git a/Utilities/Release/r15n65_aix_release.cmake b/Utilities/Release/r15n65_aix_release.cmake deleted file mode 100644 index 74d6d0b9d..000000000 --- a/Utilities/Release/r15n65_aix_release.cmake +++ /dev/null @@ -1,22 +0,0 @@ -set(CMAKE_RELEASE_DIRECTORY "/bench1/noibm34/CMakeReleaseDirectory" ) -set(FINAL_PATH /u/noibm34/cmake-release) -set(PROCESSORS 2) -set(CVS_COMMAND /vol/local/bin/cvs) -set(HOST "sshserv.centers.ihost.com" ) -set(EXTRA_HOP "rsh r15n65" ) -set(MAKE_PROGRAM "make") -set(CC "xlc") -set(CXX "xlC") -set(FC "xlf") -set(INITIAL_CACHE " -CMAKE_BUILD_TYPE:STRING=Release -CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE -") -set(EXTRA_COPY " -rm -rf ~/cmake-release -mkdir ~/cmake-release -mv *.sh ~/cmake-release -mv *.Z ~/cmake-release -mv *.gz ~/cmake-release") -get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) -include(${path}/release_cmake.cmake) diff --git a/Utilities/Release/r36n11_aix_release.cmake b/Utilities/Release/r36n11_aix_release.cmake deleted file mode 100644 index 60c845968..000000000 --- a/Utilities/Release/r36n11_aix_release.cmake +++ /dev/null @@ -1,22 +0,0 @@ -set(CMAKE_RELEASE_DIRECTORY "/bench1/noibm34/CMakeReleaseDirectory" ) -set(FINAL_PATH /u/noibm34/cmake-release) -set(PROCESSORS 2) -set(CVS_COMMAND /vol/local/bin/cvs) -set(HOST "sshserv.centers.ihost.com" ) -set(EXTRA_HOP "ssh r36n11" ) -set(MAKE_PROGRAM "make") -set(CC "xlc") -set(CXX "xlC") -set(FC "xlf") -set(INITIAL_CACHE " -CMAKE_BUILD_TYPE:STRING=Release -CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE -") -set(EXTRA_COPY " -rm -rf ~/cmake-release -mkdir ~/cmake-release -mv *.sh ~/cmake-release -mv *.Z ~/cmake-release -mv *.gz ~/cmake-release") -get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) -include(${path}/release_cmake.cmake) diff --git a/Utilities/Release/v20n17_aix_release.cmake b/Utilities/Release/v20n17_aix_release.cmake deleted file mode 100644 index b7494bb70..000000000 --- a/Utilities/Release/v20n17_aix_release.cmake +++ /dev/null @@ -1,22 +0,0 @@ -set(CMAKE_RELEASE_DIRECTORY "/bench1/noibm34/CMakeReleaseDirectory" ) -set(FINAL_PATH /u/noibm34/cmake-release) -set(PROCESSORS 2) -set(CVS_COMMAND /vol/local/bin/cvs) -set(HOST "sshserv.centers.ihost.com" ) -set(EXTRA_HOP "rsh v20n17" ) -set(MAKE_PROGRAM "make") -set(CC "xlc") -set(CXX "xlC") -set(FC "xlf") -set(INITIAL_CACHE " -CMAKE_BUILD_TYPE:STRING=Release -CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE -") -set(EXTRA_COPY " -rm -rf ~/cmake-release -mkdir ~/cmake-release -mv *.sh ~/cmake-release -mv *.Z ~/cmake-release -mv *.gz ~/cmake-release") -get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) -include(${path}/release_cmake.cmake) diff --git a/Utilities/Release/v60n177_aix_release.cmake b/Utilities/Release/v60n177_aix_release.cmake deleted file mode 100644 index 9ed42ad9a..000000000 --- a/Utilities/Release/v60n177_aix_release.cmake +++ /dev/null @@ -1,21 +0,0 @@ -set(CMAKE_RELEASE_DIRECTORY "/bench1/noibm34/CMakeReleaseDirectory" ) -set(FINAL_PATH /u/noibm34/cmake-release) -set(PROCESSORS 2) -set(CVS_COMMAND /vol/local/bin/cvs) -set(HOST "sshserv.centers.ihost.com" ) -set(EXTRA_HOP "rsh v60n177" ) -set(MAKE_PROGRAM "make") -set(CC "xlc") -set(CXX "xlC") -set(INITIAL_CACHE " -CMAKE_BUILD_TYPE:STRING=Release -CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE -") -set(EXTRA_COPY " -rm -rf ~/cmake-release -mkdir ~/cmake-release -mv *.sh ~/cmake-release -mv *.Z ~/cmake-release -mv *.gz ~/cmake-release") -get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) -include(${path}/release_cmake.cmake) diff --git a/Utilities/Release/vogon_cygwin.cmake b/Utilities/Release/vogon_cygwin.cmake deleted file mode 100644 index 0506f2a6d..000000000 --- a/Utilities/Release/vogon_cygwin.cmake +++ /dev/null @@ -1,11 +0,0 @@ -set(CMAKE_RELEASE_DIRECTORY "c:/hoffman/CMakeReleaseCygwin") -set(PROCESSORS 2) -set(HOST vogon) -set(CPACK_BINARY_GENERATORS "CygwinBinary") -set(CPACK_SOURCE_GENERATORS "CygwinSource") -set(MAKE_PROGRAM "make") -set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release -Subversion_SVNADMIN_EXECUTABLE:STRING=FALSE -") -get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) -include(${path}/release_cmake.cmake) diff --git a/Utilities/Release/vogon_release.cmake b/Utilities/Release/vogon_release.cmake deleted file mode 100644 index 41245a58d..000000000 --- a/Utilities/Release/vogon_release.cmake +++ /dev/null @@ -1,17 +0,0 @@ -set(CMAKE_RELEASE_DIRECTORY "c:/hoffman/CMakeReleaseDirectory") -set(CONFIGURE_WITH_CMAKE TRUE) -set(CMAKE_CONFIGURE_PATH "c:/Program\\ Files/CMake\\ 2.7/bin/cmake.exe") -set(PROCESSORS 1) -set(HOST vogon) -set(CPACK_BINARY_GENERATORS "NSIS ZIP") -set(CPACK_SOURCE_GENERATORS "ZIP") -set(MAKE_PROGRAM "nmake") -set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release -CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE -CMAKE_GENERATOR:INTERNAL=NMake Makefiles -CMAKE_MT_EXECUTABLE:STRING=mt -BUILD_QtDialog:BOOL:=TRUE -QT_QMAKE_EXECUTABLE:FILEPATH=C:/QT/qt-win-opensource-src-4.5.0/bin/qmake.exe -") -get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) -include(${path}/release_cmake.cmake) diff --git a/Utilities/Release/vogon_release_qt.cmake b/Utilities/Release/vogon_release_qt.cmake deleted file mode 100644 index 17720064d..000000000 --- a/Utilities/Release/vogon_release_qt.cmake +++ /dev/null @@ -1,16 +0,0 @@ -set(CMAKE_RELEASE_DIRECTORY "c:/hoffman/CMakeReleaseDirectory") -set(CONFIGURE_WITH_CMAKE TRUE) -set(CMAKE_CONFIGURE_PATH "c:/Program\\ Files/CMake\\ 2.6/bin/cmake.exe") -set(PROCESSORS 1) -set(HOST vogon) -set(CPACK_BINARY_GENERATORS "NSIS ZIP") -set(CPACK_SOURCE_GENERATORS "ZIP") -set(MAKE_PROGRAM "nmake") -set(INITIAL_CACHE "CMAKE_BUILD_TYPE:STRING=Release -CMAKE_SKIP_BOOTSTRAP_TEST:STRING=TRUE -CMAKE_GENERATOR:INTERNAL=NMake Makefiles -CMAKE_MT_EXECUTABLE:STRING=mt -QT_QMAKE_EXECUTABLE:FILEPATH=C:/QT/qt-win-opensource-src-4.5.0/bin/qmake.exe -") -get_filename_component(path "${CMAKE_CURRENT_LIST_FILE}" PATH) -include(${path}/release_cmake.cmake) From 48a126717c2747e778f724fd536504e12e015b0c Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 16 Sep 2010 00:01:06 -0400 Subject: [PATCH 118/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 7fc2bbd7e..9f59295a6 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 15) +SET(KWSYS_DATE_STAMP_DAY 16) From 2d9bb3325f6b1155bc7848f1f666e79c37bfa253 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 16 Sep 2010 15:07:41 -0400 Subject: [PATCH 119/152] Evaluate rule variable for executables Previously this placeholder was evaluated only for libraries. Make it work for executables too. --- Source/cmMakefileExecutableTargetGenerator.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/cmMakefileExecutableTargetGenerator.cxx b/Source/cmMakefileExecutableTargetGenerator.cxx index 93c981aa0..a5e319dd0 100644 --- a/Source/cmMakefileExecutableTargetGenerator.cxx +++ b/Source/cmMakefileExecutableTargetGenerator.cxx @@ -345,6 +345,13 @@ void cmMakefileExecutableTargetGenerator::WriteExecutableRule(bool relink) vars.CMTarget = this->Target; vars.Language = linkLanguage; vars.Objects = buildObjs.c_str(); + std::string objdir = cmake::GetCMakeFilesDirectoryPostSlash(); + objdir += this->Target->GetName(); + objdir += ".dir"; + objdir = this->Convert(objdir.c_str(), + cmLocalGenerator::START_OUTPUT, + cmLocalGenerator::SHELL); + vars.ObjectDir = objdir.c_str(); vars.Target = targetOutPathReal.c_str(); vars.TargetPDB = targetOutPathPDB.c_str(); From 5d7c3c0a594a57705f42ad6e1fa454234bfe7b56 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 16 Sep 2010 17:45:27 -0400 Subject: [PATCH 120/152] ccmake: Fix search with '/' Commit 7a18dd8e (Add searching of variables, 2003-03-07) added method cmCursesMainForm::JumpToCacheEntry to search for cache entries whose names match a given search string. The method also had a useless argument "int idx" probably left from earlier development iterations and hard-coded in all calls to the value '-1'. The method compared this argument to the "NumberOfVisibleEntries" member which at the time was of type "int" also. Commit ff1f8d0b (Fix or cast more integer conversions in cmake, 2010-06-29) changed the type of "NumberOfVisibleEntries" to size_t to fix other integer conversion warnings. An unsigned type makes sense given the purpose of the member. However, this caused the '-1' signed value to be converted to a large unsigned value in the above-mentioned comparison, leading to incorrect behavior. Fix the problem by removing the useless argument and the comparison. --- Source/CursesDialog/cmCursesMainForm.cxx | 14 +++++--------- Source/CursesDialog/cmCursesMainForm.h | 5 ++--- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Source/CursesDialog/cmCursesMainForm.cxx b/Source/CursesDialog/cmCursesMainForm.cxx index 389ec7f53..7f3e36010 100644 --- a/Source/CursesDialog/cmCursesMainForm.cxx +++ b/Source/CursesDialog/cmCursesMainForm.cxx @@ -902,7 +902,7 @@ void cmCursesMainForm::HandleInput() this->SearchMode = false; if ( this->SearchString.size() > 0 ) { - this->JumpToCacheEntry(-1, this->SearchString.c_str()); + this->JumpToCacheEntry(this->SearchString.c_str()); this->OldSearchString = this->SearchString; } this->SearchString = ""; @@ -1076,7 +1076,7 @@ void cmCursesMainForm::HandleInput() { if ( this->OldSearchString.size() > 0 ) { - this->JumpToCacheEntry(-1, this->OldSearchString.c_str()); + this->JumpToCacheEntry(this->OldSearchString.c_str()); } } // switch advanced on/off @@ -1191,7 +1191,7 @@ int cmCursesMainForm::LoadCache(const char *) return r; } -void cmCursesMainForm::JumpToCacheEntry(int idx, const char* astr) +void cmCursesMainForm::JumpToCacheEntry(const char* astr) { std::string str; if ( astr ) @@ -1199,18 +1199,14 @@ void cmCursesMainForm::JumpToCacheEntry(int idx, const char* astr) str = cmSystemTools::LowerCase(astr); } - if ( size_t(idx) > this->NumberOfVisibleEntries ) - { - return; - } - if ( idx < 0 && str.size() == 0) + if(str.empty()) { return; } FIELD* cur = current_field(this->Form); int start_index = field_index(cur); int findex = start_index; - while ( (findex / 3) != idx ) + for(;;) { if ( str.size() > 0 ) { diff --git a/Source/CursesDialog/cmCursesMainForm.h b/Source/CursesDialog/cmCursesMainForm.h index 4084415bd..3e191b497 100644 --- a/Source/CursesDialog/cmCursesMainForm.h +++ b/Source/CursesDialog/cmCursesMainForm.h @@ -122,9 +122,8 @@ protected: // Remove an entry from the interface and the cache. void RemoveEntry(const char* value); - // Jump to the cache value with index idx. If string str is - // specified, it will stop on widget that contain that string. - void JumpToCacheEntry(int idx, const char* str); + // Jump to the cache entry whose name matches the string. + void JumpToCacheEntry(const char* str); // Copies of cache entries stored in the user interface std::vector* Entries; From 4b682e13fb0e4810d6cb8b76602c715a6fd74247 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Fri, 17 Sep 2010 00:01:06 -0400 Subject: [PATCH 121/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 9f59295a6..529874f45 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 16) +SET(KWSYS_DATE_STAMP_DAY 17) From 5f05a3c25e1480648f46c9ccbf775225f9e8e32d Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 17 Sep 2010 09:25:36 -0400 Subject: [PATCH 122/152] MinGW: Support long object file lists Use a combination of response files and the archiver to support long object file lists that do not fit in the Windows command-line length limit. This can work only with GCC >= 4 because the MinGW GCC 3.x front-ends do not support response-file syntax. --- Modules/Platform/Windows-GNU-Fortran.cmake | 1 - Modules/Platform/Windows-GNU.cmake | 35 +++++++++++++++++++++- 2 files changed, 34 insertions(+), 2 deletions(-) diff --git a/Modules/Platform/Windows-GNU-Fortran.cmake b/Modules/Platform/Windows-GNU-Fortran.cmake index 8273a199f..c66feedbb 100644 --- a/Modules/Platform/Windows-GNU-Fortran.cmake +++ b/Modules/Platform/Windows-GNU-Fortran.cmake @@ -1,3 +1,2 @@ include(Platform/Windows-GNU) __windows_compiler_gnu(Fortran) -set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 0) diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index 79b2f806d..ac635a50e 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -76,7 +76,23 @@ macro(__windows_compiler_gnu lang) set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on Windows set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS ${__WINDOWS_GNU_LD_RESPONSE}) - set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Wl,@") + + # We prefer "@" for response files but it is not supported by gcc 3. + execute_process(COMMAND ${CMAKE_${lang}_COMPILER} --version OUTPUT_VARIABLE _ver ERROR_VARIABLE _ver) + if("${_ver}" MATCHES "\\(GCC\\) 3\\.") + if("${lang}" STREQUAL "Fortran") + # The GNU Fortran compiler reports an error: + # no input files; unwilling to write output files + # when the response file is passed with "-Wl,@". + set(CMAKE_Fortran_USE_RESPONSE_FILE_FOR_OBJECTS 0) + else() + # Use "-Wl,@" to pass the response file to the linker. + set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Wl,@") + endif() + elseif(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS) + # Use "@" to pass the response file to the front-end. + set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "@") + endif() # Binary link rules. set(CMAKE_${lang}_CREATE_SHARED_MODULE @@ -85,4 +101,21 @@ macro(__windows_compiler_gnu lang) " -o -Wl,--out-implib, ${CMAKE_GNULD_IMAGE_VERSION} ") set(CMAKE_${lang}_LINK_EXECUTABLE " -o -Wl,--out-implib, ${CMAKE_GNULD_IMAGE_VERSION} ") + + # Support very long lists of object files. + if("${CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG}" STREQUAL "@") + foreach(rule CREATE_SHARED_MODULE CREATE_SHARED_LIBRARY LINK_EXECUTABLE) + # The gcc/collect2/ld toolchain does not use response files + # internally so we cannot pass long object lists. Instead pass + # the object file list in a response file to the archiver to put + # them in a temporary archive. Hand the archive to the linker. + string(REPLACE "" "-Wl,--whole-archive /objects.a -Wl,--no-whole-archive" + CMAKE_${lang}_${rule} "${CMAKE_${lang}_${rule}}") + set(CMAKE_${lang}_${rule} + " -E remove -f /objects.a" + " cr /objects.a " + "${CMAKE_${lang}_${rule}}" + ) + endforeach() + endif() endmacro() From 8f96818a5c111fcf819bbb6e83f4281838dcc0ad Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 17 Sep 2010 13:28:29 -0400 Subject: [PATCH 123/152] Document IMPORTED_NO_SONAME target property Commit fd37a6ec (Better linker search path computation, 2008-02-21) added this property but did not document it. Add the documentation. --- Source/cmTarget.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 3da46272d..c13ff9491 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -277,6 +277,24 @@ void cmTarget::DefineProperties(cmake *cm) "Configuration names correspond to those provided by the project " "from which the target is imported."); + cm->DefineProperty + ("IMPORTED_NO_SONAME", cmProperty::TARGET, + "Specifies that an IMPORTED shared library target has no \"soname\". ", + "Set this property to true for an imported shared library file that " + "has no \"soname\" field. " + "CMake may adjust generated link commands for some platforms to prevent " + "the linker from using the path to the library in place of its missing " + "soname. " + "Ignored for non-imported targets."); + + cm->DefineProperty + ("IMPORTED_NO_SONAME_", cmProperty::TARGET, + "Per-configuration version of IMPORTED_NO_SONAME property.", + "This property is used when loading settings for the " + "configuration of an imported target. " + "Configuration names correspond to those provided by the project " + "from which the target is imported."); + cm->DefineProperty ("EXCLUDE_FROM_ALL", cmProperty::TARGET, "Exclude the target from the all target.", From c30c3ade9bfd865bea8e58d38e4044e4b00334a0 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sat, 18 Sep 2010 00:01:04 -0400 Subject: [PATCH 124/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 529874f45..0bcde24ee 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 17) +SET(KWSYS_DATE_STAMP_DAY 18) From 5e6f0f0d73ca44938bec36db81fd815cb70737a0 Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Sat, 18 Sep 2010 10:24:30 -0400 Subject: [PATCH 125/152] FindBoost.cmake fixes for issues 11204 & 8529 * Fixed issue 11204: FindBoost.cmake had trouble discovering libraries when both -sgd and -gd libraries were available by adding a new option Boost_USE_STATIC_RUNTIME. Backwards compatibility of searching for first -gd and then -sgd on WIN32 is maintained unless the user sets Boost_COMPAT_STATIC_RUNTIME to false (or they have set Boost_USE_STATIC_RUNTIME). * Fixed issue 8529: FindBoost was unable to detect boost libraries compiled against STLport, by reworking the way the Boost ABI tag is calculated. There are additional ABI tag options available now as well. * Boost_DEBUG now reports the full list of filenames being searched for when find_library is called. --- Modules/FindBoost.cmake | 198 ++++++++++++++++++++++++++++++++-------- 1 file changed, 159 insertions(+), 39 deletions(-) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 1a1b16834..6ed669e64 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -17,8 +17,10 @@ # # == Using actual libraries from within Boost: == # -# set(Boost_USE_STATIC_LIBS ON) -# set(Boost_USE_MULTITHREADED ON) +# set(Boost_USE_STATIC_LIBS ON) +# set(Boost_USE_MULTITHREADED ON) +# set(Boost_USE_STATIC_RUNTIME OFF) +# set(Boost_COMPAT_STATIC_RUNTIME OFF) # find_package( Boost 1.36.0 COMPONENTS date_time filesystem system ... ) # # if(Boost_FOUND) @@ -84,6 +86,37 @@ # Boost_USE_STATIC_LIBS Can be set to ON to force the use of the static # boost libraries. Defaults to OFF. # +# +# Boost_USE_STATIC_RUNTIME If enabled, searches for boost libraries +# linked against a static C++ standard library +# ('s' ABI tag). Defaults to OFF. +# [Since CMake 2.8.3] +# +# Boost_USE_DEBUG_PYTHON If enabled, searches for boost libraries +# compiled against a special debug build of +# Python ('y' ABI tag). Defaults to OFF. +# [Since CMake 2.8.3] +# +# Boost_USE_STLPORT If enabled, searches for boost libraries +# compiled against the STLPort standard +# library ('p' ABI tag). Defaults to OFF. +# [Since CMake 2.8.3] +# +# Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS +# If enabled, searches for boost libraries +# compiled against the deprecated STLPort +# "native iostreams" feature ('n' ABI tag). +# Defaults to OFF. +# [Since CMake 2.8.3] +# +# Boost_COMPAT_STATIC_RUNTIME Set to OFF to disable backwards compatible +# searching for libraries with the 's' ABI +# tag on WIN32 after normal searches. You +# should set this to OFF and also set +# Boost_USE_STATIC_RUNTIME appropriately. +# If not specified, defaults to ON. +# [Since CMake 2.8.3] +# # Other Variables used by this module which you may want to set. # # Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching @@ -165,7 +198,7 @@ # Copyright 2007 Wengo # Copyright 2007 Mike Jackson # Copyright 2008 Andreas Pakulat -# Copyright 2008-2009 Philip Lowman +# Copyright 2008-2010 Philip Lowman # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -286,6 +319,9 @@ endfunction() IF(NOT DEFINED Boost_USE_MULTITHREADED) SET(Boost_USE_MULTITHREADED TRUE) ENDIF() +if(NOT DEFINED Boost_COMPAT_STATIC_RUNTIME) + set(Boost_COMPAT_STATIC_RUNTIME TRUE) +endif() if(Boost_FIND_VERSION_EXACT) # The version may appear in a directory with or without the patch @@ -380,6 +416,10 @@ ELSE (_boost_IN_CACHE) "Boost_USE_MULTITHREADED = ${Boost_USE_MULTITHREADED}") message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "Boost_USE_STATIC_LIBS = ${Boost_USE_STATIC_LIBS}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Boost_USE_STATIC_RUNTIME = ${Boost_USE_STATIC_RUNTIME}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Boost_ADDITIONAL_VERSIONS = ${Boost_ADDITIONAL_VERSIONS}") endif() IF(WIN32) @@ -646,23 +686,49 @@ ELSE (_boost_IN_CACHE) "_boost_MULTITHREADED = ${_boost_MULTITHREADED}") endif() - SET( _boost_STATIC_TAG "") - set( _boost_ABI_TAG "") - IF (WIN32) - IF(MSVC OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" + #====================== + # Systematically build up the Boost ABI tag + # http://boost.org/doc/libs/1_41_0/more/getting_started/windows.html#library-naming + set( _boost_RELEASE_ABI_TAG "-") + set( _boost_DEBUG_ABI_TAG "-") + # Key Use this library when: + # s linking statically to the C++ standard library and + # compiler runtime support libraries. + if(Boost_USE_STATIC_RUNTIME) + set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}s") + set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}s") + endif() + # g using debug versions of the standard and runtime + # support libraries + if(WIN32) + if(MSVC OR "${CMAKE_CXX_COMPILER}" MATCHES "icl" OR "${CMAKE_CXX_COMPILER}" MATCHES "icpc") - SET (_boost_ABI_TAG "g") - ENDIF() - IF( Boost_USE_STATIC_LIBS ) - SET( _boost_STATIC_TAG "-s") - ENDIF( Boost_USE_STATIC_LIBS ) - ENDIF(WIN32) - SET (_boost_ABI_TAG "${_boost_ABI_TAG}d") + set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}g") + endif() + endif() + # y using special debug build of python + if(Boost_USE_DEBUG_PYTHON) + set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}y") + endif() + # d using a debug version of your code + set(_boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}d") + # p using the STLport standard library rather than the + # default one supplied with your compiler + if(Boost_USE_STLPORT) + set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}p") + set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}p") + endif() + # n using the STLport deprecated "native iostreams" feature + if(Boost_USE_STLPORT_DEPRECATED_NATIVE_IOSTREAMS) + set( _boost_RELEASE_ABI_TAG "${_boost_RELEASE_ABI_TAG}n") + set( _boost_DEBUG_ABI_TAG "${_boost_DEBUG_ABI_TAG}n") + endif() + if(Boost_DEBUG) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_STATIC_TAG = ${_boost_STATIC_TAG}") + "_boost_RELEASE_ABI_TAG = ${_boost_RELEASE_ABI_TAG}") message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_ABI_TAG = ${_boost_ABI_TAG}") + "_boost_DEBUG_ABI_TAG = ${_boost_DEBUG_ABI_TAG}") endif() # ------------------------------------------------------------------------ @@ -698,12 +764,38 @@ ELSE (_boost_IN_CACHE) "_boost_LIBRARIES_SEARCH_DIRS = ${_boost_LIBRARIES_SEARCH_DIRS}") endif() - FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) - STRING(TOUPPER ${COMPONENT} UPPERCOMPONENT) - SET( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" ) - SET( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" ) - SET( Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND") + # We want to use the tag inline below without risking double dashes + if(_boost_RELEASE_ABI_TAG) + if(${_boost_RELEASE_ABI_TAG} STREQUAL "-") + set(_boost_RELEASE_ABI_TAG "") + endif() + endif() + if(_boost_DEBUG_ABI_TAG) + if(${_boost_DEBUG_ABI_TAG} STREQUAL "-") + set(_boost_DEBUG_ABI_TAG "") + endif() + endif() + # The previous behavior of FindBoost when Boost_USE_STATIC_LIBS was enabled + # on WIN32 was to: + # 1. Search for static libs compiled against a SHARED C++ standard runtime library (use if found) + # 2. Search for static libs compiled against a STATIC C++ standard runtime library (use if found) + # We maintain this behavior since changing it could break people's builds. + # To disable the ambiguous behavior, the user can + # set Boost_COMPAT_STATIC_RUNTIME to FALSE + set(_boost_STATIC_RUNTIME_WORKAROUND false) + if(Boost_COMPAT_STATIC_RUNTIME AND WIN32 AND Boost_USE_STATIC_LIBS) + if(NOT Boost_USE_STATIC_RUNTIME) + set(_boost_STATIC_RUNTIME_WORKAROUND true) + endif() + endif() + + + foreach(COMPONENT ${Boost_FIND_COMPONENTS}) + string(TOUPPER ${COMPONENT} UPPERCOMPONENT) + set( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" ) + set( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" ) + set( Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND") # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES IF( Boost_USE_STATIC_LIBS ) SET( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) @@ -714,26 +806,54 @@ ELSE (_boost_IN_CACHE) ENDIF(WIN32) ENDIF( Boost_USE_STATIC_LIBS ) - FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE - NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG} - ${Boost_LIB_PREFIX}boost_${COMPONENT} - HINTS ${_boost_LIBRARIES_SEARCH_DIRS} + # + # Find RELEASE libraries + # + set(_boost_RELEASE_NAMES + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} + ${Boost_LIB_PREFIX}boost_${COMPONENT} ) + if(_boost_STATIC_RUNTIME_WORKAROUND) + set(_boost_RELEASE_STATIC_ABI_TAG "-s${_boost_RELEASE_ABI_TAG}") + list(APPEND _boost_RELEASE_NAMES + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} ) + endif() + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Searching for ${UPPERCOMPONENT}_LIBRARY_RELEASE: ${_boost_RELEASE_NAMES}") + endif() + find_library(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE + NAMES ${_boost_RELEASE_NAMES} + HINTS ${_boost_LIBRARIES_SEARCH_DIRS} ) - FIND_LIBRARY(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG - NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG}-${Boost_LIB_VERSION} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}-${_boost_ABI_TAG} - ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_STATIC_TAG}${_boost_ABI_TAG} - ${Boost_LIB_PREFIX}boost_${COMPONENT}-${_boost_ABI_TAG} - HINTS ${_boost_LIBRARIES_SEARCH_DIRS} + # + # Find DEBUG libraries + # + set(_boost_DEBUG_NAMES + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED} + ${Boost_LIB_PREFIX}boost_${COMPONENT} ) + if(_boost_STATIC_RUNTIME_WORKAROUND) + set(_boost_DEBUG_STATIC_ABI_TAG "-s${_boost_DEBUG_ABI_TAG}") + list(APPEND _boost_DEBUG_NAMES + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} ) + endif() + if(Boost_DEBUG) + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Searching for ${UPPERCOMPONENT}_LIBRARY_DEBUG: ${_boost_DEBUG_NAMES}") + endif() + find_library(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG + NAMES ${_boost_DEBUG_NAMES} + HINTS ${_boost_LIBRARIES_SEARCH_DIRS} ) _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT}) From 16b0eb5ac52c51485161429c2c4f9c7d627ce98a Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Sat, 18 Sep 2010 10:41:53 -0400 Subject: [PATCH 126/152] FindBoost.cmake: Miscellaneous changes and refactoring * Add a warning if the user sets Boost_ROOT which is not correct * Clarify directions to the user for viewing debugging messages * Move the CMAKE_FIND_LIBRARY_SUFFIXES tweak outside of a for loop --- Modules/FindBoost.cmake | 39 ++++++++++++++++++++++++--------------- 1 file changed, 24 insertions(+), 15 deletions(-) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 6ed669e64..1dbeaf5a3 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -402,7 +402,7 @@ IF (_boost_IN_CACHE) if(Boost_DEBUG) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "boost ${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION} " - "is already in the cache. For debugging messages, please clear the cache.") + "is already in the cache. To view debugging messages, please clear the cache.") endif() ELSE (_boost_IN_CACHE) # Need to search for boost @@ -452,6 +452,12 @@ ELSE (_boost_IN_CACHE) /sw/local/include ) + # If Boost_ROOT was defined, gently correct the user + if(Boost_ROOT) + message("WARNING: Boost_ROOT was set which is incorrect and is being ignored. " + "You need to use BOOST_ROOT instead. ") + endif() + # If BOOST_ROOT was defined in the environment, use it. if (NOT BOOST_ROOT AND NOT $ENV{BOOST_ROOT} STREQUAL "") set(BOOST_ROOT $ENV{BOOST_ROOT}) @@ -677,7 +683,7 @@ ELSE (_boost_IN_CACHE) endif() endif(Boost_COMPILER) - SET (_boost_MULTITHREADED "-mt") + set (_boost_MULTITHREADED "-mt") if( NOT Boost_USE_MULTITHREADED ) set (_boost_MULTITHREADED "") endif() @@ -764,6 +770,16 @@ ELSE (_boost_IN_CACHE) "_boost_LIBRARIES_SEARCH_DIRS = ${_boost_LIBRARIES_SEARCH_DIRS}") endif() + # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES + if( Boost_USE_STATIC_LIBS ) + set( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) + if(WIN32) + set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) + else() + set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES} ) + endif() + endif() + # We want to use the tag inline below without risking double dashes if(_boost_RELEASE_ABI_TAG) if(${_boost_RELEASE_ABI_TAG} STREQUAL "-") @@ -796,15 +812,6 @@ ELSE (_boost_IN_CACHE) set( Boost_${UPPERCOMPONENT}_LIBRARY "Boost_${UPPERCOMPONENT}_LIBRARY-NOTFOUND" ) set( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" ) set( Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND") - # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES - IF( Boost_USE_STATIC_LIBS ) - SET( _boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES}) - IF(WIN32) - SET(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - ELSE(WIN32) - SET(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) - ENDIF(WIN32) - ENDIF( Boost_USE_STATIC_LIBS ) # # Find RELEASE libraries @@ -857,10 +864,12 @@ ELSE (_boost_IN_CACHE) ) _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT}) - IF( Boost_USE_STATIC_LIBS ) - SET(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) - ENDIF( Boost_USE_STATIC_LIBS ) - ENDFOREACH(COMPONENT) + endforeach(COMPONENT) + + # Restore the original find library ordering + if( Boost_USE_STATIC_LIBS ) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${_boost_ORIG_CMAKE_FIND_LIBRARY_SUFFIXES}) + endif() # ------------------------------------------------------------------------ # End finding boost libraries # ------------------------------------------------------------------------ From 6ed7d9937aa8242e14a08c2da33df4d3d9b7f864 Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Sat, 18 Sep 2010 10:56:15 -0400 Subject: [PATCH 127/152] FindBoost.cmake: Add Boost_NO_SYSTEM_PATHS option This fixes several duplicate issues in the tracker (7725, 11019, 8412) --- Modules/FindBoost.cmake | 79 ++++++++++++++++++++++++++++------------- 1 file changed, 54 insertions(+), 25 deletions(-) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 1dbeaf5a3..8fc2dd13b 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -86,6 +86,11 @@ # Boost_USE_STATIC_LIBS Can be set to ON to force the use of the static # boost libraries. Defaults to OFF. # +# Boost_NO_SYSTEM_PATHS Set to TRUE to suppress searching in system +# paths (or other locations outside of BOOST_ROOT +# or BOOST_INCLUDEDIR). Useful when specifying +# BOOST_ROOT. Defaults to OFF. +# [Since CMake 2.8.3] # # Boost_USE_STATIC_RUNTIME If enabled, searches for boost libraries # linked against a static C++ standard library @@ -143,7 +148,9 @@ # # BOOST_ROOT or BOOSTROOT The preferred installation prefix for searching for # Boost. Set this if the module has problems finding -# the proper Boost installation. +# the proper Boost installation. To prevent falling +# back on the system paths, set Boost_NO_SYSTEM_PATHS +# to true. # # BOOST_INCLUDEDIR Set this to the include directory of Boost, if the # module has problems finding the proper Boost installation @@ -420,6 +427,8 @@ ELSE (_boost_IN_CACHE) "Boost_USE_STATIC_RUNTIME = ${Boost_USE_STATIC_RUNTIME}") message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "Boost_ADDITIONAL_VERSIONS = ${Boost_ADDITIONAL_VERSIONS}") + message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " + "Boost_NO_SYSTEM_PATHS = ${Boost_NO_SYSTEM_PATHS}") endif() IF(WIN32) @@ -455,7 +464,8 @@ ELSE (_boost_IN_CACHE) # If Boost_ROOT was defined, gently correct the user if(Boost_ROOT) message("WARNING: Boost_ROOT was set which is incorrect and is being ignored. " - "You need to use BOOST_ROOT instead. ") + "You need to use BOOST_ROOT instead. " + "Also, we suggest setting Boost_NO_SYSTEM_PATHS.") endif() # If BOOST_ROOT was defined in the environment, use it. @@ -495,18 +505,26 @@ ELSE (_boost_IN_CACHE) "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") endif() - IF( BOOST_ROOT ) - SET(_boost_INCLUDE_SEARCH_DIRS - ${BOOST_ROOT}/include - ${BOOST_ROOT} - ${_boost_INCLUDE_SEARCH_DIRS}) - ENDIF( BOOST_ROOT ) + if( BOOST_ROOT ) + if( Boost_NO_SYSTEM_PATHS ) + set(_boost_INCLUDE_SEARCH_DIRS + ${BOOST_ROOT}/include + ${BOOST_ROOT}) + set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH) + else() + set(_boost_INCLUDE_SEARCH_DIRS + ${BOOST_ROOT}/include + ${BOOST_ROOT} + ${_boost_INCLUDE_SEARCH_DIRS}) + endif() + endif( BOOST_ROOT ) - IF( BOOST_INCLUDEDIR ) + # prepend BOOST_INCLUDEDIR to search path if specified + if( BOOST_INCLUDEDIR ) file(TO_CMAKE_PATH ${BOOST_INCLUDEDIR} BOOST_INCLUDEDIR) - SET(_boost_INCLUDE_SEARCH_DIRS + set(_boost_INCLUDE_SEARCH_DIRS ${BOOST_INCLUDEDIR} ${_boost_INCLUDE_SEARCH_DIRS}) - ENDIF( BOOST_INCLUDEDIR ) + endif( BOOST_INCLUDEDIR ) # ------------------------------------------------------------------------ # Search for Boost include DIR @@ -553,6 +571,7 @@ ELSE (_boost_IN_CACHE) NAMES boost/config.hpp HINTS ${_boost_INCLUDE_SEARCH_DIRS} PATH_SUFFIXES ${_boost_PATH_SUFFIXES} + ${_boost_FIND_OPTIONS} ) ENDIF( NOT Boost_INCLUDE_DIR ) @@ -741,9 +760,14 @@ ELSE (_boost_IN_CACHE) # Begin finding boost libraries # ------------------------------------------------------------------------ - SET(_boost_LIBRARIES_SEARCH_DIRS + set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS + ${BOOST_ROOT}/lib + ${BOOST_ROOT}/stage/lib ${Boost_INCLUDE_DIR}/lib ${Boost_INCLUDE_DIR}/../lib + ${Boost_INCLUDE_DIR}/stage/lib + ) + set(_boost_LIBRARY_SEARCH_DIRS_SYSTEM C:/boost/lib C:/boost "$ENV{ProgramFiles}/boost/boost_${Boost_MAJOR_VERSION}_${Boost_MINOR_VERSION}_${Boost_SUBMINOR_VERSION}/lib" @@ -752,22 +776,25 @@ ELSE (_boost_IN_CACHE) "$ENV{ProgramFiles}/boost" /sw/local/lib ) - IF( BOOST_ROOT ) - SET(_boost_LIBRARIES_SEARCH_DIRS - ${BOOST_ROOT}/lib - ${BOOST_ROOT}/stage/lib - ${_boost_LIBRARIES_SEARCH_DIRS}) - ENDIF( BOOST_ROOT ) + if( BOOST_ROOT ) + set(_boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_ALWAYS}) + if( Boost_NO_SYSTEM_PATHS ) + set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH) + else() + list(APPEND _boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_SYSTEM}) + endif() + endif( BOOST_ROOT ) - IF( BOOST_LIBRARYDIR ) + # prepend BOOST_LIBRARYDIR to search path if specified + if( BOOST_LIBRARYDIR ) file(TO_CMAKE_PATH ${BOOST_LIBRARYDIR} BOOST_LIBRARYDIR) - SET(_boost_LIBRARIES_SEARCH_DIRS - ${BOOST_LIBRARYDIR} ${_boost_LIBRARIES_SEARCH_DIRS}) - ENDIF( BOOST_LIBRARYDIR ) + set(_boost_LIBRARY_SEARCH_DIRS + ${BOOST_LIBRARYDIR} ${_boost_LIBRARY_SEARCH_DIRS}) + endif() if(Boost_DEBUG) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " - "_boost_LIBRARIES_SEARCH_DIRS = ${_boost_LIBRARIES_SEARCH_DIRS}") + "_boost_LIBRARY_SEARCH_DIRS = ${_boost_LIBRARY_SEARCH_DIRS}") endif() # Support preference of static libs by adjusting CMAKE_FIND_LIBRARY_SUFFIXES @@ -835,7 +862,8 @@ ELSE (_boost_IN_CACHE) endif() find_library(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE NAMES ${_boost_RELEASE_NAMES} - HINTS ${_boost_LIBRARIES_SEARCH_DIRS} + HINTS ${_boost_LIBRARY_SEARCH_DIRS} + ${_boost_FIND_OPTIONS} ) # @@ -860,7 +888,8 @@ ELSE (_boost_IN_CACHE) endif() find_library(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG NAMES ${_boost_DEBUG_NAMES} - HINTS ${_boost_LIBRARIES_SEARCH_DIRS} + HINTS ${_boost_LIBRARY_SEARCH_DIRS} + ${_boost_FIND_OPTIONS} ) _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT}) From d4900c2eca0964f8ce719cb4b8502e15114c042e Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Sat, 18 Sep 2010 10:59:42 -0400 Subject: [PATCH 128/152] FindBoost.cmake: Fix compiling against a boost source tree This fixes issues 11192 & 11187. --- Modules/FindBoost.cmake | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 8fc2dd13b..ee77abeab 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -550,10 +550,7 @@ ELSE (_boost_IN_CACHE) ENDIF() list(APPEND _boost_PATH_SUFFIXES "boost-${_boost_BOOSTIFIED_VERSION}") - if(WIN32) - # For BoostPro's underscores (and others?) - list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}") - endif() + list(APPEND _boost_PATH_SUFFIXES "boost_${_boost_BOOSTIFIED_VERSION}") ENDFOREACH(_boost_VER) From 02390416e101edbf07aa9e0952fc3c0452b97009 Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Sat, 18 Sep 2010 11:16:09 -0400 Subject: [PATCH 129/152] FindBoost.cmake: Fixes 11246 FindBoost can find shared libraries (.so) in rare circumstances even when Boost_USE_STATIC_LIBS is set --- Modules/FindBoost.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index ee77abeab..32c0ab67e 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -800,7 +800,7 @@ ELSE (_boost_IN_CACHE) if(WIN32) set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .a ${CMAKE_FIND_LIBRARY_SUFFIXES}) else() - set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES} ) + set(CMAKE_FIND_LIBRARY_SUFFIXES .a ) endif() endif() From 5cce138c91d786197c90b2a108240a6573d72392 Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Sat, 18 Sep 2010 11:19:29 -0400 Subject: [PATCH 130/152] FindBoost.cmake: Fixes 11121 Add support for finding Boost.Thread with special THREADAPI in filename --- Modules/FindBoost.cmake | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 32c0ab67e..4cf99af5d 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -143,6 +143,21 @@ # Boost_COMPILER Set this to the compiler suffix used by Boost # (e.g. "-gcc43") if FindBoost has problems finding # the proper Boost installation +# +# Boost_THREADAPI When building boost.thread, sometimes the name of the +# library contains an additional "pthread" or "win32" +# string known as the threadapi. This can happen when +# compiling against pthreads on Windows or win32 threads +# on Cygwin. You may specify this variable and if set +# when FindBoost searches for the Boost threading library +# it will first try to match the threadapi you specify. +# For Example: libboost_thread_win32-mgw45-mt-1_43.a +# might be found if you specified "win32" here before +# falling back on libboost_thread-mgw45-mt-1_43.a. +# [Since CMake 2.8.3] + + + # # These last three variables are available also as environment variables: # @@ -315,6 +330,17 @@ function(_Boost_MARK_COMPONENTS_FOUND _yes_or_no) endforeach() endfunction() +# +# Take a list of libraries with "thread" in it +# and prepend duplicates with "thread_${Boost_THREADAPI}" +# at the front of the list +# +function(_Boost_PREPEND_LIST_WITH_THREADAPI _output) + set(_orig_libnames ${ARGN}) + string(REPLACE "thread" "thread_${Boost_THREADAPI}" _threadapi_libnames ${_orig_libnames}) + set(${_output} ${_threadapi_libnames} ${_orig_libnames} PARENT_SCOPE) +endfunction() + # # End functions/macros # @@ -853,6 +879,9 @@ ELSE (_boost_IN_CACHE) ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_STATIC_ABI_TAG} ) endif() + if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread") + _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_RELEASE_NAMES ${_boost_RELEASE_NAMES}) + endif() if(Boost_DEBUG) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "Searching for ${UPPERCOMPONENT}_LIBRARY_RELEASE: ${_boost_RELEASE_NAMES}") @@ -879,6 +908,9 @@ ELSE (_boost_IN_CACHE) ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_STATIC_ABI_TAG} ) endif() + if(Boost_THREADAPI AND ${COMPONENT} STREQUAL "thread") + _Boost_PREPEND_LIST_WITH_THREADAPI(_boost_DEBUG_NAMES ${_boost_DEBUG_NAMES}) + endif() if(Boost_DEBUG) message(STATUS "[ ${CMAKE_CURRENT_LIST_FILE}:${CMAKE_CURRENT_LIST_LINE} ] " "Searching for ${UPPERCOMPONENT}_LIBRARY_DEBUG: ${_boost_DEBUG_NAMES}") From 95ff12091dd1bfed6207021c1a64803c9fcc5e44 Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Sat, 18 Sep 2010 11:21:23 -0400 Subject: [PATCH 131/152] FindBoost.cmake: Fixes 10436 Add an additional library filename permutation which fixes library detection for some custom builds of Boost. --- Modules/FindBoost.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 4cf99af5d..ff3e17b52 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -868,6 +868,7 @@ ELSE (_boost_IN_CACHE) # set(_boost_RELEASE_NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_RELEASE_ABI_TAG} ${Boost_LIB_PREFIX}boost_${COMPONENT} ) @@ -897,6 +898,7 @@ ELSE (_boost_IN_CACHE) # set(_boost_DEBUG_NAMES ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} + ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_COMPILER}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG} ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED}${_boost_DEBUG_ABI_TAG}-${Boost_LIB_VERSION} ${Boost_LIB_PREFIX}boost_${COMPONENT}${_boost_MULTITHREADED} ${Boost_LIB_PREFIX}boost_${COMPONENT} ) From 90c16d84bee64719d4bf3c4c2ee561a8dec54b3c Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Sat, 18 Sep 2010 11:57:42 -0400 Subject: [PATCH 132/152] FindBoost.cmake: Implements 11160 Add Boost_REALPATH option for people packaging Boost with their app: Boost_REALPATH Resolves symbolic links for discovered boost libraries to assist with packaging. For example, instead of Boost_SYSTEM_LIBRARY_RELEASE being resolved to "/usr/lib/libboost_system.so" it would be "/usr/lib/libboost_system.so.1.42.0" instead. This does not affect linking and should not be enabled unless the user needs this information. --- Modules/FindBoost.cmake | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index ff3e17b52..7acd31a88 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -155,7 +155,16 @@ # might be found if you specified "win32" here before # falling back on libboost_thread-mgw45-mt-1_43.a. # [Since CMake 2.8.3] - +# +# Boost_REALPATH Resolves symbolic links for discovered boost libraries +# to assist with packaging. For example, instead of +# Boost_SYSTEM_LIBRARY_RELEASE being resolved to +# "/usr/lib/libboost_system.so" it would be +# "/usr/lib/libboost_system.so.1.42.0" instead. +# This does not affect linking and should not be +# enabled unless the user needs this information. +# [Since CMake 2.8.3] +# # @@ -341,6 +350,17 @@ function(_Boost_PREPEND_LIST_WITH_THREADAPI _output) set(${_output} ${_threadapi_libnames} ${_orig_libnames} PARENT_SCOPE) endfunction() +# +# If a library is found, replace its cache entry with its REALPATH +# +function(_Boost_SWAP_WITH_REALPATH _library _docstring) + if(${_library}) + get_filename_component(_boost_filepathreal ${${_library}} REALPATH) + unset(${_library} CACHE) + set(${_library} ${_boost_filepathreal} CACHE FILEPATH "${_docstring}") + endif() +endfunction() + # # End functions/macros # @@ -863,6 +883,9 @@ ELSE (_boost_IN_CACHE) set( Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE-NOTFOUND" ) set( Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG-NOTFOUND") + set( _boost_docstring_release "Boost ${COMPONENT} library (release)") + set( _boost_docstring_debug "Boost ${COMPONENT} library (debug)") + # # Find RELEASE libraries # @@ -891,6 +914,7 @@ ELSE (_boost_IN_CACHE) NAMES ${_boost_RELEASE_NAMES} HINTS ${_boost_LIBRARY_SEARCH_DIRS} ${_boost_FIND_OPTIONS} + DOC "${_boost_docstring_release}" ) # @@ -921,9 +945,16 @@ ELSE (_boost_IN_CACHE) NAMES ${_boost_DEBUG_NAMES} HINTS ${_boost_LIBRARY_SEARCH_DIRS} ${_boost_FIND_OPTIONS} + DOC "${_boost_docstring_debug}" ) + if(Boost_REALPATH) + _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_RELEASE "${_boost_docstring_release}") + _Boost_SWAP_WITH_REALPATH(Boost_${UPPERCOMPONENT}_LIBRARY_DEBUG "${_boost_docstring_debug}" ) + endif() + _Boost_ADJUST_LIB_VARS(${UPPERCOMPONENT}) + endforeach(COMPONENT) # Restore the original find library ordering From 7016fae6d4c0a58fcbf74ee29bf25a7b5e2cf369 Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Sat, 18 Sep 2010 13:46:08 -0400 Subject: [PATCH 133/152] Fix 11136: [patch] FindThreads.cmake documents the wrong variable Fixed documentation to be correct. --- Modules/FindThreads.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindThreads.cmake b/Modules/FindThreads.cmake index 25d48d1fc..4cb7451a4 100644 --- a/Modules/FindThreads.cmake +++ b/Modules/FindThreads.cmake @@ -6,7 +6,7 @@ # CMAKE_USE_PTHREADS_INIT - are we using pthreads # CMAKE_HP_PTHREADS_INIT - are we using hp pthreads # For systems with multiple thread libraries, caller can set -# CMAKE_THREAD_PREFER_PTHREADS +# CMAKE_THREAD_PREFER_PTHREAD #============================================================================= # Copyright 2002-2009 Kitware, Inc. From d10b94b2f0c73c4766bb7c9047ddd78c8e470ffa Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Sun, 19 Sep 2010 00:01:04 -0400 Subject: [PATCH 134/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 0bcde24ee..642031324 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 18) +SET(KWSYS_DATE_STAMP_DAY 19) From b8b9a321703eaea1a0c50340dc594d9410c3032b Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Sun, 19 Sep 2010 23:15:07 -0400 Subject: [PATCH 135/152] FindBoost.cmake: Fix library search path glitch introduced in earlier commit --- Modules/FindBoost.cmake | 47 +++++++++++++++++++++-------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index 7acd31a88..2377e1077 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -499,7 +499,7 @@ ELSE (_boost_IN_CACHE) "-DBOOST_LIB_DIAGNOSTIC" CACHE STRING "Boost diagnostic define") ENDIF(WIN32) - SET(_boost_INCLUDE_SEARCH_DIRS + set(_boost_INCLUDE_SEARCH_DIRS_SYSTEM C:/boost/include C:/boost "$ENV{ProgramFiles}/boost/include" @@ -551,19 +551,18 @@ ELSE (_boost_IN_CACHE) "_boost_TEST_VERSIONS = ${_boost_TEST_VERSIONS}") endif() + if( Boost_NO_SYSTEM_PATHS) + set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH) + else() + set(_boost_INCLUDE_SEARCH_DIRS ${_boost_INCLUDE_SEARCH_DIRS_SYSTEM}) + endif() + if( BOOST_ROOT ) - if( Boost_NO_SYSTEM_PATHS ) - set(_boost_INCLUDE_SEARCH_DIRS - ${BOOST_ROOT}/include - ${BOOST_ROOT}) - set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH) - else() - set(_boost_INCLUDE_SEARCH_DIRS - ${BOOST_ROOT}/include - ${BOOST_ROOT} - ${_boost_INCLUDE_SEARCH_DIRS}) - endif() - endif( BOOST_ROOT ) + set(_boost_INCLUDE_SEARCH_DIRS + ${BOOST_ROOT}/include + ${BOOST_ROOT} + ${_boost_INCLUDE_SEARCH_DIRS}) + endif() # prepend BOOST_INCLUDEDIR to search path if specified if( BOOST_INCLUDEDIR ) @@ -803,9 +802,13 @@ ELSE (_boost_IN_CACHE) # Begin finding boost libraries # ------------------------------------------------------------------------ + if(BOOST_ROOT) + set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS + ${BOOST_ROOT}/lib + ${BOOST_ROOT}/stage/lib) + endif() set(_boost_LIBRARY_SEARCH_DIRS_ALWAYS - ${BOOST_ROOT}/lib - ${BOOST_ROOT}/stage/lib + ${_boost_LIBRARY_SEARCH_DIRS_ALWAYS} ${Boost_INCLUDE_DIR}/lib ${Boost_INCLUDE_DIR}/../lib ${Boost_INCLUDE_DIR}/stage/lib @@ -819,14 +822,12 @@ ELSE (_boost_IN_CACHE) "$ENV{ProgramFiles}/boost" /sw/local/lib ) - if( BOOST_ROOT ) - set(_boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_ALWAYS}) - if( Boost_NO_SYSTEM_PATHS ) - set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH) - else() - list(APPEND _boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_SYSTEM}) - endif() - endif( BOOST_ROOT ) + set(_boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_ALWAYS}) + if( Boost_NO_SYSTEM_PATHS ) + set(_boost_FIND_OPTIONS NO_CMAKE_SYSTEM_PATH) + else() + list(APPEND _boost_LIBRARY_SEARCH_DIRS ${_boost_LIBRARY_SEARCH_DIRS_SYSTEM}) + endif() # prepend BOOST_LIBRARYDIR to search path if specified if( BOOST_LIBRARYDIR ) From 38691d91a58b416fd4698047b037c8123e133e2b Mon Sep 17 00:00:00 2001 From: Philip Lowman Date: Sun, 19 Sep 2010 23:56:34 -0400 Subject: [PATCH 136/152] FindFLEX.cmake: Fix issue 11249 FindFLEX no longer sense a CMake fatal error if executing "flex --version" fails unless the REQUIRED argument was specified. --- Modules/FindFLEX.cmake | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake index 55b563916..d42e51464 100644 --- a/Modules/FindFLEX.cmake +++ b/Modules/FindFLEX.cmake @@ -78,7 +78,11 @@ IF(FLEX_EXECUTABLE) RESULT_VARIABLE FLEX_version_result OUTPUT_STRIP_TRAILING_WHITESPACE) IF(NOT ${FLEX_version_result} EQUAL 0) - MESSAGE(SEND_ERROR "Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_error}") + IF(FLEX_FIND_REQUIRED) + MESSAGE(SEND_ERROR "Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}") + ELSE() + MESSAGE("Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}\nFLEX_VERSION will not be available") + ENDIF() ELSE() STRING(REGEX REPLACE "^flex (.*)$" "\\1" FLEX_VERSION "${FLEX_version_output}") From b03087798b5fb769c2924942bae5c42911b0d11d Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Mon, 20 Sep 2010 00:01:05 -0400 Subject: [PATCH 137/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 642031324..1576f6633 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 19) +SET(KWSYS_DATE_STAMP_DAY 20) From a56969f3d3dcd6f711b8f1881f0258ec4a333373 Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 9 Sep 2010 15:29:05 -0400 Subject: [PATCH 138/152] FindMPI: Recoginze -f flags from mpicc (#10771) Parse compiler flags like "-fmessage-length=0 -fstack-protector -funwind-tables -fasynchronous-unwind-tables -fno-strict-aliasing" from the output of "mpicc -show". We already handle preprocessor definition arguments like -DUSE_STDARG. Honor '-f' flags too. --- Modules/FindMPI.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Modules/FindMPI.cmake b/Modules/FindMPI.cmake index 45d6bff50..9fef8f90c 100644 --- a/Modules/FindMPI.cmake +++ b/Modules/FindMPI.cmake @@ -188,7 +188,7 @@ if (MPI_INCLUDE_PATH AND MPI_LIBRARY) # the cache, and we don't want to override those settings. elseif (MPI_COMPILE_CMDLINE) # Extract compile flags from the compile command line. - string(REGEX MATCHALL "(^| )-D([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}") + string(REGEX MATCHALL "(^| )-[Df]([^\" ]+|\"[^\"]+\")" MPI_ALL_COMPILE_FLAGS "${MPI_COMPILE_CMDLINE}") set(MPI_COMPILE_FLAGS_WORK) foreach(FLAG ${MPI_ALL_COMPILE_FLAGS}) if (MPI_COMPILE_FLAGS_WORK) From c04af060093565d0bdb3703ca89176aff4732abf Mon Sep 17 00:00:00 2001 From: Brad King Date: Mon, 20 Sep 2010 09:53:45 -0400 Subject: [PATCH 139/152] Add module-dir flag for Compaq Visual Fortran (#11248) This compiler uses "-module:" to specify where modules should be placed. --- Modules/Platform/Windows-df.cmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Modules/Platform/Windows-df.cmake b/Modules/Platform/Windows-df.cmake index 753b19873..f5046bf35 100644 --- a/Modules/Platform/Windows-df.cmake +++ b/Modules/Platform/Windows-df.cmake @@ -10,6 +10,8 @@ ELSE(CMAKE_VERBOSE_MAKEFILE) SET(CMAKE_CL_NOLOGO "/nologo") ENDIF(CMAKE_VERBOSE_MAKEFILE) +SET(CMAKE_Fortran_MODDIR_FLAG "-module:") + SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY "link ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out: /dll ${CMAKE_END_TEMP_FILE}") From 0790af3bf54f8b1fcd418fec4ff968ffa55f334c Mon Sep 17 00:00:00 2001 From: Mikkel Krautz Date: Mon, 20 Sep 2010 10:02:39 -0400 Subject: [PATCH 140/152] Xcode: Avoid trailing space in ARCHS list (#11244) With CMAKE_OSX_ARCHITECTURE settings such as $(ARCHS_STANDARD_32BIT), the space inserted by the for loop would confuse Xcode if quoted. In this particular example, what would be output would be: ARCHS = "$(ARCHS_STANDARD_32BIT) "; The Xcode UI does not recognize this as the built-in "Standards 32-bit" architecture setting unless the space is removed. --- Source/cmGlobalXCodeGenerator.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index c63b4034d..4e9969d0b 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -2726,12 +2726,14 @@ void cmGlobalXCodeGenerator buildSettings->AddAttribute("SDKROOT", this->CreateString(sysroot)); std::string archString; + const char* sep = ""; for( std::vector::iterator i = this->Architectures.begin(); i != this->Architectures.end(); ++i) { + archString += sep; archString += *i; - archString += " "; + sep = " "; } buildSettings->AddAttribute("ARCHS", this->CreateString(archString.c_str())); From a8ded5338bf44173fe33e0249ab14aa3d8e7540c Mon Sep 17 00:00:00 2001 From: Mikkel Krautz Date: Sat, 18 Sep 2010 14:18:12 +0200 Subject: [PATCH 141/152] Xcode: Quote string values containing '$' (#11244) Allow use of $(STANDARD_32BIT_ARCHS) as CMAKE_OSX_ARCHITECTURES. The expanded value must remain a single string. --- Source/cmXCodeObject.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmXCodeObject.cxx b/Source/cmXCodeObject.cxx index 07c7b8cf1..592047031 100644 --- a/Source/cmXCodeObject.cxx +++ b/Source/cmXCodeObject.cxx @@ -236,7 +236,7 @@ void cmXCodeObject::PrintString(std::ostream& os) const // considered special by the Xcode project file parser. bool needQuote = (this->String.empty() || - this->String.find_first_of(" <>.+-=@") != this->String.npos); + this->String.find_first_of(" <>.+-=@$") != this->String.npos); const char* quote = needQuote? "\"" : ""; // Print the string, quoted and escaped as necessary. From a798bb7074dd45e4e375a3df69d08f62a17ab2ab Mon Sep 17 00:00:00 2001 From: David Cole Date: Mon, 20 Sep 2010 13:20:15 -0400 Subject: [PATCH 142/152] Avoid CustomCommand test failure on VS71 (#9963) Test still failing on dash1.kitware. Give up on testing the new arg on MSVC71. Test it with newer nmakes instead. All other dashboards are fine with -DPATH=c:/posix/path as the first arg, so keep it except when MSVC71 is true. --- Tests/CustomCommand/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Tests/CustomCommand/CMakeLists.txt b/Tests/CustomCommand/CMakeLists.txt index d2a0cf722..76208d479 100644 --- a/Tests/CustomCommand/CMakeLists.txt +++ b/Tests/CustomCommand/CMakeLists.txt @@ -224,8 +224,12 @@ ADD_CUSTOM_COMMAND(OUTPUT gen_redirect.c ############################################################################## # Test non-trivial command line arguments in custom commands. SET(EXPECTED_ARGUMENTS) +SET(CHECK_ARGS) +IF(NOT MSVC71) + SET(CHECK_ARGS -DPATH=c:/posix/path) +ENDIF() SET(CHECK_ARGS - -DPATH=c:/posix/path + ${CHECK_ARGS} c:/posix/path c:\\windows\\path 'single-quotes' From 950b7351011b7315809271e5e5a1a1c8fc045d53 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Tue, 21 Sep 2010 00:01:05 -0400 Subject: [PATCH 143/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index 1576f6633..d50aa3f7b 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 20) +SET(KWSYS_DATE_STAMP_DAY 21) From 775697d5f5e8812dc642d1e21e7bc5405df943cd Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Tue, 21 Sep 2010 10:04:04 -0400 Subject: [PATCH 144/152] Add a delay after untar on windows to make external project work on windows 7 OK, on windows 7 after we untar some files, sometimes we can not rename the directory after the untar is done. This breaks the external project untar and rename code. So, by default we will wait 1/10th of a second after the untar. If CMAKE_UNTAR_DELAY is set in the env, its value will be used instead of 100. --- Source/cmake.cxx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/Source/cmake.cxx b/Source/cmake.cxx index e6c7bb0b0..1e3b0187a 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -1574,6 +1574,24 @@ int cmake::ExecuteCMakeCommand(std::vector& args) cmSystemTools::Error("Problem extracting tar: ", outFile.c_str()); return 1; } +#ifdef WIN32 + // OK, on windows 7 after we untar some files, + // sometimes we can not rename the directory after + // the untar is done. This breaks the external project + // untar and rename code. So, by default we will wait + // 1/10th of a second after the untar. If CMAKE_UNTAR_DELAY + // is set in the env, its value will be used instead of 100. + int delay = 100; + const char* delayVar = cmSystemTools::GetEnv("CMAKE_UNTAR_DELAY"); + if(delayVar) + { + delay = atoi(delayVar); + } + if(delay) + { + cmSystemTools::Delay(delay); + } +#endif } return 0; } From 2f665d5d1f9b4af3f9ece89565ba71bbc56ca05b Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 21 Sep 2010 17:22:07 -0400 Subject: [PATCH 145/152] FindPythonInterp: Look for python2.7 interpreter Python 2.7 was released on July 3rd, 2010. --- Modules/FindPythonInterp.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Modules/FindPythonInterp.cmake b/Modules/FindPythonInterp.cmake index ed6ade6a0..6c97ba341 100644 --- a/Modules/FindPythonInterp.cmake +++ b/Modules/FindPythonInterp.cmake @@ -7,7 +7,7 @@ # #============================================================================= -# Copyright 2005-2009 Kitware, Inc. +# Copyright 2005-2010 Kitware, Inc. # # Distributed under the OSI-approved BSD License (the "License"); # see accompanying file Copyright.txt for details. @@ -20,8 +20,9 @@ # License text for the above reference.) FIND_PROGRAM(PYTHON_EXECUTABLE - NAMES python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python + NAMES python2.7 python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.7\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath] From a6628d154a5bbdd7a41f0791df26eb55f18a3a3e Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 21 Sep 2010 17:28:34 -0400 Subject: [PATCH 146/152] FindFLTK*: Use Cygwin fltk on Cygwin Do not set FLTK_PLATFORM_DEPENDENT_LIBS to contain win32 libraries. Cygwin builds should use the fltk that comes with Cygwin. --- Modules/FindFLTK.cmake | 5 ----- Modules/FindFLTK2.cmake | 4 ---- 2 files changed, 9 deletions(-) diff --git a/Modules/FindFLTK.cmake b/Modules/FindFLTK.cmake index 6d51277ae..03d4b8e14 100644 --- a/Modules/FindFLTK.cmake +++ b/Modules/FindFLTK.cmake @@ -67,11 +67,6 @@ IF(APPLE) SET( FLTK_PLATFORM_DEPENDENT_LIBS "-framework Carbon -framework Cocoa -framework ApplicationServices -lz") ENDIF(APPLE) -IF(CYGWIN) - FIND_LIBRARY(FLTK_MATH_LIBRARY m) - SET( FLTK_PLATFORM_DEPENDENT_LIBS ole32 uuid comctl32 wsock32 supc++ ${FLTK_MATH_LIBRARY} -lgdi32) -ENDIF(CYGWIN) - # If FLTK_INCLUDE_DIR is already defined we assigne its value to FLTK_DIR IF(FLTK_INCLUDE_DIR) SET(FLTK_DIR ${FLTK_INCLUDE_DIR}) diff --git a/Modules/FindFLTK2.cmake b/Modules/FindFLTK2.cmake index 43409d3b6..436e280bc 100644 --- a/Modules/FindFLTK2.cmake +++ b/Modules/FindFLTK2.cmake @@ -45,10 +45,6 @@ IF(APPLE) SET( FLTK2_PLATFORM_DEPENDENT_LIBS "-framework Carbon -framework Cocoa -framework ApplicationServices -lz") ENDIF(APPLE) -IF(CYGWIN) - SET( FLTK2_PLATFORM_DEPENDENT_LIBS ole32 uuid comctl32 wsock32 supc++ -lm -lgdi32) -ENDIF(CYGWIN) - # If FLTK2_INCLUDE_DIR is already defined we assigne its value to FLTK2_DIR IF(FLTK2_INCLUDE_DIR) SET(FLTK2_DIR ${FLTK2_INCLUDE_DIR}) From 2412d9bc0eb2a70defe860672ad3f0de60bae28d Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Tue, 21 Sep 2010 17:32:49 -0400 Subject: [PATCH 147/152] Use 'uname -m' for processor on Cygwin (#10774) POSIX requires 'uname -m' but not 'uname -p': http://www.opengroup.org/onlinepubs/9699919799/utilities/uname.html Indeed Cygwin 'uname -p' returns "unknown". --- Modules/CMakeDetermineSystem.cmake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Modules/CMakeDetermineSystem.cmake b/Modules/CMakeDetermineSystem.cmake index 5589dfc06..0e65bceae 100644 --- a/Modules/CMakeDetermineSystem.cmake +++ b/Modules/CMakeDetermineSystem.cmake @@ -47,17 +47,17 @@ IF(CMAKE_HOST_UNIX) IF(CMAKE_UNAME) EXEC_PROGRAM(uname ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_NAME) EXEC_PROGRAM(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION) - IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux") + IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*") EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) - ELSE(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux") + ELSE(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*") EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) IF("${val}" GREATER 0) EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR RETURN_VALUE val) ENDIF("${val}" GREATER 0) - ENDIF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux") + ENDIF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*") # check the return of the last uname -m or -p IF("${val}" GREATER 0) SET(CMAKE_HOST_SYSTEM_PROCESSOR "unknown") From 4a323bde0cc23a425ee6589c13bee3b9644942c4 Mon Sep 17 00:00:00 2001 From: David Cole Date: Tue, 21 Sep 2010 21:46:52 -0400 Subject: [PATCH 148/152] Honor MAKECOMMAND value saved in cache (#11026) Use a separate variable to pass to the BUILD_COMMAND call and then use set(CACHE) to transfer that to MAKECOMMAND. That way, if MAKECOMMAND is in the cache already, it is left untouched. Fixes regression introduced in commit 0b38bb4c with the fix for bug #2336. Thanks to Evgeniy P for the patch. --- Modules/CTest.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Modules/CTest.cmake b/Modules/CTest.cmake index e3157fac2..bb76ddd25 100644 --- a/Modules/CTest.cmake +++ b/Modules/CTest.cmake @@ -228,8 +228,10 @@ IF(BUILD_TESTING) ENDIF(NOT BUILDNAME) # the build command - BUILD_COMMAND(MAKECOMMAND CONFIGURATION "\${CTEST_CONFIGURATION_TYPE}") - SET(MAKECOMMAND ${MAKECOMMAND} CACHE STRING "Command to build the project") + BUILD_COMMAND(MAKECOMMAND_DEFAULT_VALUE + CONFIGURATION "\${CTEST_CONFIGURATION_TYPE}") + SET(MAKECOMMAND ${MAKECOMMAND_DEFAULT_VALUE} + CACHE STRING "Command to build the project") # the default build configuration the ctest build handler will use # if there is no -C arg given to ctest: From d65a91dd4546a5ae10d4dcfe1598f3dcd55c6f48 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Wed, 22 Sep 2010 00:01:05 -0400 Subject: [PATCH 149/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index d50aa3f7b..f6525f113 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 21) +SET(KWSYS_DATE_STAMP_DAY 22) From a9bf98b2a6fc5a0f8b7023430779f74fcd0fa5c9 Mon Sep 17 00:00:00 2001 From: KWSys Robot Date: Thu, 23 Sep 2010 00:01:04 -0400 Subject: [PATCH 150/152] KWSys Nightly Date Stamp --- Source/kwsys/kwsysDateStamp.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/kwsys/kwsysDateStamp.cmake b/Source/kwsys/kwsysDateStamp.cmake index f6525f113..769475373 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 22) +SET(KWSYS_DATE_STAMP_DAY 23) From 8e8acb7aaba8c17cb7407b198ca8d8d19046cc7c Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Thu, 23 Sep 2010 21:47:06 +0200 Subject: [PATCH 151/152] -remove trailing whitespace Alex --- Source/QtDialog/CMakeSetupDialog.cxx | 168 +++++++++++++-------------- 1 file changed, 84 insertions(+), 84 deletions(-) diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 74a3d3594..7207a8a7a 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -34,7 +34,7 @@ #include "FirstConfigure.h" #include "cmVersion.h" -QCMakeThread::QCMakeThread(QObject* p) +QCMakeThread::QCMakeThread(QObject* p) : QThread(p), CMakeInstance(NULL) { } @@ -76,7 +76,7 @@ CMakeSetupDialog::CMakeSetupDialog() this->ProgressBar->reset(); this->RemoveEntry->setEnabled(false); this->AddEntry->setEnabled(false); - + QByteArray p = settings.value("SplitterSizes").toByteArray(); this->Splitter->restoreState(p); @@ -86,48 +86,48 @@ CMakeSetupDialog::CMakeSetupDialog() QMenu* FileMenu = this->menuBar()->addMenu(tr("&File")); this->ReloadCacheAction = FileMenu->addAction(tr("&Reload Cache")); - QObject::connect(this->ReloadCacheAction, SIGNAL(triggered(bool)), + QObject::connect(this->ReloadCacheAction, SIGNAL(triggered(bool)), this, SLOT(doReloadCache())); this->DeleteCacheAction = FileMenu->addAction(tr("&Delete Cache")); - QObject::connect(this->DeleteCacheAction, SIGNAL(triggered(bool)), + QObject::connect(this->DeleteCacheAction, SIGNAL(triggered(bool)), this, SLOT(doDeleteCache())); this->ExitAction = FileMenu->addAction(tr("E&xit")); - QObject::connect(this->ExitAction, SIGNAL(triggered(bool)), + QObject::connect(this->ExitAction, SIGNAL(triggered(bool)), this, SLOT(close())); QMenu* ToolsMenu = this->menuBar()->addMenu(tr("&Tools")); this->ConfigureAction = ToolsMenu->addAction(tr("&Configure")); // prevent merging with Preferences menu item on Mac OS X this->ConfigureAction->setMenuRole(QAction::NoRole); - QObject::connect(this->ConfigureAction, SIGNAL(triggered(bool)), + QObject::connect(this->ConfigureAction, SIGNAL(triggered(bool)), this, SLOT(doConfigure())); this->GenerateAction = ToolsMenu->addAction(tr("&Generate")); - QObject::connect(this->GenerateAction, SIGNAL(triggered(bool)), + QObject::connect(this->GenerateAction, SIGNAL(triggered(bool)), this, SLOT(doGenerate())); QAction* showChangesAction = ToolsMenu->addAction(tr("&Show My Changes")); - QObject::connect(showChangesAction, SIGNAL(triggered(bool)), + QObject::connect(showChangesAction, SIGNAL(triggered(bool)), this, SLOT(showUserChanges())); #if defined(Q_WS_MAC) - this->InstallForCommandLineAction + this->InstallForCommandLineAction = ToolsMenu->addAction(tr("&Install For Command Line Use")); - QObject::connect(this->InstallForCommandLineAction, SIGNAL(triggered(bool)), + QObject::connect(this->InstallForCommandLineAction, SIGNAL(triggered(bool)), this, SLOT(doInstallForCommandLine())); -#endif +#endif QMenu* OptionsMenu = this->menuBar()->addMenu(tr("&Options")); this->SuppressDevWarningsAction = OptionsMenu->addAction(tr("&Suppress dev Warnings (-Wno-dev)")); this->SuppressDevWarningsAction->setCheckable(true); QAction* debugAction = OptionsMenu->addAction(tr("&Debug Output")); debugAction->setCheckable(true); - QObject::connect(debugAction, SIGNAL(toggled(bool)), + QObject::connect(debugAction, SIGNAL(toggled(bool)), this, SLOT(setDebugOutput(bool))); - + OptionsMenu->addSeparator(); QAction* expandAction = OptionsMenu->addAction(tr("&Expand Grouped Entries")); - QObject::connect(expandAction, SIGNAL(triggered(bool)), + QObject::connect(expandAction, SIGNAL(triggered(bool)), this->CacheValues, SLOT(expandAll())); QAction* collapseAction = OptionsMenu->addAction(tr("&Collapse Grouped Entries")); - QObject::connect(collapseAction, SIGNAL(triggered(bool)), + QObject::connect(collapseAction, SIGNAL(triggered(bool)), this->CacheValues, SLOT(collapseAll())); QMenu* HelpMenu = this->menuBar()->addMenu(tr("&Help")); @@ -137,17 +137,17 @@ CMakeSetupDialog::CMakeSetupDialog() a = HelpMenu->addAction(tr("Help")); QObject::connect(a, SIGNAL(triggered(bool)), this, SLOT(doHelp())); - + QShortcut* filterShortcut = new QShortcut(QKeySequence::Find, this); - QObject::connect(filterShortcut, SIGNAL(activated()), + QObject::connect(filterShortcut, SIGNAL(activated()), this, SLOT(startSearch())); - + this->setAcceptDrops(true); - + // get the saved binary directories QStringList buildPaths = this->loadBuildPaths(); this->BinaryDirectory->addItems(buildPaths); - + this->BinaryDirectory->setCompleter(new QCMakeFileCompleter(this, true)); this->SourceDirectory->setCompleter(new QCMakeFileCompleter(this, true)); @@ -159,23 +159,23 @@ CMakeSetupDialog::CMakeSetupDialog() // start the cmake worker thread this->CMakeThread = new QCMakeThread(this); QObject::connect(this->CMakeThread, SIGNAL(cmakeInitialized()), - this, SLOT(initialize()), Qt::QueuedConnection); + this, SLOT(initialize()), Qt::QueuedConnection); this->CMakeThread->start(); - + this->enterState(ReadyConfigure); } void CMakeSetupDialog::initialize() { // now the cmake worker thread is running, lets make our connections to it - QObject::connect(this->CMakeThread->cmakeInstance(), + QObject::connect(this->CMakeThread->cmakeInstance(), SIGNAL(propertiesChanged(const QCMakePropertyList&)), this->CacheValues->cacheModel(), SLOT(setProperties(const QCMakePropertyList&))); QObject::connect(this->ConfigureButton, SIGNAL(clicked(bool)), this, SLOT(doConfigure())); - QObject::connect(this->CMakeThread->cmakeInstance(), + QObject::connect(this->CMakeThread->cmakeInstance(), SIGNAL(configureDone(int)), this, SLOT(finishConfigure(int))); QObject::connect(this->CMakeThread->cmakeInstance(), @@ -184,12 +184,12 @@ void CMakeSetupDialog::initialize() QObject::connect(this->GenerateButton, SIGNAL(clicked(bool)), this, SLOT(doGenerate())); - + QObject::connect(this->BrowseSourceDirectoryButton, SIGNAL(clicked(bool)), this, SLOT(doSourceBrowse())); QObject::connect(this->BrowseBinaryDirectoryButton, SIGNAL(clicked(bool)), this, SLOT(doBinaryBrowse())); - + QObject::connect(this->BinaryDirectory, SIGNAL(editTextChanged(QString)), this, SLOT(onBinaryDirectoryChanged(QString))); QObject::connect(this->SourceDirectory, SIGNAL(textChanged(QString)), @@ -201,11 +201,11 @@ void CMakeSetupDialog::initialize() QObject::connect(this->CMakeThread->cmakeInstance(), SIGNAL(binaryDirChanged(QString)), this, SLOT(updateBinaryDirectory(QString))); - + QObject::connect(this->CMakeThread->cmakeInstance(), SIGNAL(progressChanged(QString, float)), this, SLOT(showProgress(QString,float))); - + QObject::connect(this->CMakeThread->cmakeInstance(), SIGNAL(errorMessage(QString)), this, SLOT(error(QString))); @@ -218,29 +218,29 @@ void CMakeSetupDialog::initialize() this, SLOT(setGroupedView(bool))); QObject::connect(this->advancedCheck, SIGNAL(toggled(bool)), this, SLOT(setAdvancedView(bool))); - QObject::connect(this->Search, SIGNAL(textChanged(QString)), + QObject::connect(this->Search, SIGNAL(textChanged(QString)), this, SLOT(setSearchFilter(QString))); - + QObject::connect(this->CMakeThread->cmakeInstance(), SIGNAL(generatorChanged(QString)), this, SLOT(updateGeneratorLabel(QString))); this->updateGeneratorLabel(QString()); - + QObject::connect(this->CacheValues->cacheModel(), - SIGNAL(dataChanged(QModelIndex,QModelIndex)), + SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SLOT(setCacheModified())); - + QObject::connect(this->CacheValues->selectionModel(), - SIGNAL(selectionChanged(QItemSelection,QItemSelection)), + SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(selectionChanged())); - QObject::connect(this->RemoveEntry, SIGNAL(clicked(bool)), + QObject::connect(this->RemoveEntry, SIGNAL(clicked(bool)), this, SLOT(removeSelectedCacheEntries())); - QObject::connect(this->AddEntry, SIGNAL(clicked(bool)), + QObject::connect(this->AddEntry, SIGNAL(clicked(bool)), this, SLOT(addCacheEntry())); - QObject::connect(this->SuppressDevWarningsAction, SIGNAL(triggered(bool)), + QObject::connect(this->SuppressDevWarningsAction, SIGNAL(triggered(bool)), this->CMakeThread->cmakeInstance(), SLOT(setSuppressDevWarnings(bool))); - + if(!this->SourceDirectory->text().isEmpty() || !this->BinaryDirectory->lineEdit()->text().isEmpty()) { @@ -265,7 +265,7 @@ CMakeSetupDialog::~CMakeSetupDialog() this->CMakeThread->quit(); this->CMakeThread->wait(2000); } - + void CMakeSetupDialog::doConfigure() { if(this->CurrentState == Configuring) @@ -287,7 +287,7 @@ void CMakeSetupDialog::doConfigure() msg += bindir; QString title = tr("Create Directory"); QMessageBox::StandardButton btn; - btn = QMessageBox::information(this, title, msg, + btn = QMessageBox::information(this, title, msg, QMessageBox::Yes | QMessageBox::No); if(btn == QMessageBox::No) { @@ -295,8 +295,8 @@ void CMakeSetupDialog::doConfigure() } if(!dir.mkpath(".")) { - QMessageBox::information(this, tr("Create Directory Failed"), - QString(tr("Failed to create directory %1")).arg(dir.path()), + QMessageBox::information(this, tr("Create Directory Failed"), + QString(tr("Failed to create directory %1")).arg(dir.path()), QMessageBox::Ok); return; @@ -314,12 +314,12 @@ void CMakeSetupDialog::doConfigure() // remember path this->addBinaryPath(dir.absolutePath()); - + this->enterState(Configuring); this->CacheValues->selectionModel()->clear(); QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(), - "setProperties", Qt::QueuedConnection, + "setProperties", Qt::QueuedConnection, Q_ARG(QCMakePropertyList, this->CacheValues->cacheModel()->properties())); QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(), @@ -337,11 +337,11 @@ void CMakeSetupDialog::finishConfigure(int err) this->enterState(ReadyConfigure); this->CacheValues->scrollToTop(); } - + if(err != 0) { - QMessageBox::critical(this, tr("Error"), - tr("Error in configuration process, project files may be invalid"), + QMessageBox::critical(this, tr("Error"), + tr("Error in configuration process, project files may be invalid"), QMessageBox::Ok); } } @@ -351,7 +351,7 @@ void CMakeSetupDialog::finishGenerate(int err) this->enterState(ReadyConfigure); if(err != 0) { - QMessageBox::critical(this, tr("Error"), + QMessageBox::critical(this, tr("Error"), tr("Error in generation process, project files may be invalid"), QMessageBox::Ok); } @@ -375,7 +375,7 @@ void CMakeSetupDialog::doGenerate() QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(), "generate", Qt::QueuedConnection); } - + void CMakeSetupDialog::closeEvent(QCloseEvent* e) { // prompt for close if there are unsaved changes, and we're not busy @@ -466,7 +466,7 @@ void CMakeSetupDialog::doInterrupt() void CMakeSetupDialog::doSourceBrowse() { - QString dir = QFileDialog::getExistingDirectory(this, + QString dir = QFileDialog::getExistingDirectory(this, tr("Enter Path to Source"), this->SourceDirectory->text()); if(!dir.isEmpty()) { @@ -496,7 +496,7 @@ void CMakeSetupDialog::updateBinaryDirectory(const QString& dir) void CMakeSetupDialog::doBinaryBrowse() { - QString dir = QFileDialog::getExistingDirectory(this, + QString dir = QFileDialog::getExistingDirectory(this, tr("Enter Path to Build"), this->BinaryDirectory->currentText()); if(!dir.isEmpty() && dir != this->BinaryDirectory->currentText()) { @@ -585,7 +585,7 @@ bool CMakeSetupDialog::setupFirstConfigure() { dialog.saveToSettings(); this->CMakeThread->cmakeInstance()->setGenerator(dialog.getGenerator()); - + QCMakeCacheModel* m = this->CacheValues->cacheModel(); if(dialog.compilerSetup()) @@ -593,20 +593,20 @@ bool CMakeSetupDialog::setupFirstConfigure() QString fortranCompiler = dialog.getFortranCompiler(); if(!fortranCompiler.isEmpty()) { - m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_Fortran_COMPILER", + m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_Fortran_COMPILER", "Fortran compiler.", fortranCompiler, false); } QString cxxCompiler = dialog.getCXXCompiler(); if(!cxxCompiler.isEmpty()) { - m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER", + m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER", "CXX compiler.", cxxCompiler, false); } - + QString cCompiler = dialog.getCCompiler(); if(!cCompiler.isEmpty()) { - m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER", + m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER", "C compiler.", cCompiler, false); } } @@ -615,38 +615,38 @@ bool CMakeSetupDialog::setupFirstConfigure() QString fortranCompiler = dialog.getFortranCompiler(); if(!fortranCompiler.isEmpty()) { - m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_Fortran_COMPILER", + m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_Fortran_COMPILER", "Fortran compiler.", fortranCompiler, false); } QString mode = dialog.getCrossIncludeMode(); - m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_INCLUDE", + m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_INCLUDE", "CMake Find Include Mode", mode, false); mode = dialog.getCrossLibraryMode(); - m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_LIBRARY", + m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_LIBRARY", "CMake Find Library Mode", mode, false); mode = dialog.getCrossProgramMode(); - m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM", + m->insertProperty(QCMakeProperty::STRING, "CMAKE_FIND_ROOT_PATH_MODE_PROGRAM", "CMake Find Program Mode", mode, false); - + QString rootPath = dialog.getCrossRoot(); - m->insertProperty(QCMakeProperty::PATH, "CMAKE_FIND_ROOT_PATH", + m->insertProperty(QCMakeProperty::PATH, "CMAKE_FIND_ROOT_PATH", "CMake Find Root Path", rootPath, false); QString systemName = dialog.getSystemName(); - m->insertProperty(QCMakeProperty::STRING, "CMAKE_SYSTEM_NAME", + m->insertProperty(QCMakeProperty::STRING, "CMAKE_SYSTEM_NAME", "CMake System Name", systemName, false); QString cxxCompiler = dialog.getCXXCompiler(); - m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER", + m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_CXX_COMPILER", "CXX compiler.", cxxCompiler, false); QString cCompiler = dialog.getCCompiler(); - m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER", + m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_C_COMPILER", "C compiler.", cCompiler, false); } else if(dialog.crossCompilerToolChainFile()) { QString toolchainFile = dialog.getCrossCompilerToolChainFile(); - m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_TOOLCHAIN_FILE", + m->insertProperty(QCMakeProperty::FILEPATH, "CMAKE_TOOLCHAIN_FILE", "Cross Compile ToolChain File", toolchainFile, false); } return true; @@ -676,11 +676,11 @@ void CMakeSetupDialog::doReloadCache() } void CMakeSetupDialog::doDeleteCache() -{ +{ QString title = tr("Delete Cache"); QString msg = "Are you sure you want to delete the cache?"; QMessageBox::StandardButton btn; - btn = QMessageBox::information(this, title, msg, + btn = QMessageBox::information(this, title, msg, QMessageBox::Yes | QMessageBox::No); if(btn == QMessageBox::No) { @@ -721,7 +721,7 @@ void CMakeSetupDialog::setExitAfterGenerate(bool b) void CMakeSetupDialog::addBinaryPath(const QString& path) { QString cleanpath = QDir::cleanPath(path); - + // update UI this->BinaryDirectory->blockSignals(true); int idx = this->BinaryDirectory->findText(cleanpath); @@ -732,7 +732,7 @@ void CMakeSetupDialog::addBinaryPath(const QString& path) this->BinaryDirectory->insertItem(0, cleanpath); this->BinaryDirectory->setCurrentIndex(0); this->BinaryDirectory->blockSignals(false); - + // save to registry QStringList buildPaths = this->loadBuildPaths(); buildPaths.removeAll(cleanpath); @@ -742,7 +742,7 @@ void CMakeSetupDialog::addBinaryPath(const QString& path) void CMakeSetupDialog::dragEnterEvent(QDragEnterEvent* e) { - if(!(this->CurrentState == ReadyConfigure || + if(!(this->CurrentState == ReadyConfigure || this->CurrentState == ReadyGenerate)) { e->ignore(); @@ -752,7 +752,7 @@ void CMakeSetupDialog::dragEnterEvent(QDragEnterEvent* e) const QMimeData* dat = e->mimeData(); QList urls = dat->urls(); QString file = urls.count() ? urls[0].toLocalFile() : QString(); - if(!file.isEmpty() && + if(!file.isEmpty() && (file.endsWith("CMakeCache.txt", Qt::CaseInsensitive) || file.endsWith("CMakeLists.txt", Qt::CaseInsensitive) ) ) { @@ -766,7 +766,7 @@ void CMakeSetupDialog::dragEnterEvent(QDragEnterEvent* e) void CMakeSetupDialog::dropEvent(QDropEvent* e) { - if(!(this->CurrentState == ReadyConfigure || + if(!(this->CurrentState == ReadyConfigure || this->CurrentState == ReadyGenerate)) { return; @@ -801,7 +801,7 @@ QStringList CMakeSetupDialog::loadBuildPaths() QStringList buildPaths; for(int i=0; i<10; i++) - { + { QString p = settings.value(QString("WhereBuild%1").arg(i)).toString(); if(!p.isEmpty()) { @@ -823,11 +823,11 @@ void CMakeSetupDialog::saveBuildPaths(const QStringList& paths) } for(int i=0; iCacheModified = true; @@ -851,8 +851,8 @@ void CMakeSetupDialog::removeSelectedCacheEntries() void CMakeSetupDialog::selectionChanged() { QModelIndexList idxs = this->CacheValues->selectionModel()->selectedRows(); - if(idxs.count() && - (this->CurrentState == ReadyConfigure || + if(idxs.count() && + (this->CurrentState == ReadyConfigure || this->CurrentState == ReadyGenerate) ) { this->RemoveEntry->setEnabled(true); @@ -862,7 +862,7 @@ void CMakeSetupDialog::selectionChanged() this->RemoveEntry->setEnabled(false); } } - + void CMakeSetupDialog::enterState(CMakeSetupDialog::State s) { if(s == this->CurrentState) @@ -953,11 +953,11 @@ void CMakeSetupDialog::setGroupedView(bool v) { this->CacheValues->cacheModel()->setViewType(v ? QCMakeCacheModel::GroupView : QCMakeCacheModel::FlatView); this->CacheValues->setRootIsDecorated(v); - + QSettings settings; settings.beginGroup("Settings/StartPath"); settings.setValue("GroupView", v); - + } void CMakeSetupDialog::setAdvancedView(bool v) @@ -984,7 +984,7 @@ void CMakeSetupDialog::showUserChanges() QString command; QString cache; - + foreach(QCMakeProperty prop, changes) { QString type; @@ -1020,13 +1020,13 @@ void CMakeSetupDialog::showUserChanges() command += QString("-D%1\"%2\" ").arg(line).arg(value); cache += QString("%1%2\n").arg(line).arg(value); } - + textedit->append(tr("Commandline options:")); textedit->append(command); textedit->append("\n"); textedit->append(tr("Cache file:")); textedit->append(cache); - + dialog.exec(); } From 3d13502c986e43f070366d04891c8a3da05e2cb8 Mon Sep 17 00:00:00 2001 From: Alex Neundorf Date: Thu, 23 Sep 2010 21:48:07 +0200 Subject: [PATCH 152/152] Make cmake-gui remember whether the "Advanced" checkbox was checked or not Alex --- Source/QtDialog/CMakeSetupDialog.cxx | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Source/QtDialog/CMakeSetupDialog.cxx b/Source/QtDialog/CMakeSetupDialog.cxx index 7207a8a7a..29fcfc0ee 100644 --- a/Source/QtDialog/CMakeSetupDialog.cxx +++ b/Source/QtDialog/CMakeSetupDialog.cxx @@ -84,6 +84,10 @@ CMakeSetupDialog::CMakeSetupDialog() this->setGroupedView(groupView); this->groupedCheck->setCheckState(groupView ? Qt::Checked : Qt::Unchecked); + bool advancedView = settings.value("AdvancedView", false).toBool(); + this->setAdvancedView(advancedView); + this->advancedCheck->setCheckState(advancedView?Qt::Checked : Qt::Unchecked); + QMenu* FileMenu = this->menuBar()->addMenu(tr("&File")); this->ReloadCacheAction = FileMenu->addAction(tr("&Reload Cache")); QObject::connect(this->ReloadCacheAction, SIGNAL(triggered(bool)), @@ -963,6 +967,9 @@ void CMakeSetupDialog::setGroupedView(bool v) void CMakeSetupDialog::setAdvancedView(bool v) { this->CacheValues->setShowAdvanced(v); + QSettings settings; + settings.beginGroup("Settings/StartPath"); + settings.setValue("AdvancedView", v); } void CMakeSetupDialog::showUserChanges()