Import cmake 2.6.4.

ci/unstable
Modestas Vainius 16 years ago
parent 39fa526e1d
commit a4cab8ff9f

@ -353,8 +353,8 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
# The CMake version number. # The CMake version number.
SET(CMake_VERSION_MAJOR 2) SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 6) SET(CMake_VERSION_MINOR 6)
SET(CMake_VERSION_PATCH 3) SET(CMake_VERSION_PATCH 4)
#SET(CMake_VERSION_RC 17) #SET(CMake_VERSION_RC 6)
# CVS versions are odd, if this is an odd minor version # CVS versions are odd, if this is an odd minor version
# then set the CMake_VERSION_DATE variable # then set the CMake_VERSION_DATE variable
IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$") IF("${CMake_VERSION_MINOR}" MATCHES "[13579]$")

@ -1,3 +1,52 @@
Changes in CMake 2.6.4 RC 6
- Use $ var in CPack.cmake, and not @var@
- Add more missing OSXX11 CPack files
Changes in CMake 2.6.4 RC 5
- Add missing file for OSXX11 CPack generator
- cmake-gui fix path length in the binary directory's combo box
Changes in CMake 2.6.4 RC 4
- Better document Verbatim in custom commands
- Fix #8843 ctest system information was not always correct on linux
- Fix transitive linking of imported libraries
Changes in CMake 2.6.4 RC 3
- Documentation fix for #8815
- Fix CDash only submit with ctest_submit
- various fixes for FindQt4.cmake
- cmake-gui block checkable flag for item during configure/generate.
- put qt version in about for cmake-gui
Changes in CMake 2.6.4 RC 2
- Fix issues in FindBoost #8576 #8734
- Fix -D issues with VS 6
- Fix scope issue with CMAKE_CURRENT_LIST_FILE and macros
- Eclipse make VERBOSE off in makfiles #7585, and use built-in includes
- Codeblocks auto header finding
- Fix crash in include_directories #8704
- Some documentation fixes to commands and classes.
- Do not warn if LIBPATH is not set for nmake
Changes in CMake 2.6.4 RC 1
- Add some better documentation about RPATH variables
- No longer mark header files as HEADER_FILE_ONLY automatically,
this gets rid of the ugly red marks in Visual Stuido
- Fix man-page preformatted text paragraphing
- Teach file(REMOVE) how to use relative paths
- Gracefully handle broken version symlinks
- Fix ASM source file extension default list
- Pass shared library export symbol in DEFINES
- Enforce unique binary directories
- Fix cmake-mode.el indentation cursor motion
- Simplify reverse cmLocalGenerator::Convert
- More robust decision to suppress implicit include dirs
- Fix Fortran implicit dependency include path (and test it)
- Clarify docs of old *_OUTPUT_PATH vars
- Fix svn update logic for modified files
- Add get_filename_component(... REALPATH)
- Work around broken GetLongPathName case
Changes in CMake 2.6.3 RC 17 - 15 Changes in CMake 2.6.3 RC 17 - 15
- Fix Xcode rebuild issue with static libraries and add a test. - Fix Xcode rebuild issue with static libraries and add a test.

@ -3,7 +3,7 @@
; Program: CMake - Cross-Platform Makefile Generator ; Program: CMake - Cross-Platform Makefile Generator
; Module: $RCSfile: cmake-mode.el,v $ ; Module: $RCSfile: cmake-mode.el,v $
; ;
; Copyright (c) 2000-$Date: 2008-03-11 14:54:40 $ Kitware, Inc., Insight Consortium. All rights reserved. ; Copyright (c) 2000-$Date: 2009-03-23 17:58:40 $ Kitware, Inc., Insight Consortium. All rights reserved.
; See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. ; See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
; ;
; This software is distributed WITHOUT ANY WARRANTY; without even ; This software is distributed WITHOUT ANY WARRANTY; without even
@ -102,54 +102,70 @@
(defun cmake-indent () (defun cmake-indent ()
"Indent current line as CMAKE code." "Indent current line as CMAKE code."
(interactive) (interactive)
(beginning-of-line)
(if (cmake-line-starts-inside-string) (if (cmake-line-starts-inside-string)
() ()
(if (bobp) (if (bobp)
(indent-line-to 0) (cmake-indent-line-to 0)
(let ((point-start (point)) (let (cur-indent)
token cur-indent)
(save-excursion (save-excursion
; Search back for the last indented line. (beginning-of-line)
(cmake-find-last-indented-line)
(let ((point-start (point))
; Start with the indentation on this line. token)
(setq cur-indent (current-indentation))
; Search back for the last indented line.
; Search forward counting tokens that adjust indentation. (cmake-find-last-indented-line)
(while (re-search-forward cmake-regex-token point-start t)
(setq token (match-string 0)) ; Start with the indentation on this line.
(if (string-match (concat "^" cmake-regex-paren-left "$") token) (setq cur-indent (current-indentation))
(setq cur-indent (+ cur-indent cmake-tab-width))
; Search forward counting tokens that adjust indentation.
(while (re-search-forward cmake-regex-token point-start t)
(setq token (match-string 0))
(if (string-match (concat "^" cmake-regex-paren-left "$") token)
(setq cur-indent (+ cur-indent cmake-tab-width))
)
(if (string-match (concat "^" cmake-regex-paren-right "$") token)
(setq cur-indent (- cur-indent cmake-tab-width))
)
(if (and
(string-match cmake-regex-block-open token)
(looking-at (concat "[ \t]*" cmake-regex-paren-left))
)
(setq cur-indent (+ cur-indent cmake-tab-width))
)
) )
(if (string-match (concat "^" cmake-regex-paren-right "$") token) (goto-char point-start)
; If this is the end of a block, decrease indentation.
(if (looking-at cmake-regex-block-close)
(setq cur-indent (- cur-indent cmake-tab-width)) (setq cur-indent (- cur-indent cmake-tab-width))
) )
(if (and
(string-match cmake-regex-block-open token)
(looking-at (concat "[ \t]*" cmake-regex-paren-left))
)
(setq cur-indent (+ cur-indent cmake-tab-width))
)
) )
) )
; If this is the end of a block, decrease indentation.
(if (looking-at cmake-regex-block-close)
(setq cur-indent (- cur-indent cmake-tab-width))
)
; Indent this line by the amount selected. ; Indent this line by the amount selected.
(if (< cur-indent 0) (if (< cur-indent 0)
(indent-line-to 0) (cmake-indent-line-to 0)
(indent-line-to cur-indent) (cmake-indent-line-to cur-indent)
) )
) )
) )
) )
) )
(defun cmake-point-in-indendation ()
(string-match "^[ \\t]*$" (buffer-substring (point-at-bol) (point))))
(defun cmake-indent-line-to (column)
"Indent the current line to COLUMN.
If point is within the existing indentation it is moved to the end of
the indentation. Otherwise it retains the same position on the line"
(if (cmake-point-in-indendation)
(indent-line-to column)
(save-excursion (indent-line-to column))))
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
;; ;;

@ -28,9 +28,9 @@ IF(NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-ASM OPTIONAL) INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-ASM OPTIONAL)
ENDIF(NOT _INCLUDED_FILE) ENDIF(NOT _INCLUDED_FILE)
IF(NOT CMAKE_ASM@ASM_DIALECT@_SOURCE_FILE_EXTENSIONS) IF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
SET(CMAKE_ASM@ASM_DIALECT@_SOURCE_FILE_EXTENSIONS s;S;asm) SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
ENDIF(NOT CMAKE_ASM@ASM_DIALECT@_SOURCE_FILE_EXTENSIONS) ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT) IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>") SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")

@ -35,6 +35,44 @@ IF(NOT _INCLUDED_SYSTEM_INFO_FILE)
ENDIF(NOT _INCLUDED_SYSTEM_INFO_FILE) ENDIF(NOT _INCLUDED_SYSTEM_INFO_FILE)
# The Eclipse generator needs to know the standard include path
# so that Eclipse ca find the headers at runtime and parsing etc. works better
# This is done here by actually running gcc with the options so it prints its
# system include directories, which are parsed then and stored in the cache.
IF("${CMAKE_EXTRA_GENERATOR}" MATCHES "Eclipse")
MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _result)
SET(${_result})
SET(_gccOutput)
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} -v -E -x ${_lang} dummy
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
ERROR_VARIABLE _gccOutput
OUTPUT_QUIET )
FILE(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
IF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list" )
SET(${_result} ${CMAKE_MATCH_1})
STRING(REPLACE "\n" " " ${_result} "${${_result}}")
SEPARATE_ARGUMENTS(${_result})
ENDIF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+) *\n *End of (search) list" )
ENDMACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang)
# Now check for C
IF ("${CMAKE_C_COMPILER_ID}" MATCHES GNU AND NOT CMAKE_ECLIPSE_C_SYSTEM_INCLUDE_DIRS)
_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c _dirs)
SET(CMAKE_ECLIPSE_C_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "C compiler system include directories")
ENDIF ("${CMAKE_C_COMPILER_ID}" MATCHES GNU AND NOT CMAKE_ECLIPSE_C_SYSTEM_INCLUDE_DIRS)
# And now the same for C++
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU AND NOT CMAKE_ECLIPSE_CXX_SYSTEM_INCLUDE_DIRS)
_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c++ _dirs)
SET(CMAKE_ECLIPSE_CXX_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "CXX compiler system include directories")
ENDIF ("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU AND NOT CMAKE_ECLIPSE_CXX_SYSTEM_INCLUDE_DIRS)
ENDIF("${CMAKE_EXTRA_GENERATOR}" MATCHES "Eclipse")
# for most systems a module is the same as a shared library # for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just # so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables # copy the values from the LIBRARY variables

Binary file not shown.

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 46 KiB

@ -778,7 +778,7 @@ cpack_set_if_not_set(CPACK_INSTALL_CMAKE_PROJECTS
cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}") cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}") cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}")
cpack_set_if_not_set(CPACK_NSIS_DISPLAY_NAME "@CPACK_PACKAGE_INSTALL_DIRECTORY@") cpack_set_if_not_set(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
cpack_set_if_not_set(CPACK_OUTPUT_CONFIG_FILE cpack_set_if_not_set(CPACK_OUTPUT_CONFIG_FILE
"${CMAKE_BINARY_DIR}/CPackConfig.cmake") "${CMAKE_BINARY_DIR}/CPackConfig.cmake")

@ -1,6 +1,6 @@
# - Check if the source code provided in the SOURCE argument compiles. # - Check if the C source code provided in the SOURCE argument compiles.
# CHECK_C_SOURCE_COMPILES(SOURCE VAR) # CHECK_C_SOURCE_COMPILES(SOURCE VAR)
# - macro which checks if the source code compiles #
# SOURCE - source code to try to compile # SOURCE - source code to try to compile
# VAR - variable to store whether the source code compiled # VAR - variable to store whether the source code compiled
# #

@ -1,6 +1,6 @@
# - Check if the source code provided in the SOURCE argument compiles and runs. # - Check if the C source code provided in the SOURCE argument compiles and runs.
# CHECK_C_SOURCE_RUNS(SOURCE VAR) # CHECK_C_SOURCE_RUNS(SOURCE VAR)
# - macro which checks if the source code runs #
# SOURCE - source code to try to compile # SOURCE - source code to try to compile
# VAR - variable to store the result, 1 for success, empty for failure # VAR - variable to store the result, 1 for success, empty for failure
# #

@ -1,6 +1,6 @@
# - Check if the source code provided in the SOURCE argument compiles. # - Check if the C++ source code provided in the SOURCE argument compiles.
# CHECK_CXX_SOURCE_COMPILES(SOURCE VAR) # CHECK_CXX_SOURCE_COMPILES(SOURCE VAR)
# - macro which checks if the source code compiles #
# SOURCE - source code to try to compile # SOURCE - source code to try to compile
# VAR - variable to store whether the source code compiled # VAR - variable to store whether the source code compiled
# #

@ -1,6 +1,6 @@
# - Check if the source code provided in the SOURCE argument compiles and runs. # - Check if the C++ source code provided in the SOURCE argument compiles and runs.
# CHECK_CXX_SOURCE_RUNS(SOURCE VAR) # CHECK_CXX_SOURCE_RUNS(SOURCE VAR)
# - macro which checks if the source code compiles #
# SOURCE - source code to try to compile # SOURCE - source code to try to compile
# VAR - variable to store the result, 1 for success, empty for failure # VAR - variable to store the result, 1 for success, empty for failure
# #

@ -68,86 +68,87 @@
# #
# ============================================================================ # ============================================================================
# #
# Variables used by this module, they can change the default behaviour and need to be set # Variables used by this module, they can change the default behaviour and
# before calling find_package: # need to be set before calling find_package:
# #
# Boost_USE_MULTITHREADED Can be set to OFF to use the non-multithreaded # Boost_USE_MULTITHREADED Can be set to OFF to use the non-multithreaded
# boost libraries. If not specified, defaults # boost libraries. If not specified, defaults
# to ON. # to ON.
# #
# Boost_USE_STATIC_LIBS Can be set to ON to force the use of the static # Boost_USE_STATIC_LIBS Can be set to ON to force the use of the static
# boost libraries. Defaults to OFF. # boost libraries. Defaults to OFF.
# #
# Other Variables used by this module which you may want to set. # Other Variables used by this module which you may want to set.
# #
# Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching # Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching
# the boost include directory. Please see # the boost include directory. Please see
# the documentation above regarding this # the documentation above regarding this
# annoying, but necessary variable :( # annoying, but necessary variable :(
# #
# Boost_DEBUG Set this to TRUE to enable debugging output # Boost_DEBUG Set this to TRUE to enable debugging output
# of FindBoost.cmake if you are having problems. # of FindBoost.cmake if you are having problems.
# Please enable this before filing any bug # Please enable this before filing any bug
# reports. # reports.
# #
# Boost_COMPILER Set this to the compiler suffix used by Boost # Boost_COMPILER Set this to the compiler suffix used by Boost
# (e.g. "-gcc43") if FindBoods has problems finding # (e.g. "-gcc43") if FindBoost has problems finding
# the proper Boost installation # the proper Boost installation
# #
# These last three variables are available also as environment variables: # These last three variables are available also as environment variables:
# #
# BOOST_ROOT or BOOSTROOT The preferred installation prefix for searching for # BOOST_ROOT or BOOSTROOT The preferred installation prefix for searching for
# Boost. Set this if the module has problems finding # Boost. Set this if the module has problems finding
# the proper Boost installation. # the proper Boost installation.
# #
# BOOST_INCLUDEDIR Set this to the include directory of Boost, if the # BOOST_INCLUDEDIR Set this to the include directory of Boost, if the
# module has problems finding the proper Boost installation # module has problems finding the proper Boost installation
# #
# BOOST_LIBRARYDIR Set this to the lib directory of Boost, if the # BOOST_LIBRARYDIR Set this to the lib directory of Boost, if the
# module has problems finding the proper Boost installation # module has problems finding the proper Boost installation
# #
# Variables defined by this module: # Variables defined by this module:
# #
# Boost_FOUND System has Boost, this means the include dir was # Boost_FOUND System has Boost, this means the include dir was
# found, as well as all the libraries specified in # found, as well as all the libraries specified in
# the COMPONENTS list. # the COMPONENTS list.
# #
# Boost_INCLUDE_DIRS Boost include directories: not cached # Boost_INCLUDE_DIRS Boost include directories: not cached
# #
# Boost_INCLUDE_DIR This is almost the same as above, but this one is # Boost_INCLUDE_DIR This is almost the same as above, but this one is
# cached and may be modified by advanced users # cached and may be modified by advanced users
# #
# Boost_LIBRARIES Link these to use the Boost libraries that you # Boost_LIBRARIES Link to these to use the Boost libraries that you
# specified: not cached # specified: not cached
# #
# Boost_LIBRARY_DIRS The path to where the Boost library files are. # Boost_LIBRARY_DIRS The path to where the Boost library files are.
# #
# Boost_VERSION The version number of the boost libraries that # Boost_VERSION The version number of the boost libraries that
# have been found, same as in version.hpp from Boost # have been found, same as in version.hpp from Boost
# #
# Boost_LIB_VERSION The version number in filename form as # Boost_LIB_VERSION The version number in filename form as
# it's appended to the library filenames # it's appended to the library filenames
# #
# Boost_MAJOR_VERSION major version number of boost # Boost_MAJOR_VERSION major version number of boost
# Boost_MINOR_VERSION minor version number of boost # Boost_MINOR_VERSION minor version number of boost
# Boost_SUBMINOR_VERSION subminor version number of boost # Boost_SUBMINOR_VERSION subminor version number of boost
# #
# Boost_LIB_DIAGNOSTIC_DEFINITIONS [WIN32 Only] You can call # Boost_LIB_DIAGNOSTIC_DEFINITIONS [WIN32 Only] You can call
# add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINTIIONS}) # add_definitions(${Boost_LIB_DIAGNOSTIC_DEFINTIIONS})
# to have diagnostic information about Boost's # to have diagnostic information about Boost's
# automatic linking outputted during compilation time. # automatic linking outputted during compilation time.
# #
# For each component you list the following variables are set. # For each component you specify in find_package(), the following (UPPER-CASE)
# ATTENTION: The component names need to be in lower case, just as the boost # variables are set. You can use these variables if you would like to pick and
# library names however the CMake variables use upper case for the component # choose components for your targets instead of just using Boost_LIBRARIES.
# part. So you'd get Boost_SERIALIZATION_FOUND for example. #
# Boost_${COMPONENT}_FOUND True IF the Boost library "component" was found.
#
# Boost_${COMPONENT}_LIBRARY Contains the libraries for the specified Boost
# "component" (includes debug and optimized keywords
# when needed).
#
# =====================================================================
# #
# Boost_${COMPONENT}_FOUND True IF the Boost library "component" was found.
# Boost_${COMPONENT}_LIBRARY The absolute path of the Boost library "component".
# Boost_${COMPONENT}_LIBRARY_DEBUG The absolute path of the debug version of the
# Boost library "component".
# Boost_${COMPONENT}_LIBRARY_RELEASE The absolute path of the release version of the
# Boost library "component"
# #
# Copyright (c) 2006-2008 Andreas Schneider <mail@cynapses.org> # Copyright (c) 2006-2008 Andreas Schneider <mail@cynapses.org>
# Copyright (c) 2007 Wengo # Copyright (c) 2007 Wengo
@ -159,48 +160,11 @@
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
# #
IF(NOT DEFINED Boost_USE_MULTITHREADED)
SET(Boost_USE_MULTITHREADED TRUE)
ENDIF()
if(Boost_FIND_VERSION_EXACT)
# The version may appear in a directory with or without the patch
# level, even when the patch level is non-zero.
set(_boost_TEST_VERSIONS
"${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}"
"${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
else(Boost_FIND_VERSION_EXACT)
# The user has not requested an exact version. Among known
# versions, find those that are acceptable to the user request.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
"1.38.0" "1.38" "1.37.0" "1.37"
"1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
"1.34" "1.33.1" "1.33.0" "1.33")
set(_boost_TEST_VERSIONS)
if(Boost_FIND_VERSION)
set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
# Select acceptable versions.
foreach(version ${_Boost_KNOWN_VERSIONS})
if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}")
# This version is high enough.
list(APPEND _boost_TEST_VERSIONS "${version}")
elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99")
# This version is a short-form for the requested version with
# the patch level dropped.
list(APPEND _boost_TEST_VERSIONS "${version}")
endif()
endforeach(version)
else(Boost_FIND_VERSION)
# Any version is acceptable.
set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}")
endif(Boost_FIND_VERSION)
endif(Boost_FIND_VERSION_EXACT)
# The reason that we failed to find Boost. This will be set to a
# user-friendly message when we fail to find some necessary piece of
# Boost.
set(Boost_ERROR_REASON)
#-------------------------------------------------------------------------------
# FindBoost functions & macros
#
############################################ ############################################
# #
# Check the existence of the libraries. # Check the existence of the libraries.
@ -210,6 +174,7 @@ set(Boost_ERROR_REASON)
# with the CMake distribution. This is NOT my work. All work was done by the # with the CMake distribution. This is NOT my work. All work was done by the
# original authors of the FindQt4.cmake file. Only minor modifications were # original authors of the FindQt4.cmake file. Only minor modifications were
# made to remove references to Qt and make this file more generally applicable # made to remove references to Qt and make this file more generally applicable
# And ELSE/ENDIF pairs were removed for readability.
######################################################################### #########################################################################
MACRO (_Boost_ADJUST_LIB_VARS basename) MACRO (_Boost_ADJUST_LIB_VARS basename)
@ -219,27 +184,28 @@ MACRO (_Boost_ADJUST_LIB_VARS basename)
# optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value # optimized and debug libraries, or if the CMAKE_BUILD_TYPE has a value
IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) IF (CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE)
SET(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) SET(Boost_${basename}_LIBRARY optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
ELSE(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) ELSE()
# if there are no configuration types and CMAKE_BUILD_TYPE has no value # if there are no configuration types and CMAKE_BUILD_TYPE has no value
# then just use the release libraries # then just use the release libraries
SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} ) SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE} )
ENDIF(CMAKE_CONFIGURATION_TYPES OR CMAKE_BUILD_TYPE) ENDIF()
# FIXME: This probably should be set for both cases
SET(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG}) SET(Boost_${basename}_LIBRARIES optimized ${Boost_${basename}_LIBRARY_RELEASE} debug ${Boost_${basename}_LIBRARY_DEBUG})
ENDIF (Boost_${basename}_LIBRARY_DEBUG AND Boost_${basename}_LIBRARY_RELEASE) ENDIF()
# if only the release version was found, set the debug variable also to the release version # if only the release version was found, set the debug variable also to the release version
IF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG) IF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG)
SET(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE}) SET(Boost_${basename}_LIBRARY_DEBUG ${Boost_${basename}_LIBRARY_RELEASE})
SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE}) SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_RELEASE})
SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE}) SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_RELEASE})
ENDIF (Boost_${basename}_LIBRARY_RELEASE AND NOT Boost_${basename}_LIBRARY_DEBUG) ENDIF()
# if only the debug version was found, set the release variable also to the debug version # if only the debug version was found, set the release variable also to the debug version
IF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE) IF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE)
SET(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG}) SET(Boost_${basename}_LIBRARY_RELEASE ${Boost_${basename}_LIBRARY_DEBUG})
SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG}) SET(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY_DEBUG})
SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG}) SET(Boost_${basename}_LIBRARIES ${Boost_${basename}_LIBRARY_DEBUG})
ENDIF (Boost_${basename}_LIBRARY_DEBUG AND NOT Boost_${basename}_LIBRARY_RELEASE) ENDIF()
IF (Boost_${basename}_LIBRARY) IF (Boost_${basename}_LIBRARY)
set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY} CACHE FILEPATH "The Boost ${basename} library") set(Boost_${basename}_LIBRARY ${Boost_${basename}_LIBRARY} CACHE FILEPATH "The Boost ${basename} library")
@ -254,7 +220,7 @@ MACRO (_Boost_ADJUST_LIB_VARS basename)
set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory") set(Boost_LIBRARY_DIRS ${Boost_LIBRARY_DIRS} CACHE FILEPATH "Boost library directory")
SET(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found") SET(Boost_${basename}_FOUND ON CACHE INTERNAL "Whether the Boost ${basename} library found")
ENDIF (Boost_${basename}_LIBRARY) ENDIF(Boost_${basename}_LIBRARY)
ENDIF (Boost_INCLUDE_DIR ) ENDIF (Boost_INCLUDE_DIR )
# Make variables changeble to the advanced user # Make variables changeble to the advanced user
@ -265,6 +231,8 @@ MACRO (_Boost_ADJUST_LIB_VARS basename)
) )
ENDMACRO (_Boost_ADJUST_LIB_VARS) ENDMACRO (_Boost_ADJUST_LIB_VARS)
#-------------------------------------------------------------------------------
# #
# Runs compiler with "-dumpversion" and parses major/minor # Runs compiler with "-dumpversion" and parses major/minor
# version with a regex. # version with a regex.
@ -281,12 +249,69 @@ FUNCTION(_Boost_COMPILER_DUMPVERSION _OUTPUT_VERSION)
SET(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE) SET(${_OUTPUT_VERSION} ${_boost_COMPILER_VERSION} PARENT_SCOPE)
ENDFUNCTION() ENDFUNCTION()
#
# End functions/macros
#
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------
IF(NOT DEFINED Boost_USE_MULTITHREADED)
SET(Boost_USE_MULTITHREADED TRUE)
ENDIF()
if(Boost_FIND_VERSION_EXACT)
# The version may appear in a directory with or without the patch
# level, even when the patch level is non-zero.
set(_boost_TEST_VERSIONS
"${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}.${Boost_FIND_VERSION_PATCH}"
"${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
else(Boost_FIND_VERSION_EXACT)
# The user has not requested an exact version. Among known
# versions, find those that are acceptable to the user request.
set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS}
"1.38.0" "1.38" "1.37.0" "1.37"
"1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0"
"1.34" "1.33.1" "1.33.0" "1.33")
set(_boost_TEST_VERSIONS)
if(Boost_FIND_VERSION)
set(_Boost_FIND_VERSION_SHORT "${Boost_FIND_VERSION_MAJOR}.${Boost_FIND_VERSION_MINOR}")
# Select acceptable versions.
foreach(version ${_Boost_KNOWN_VERSIONS})
if(NOT "${version}" VERSION_LESS "${Boost_FIND_VERSION}")
# This version is high enough.
list(APPEND _boost_TEST_VERSIONS "${version}")
elseif("${version}.99" VERSION_EQUAL "${_Boost_FIND_VERSION_SHORT}.99")
# This version is a short-form for the requested version with
# the patch level dropped.
list(APPEND _boost_TEST_VERSIONS "${version}")
endif()
endforeach(version)
else(Boost_FIND_VERSION)
# Any version is acceptable.
set(_boost_TEST_VERSIONS "${_Boost_KNOWN_VERSIONS}")
endif(Boost_FIND_VERSION)
endif(Boost_FIND_VERSION_EXACT)
# The reason that we failed to find Boost. This will be set to a
# user-friendly message when we fail to find some necessary piece of
# Boost.
set(Boost_ERROR_REASON)
SET( _boost_IN_CACHE TRUE) SET( _boost_IN_CACHE TRUE)
IF(Boost_INCLUDE_DIR) IF(Boost_INCLUDE_DIR)
# On versions < 1.35, remove the System library from the considered list
# since it wasn't added until 1.35.
if(Boost_VERSION AND Boost_FIND_COMPONENTS)
math(EXPR _boost_maj "${Boost_VERSION} / 100000")
math(EXPR _boost_min "${Boost_VERSION} / 100 % 1000")
if(${_boost_maj}.${_boost_min} VERSION_LESS 1.35)
list(REMOVE_ITEM Boost_FIND_COMPONENTS system)
endif()
endif()
FOREACH(COMPONENT ${Boost_FIND_COMPONENTS}) FOREACH(COMPONENT ${Boost_FIND_COMPONENTS})
STRING(TOUPPER ${COMPONENT} COMPONENT) STRING(TOUPPER ${COMPONENT} COMPONENT)
IF(NOT Boost_${COMPONENT}_FOUND) IF(NOT Boost_${COMPONENT}_FOUND)
@ -503,7 +528,7 @@ ELSE (_boost_IN_CACHE)
# Setting some more suffixes for the library # Setting some more suffixes for the library
SET (Boost_LIB_PREFIX "") SET (Boost_LIB_PREFIX "")
if ( MSVC AND Boost_USE_STATIC_LIBS ) if ( WIN32 AND Boost_USE_STATIC_LIBS )
SET (Boost_LIB_PREFIX "lib") SET (Boost_LIB_PREFIX "lib")
endif() endif()

@ -3,10 +3,20 @@
# The most important issue is that the Qt4 qmake is available via the system path. # The most important issue is that the Qt4 qmake is available via the system path.
# This qmake is then used to detect basically everything else. # This qmake is then used to detect basically everything else.
# This module defines a number of key variables and macros. # This module defines a number of key variables and macros.
# First is QT_USE_FILE which is the path to a CMake file that can be included # The variable QT_USE_FILE is set which is the path to a CMake file that can be included
# to compile Qt 4 applications and libraries. By default, the QtCore and QtGui # to compile Qt 4 applications and libraries. It sets up the compilation
# libraries are loaded. This behavior can be changed by setting one or more # environment for include directories, preprocessor defines and populates a
# of the following variables to true before doing INCLUDE(${QT_USE_FILE}): # QT_LIBRARIES variable.
#
# Typical usage could be something like:
# find_package(Qt4 4.4.3 COMPONENTS QtCore QtGui QtXml REQUIRED )
# include(${QT_USE_FILE})
# add_executable(myexe main.cpp)
# target_link_libraries(myexe ${QT_LIBRARIES})
#
# When using the components argument, QT_USE_QT* variables are automatically set
# for the QT_USE_FILE to pick up. If one wishes to manually set them, the
# available ones to set include:
# QT_DONT_USE_QTCORE # QT_DONT_USE_QTCORE
# QT_DONT_USE_QTGUI # QT_DONT_USE_QTGUI
# QT_USE_QT3SUPPORT # QT_USE_QT3SUPPORT
@ -32,19 +42,6 @@
# QT_USE_QTXMLPATTERNS # QT_USE_QTXMLPATTERNS
# QT_USE_PHONON # QT_USE_PHONON
# #
# The file pointed to by QT_USE_FILE will set up your compile environment
# by adding include directories, preprocessor defines, and populate a
# QT_LIBRARIES variable containing all the Qt libraries and their dependencies.
# Add the QT_LIBRARIES variable to your TARGET_LINK_LIBRARIES.
#
# Typical usage could be something like:
# FIND_PACKAGE(Qt4)
# SET(QT_USE_QTXML 1)
# INCLUDE(${QT_USE_FILE})
# ADD_EXECUTABLE(myexe main.cpp)
# TARGET_LINK_LIBRARIES(myexe ${QT_LIBRARIES})
#
#
# There are also some files that need processing by some Qt tools such as moc # There are also some files that need processing by some Qt tools such as moc
# and uic. Listed below are macros that may be used to process those files. # and uic. Listed below are macros that may be used to process those files.
# #
@ -128,6 +125,7 @@
# must exists and are not updated in any way. # must exists and are not updated in any way.
# #
# #
# Below is a detailed list of variables that FindQt4.cmake sets.
# QT_FOUND If false, don't try to use Qt. # QT_FOUND If false, don't try to use Qt.
# QT4_FOUND If false, don't try to use Qt 4. # QT4_FOUND If false, don't try to use Qt 4.
# #
@ -267,6 +265,25 @@
# (They make no sense in Qt4) # (They make no sense in Qt4)
# QT_QT_LIBRARY Qt-Library is now split # QT_QT_LIBRARY Qt-Library is now split
# Use FIND_PACKAGE( Qt4 COMPONENTS ... ) to enable modules
IF( Qt4_FIND_COMPONENTS )
FOREACH( component ${Qt4_FIND_COMPONENTS} )
STRING( TOUPPER ${component} _COMPONENT )
SET( QT_USE_${_COMPONENT} 1 )
ENDFOREACH( component )
# To make sure we don't use QtCore or QtGui when not in COMPONENTS
IF(NOT QT_USE_QTCORE)
SET( QT_DONT_USE_QTCORE 1 )
ENDIF(NOT QT_USE_QTCORE)
IF(NOT QT_USE_QTGUI)
SET( QT_DONT_USE_QTGUI 1 )
ENDIF(NOT QT_USE_QTGUI)
ENDIF( Qt4_FIND_COMPONENTS )
# If Qt3 has already been found, fail. # If Qt3 has already been found, fail.
IF(QT_QT_LIBRARY) IF(QT_QT_LIBRARY)
IF(Qt4_FIND_REQUIRED) IF(Qt4_FIND_REQUIRED)
@ -372,6 +389,18 @@ IF (QT_QMAKE_EXECUTABLE)
STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" req_qt_minor_vers "${QT_MIN_VERSION}") STRING(REGEX REPLACE "^[0-9]+\\.([0-9])+\\.[0-9]+" "\\1" req_qt_minor_vers "${QT_MIN_VERSION}")
STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_qt_patch_vers "${QT_MIN_VERSION}") STRING(REGEX REPLACE "^[0-9]+\\.[0-9]+\\.([0-9]+)" "\\1" req_qt_patch_vers "${QT_MIN_VERSION}")
# Suppport finding at least a particular version, for instance FIND_PACKAGE( Qt4 4.4.3 )
# This implementation is a hack to avoid duplicating code and make sure we stay
# source-compatible with CMake 2.6.x
# For CMake 2.8, we should not set QT_MIN_VERSION but only use Qt4_FIND_VERSION_MAJOR,
# Qt4_FIND_VERSION_MINOR, etc
IF( Qt4_FIND_VERSION )
SET( QT_MIN_VERSION ${Qt4_FIND_VERSION} )
SET( req_qt_major_vers ${Qt4_FIND_VERSION_MAJOR} )
SET( req_qt_minor_vers ${Qt4_FIND_VERSION_MINOR} )
SET( req_qt_patch_vers ${Qt4_FIND_VERSION_PATCH} )
ENDIF( Qt4_FIND_VERSION )
IF (NOT req_qt_major_vers EQUAL 4) IF (NOT req_qt_major_vers EQUAL 4)
MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", major version 4 is required, e.g. \"4.0.1\"") MESSAGE( FATAL_ERROR "Invalid Qt version string given: \"${QT_MIN_VERSION}\", major version 4 is required, e.g. \"4.0.1\"")
ENDIF (NOT req_qt_major_vers EQUAL 4) ENDIF (NOT req_qt_major_vers EQUAL 4)
@ -385,12 +414,27 @@ IF (QT_QMAKE_EXECUTABLE)
MATH(EXPR req_vers "${req_qt_major_vers}*10000 + ${req_qt_minor_vers}*100 + ${req_qt_patch_vers}") MATH(EXPR req_vers "${req_qt_major_vers}*10000 + ${req_qt_minor_vers}*100 + ${req_qt_patch_vers}")
MATH(EXPR found_vers "${QT_VERSION_MAJOR}*10000 + ${QT_VERSION_MINOR}*100 + ${QT_VERSION_PATCH}") MATH(EXPR found_vers "${QT_VERSION_MAJOR}*10000 + ${QT_VERSION_MINOR}*100 + ${QT_VERSION_PATCH}")
# Support finding *exactly* a particular version, for instance FIND_PACKAGE( Qt4 4.4.3 EXACT )
# The 'else' branch should be removed for CMake 2.8
IF( Qt4_FIND_VERSION_EXACT )
IF(found_vers EQUAL req_vers)
SET( QT4_QMAKE_FOUND TRUE )
ELSE(found_vers EQUAL req_vers)
SET( QT4_QMAKE_FOUND FALSE )
IF (found_vers LESS req_vers)
SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE)
ELSE (found_vers LESS req_vers)
SET(QT4_INSTALLED_VERSION_TOO_NEW TRUE)
ENDIF (found_vers LESS req_vers)
ENDIF(found_vers EQUAL req_vers)
ELSE( Qt4_FIND_VERSION_EXACT )
IF (found_vers LESS req_vers) IF (found_vers LESS req_vers)
SET(QT4_QMAKE_FOUND FALSE) SET(QT4_QMAKE_FOUND FALSE)
SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE) SET(QT4_INSTALLED_VERSION_TOO_OLD TRUE)
ELSE (found_vers LESS req_vers) ELSE (found_vers LESS req_vers)
SET(QT4_QMAKE_FOUND TRUE) SET(QT4_QMAKE_FOUND TRUE)
ENDIF (found_vers LESS req_vers) ENDIF (found_vers LESS req_vers)
ENDIF( Qt4_FIND_VERSION_EXACT )
ENDIF (qt_version_tmp) ENDIF (qt_version_tmp)
ENDIF (QT_QMAKE_EXECUTABLE) ENDIF (QT_QMAKE_EXECUTABLE)
@ -526,6 +570,10 @@ IF (QT4_QMAKE_FOUND)
SET(QT_QAXSERVER_INCLUDE_DIR NOTFOUND) SET(QT_QAXSERVER_INCLUDE_DIR NOTFOUND)
SET(QT_QAXSERVER_LIBRARY_RELEASE NOTFOUND) SET(QT_QAXSERVER_LIBRARY_RELEASE NOTFOUND)
SET(QT_QAXSERVER_LIBRARY_DEBUG NOTFOUND) SET(QT_QAXSERVER_LIBRARY_DEBUG NOTFOUND)
IF(WIN32)
SET(QT_QTMAIN_LIBRARY_DEBUG NOTFOUND)
SET(QT_QTMAIN_LIBRARY_RELEASE NOTFOUND)
ENDIF(WIN32)
ENDIF(QT_QMAKE_CHANGED) ENDIF(QT_QMAKE_CHANGED)
FOREACH(QT_MODULE ${QT_MODULES}) FOREACH(QT_MODULE ${QT_MODULES})
@ -621,6 +669,9 @@ IF (QT4_QMAKE_FOUND)
CHECK_SYMBOL_EXISTS(Q_WS_QWS "QtCore/qglobal.h" Q_WS_QWS) CHECK_SYMBOL_EXISTS(Q_WS_QWS "QtCore/qglobal.h" Q_WS_QWS)
CHECK_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC) CHECK_SYMBOL_EXISTS(Q_WS_MAC "QtCore/qglobal.h" Q_WS_MAC)
IF(Q_WS_MAC) IF(Q_WS_MAC)
IF(QT_QMAKE_CHANGED)
UNSET(QT_MAC_USE_COCOA CACHE)
ENDIF(QT_QMAKE_CHANGED)
CHECK_SYMBOL_EXISTS(QT_MAC_USE_COCOA "QtCore/qconfig.h" QT_MAC_USE_COCOA) CHECK_SYMBOL_EXISTS(QT_MAC_USE_COCOA "QtCore/qconfig.h" QT_MAC_USE_COCOA)
ENDIF(Q_WS_MAC) ENDIF(Q_WS_MAC)
@ -735,9 +786,9 @@ IF (QT4_QMAKE_FOUND)
ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE) ENDIF (QT_${basename}_LIBRARY_DEBUG AND QT_${basename}_LIBRARY_RELEASE)
IF(QT_QMAKE_CHANGED) IF(QT_QMAKE_CHANGED)
SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE FILEPATH "The Qt ${basename} library" FORCE) SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library" FORCE)
ELSE(QT_QMAKE_CHANGED) ELSE(QT_QMAKE_CHANGED)
SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE FILEPATH "The Qt ${basename} library") SET(QT_${basename}_LIBRARY ${QT_${basename}_LIBRARY} CACHE STRING "The Qt ${basename} library")
ENDIF(QT_QMAKE_CHANGED) ENDIF(QT_QMAKE_CHANGED)
IF (QT_${basename}_LIBRARY) IF (QT_${basename}_LIBRARY)
@ -798,30 +849,9 @@ IF (QT4_QMAKE_FOUND)
####################################### #######################################
# find moc and uic using qmake
QT_QUERY_QMAKE(QT_MOC_EXECUTABLE_INTERNAL "QMAKE_MOC")
QT_QUERY_QMAKE(QT_UIC_EXECUTABLE_INTERNAL "QMAKE_UIC")
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH
"${QT_MOC_EXECUTABLE_INTERNAL}" QT_MOC_EXECUTABLE_INTERNAL)
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH
"${QT_UIC_EXECUTABLE_INTERNAL}" QT_UIC_EXECUTABLE_INTERNAL)
IF(QT_QMAKE_CHANGED)
SET(QT_MOC_EXECUTABLE
${QT_MOC_EXECUTABLE_INTERNAL} CACHE FILEPATH "The moc executable" FORCE)
SET(QT_UIC_EXECUTABLE
${QT_UIC_EXECUTABLE_INTERNAL} CACHE FILEPATH "The uic executable" FORCE)
ELSE(QT_QMAKE_CHANGED)
SET(QT_MOC_EXECUTABLE
${QT_MOC_EXECUTABLE_INTERNAL} CACHE FILEPATH "The moc executable")
SET(QT_UIC_EXECUTABLE
${QT_UIC_EXECUTABLE_INTERNAL} CACHE FILEPATH "The uic executable")
ENDIF(QT_QMAKE_CHANGED)
IF(QT_QMAKE_CHANGED) IF(QT_QMAKE_CHANGED)
SET(QT_UIC_EXECUTABLE NOTFOUND)
SET(QT_MOC_EXECUTABLE NOTFOUND)
SET(QT_UIC3_EXECUTABLE NOTFOUND) SET(QT_UIC3_EXECUTABLE NOTFOUND)
SET(QT_RCC_EXECUTABLE NOTFOUND) SET(QT_RCC_EXECUTABLE NOTFOUND)
SET(QT_DBUSCPP2XML_EXECUTABLE NOTFOUND) SET(QT_DBUSCPP2XML_EXECUTABLE NOTFOUND)
@ -829,6 +859,18 @@ IF (QT4_QMAKE_FOUND)
SET(QT_LUPDATE_EXECUTABLE NOTFOUND) SET(QT_LUPDATE_EXECUTABLE NOTFOUND)
SET(QT_LRELEASE_EXECUTABLE NOTFOUND) SET(QT_LRELEASE_EXECUTABLE NOTFOUND)
ENDIF(QT_QMAKE_CHANGED) ENDIF(QT_QMAKE_CHANGED)
FIND_PROGRAM(QT_MOC_EXECUTABLE
NAMES moc-qt4 moc
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
FIND_PROGRAM(QT_UIC_EXECUTABLE
NAMES uic-qt4 uic
PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH
)
FIND_PROGRAM(QT_UIC3_EXECUTABLE FIND_PROGRAM(QT_UIC3_EXECUTABLE
NAMES uic3 NAMES uic3
@ -855,13 +897,13 @@ IF (QT4_QMAKE_FOUND)
) )
FIND_PROGRAM(QT_LUPDATE_EXECUTABLE FIND_PROGRAM(QT_LUPDATE_EXECUTABLE
NAMES lupdate NAMES lupdate-qt4 lupdate
PATHS ${QT_BINARY_DIR} PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH NO_DEFAULT_PATH
) )
FIND_PROGRAM(QT_LRELEASE_EXECUTABLE FIND_PROGRAM(QT_LRELEASE_EXECUTABLE
NAMES lrelease NAMES lrelease-qt4 lrelease
PATHS ${QT_BINARY_DIR} PATHS ${QT_BINARY_DIR}
NO_DEFAULT_PATH NO_DEFAULT_PATH
) )
@ -1221,7 +1263,13 @@ IF (QT4_QMAKE_FOUND)
FOREACH (_current_FILE ${ARGN}) FOREACH (_current_FILE ${ARGN})
GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE) GET_FILENAME_COMPONENT(_abs_FILE ${_current_FILE} ABSOLUTE)
GET_FILENAME_COMPONENT(qm ${_abs_FILE} NAME_WE) GET_FILENAME_COMPONENT(qm ${_abs_FILE} NAME_WE)
SET(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm") GET_SOURCE_FILE_PROPERTY(output_location ${_abs_FILE} OUTPUT_LOCATION)
IF(output_location)
FILE(MAKE_DIRECTORY "${output_location}")
SET(qm "${output_location}/${qm}.qm")
ELSE(output_location)
SET(qm "${CMAKE_CURRENT_BINARY_DIR}/${qm}.qm")
ENDIF(output_location)
ADD_CUSTOM_COMMAND(OUTPUT ${qm} ADD_CUSTOM_COMMAND(OUTPUT ${qm}
COMMAND ${QT_LRELEASE_EXECUTABLE} COMMAND ${QT_LRELEASE_EXECUTABLE}
@ -1559,11 +1607,23 @@ IF (QT4_QMAKE_FOUND)
ELSE(QT4_QMAKE_FOUND) ELSE(QT4_QMAKE_FOUND)
SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE) SET(QT_QMAKE_EXECUTABLE "${QT_QMAKE_EXECUTABLE}-NOTFOUND" CACHE FILEPATH "Invalid qmake found" FORCE)
# The code below is overly complex to make sure we do not break compatibility with CMake 2.6.x
# For CMake 2.8, it should be simplified by getting rid of QT4_INSTALLED_VERSION_TOO_OLD and
# QT4_INSTALLED_VERSION_TOO_NEW
IF(Qt4_FIND_REQUIRED) IF(Qt4_FIND_REQUIRED)
IF(QT4_INSTALLED_VERSION_TOO_OLD) IF(QT4_INSTALLED_VERSION_TOO_OLD)
MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required") IF( Qt4_FIND_VERSION_EXACT )
MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too old, version ${QT_MIN_VERSION} is required")
ELSE( Qt4_FIND_VERSION_EXACT )
MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too old, at least version ${QT_MIN_VERSION} is required")
ENDIF( Qt4_FIND_VERSION_EXACT )
ELSE(QT4_INSTALLED_VERSION_TOO_OLD) ELSE(QT4_INSTALLED_VERSION_TOO_OLD)
MESSAGE( FATAL_ERROR "Qt qmake not found!") IF( Qt4_FIND_VERSION_EXACT AND QT4_INSTALLED_VERSION_TOO_NEW )
MESSAGE(FATAL_ERROR "The installed Qt version ${QTVERSION} is too new, version ${QT_MIN_VERSION} is required")
ELSE( Qt4_FIND_VERSION_EXACT AND QT4_INSTALLED_VERSION_TOO_NEW )
MESSAGE( FATAL_ERROR "Qt qmake not found!")
ENDIF( Qt4_FIND_VERSION_EXACT AND QT4_INSTALLED_VERSION_TOO_NEW )
ENDIF(QT4_INSTALLED_VERSION_TOO_OLD) ENDIF(QT4_INSTALLED_VERSION_TOO_OLD)
ELSE(Qt4_FIND_REQUIRED) ELSE(Qt4_FIND_REQUIRED)
IF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY) IF(QT4_INSTALLED_VERSION_TOO_OLD AND NOT Qt4_FIND_QUIETLY)

@ -103,7 +103,6 @@ SET(CMAKE_Fortran_CREATE_SHARED_MODULE
# We can use $ENV{INTEL_LICENSE_FILE} to try and get at the installation location for ICC. # We can use $ENV{INTEL_LICENSE_FILE} to try and get at the installation location for ICC.
# We also need to consider to use cce (which is the 64bit compiler) and not JUST the 32bit compiler. # We also need to consider to use cce (which is the 64bit compiler) and not JUST the 32bit compiler.
# I have no idea what the best way to do that would be. # I have no idea what the best way to do that would be.
SET(CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES /usr/local/include )
# default to searching for frameworks first # default to searching for frameworks first

@ -140,7 +140,6 @@ SET(CMAKE_CXX_CREATE_MACOSX_FRAMEWORK
SET(CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES /usr/local/include)
# default to searching for frameworks first # default to searching for frameworks first
SET(CMAKE_FIND_FRAMEWORK FIRST) SET(CMAKE_FIND_FRAMEWORK FIRST)
# set up the default search directories for frameworks # set up the default search directories for frameworks

@ -53,5 +53,12 @@ LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES
/lib /usr/lib /usr/lib32 /usr/lib64 /lib /usr/lib /usr/lib32 /usr/lib64
) )
LIST(APPEND CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES
/usr/include
)
LIST(APPEND CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES
/usr/include
)
# Enable use of lib64 search path variants by default. # Enable use of lib64 search path variants by default.
SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE) SET_PROPERTY(GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS TRUE)

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmCTestSubmitCommand.cxx,v $ Module: $RCSfile: cmCTestSubmitCommand.cxx,v $
Language: C++ Language: C++
Date: $Date: 2006-03-29 17:33:41 $ Date: $Date: 2009-03-31 14:29:12 $
Version: $Revision: 1.13 $ Version: $Revision: 1.13.12.1 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -29,31 +29,66 @@ cmCTestGenericHandler* cmCTestSubmitCommand::InitializeHandler()
= this->Makefile->GetDefinition("CTEST_DROP_LOCATION"); = this->Makefile->GetDefinition("CTEST_DROP_LOCATION");
const char* ctestTriggerSite const char* ctestTriggerSite
= this->Makefile->GetDefinition("CTEST_TRIGGER_SITE"); = this->Makefile->GetDefinition("CTEST_TRIGGER_SITE");
bool ctestDropSiteCDash
= this->Makefile->IsOn("CTEST_DROP_SITE_CDASH");
if ( !ctestDropMethod ) if ( !ctestDropMethod )
{ {
ctestDropMethod = "http"; ctestDropMethod = "http";
} }
if ( !ctestDropSite )
{ if ( ctestDropSiteCDash )
ctestDropSite = "public.kitware.com";
}
if ( !ctestDropLocation )
{ {
ctestDropLocation = "/cgi-bin/HTTPUploadDartFile.cgi"; // drop site is a CDash server...
//
if ( !ctestDropSite )
{
// error: CDash requires CTEST_DROP_SITE definition
// in CTestConfig.cmake
}
if ( !ctestDropLocation )
{
// error: CDash requires CTEST_DROP_LOCATION definition
// in CTestConfig.cmake
}
} }
if ( !ctestTriggerSite ) else
{ {
ctestTriggerSite // drop site is a *NOT* a CDash server...
= "http://public.kitware.com/cgi-bin/Submit-Random-TestingResults.cgi"; //
cmCTestLog(this->CTest, HANDLER_OUTPUT, "* Use default trigger site: " // Keep all this code in case anybody out there is still
<< ctestTriggerSite << std::endl;); // using newer CMake with non-CDash servers
//
if ( !ctestDropSite )
{
ctestDropSite = "public.kitware.com";
}
if ( !ctestDropLocation )
{
ctestDropLocation = "/cgi-bin/HTTPUploadDartFile.cgi";
}
if ( !ctestTriggerSite )
{
ctestTriggerSite
= "http://public.kitware.com/cgi-bin/Submit-Random-TestingResults.cgi";
cmCTestLog(this->CTest, HANDLER_OUTPUT, "* Use default trigger site: "
<< ctestTriggerSite << std::endl;);
}
} }
this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod); this->CTest->SetCTestConfiguration("DropMethod", ctestDropMethod);
this->CTest->SetCTestConfiguration("DropSite", ctestDropSite); this->CTest->SetCTestConfiguration("DropSite", ctestDropSite);
this->CTest->SetCTestConfiguration("DropLocation", ctestDropLocation); this->CTest->SetCTestConfiguration("DropLocation", ctestDropLocation);
this->CTest->SetCTestConfiguration("TriggerSite", ctestTriggerSite);
this->CTest->SetCTestConfiguration("IsCDash",
ctestDropSiteCDash ? "TRUE" : "FALSE");
// Only propagate TriggerSite for non-CDash projects:
//
if ( !ctestDropSiteCDash )
{
this->CTest->SetCTestConfiguration("TriggerSite", ctestTriggerSite);
}
this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile, this->CTest->SetCTestConfigurationFromCMakeVariable(this->Makefile,
"DropSiteUser", "CTEST_DROP_SITE_USER"); "DropSiteUser", "CTEST_DROP_SITE_USER");

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmCTestUpdateHandler.cxx,v $ Module: $RCSfile: cmCTestUpdateHandler.cxx,v $
Language: C++ Language: C++
Date: $Date: 2009-01-13 18:03:54 $ Date: $Date: 2009-03-23 17:58:49 $
Version: $Revision: 1.41.2.2 $ Version: $Revision: 1.41.2.3 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -693,7 +693,7 @@ int cmCTestUpdateHandler::ProcessHandler()
cmCTestUpdateHandler::AuthorsToUpdatesMap authors_files_map; cmCTestUpdateHandler::AuthorsToUpdatesMap authors_files_map;
int numUpdated = 0; int numUpdated = 0;
int numModiefied = 0; int numModified = 0;
int numConflicting = 0; int numConflicting = 0;
// In subversion, get the latest revision // In subversion, get the latest revision
if ( updateType == cmCTestUpdateHandler::e_SVN ) if ( updateType == cmCTestUpdateHandler::e_SVN )
@ -750,7 +750,7 @@ int cmCTestUpdateHandler::ProcessHandler()
std::string upChar = file_update_line.match(1); std::string upChar = file_update_line.match(1);
std::string upFile = file_update_line.match(2); std::string upFile = file_update_line.match(2);
char mod = upChar[0]; char mod = upChar[0];
bool modifiedOrConflict = false; bool notLocallyModified = false;
if ( mod == 'X' || mod == 'L') if ( mod == 'X' || mod == 'L')
{ {
continue; continue;
@ -758,14 +758,14 @@ int cmCTestUpdateHandler::ProcessHandler()
if ( mod != 'M' && mod != 'C' && mod != 'G' ) if ( mod != 'M' && mod != 'C' && mod != 'G' )
{ {
count ++; count ++;
modifiedOrConflict = true; notLocallyModified = true;
} }
const char* file = upFile.c_str(); const char* file = upFile.c_str();
cmCTestLog(this->CTest, DEBUG, "Line" << cc << ": " << mod << " - " cmCTestLog(this->CTest, DEBUG, "Line" << cc << ": " << mod << " - "
<< file << std::endl); << file << std::endl);
std::string output; std::string output;
if ( modifiedOrConflict ) if ( notLocallyModified )
{ {
std::string logcommand; std::string logcommand;
switch ( updateType ) switch ( updateType )
@ -806,6 +806,10 @@ int cmCTestUpdateHandler::ProcessHandler()
ofs << output << std::endl; ofs << output << std::endl;
} }
} }
else
{
res = false;
}
if ( res ) if ( res )
{ {
cmCTestLog(this->CTest, DEBUG, output << std::endl); cmCTestLog(this->CTest, DEBUG, output << std::endl);
@ -993,7 +997,7 @@ int cmCTestUpdateHandler::ProcessHandler()
} }
else if ( mod == 'M' ) else if ( mod == 'M' )
{ {
numModiefied ++; numModified ++;
os << "\t<Modified>" << std::endl; os << "\t<Modified>" << std::endl;
} }
else else
@ -1089,9 +1093,9 @@ int cmCTestUpdateHandler::ProcessHandler()
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Found " << numUpdated cmCTestLog(this->CTest, HANDLER_OUTPUT, " Found " << numUpdated
<< " updated files" << std::endl); << " updated files" << std::endl);
} }
if ( numModiefied ) if ( numModified )
{ {
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Found " << numModiefied cmCTestLog(this->CTest, HANDLER_OUTPUT, " Found " << numModified
<< " locally modified files" << " locally modified files"
<< std::endl); << std::endl);
} }
@ -1101,7 +1105,7 @@ int cmCTestUpdateHandler::ProcessHandler()
<< " conflicting files" << " conflicting files"
<< std::endl); << std::endl);
} }
if ( numModiefied == 0 && numConflicting == 0 && numUpdated == 0 ) if ( numModified == 0 && numConflicting == 0 && numUpdated == 0 )
{ {
cmCTestLog(this->CTest, HANDLER_OUTPUT, " Project is up-to-date" cmCTestLog(this->CTest, HANDLER_OUTPUT, " Project is up-to-date"
<< std::endl); << std::endl);
@ -1136,7 +1140,7 @@ int cmCTestUpdateHandler::ProcessHandler()
static_cast<int>((cmSystemTools::GetTime() - elapsed_time_start)/6)/10.0 static_cast<int>((cmSystemTools::GetTime() - elapsed_time_start)/6)/10.0
<< "</ElapsedMinutes>\n" << "</ElapsedMinutes>\n"
<< "\t<UpdateReturnStatus>"; << "\t<UpdateReturnStatus>";
if ( numModiefied > 0 || numConflicting > 0 ) if ( numModified > 0 || numConflicting > 0 )
{ {
os << "Update error: There are modified or conflicting files in the " os << "Update error: There are modified or conflicting files in the "
"repository"; "repository";

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: CMakeSetupDialog.cxx,v $ Module: $RCSfile: CMakeSetupDialog.cxx,v $
Language: C++ Language: C++
Date: $Date: 2008-12-31 15:14:30 $ Date: $Date: 2009-03-31 14:29:15 $
Version: $Revision: 1.40.2.8 $ Version: $Revision: 1.40.2.9 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -32,7 +32,7 @@
#include <QUrl> #include <QUrl>
#include <QShortcut> #include <QShortcut>
#include <QMacInstallDialog.h> #include <QMacInstallDialog.h>
#include "cmVersion.h"
#include "QCMake.h" #include "QCMake.h"
#include "QCMakeCacheView.h" #include "QCMakeCacheView.h"
#include "AddCacheEntry.h" #include "AddCacheEntry.h"
@ -673,7 +673,12 @@ void CMakeSetupDialog::doDeleteCache()
void CMakeSetupDialog::doAbout() void CMakeSetupDialog::doAbout()
{ {
QString msg = "CMake\nwww.cmake.org"; QString msg = "CMake %1\n"
"Using Qt %2\n"
"www.cmake.org";
msg = msg.arg(cmVersion::GetCMakeVersion().c_str());
msg = msg.arg(qVersion());
QDialog dialog; QDialog dialog;
dialog.setWindowTitle(tr("About")); dialog.setWindowTitle(tr("About"));

@ -51,9 +51,7 @@
<item row="1" column="1" > <item row="1" column="1" >
<widget class="QComboBox" name="BinaryDirectory" > <widget class="QComboBox" name="BinaryDirectory" >
<property name="sizePolicy" > <property name="sizePolicy" >
<sizepolicy> <sizepolicy vsizetype="Fixed" hsizetype="Ignored" >
<hsizetype>7</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: QCMakeCacheView.cxx,v $ Module: $RCSfile: QCMakeCacheView.cxx,v $
Language: C++ Language: C++
Date: $Date: 2008-07-13 21:55:25 $ Date: $Date: 2009-03-31 14:29:18 $
Version: $Revision: 1.26.2.4 $ Version: $Revision: 1.26.2.5 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -517,6 +517,7 @@ Qt::ItemFlags QCMakeCacheModel::flags (const QModelIndex& idx) const
if(!this->EditEnabled) if(!this->EditEnabled)
{ {
f &= ~Qt::ItemIsEditable; f &= ~Qt::ItemIsEditable;
return f;
} }
if(QCMakeProperty::BOOL == this->data(idx, TypeRole).toInt()) if(QCMakeProperty::BOOL == this->data(idx, TypeRole).toInt())
{ {

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmAddCustomCommandCommand.h,v $ Module: $RCSfile: cmAddCustomCommandCommand.h,v $
Language: C++ Language: C++
Date: $Date: 2008-06-13 12:55:17 $ Date: $Date: 2009-04-07 19:32:07 $
Version: $Revision: 1.33.2.2 $ Version: $Revision: 1.33.2.4 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -75,9 +75,10 @@ public:
" [IMPLICIT_DEPENDS <lang1> depend1 ...]\n" " [IMPLICIT_DEPENDS <lang1> depend1 ...]\n"
" [WORKING_DIRECTORY dir]\n" " [WORKING_DIRECTORY dir]\n"
" [COMMENT comment] [VERBATIM] [APPEND])\n" " [COMMENT comment] [VERBATIM] [APPEND])\n"
"This defines a new command that can be executed during the build " "This defines a command to generate specified OUTPUT file(s). "
"process. The outputs named should be listed as source files in the " "A target created in the same directory (CMakeLists.txt file) that "
"target for which they are to be generated. " "specifies any output of the custom command as a source file is given "
"a rule to generate the file using the command at build time. "
"If an output name is a relative path it will be interpreted " "If an output name is a relative path it will be interpreted "
"relative to the build tree directory corresponding to the current " "relative to the build tree directory corresponding to the current "
"source directory. " "source directory. "
@ -122,14 +123,15 @@ public:
"options are currently ignored when APPEND is given, " "options are currently ignored when APPEND is given, "
"but may be used in the future." "but may be used in the future."
"\n" "\n"
"If VERBATIM is given then all the arguments to the commands will be " "If VERBATIM is given then all arguments to the commands will be "
"passed exactly as specified no matter the build tool used. " "escaped properly for the build tool so that the invoked command "
"receives each argument unchanged. "
"Note that one level of escapes is still used by the CMake language " "Note that one level of escapes is still used by the CMake language "
"processor before ADD_CUSTOM_TARGET even sees the arguments. " "processor before add_custom_command even sees the arguments. "
"Use of VERBATIM is recommended as it enables correct behavior. " "Use of VERBATIM is recommended as it enables correct behavior. "
"When VERBATIM is not given the behavior is platform specific. " "When VERBATIM is not given the behavior is platform specific because "
"In the future VERBATIM may be enabled by default. The only reason " "there is no protection of tool-specific special characters."
"it is an option is to preserve compatibility with older CMake code.\n" "\n"
"If the output of the custom command is not actually " "If the output of the custom command is not actually "
"created as a file on disk it should be marked as SYMBOLIC with " "created as a file on disk it should be marked as SYMBOLIC with "
"SET_SOURCE_FILES_PROPERTIES.\n" "SET_SOURCE_FILES_PROPERTIES.\n"
@ -151,6 +153,10 @@ public:
"this does NOT add a file-level dependency that would cause the " "this does NOT add a file-level dependency that would cause the "
"custom command to re-run whenever the executable is recompiled.\n" "custom command to re-run whenever the executable is recompiled.\n"
"The DEPENDS option specifies files on which the command depends. "
"If any dependency is an OUTPUT of another custom command in the "
"same directory (CMakeLists.txt file) CMake automatically brings the "
"other custom command into the target in which this command is built. "
"If DEPENDS specifies any target (created by an ADD_* command) " "If DEPENDS specifies any target (created by an ADD_* command) "
"a target-level dependency is created to make sure the target is " "a target-level dependency is created to make sure the target is "
"built before any target using this custom command. Additionally, " "built before any target using this custom command. Additionally, "

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmAddCustomTargetCommand.h,v $ Module: $RCSfile: cmAddCustomTargetCommand.h,v $
Language: C++ Language: C++
Date: $Date: 2008-10-24 15:18:45 $ Date: $Date: 2009-04-07 19:32:07 $
Version: $Revision: 1.22.2.1 $ Version: $Revision: 1.22.2.3 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -87,15 +87,16 @@ public:
"If COMMENT is set, the value will be displayed as a " "If COMMENT is set, the value will be displayed as a "
"message before the commands are executed at build time. " "message before the commands are executed at build time. "
"Dependencies listed with the DEPENDS argument may reference files " "Dependencies listed with the DEPENDS argument may reference files "
"and outputs of custom commands created with ADD_CUSTOM_COMMAND.\n" "and outputs of custom commands created with add_custom_command() in "
"If VERBATIM is given then all the arguments to the commands will be " "the same directory (CMakeLists.txt file).\n"
"passed exactly as specified no matter the build tool used. " "If VERBATIM is given then all arguments to the commands will be "
"escaped properly for the build tool so that the invoked command "
"receives each argument unchanged. "
"Note that one level of escapes is still used by the CMake language " "Note that one level of escapes is still used by the CMake language "
"processor before add_custom_target even sees the arguments. " "processor before add_custom_target even sees the arguments. "
"Use of VERBATIM is recommended as it enables correct behavior. " "Use of VERBATIM is recommended as it enables correct behavior. "
"When VERBATIM is not given the behavior is platform specific. " "When VERBATIM is not given the behavior is platform specific because "
"In the future VERBATIM may be enabled by default. The only reason " "there is no protection of tool-specific special characters."
"it is an option is to preserve compatibility with older CMake code."
"\n" "\n"
"The SOURCES option specifies additional source files to be included " "The SOURCES option specifies additional source files to be included "
"in the custom target. " "in the custom target. "

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmCPluginAPI.cxx,v $ Module: $RCSfile: cmCPluginAPI.cxx,v $
Language: C++ Language: C++
Date: $Date: 2008-01-23 15:27:59 $ Date: $Date: 2009-03-23 17:58:40 $
Version: $Revision: 1.42 $ Version: $Revision: 1.42.2.1 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -706,10 +706,6 @@ void CCONV cmSourceFileSetName(void *arg, const char* name, const char* dir,
headerExts.push_back(headerExtensions[i]); headerExts.push_back(headerExtensions[i]);
} }
// Implement the old SetName method code here.
sf->Properties.SetProperty("HEADER_FILE_ONLY", "1",
cmProperty::SOURCE_FILE);
// Save the original name given. // Save the original name given.
sf->SourceName = name; sf->SourceName = name;
@ -742,13 +738,6 @@ void CCONV cmSourceFileSetName(void *arg, const char* name, const char* dir,
} }
} }
// See if the file is a header file
if(std::find( headerExts.begin(), headerExts.end(),
sf->SourceExtension ) == headerExts.end())
{
sf->Properties.SetProperty("HEADER_FILE_ONLY", "0",
cmProperty::SOURCE_FILE);
}
sf->FullPath = hname; sf->FullPath = hname;
return; return;
} }
@ -763,8 +752,6 @@ void CCONV cmSourceFileSetName(void *arg, const char* name, const char* dir,
if(cmSystemTools::FileExists(hname.c_str())) if(cmSystemTools::FileExists(hname.c_str()))
{ {
sf->SourceExtension = *ext; sf->SourceExtension = *ext;
sf->Properties.SetProperty("HEADER_FILE_ONLY", "0",
cmProperty::SOURCE_FILE);
sf->FullPath = hname; sf->FullPath = hname;
return; return;
} }
@ -814,9 +801,11 @@ void CCONV cmSourceFileSetName2(void *arg, const char* name, const char* dir,
} }
// Implement the old SetName method code here. // Implement the old SetName method code here.
sf->Properties.SetProperty("HEADER_FILE_ONLY", if(headerFileOnly)
headerFileOnly? "1" : "0", {
cmProperty::SOURCE_FILE); sf->Properties.SetProperty("HEADER_FILE_ONLY", "1",
cmProperty::SOURCE_FILE);
}
sf->SourceName = name; sf->SourceName = name;
std::string fname = sf->SourceName; std::string fname = sf->SourceName;
if(ext && strlen(ext)) if(ext && strlen(ext))

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmCommandArgumentParserHelper.cxx,v $ Module: $RCSfile: cmCommandArgumentParserHelper.cxx,v $
Language: C++ Language: C++
Date: $Date: 2009-01-01 17:49:41 $ Date: $Date: 2009-03-27 15:55:57 $
Version: $Revision: 1.20.4.1 $ Version: $Revision: 1.20.4.2 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -115,11 +115,7 @@ char* cmCommandArgumentParserHelper::ExpandVariable(const char* var)
{ {
return 0; return 0;
} }
if(this->FileName && strcmp(var, "CMAKE_CURRENT_LIST_FILE") == 0) if(this->FileLine >= 0 && strcmp(var, "CMAKE_CURRENT_LIST_LINE") == 0)
{
return this->AddString(this->FileName);
}
else if(this->FileLine >= 0 && strcmp(var, "CMAKE_CURRENT_LIST_LINE") == 0)
{ {
cmOStringStream ostr; cmOStringStream ostr;
ostr << this->FileLine; ostr << this->FileLine;

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmComputeLinkDepends.cxx,v $ Module: $RCSfile: cmComputeLinkDepends.cxx,v $
Language: C++ Language: C++
Date: $Date: 2009-01-13 18:03:49 $ Date: $Date: 2009-04-07 19:32:07 $
Version: $Revision: 1.12.2.7 $ Version: $Revision: 1.12.2.8 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -295,7 +295,8 @@ cmComputeLinkDepends::AllocateLinkEntry(std::string const& item)
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
int cmComputeLinkDepends::AddLinkEntry(std::string const& item) int cmComputeLinkDepends::AddLinkEntry(int depender_index,
std::string const& item)
{ {
// Check if the item entry has already been added. // Check if the item entry has already been added.
std::map<cmStdString, int>::iterator lei = this->LinkEntryIndex.find(item); std::map<cmStdString, int>::iterator lei = this->LinkEntryIndex.find(item);
@ -312,7 +313,7 @@ int cmComputeLinkDepends::AddLinkEntry(std::string const& item)
int index = lei->second; int index = lei->second;
LinkEntry& entry = this->EntryList[index]; LinkEntry& entry = this->EntryList[index];
entry.Item = item; entry.Item = item;
entry.Target = this->FindTargetToLink(entry.Item.c_str()); entry.Target = this->FindTargetToLink(depender_index, entry.Item.c_str());
entry.IsFlag = (!entry.Target && item[0] == '-' && item[1] != 'l' && entry.IsFlag = (!entry.Target && item[0] == '-' && item[1] != 'l' &&
item.substr(0, 10) != "-framework"); item.substr(0, 10) != "-framework");
@ -409,7 +410,8 @@ void cmComputeLinkDepends::HandleSharedDependency(SharedDepEntry const& dep)
// Initialize the item entry. // Initialize the item entry.
LinkEntry& entry = this->EntryList[lei->second]; LinkEntry& entry = this->EntryList[lei->second];
entry.Item = dep.Item; entry.Item = dep.Item;
entry.Target = this->FindTargetToLink(dep.Item.c_str()); entry.Target = this->FindTargetToLink(dep.DependerIndex,
dep.Item.c_str());
// This item was added specifically because it is a dependent // This item was added specifically because it is a dependent
// shared library. It may get special treatment // shared library. It may get special treatment
@ -500,7 +502,7 @@ void cmComputeLinkDepends::AddVarLinkEntries(int depender_index,
} }
else if(this->OldLinkDirMode) else if(this->OldLinkDirMode)
{ {
this->CheckWrongConfigItem(*di); this->CheckWrongConfigItem(depender_index, *di);
} }
// Reset the link type until another explicit type is given. // Reset the link type until another explicit type is given.
@ -529,7 +531,7 @@ cmComputeLinkDepends::AddTargetLinkEntries(int depender_index,
} }
else if(this->OldLinkDirMode) else if(this->OldLinkDirMode)
{ {
this->CheckWrongConfigItem(li->first); this->CheckWrongConfigItem(depender_index, li->first);
} }
} }
@ -558,7 +560,7 @@ cmComputeLinkDepends::AddLinkEntries(int depender_index,
} }
// Add a link entry for this item. // Add a link entry for this item.
int dependee_index = this->AddLinkEntry(item); int dependee_index = this->AddLinkEntry(depender_index, item);
// The dependee must come after the depender. // The dependee must come after the depender.
if(depender_index >= 0) if(depender_index >= 0)
@ -664,10 +666,19 @@ std::string cmComputeLinkDepends::CleanItemName(std::string const& item)
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmTarget* cmComputeLinkDepends::FindTargetToLink(const char* name) cmTarget* cmComputeLinkDepends::FindTargetToLink(int depender_index,
const char* name)
{ {
// Look for a target. // Look for a target in the scope of the depender.
cmTarget* tgt = this->Makefile->FindTargetToUse(name); cmMakefile* mf = this->Makefile;
if(depender_index >= 0)
{
if(cmTarget* depender = this->EntryList[depender_index].Target)
{
mf = depender->GetMakefile();
}
}
cmTarget* tgt = mf->FindTargetToUse(name);
// Skip targets that will not really be linked. This is probably a // Skip targets that will not really be linked. This is probably a
// name conflict between an external library and an executable // name conflict between an external library and an executable
@ -987,7 +998,8 @@ void cmComputeLinkDepends::DisplayFinalEntries()
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmComputeLinkDepends::CheckWrongConfigItem(std::string const& item) void cmComputeLinkDepends::CheckWrongConfigItem(int depender_index,
std::string const& item)
{ {
if(!this->OldLinkDirMode) if(!this->OldLinkDirMode)
{ {
@ -997,7 +1009,7 @@ void cmComputeLinkDepends::CheckWrongConfigItem(std::string const& item)
// For CMake 2.4 bug-compatibility we need to consider the output // For CMake 2.4 bug-compatibility we need to consider the output
// directories of targets linked in another configuration as link // directories of targets linked in another configuration as link
// directories. // directories.
if(cmTarget* tgt = this->FindTargetToLink(item.c_str())) if(cmTarget* tgt = this->FindTargetToLink(depender_index, item.c_str()))
{ {
if(!tgt->IsImported()) if(!tgt->IsImported())
{ {

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmComputeLinkDepends.h,v $ Module: $RCSfile: cmComputeLinkDepends.h,v $
Language: C++ Language: C++
Date: $Date: 2009-01-13 18:03:51 $ Date: $Date: 2009-04-07 19:32:07 $
Version: $Revision: 1.5.2.7 $ Version: $Revision: 1.5.2.8 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -81,14 +81,14 @@ private:
std::map<cmStdString, int>::iterator std::map<cmStdString, int>::iterator
AllocateLinkEntry(std::string const& item); AllocateLinkEntry(std::string const& item);
int AddLinkEntry(std::string const& item); int AddLinkEntry(int depender_index, std::string const& item);
void AddVarLinkEntries(int depender_index, const char* value); void AddVarLinkEntries(int depender_index, const char* value);
void AddTargetLinkEntries(int depender_index, void AddTargetLinkEntries(int depender_index,
LinkLibraryVectorType const& libs); LinkLibraryVectorType const& libs);
void AddLinkEntries(int depender_index, void AddLinkEntries(int depender_index,
std::vector<std::string> const& libs); std::vector<std::string> const& libs);
std::string CleanItemName(std::string const& item); std::string CleanItemName(std::string const& item);
cmTarget* FindTargetToLink(const char* name); cmTarget* FindTargetToLink(int depender_index, const char* name);
// One entry for each unique item. // One entry for each unique item.
std::vector<LinkEntry> EntryList; std::vector<LinkEntry> EntryList;
@ -162,7 +162,7 @@ private:
// Compatibility help. // Compatibility help.
bool OldLinkDirMode; bool OldLinkDirMode;
void CheckWrongConfigItem(std::string const& item); void CheckWrongConfigItem(int depender_index, std::string const& item);
std::set<cmTarget*> OldWrongConfigItems; std::set<cmTarget*> OldWrongConfigItems;
}; };

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmDependsFortran.cxx,v $ Module: $RCSfile: cmDependsFortran.cxx,v $
Language: C++ Language: C++
Date: $Date: 2008-05-15 19:39:50 $ Date: $Date: 2009-03-23 17:58:40 $
Version: $Revision: 1.46.2.2 $ Version: $Revision: 1.46.2.3 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -141,6 +141,9 @@ cmDependsFortran
cmDepends(lg), cmDepends(lg),
Internal(new cmDependsFortranInternals) Internal(new cmDependsFortranInternals)
{ {
// Configure the include file search path.
this->SetIncludePathFromLanguage("Fortran");
// Get the list of definitions. // Get the list of definitions.
std::vector<std::string> definitions; std::vector<std::string> definitions;
cmMakefile* mf = this->LocalGenerator->GetMakefile(); cmMakefile* mf = this->LocalGenerator->GetMakefile();

@ -145,8 +145,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmDependsFortranParser.cxx,v $ Module: $RCSfile: cmDependsFortranParser.cxx,v $
Language: C++ Language: C++
Date: $Date: 2008-04-24 16:56:25 $ Date: $Date: 2009-03-23 17:58:40 $
Version: $Revision: 1.16.2.2 $ Version: $Revision: 1.16.2.3 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -242,8 +242,8 @@ static char charmap[] = {
inline int strcasecmpCM(const char *s1, const char *s2) inline int strcasecmpCM(const char *s1, const char *s2)
{ {
const char *cm = charmap; const char *cm = charmap;
const char* us1 = s1; unsigned char const* us1 = reinterpret_cast<unsigned char const*>(s1);
const char* us2 = s2; unsigned char const* us2 = reinterpret_cast<unsigned char const*>(s2);
while(cm[*us1] == cm[*us2++]) while(cm[*us1] == cm[*us2++])
if(*us1++ == '\0') if(*us1++ == '\0')

@ -4,8 +4,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmDependsFortranParser.y,v $ Module: $RCSfile: cmDependsFortranParser.y,v $
Language: C++ Language: C++
Date: $Date: 2008-04-24 16:56:25 $ Date: $Date: 2009-03-23 17:58:40 $
Version: $Revision: 1.18.2.2 $ Version: $Revision: 1.18.2.3 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -101,8 +101,8 @@ static char charmap[] = {
inline int strcasecmpCM(const char *s1, const char *s2) inline int strcasecmpCM(const char *s1, const char *s2)
{ {
const char *cm = charmap; const char *cm = charmap;
const char* us1 = s1; unsigned char const* us1 = reinterpret_cast<unsigned char const*>(s1);
const char* us2 = s2; unsigned char const* us2 = reinterpret_cast<unsigned char const*>(s2);
while(cm[*us1] == cm[*us2++]) while(cm[*us1] == cm[*us2++])
if(*us1++ == '\0') if(*us1++ == '\0')

@ -931,21 +931,17 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
cm->DefineProperty cm->DefineProperty
("EXECUTABLE_OUTPUT_PATH", cmProperty::VARIABLE, ("EXECUTABLE_OUTPUT_PATH", cmProperty::VARIABLE,
"Old executable location variable.", "Old executable location variable.",
"This variable should no longer be used as of CMake 2.6. " "The target property RUNTIME_OUTPUT_DIRECTORY supercedes "
"Use the RUNTIME_OUTPUT_DIRECTORY target property instead. " "this variable for a target if it is set. "
"It will override this variable if it is set.\n" "Executable targets are otherwise placed in this directory.",false,
"If set, this is the directory where all executables "
"built during the build process will be placed.",false,
"Variables that Control the Build"); "Variables that Control the Build");
cm->DefineProperty cm->DefineProperty
("LIBRARY_OUTPUT_PATH", cmProperty::VARIABLE, ("LIBRARY_OUTPUT_PATH", cmProperty::VARIABLE,
"Old library location variable.", "Old library location variable.",
"This variable should no longer be used as of CMake 2.6. " "The target properties ARCHIVE_OUTPUT_DIRECTORY, "
"Use the ARCHIVE_OUTPUT_DIRECTORY, LIBRARY_OUTPUT_DIRECTORY, and " "LIBRARY_OUTPUT_DIRECTORY, and RUNTIME_OUTPUT_DIRECTORY supercede "
"RUNTIME_OUTPUT_DIRECTORY target properties instead. " "this variable for a target if they are set. "
"They will override this variable if they are set.\n" "Library targets are otherwise placed in this directory.",false,
"If set, this is the directory where all the libraries "
"built during the build process will be placed.",false,
"Variables that Control the Build"); "Variables that Control the Build");
@ -1101,6 +1097,15 @@ void cmDocumentVariables::DefineVariables(cmake* cm)
"This is a list of file extensions that may be " "This is a list of file extensions that may be "
"part of a project for a given language but are not compiled. ",false, "part of a project for a given language but are not compiled. ",false,
"Variables for Languages"); "Variables for Languages");
cm->DefineProperty
("CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES", cmProperty::VARIABLE,
"Directories implicitly searched by the compiler for header files.",
"CMake does not explicitly specify these directories on compiler "
"command lines for language <LANG>. "
"This prevents system include directories from being treated as user "
"include directories on some compilers.", false,
"Variables for Languages");
cm->DefineProperty cm->DefineProperty
("CMAKE_<LANG>_LINKER_PREFERENCE", cmProperty::VARIABLE, ("CMAKE_<LANG>_LINKER_PREFERENCE", cmProperty::VARIABLE,

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmDocumentationFormatterMan.cxx,v $ Module: $RCSfile: cmDocumentationFormatterMan.cxx,v $
Language: C++ Language: C++
Date: $Date: 2008-10-24 15:18:46 $ Date: $Date: 2009-03-23 17:58:40 $
Version: $Revision: 1.5.2.1 $ Version: $Revision: 1.5.2.2 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -71,7 +71,7 @@ void cmDocumentationFormatterMan::PrintPreformatted(std::ostream& os,
os << ".nf\n" << man_text; os << ".nf\n" << man_text;
if (*text && man_text.at(man_text.length()-1) != '\n') if (*text && man_text.at(man_text.length()-1) != '\n')
os << "\n"; os << "\n";
os << ".fi\n"; os << ".fi\n\n";
} }
void cmDocumentationFormatterMan::PrintParagraph(std::ostream& os, void cmDocumentationFormatterMan::PrintParagraph(std::ostream& os,

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmExtraCodeBlocksGenerator.cxx,v $ Module: $RCSfile: cmExtraCodeBlocksGenerator.cxx,v $
Language: C++ Language: C++
Date: $Date: 2009-01-13 18:03:52 $ Date: $Date: 2009-03-27 15:55:59 $
Version: $Revision: 1.18.2.2 $ Version: $Revision: 1.18.2.3 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
Copyright (c) 2004 Alexander Neundorf neundorf@kde.org, All rights reserved. Copyright (c) 2004 Alexander Neundorf neundorf@kde.org, All rights reserved.
@ -230,7 +230,10 @@ void cmExtraCodeBlocksGenerator
// Collect all used source files in the project // Collect all used source files in the project
std::map<std::string, std::string> sourceFiles; // Sort them into two containers, one for C/C++ implementation files
// which may have an acompanying header, one for all other files
std::map<std::string, cmSourceFile*> cFiles;
std::set<std::string> otherFiles;
for (std::vector<cmLocalGenerator*>::const_iterator lg=lgs.begin(); for (std::vector<cmLocalGenerator*>::const_iterator lg=lgs.begin();
lg!=lgs.end(); lg++) lg!=lgs.end(); lg++)
{ {
@ -250,7 +253,32 @@ void cmExtraCodeBlocksGenerator
for (std::vector<cmSourceFile*>::const_iterator si=sources.begin(); for (std::vector<cmSourceFile*>::const_iterator si=sources.begin();
si!=sources.end(); si++) si!=sources.end(); si++)
{ {
sourceFiles[(*si)->GetFullPath()] = ti->first; // check whether it is a C/C++ implementation file
bool isCFile = false;
if ((*si)->GetLanguage() && (*(*si)->GetLanguage() == 'C'))
{
for(std::vector<std::string>::const_iterator
ext = mf->GetSourceExtensions().begin();
ext != mf->GetSourceExtensions().end();
++ext)
{
if ((*si)->GetExtension() == *ext)
{
isCFile = true;
break;
}
}
}
// then put it accordingly into one of the two containers
if (isCFile)
{
cFiles[(*si)->GetFullPath()] = *si ;
}
else
{
otherFiles.insert((*si)->GetFullPath());
}
} }
} }
default: // intended fallthrough default: // intended fallthrough
@ -259,13 +287,61 @@ void cmExtraCodeBlocksGenerator
} }
} }
// insert all used source files in the CodeBlocks project // The following loop tries to add header files matching to implementation
for (std::map<std::string, std::string>::const_iterator // files to the project. It does that by iterating over all source files,
sit=sourceFiles.begin(); // replacing the file name extension with ".h" and checks whether such a
sit!=sourceFiles.end(); // file exists. If it does, it is inserted into the map of files.
// A very similar version of that code exists also in the kdevelop
// project generator.
for (std::map<std::string, cmSourceFile*>::const_iterator
sit=cFiles.begin();
sit!=cFiles.end();
++sit)
{
std::string headerBasename=cmSystemTools::GetFilenamePath(sit->first);
headerBasename+="/";
headerBasename+=cmSystemTools::GetFilenameWithoutExtension(sit->first);
// check if there's a matching header around
for(std::vector<std::string>::const_iterator
ext = mf->GetHeaderExtensions().begin();
ext != mf->GetHeaderExtensions().end();
++ext)
{
std::string hname=headerBasename;
hname += ".";
hname += *ext;
// if it's already in the set, don't check if it exists on disk
std::set<std::string>::const_iterator headerIt=otherFiles.find(hname);
if (headerIt != otherFiles.end())
{
break;
}
if(cmSystemTools::FileExists(hname.c_str()))
{
otherFiles.insert(hname);
break;
}
}
}
// insert all source files in the CodeBlocks project
// first the C/C++ implementation files, then all others
for (std::map<std::string, cmSourceFile*>::const_iterator
sit=cFiles.begin();
sit!=cFiles.end();
++sit)
{
fout<<" <Unit filename=\""<< sit->first <<"\">\n"
" </Unit>\n";
}
for (std::set<std::string>::const_iterator
sit=otherFiles.begin();
sit!=otherFiles.end();
++sit) ++sit)
{ {
fout<<" <Unit filename=\""<<sit->first <<"\">\n" fout<<" <Unit filename=\""<< sit->c_str() <<"\">\n"
" </Unit>\n"; " </Unit>\n";
} }

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmExtraEclipseCDT4Generator.cxx,v $ Module: $RCSfile: cmExtraEclipseCDT4Generator.cxx,v $
Language: C++ Language: C++
Date: $Date: 2009-01-15 14:17:20 $ Date: $Date: 2009-03-27 15:56:01 $
Version: $Revision: 1.13.2.4 $ Version: $Revision: 1.13.2.5 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
Copyright (c) 2004 Alexander Neundorf neundorf@kde.org, All rights reserved. Copyright (c) 2004 Alexander Neundorf neundorf@kde.org, All rights reserved.
@ -95,7 +95,6 @@ void cmExtraEclipseCDT4Generator
cmGlobalUnixMakefileGenerator3* mf cmGlobalUnixMakefileGenerator3* mf
= static_cast<cmGlobalUnixMakefileGenerator3*>(generator); = static_cast<cmGlobalUnixMakefileGenerator3*>(generator);
mf->SetToolSupportsColor(true); mf->SetToolSupportsColor(true);
mf->SetForceVerboseMakefiles(true);
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -251,6 +250,7 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
fout << fout <<
"\t\t\t\t<dictionary>\n" "\t\t\t\t<dictionary>\n"
"\t\t\t\t\t<key>org.eclipse.cdt.make.core.environment</key>\n" "\t\t\t\t\t<key>org.eclipse.cdt.make.core.environment</key>\n"
"\t\t\t\t\t<value>VERBOSE=1|</value>\n" // enforce VERBOSE Makefile output
"\t\t\t\t\t<value>" "\t\t\t\t\t<value>"
; ;
// set vsvars32.bat environment available at CMake time, // set vsvars32.bat environment available at CMake time,
@ -394,6 +394,30 @@ void cmExtraEclipseCDT4Generator::CreateProjectFile()
fout << "</projectDescription>\n"; fout << "</projectDescription>\n";
} }
//----------------------------------------------------------------------------
void cmExtraEclipseCDT4Generator::AppendIncludeDirectories(
cmGeneratedFileStream& fout,
const std::vector<std::string>& includeDirs,
std::set<std::string>& emittedDirs)
{
for(std::vector<std::string>::const_iterator inc = includeDirs.begin();
inc != includeDirs.end();
++inc)
{
if (!inc->empty())
{
std::string dir = cmSystemTools::CollapseFullPath(inc->c_str());
if(emittedDirs.find(dir) == emittedDirs.end())
{
emittedDirs.insert(dir);
fout << "<pathentry include=\""
<< cmExtraEclipseCDT4Generator::GetEclipsePath(dir)
<< "\" kind=\"inc\" path=\"\" system=\"true\"/>\n";
}
}
}
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmExtraEclipseCDT4Generator::CreateCProjectFile() const void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
{ {
@ -590,18 +614,29 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
{ {
const std::vector<std::string>& includeDirs const std::vector<std::string>& includeDirs
= (*it)->GetMakefile()->GetIncludeDirectories(); = (*it)->GetMakefile()->GetIncludeDirectories();
for(std::vector<std::string>::const_iterator inc = includeDirs.begin(); this->AppendIncludeDirectories(fout, includeDirs, emmited);
inc != includeDirs.end();
++inc)
{
std::string dir = cmSystemTools::CollapseFullPath(inc->c_str());
if(emmited.find(dir) == emmited.end())
{
emmited.insert(dir);
fout << "<pathentry include=\"" << this->GetEclipsePath(dir)
<< "\" kind=\"inc\" path=\"\" system=\"true\"/>\n";
}
} }
// now also the system include directories, in case we found them in
// CMakeSystemSpecificInformation.cmake. This makes Eclipse find the
// standard headers.
mf->GetDefinition("CMAKE_ECLIPSE_C_SYSTEM_INCLUDE_DIRS");
std::string compiler = mf->GetSafeDefinition("CMAKE_C_COMPILER");
if (!compiler.empty())
{
std::string systemIncludeDirs = mf->GetSafeDefinition(
"CMAKE_ECLIPSE_C_SYSTEM_INCLUDE_DIRS");
std::vector<std::string> dirs;
cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
this->AppendIncludeDirectories(fout, dirs, emmited);
}
compiler = mf->GetSafeDefinition("CMAKE_CXX_COMPILER");
if (!compiler.empty())
{
std::string systemIncludeDirs = mf->GetSafeDefinition(
"CMAKE_ECLIPSE_CXX_SYSTEM_INCLUDE_DIRS");
std::vector<std::string> dirs;
cmSystemTools::ExpandListArgument(systemIncludeDirs.c_str(), dirs);
this->AppendIncludeDirectories(fout, dirs, emmited);
} }
fout << "</storageModule>\n"; fout << "</storageModule>\n";

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmExtraEclipseCDT4Generator.h,v $ Module: $RCSfile: cmExtraEclipseCDT4Generator.h,v $
Language: C++ Language: C++
Date: $Date: 2009-01-13 18:03:52 $ Date: $Date: 2009-03-27 15:56:06 $
Version: $Revision: 1.4.2.1 $ Version: $Revision: 1.4.2.2 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
Copyright (c) 2004 Alexander Neundorf, neundorf@kde.org. All rights reserved. Copyright (c) 2004 Alexander Neundorf, neundorf@kde.org. All rights reserved.
@ -111,6 +111,10 @@ private:
const std::string& defname, const std::string& defname,
const std::string& altdefname); const std::string& altdefname);
static void AppendIncludeDirectories(cmGeneratedFileStream& fout,
const std::vector<std::string>& includeDirs,
std::set<std::string>& emittedDirs);
std::vector<std::string> SrcLinkedResources; std::vector<std::string> SrcLinkedResources;
std::vector<std::string> OutLinkedResources; std::vector<std::string> OutLinkedResources;
std::string HomeDirectory; std::string HomeDirectory;

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmFileCommand.cxx,v $ Module: $RCSfile: cmFileCommand.cxx,v $
Language: C++ Language: C++
Date: $Date: 2009-01-13 18:03:52 $ Date: $Date: 2009-03-23 17:58:40 $
Version: $Revision: 1.103.2.8 $ Version: $Revision: 1.103.2.9 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -2185,13 +2185,20 @@ bool cmFileCommand::HandleRemove(std::vector<std::string> const& args,
i++; // Get rid of subcommand i++; // Get rid of subcommand
for(;i != args.end(); ++i) for(;i != args.end(); ++i)
{ {
if(cmSystemTools::FileIsDirectory(i->c_str()) && recurse) std::string fileName = *i;
if(!cmsys::SystemTools::FileIsFullPath(fileName.c_str()))
{ {
cmSystemTools::RemoveADirectory(i->c_str()); fileName = this->Makefile->GetCurrentDirectory();
fileName += "/" + *i;
}
if(cmSystemTools::FileIsDirectory(fileName.c_str()) && recurse)
{
cmSystemTools::RemoveADirectory(fileName.c_str());
} }
else else
{ {
cmSystemTools::RemoveFile(i->c_str()); cmSystemTools::RemoveFile(fileName.c_str());
} }
} }
return true; return true;

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmGetFilenameComponentCommand.cxx,v $ Module: $RCSfile: cmGetFilenameComponentCommand.cxx,v $
Language: C++ Language: C++
Date: $Date: 2008-01-23 15:27:59 $ Date: $Date: 2009-03-23 17:58:40 $
Version: $Revision: 1.17 $ Version: $Revision: 1.17.2.1 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -75,7 +75,8 @@ bool cmGetFilenameComponentCommand
{ {
result = cmSystemTools::GetFilenameWithoutExtension(filename); result = cmSystemTools::GetFilenameWithoutExtension(filename);
} }
else if (args[2] == "ABSOLUTE") else if (args[2] == "ABSOLUTE" ||
args[2] == "REALPATH")
{ {
// If the path given is relative evaluate it relative to the // If the path given is relative evaluate it relative to the
// current source directory. // current source directory.
@ -92,6 +93,11 @@ bool cmGetFilenameComponentCommand
// Collapse the path to its simplest form. // Collapse the path to its simplest form.
result = cmSystemTools::CollapseFullPath(filename.c_str()); result = cmSystemTools::CollapseFullPath(filename.c_str());
if(args[2] == "REALPATH")
{
// Resolve symlinks if possible
result = cmSystemTools::GetRealPath(filename.c_str());
}
} }
else else
{ {

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmGetFilenameComponentCommand.h,v $ Module: $RCSfile: cmGetFilenameComponentCommand.h,v $
Language: C++ Language: C++
Date: $Date: 2008-01-23 15:27:59 $ Date: $Date: 2009-03-23 17:58:40 $
Version: $Revision: 1.14 $ Version: $Revision: 1.14.2.1 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -68,11 +68,12 @@ public:
{ {
return return
" get_filename_component(VarName FileName\n" " get_filename_component(VarName FileName\n"
" PATH|ABSOLUTE|NAME|EXT|NAME_WE\n" " PATH|ABSOLUTE|NAME|EXT|NAME_WE|REALPATH\n"
" [CACHE])\n" " [CACHE])\n"
"Set VarName to be the path (PATH), file name (NAME), file " "Set VarName to be the path (PATH), file name (NAME), file "
"extension (EXT), file name without extension (NAME_WE) of FileName, " "extension (EXT), file name without extension (NAME_WE) of FileName, "
"or the full absolute (ABSOLUTE) file name without symlinks. " "the full path (ABSOLUTE), or the full path with all symlinks "
"resolved (REALPATH). "
"Note that the path is converted to Unix slashes format and has no " "Note that the path is converted to Unix slashes format and has no "
"trailing slashes. The longest file extension is always considered. " "trailing slashes. The longest file extension is always considered. "
"If the optional CACHE argument is specified, the result variable is " "If the optional CACHE argument is specified, the result variable is "

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmGlobalGenerator.cxx,v $ Module: $RCSfile: cmGlobalGenerator.cxx,v $
Language: C++ Language: C++
Date: $Date: 2008-11-11 21:52:22 $ Date: $Date: 2009-03-23 17:58:40 $
Version: $Revision: 1.227.2.9 $ Version: $Revision: 1.227.2.10 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -732,18 +732,22 @@ void cmGlobalGenerator::Configure()
this->ProjectMap.clear(); this->ProjectMap.clear();
this->RuleHashes.clear(); this->RuleHashes.clear();
this->DirectoryContentMap.clear(); this->DirectoryContentMap.clear();
this->BinaryDirectories.clear();
// start with this directory // start with this directory
cmLocalGenerator *lg = this->CreateLocalGenerator(); cmLocalGenerator *lg = this->CreateLocalGenerator();
this->LocalGenerators.push_back(lg); this->LocalGenerators.push_back(lg);
// set the Start directories // set the Start directories
cmMakefile* mf = lg->GetMakefile();
lg->GetMakefile()->SetStartDirectory lg->GetMakefile()->SetStartDirectory
(this->CMakeInstance->GetStartDirectory()); (this->CMakeInstance->GetStartDirectory());
lg->GetMakefile()->SetStartOutputDirectory lg->GetMakefile()->SetStartOutputDirectory
(this->CMakeInstance->GetStartOutputDirectory()); (this->CMakeInstance->GetStartOutputDirectory());
lg->GetMakefile()->MakeStartDirectoriesCurrent(); lg->GetMakefile()->MakeStartDirectoriesCurrent();
this->BinaryDirectories.insert(mf->GetStartOutputDirectory());
// now do it // now do it
lg->Configure(); lg->Configure();

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmGlobalGenerator.h,v $ Module: $RCSfile: cmGlobalGenerator.h,v $
Language: C++ Language: C++
Date: $Date: 2008-10-24 15:18:46 $ Date: $Date: 2009-03-23 17:58:40 $
Version: $Revision: 1.107.2.6 $ Version: $Revision: 1.107.2.7 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -252,6 +252,12 @@ public:
std::vector<std::string>::const_iterator first, std::vector<std::string>::const_iterator first,
std::vector<std::string>::const_iterator last); std::vector<std::string>::const_iterator last);
/** Return whether the given binary directory is unused. */
bool BinaryDirectoryIsNew(const char* dir)
{
return this->BinaryDirectories.insert(dir).second;
}
protected: protected:
// for a project collect all its targets by following depend // for a project collect all its targets by following depend
// information, and also collect all the targets // information, and also collect all the targets
@ -346,6 +352,9 @@ private:
derived(dc), LoadedFromDisk(dc.LoadedFromDisk) {} derived(dc), LoadedFromDisk(dc.LoadedFromDisk) {}
}; };
std::map<cmStdString, DirectoryContent> DirectoryContentMap; std::map<cmStdString, DirectoryContent> DirectoryContentMap;
// Set of binary directories on disk.
std::set<cmStdString> BinaryDirectories;
}; };
#endif #endif

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmGlobalNMakeMakefileGenerator.cxx,v $ Module: $RCSfile: cmGlobalNMakeMakefileGenerator.cxx,v $
Language: C++ Language: C++
Date: $Date: 2008-10-24 15:18:46 $ Date: $Date: 2009-03-27 15:56:10 $
Version: $Revision: 1.26.2.1 $ Version: $Revision: 1.26.2.2 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -35,8 +35,7 @@ void cmGlobalNMakeMakefileGenerator
mf->AddDefinition("CMAKE_GENERATOR_CC", "cl"); mf->AddDefinition("CMAKE_GENERATOR_CC", "cl");
mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl"); mf->AddDefinition("CMAKE_GENERATOR_CXX", "cl");
if(!(cmSystemTools::GetEnv("INCLUDE") && if(!(cmSystemTools::GetEnv("INCLUDE") &&
cmSystemTools::GetEnv("LIB") && cmSystemTools::GetEnv("LIB"))
cmSystemTools::GetEnv("LIBPATH"))
) )
{ {
std::string message = "To use the NMake generator, cmake must be run " std::string message = "To use the NMake generator, cmake must be run "

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator3 Program: CMake - Cross-Platform Makefile Generator3
Module: $RCSfile: cmGlobalUnixMakefileGenerator3.h,v $ Module: $RCSfile: cmGlobalUnixMakefileGenerator3.h,v $
Language: C++ Language: C++
Date: $Date: 2008-06-13 12:55:17 $ Date: $Date: 2009-03-27 15:56:15 $
Version: $Revision: 1.55.2.1 $ Version: $Revision: 1.55.2.2 $
Copyright (c) 2005 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2005 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -176,7 +176,6 @@ protected:
// in the rule to satisfy the make program. // in the rule to satisfy the make program.
std::string EmptyRuleHackCommand; std::string EmptyRuleHackCommand;
std::map<cmStdString, int > TargetSourceFileCount;
bool ForceVerboseMakefiles; bool ForceVerboseMakefiles;
}; };

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmGlobalXCodeGenerator.cxx,v $ Module: $RCSfile: cmGlobalXCodeGenerator.cxx,v $
Language: C++ Language: C++
Date: $Date: 2009-02-19 16:53:45 $ Date: $Date: 2009-03-23 17:58:41 $
Version: $Revision: 1.186.2.13 $ Version: $Revision: 1.186.2.14 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -728,7 +728,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
{ {
externalObjFiles.push_back(xsf); externalObjFiles.push_back(xsf);
} }
else if((*i)->GetPropertyAsBool("HEADER_FILE_ONLY") || else if(this->IsHeaderFile(*i) ||
(tsFlags.Type == cmTarget::SourceFileTypePrivateHeader) || (tsFlags.Type == cmTarget::SourceFileTypePrivateHeader) ||
(tsFlags.Type == cmTarget::SourceFileTypePublicHeader)) (tsFlags.Type == cmTarget::SourceFileTypePublicHeader))
{ {
@ -738,7 +738,7 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
{ {
resourceFiles.push_back(xsf); resourceFiles.push_back(xsf);
} }
else else if(!(*i)->GetPropertyAsBool("HEADER_FILE_ONLY"))
{ {
// Include this file in the build if it has a known language // Include this file in the build if it has a known language
// and has not been listed as an ignored extension for this // and has not been listed as an ignored extension for this
@ -907,6 +907,15 @@ cmGlobalXCodeGenerator::CreateXCodeTargets(cmLocalGenerator* gen,
} }
} }
//----------------------------------------------------------------------------
bool cmGlobalXCodeGenerator::IsHeaderFile(cmSourceFile* sf)
{
const std::vector<std::string>& hdrExts =
this->CurrentMakefile->GetHeaderExtensions();
return (std::find(hdrExts.begin(), hdrExts.end(), sf->GetExtension()) !=
hdrExts.end());
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
cmXCodeObject* cmXCodeObject*
cmGlobalXCodeGenerator::CreateBuildPhase(const char* name, cmGlobalXCodeGenerator::CreateBuildPhase(const char* name,

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmGlobalXCodeGenerator.h,v $ Module: $RCSfile: cmGlobalXCodeGenerator.h,v $
Language: C++ Language: C++
Date: $Date: 2008-10-24 15:18:48 $ Date: $Date: 2009-03-23 17:58:41 $
Version: $Revision: 1.52.2.2 $ Version: $Revision: 1.52.2.3 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -159,6 +159,7 @@ private:
cmTarget& cmtarget); cmTarget& cmtarget);
void CreateXCodeTargets(cmLocalGenerator* gen, void CreateXCodeTargets(cmLocalGenerator* gen,
std::vector<cmXCodeObject*>&); std::vector<cmXCodeObject*>&);
bool IsHeaderFile(cmSourceFile*);
void AddDependTarget(cmXCodeObject* target, void AddDependTarget(cmXCodeObject* target,
cmXCodeObject* dependTarget); cmXCodeObject* dependTarget);
void CreateXCodeDependHackTarget(std::vector<cmXCodeObject*>& targets); void CreateXCodeDependHackTarget(std::vector<cmXCodeObject*>& targets);

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmIncludeDirectoryCommand.cxx,v $ Module: $RCSfile: cmIncludeDirectoryCommand.cxx,v $
Language: C++ Language: C++
Date: $Date: 2008-03-08 14:50:56 $ Date: $Date: 2009-03-27 15:56:22 $
Version: $Revision: 1.30 $ Version: $Revision: 1.30.2.1 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -94,20 +94,15 @@ void cmIncludeDirectoryCommand::AddDirectory(const char *i,
} }
// remove any leading or trailing spaces and \r // remove any leading or trailing spaces and \r
pos = ret.size()-1; std::string::size_type b = ret.find_first_not_of(" \r");
while(ret[pos] == ' ' || ret[pos] == '\r') std::string::size_type e = ret.find_last_not_of(" \r");
if ((b!=ret.npos) && (e!=ret.npos))
{ {
ret.erase(pos); ret.assign(ret, b, 1+e-b); // copy the remaining substring
pos--;
} }
pos = 0; else
while(ret.size() && ret[pos] == ' ' || ret[pos] == '\r')
{ {
ret.erase(pos,1); return; // if we get here, we had only whitespace in the string
}
if (!ret.size())
{
return;
} }
if (!cmSystemTools::IsOff(ret.c_str())) if (!cmSystemTools::IsOff(ret.c_str()))

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmLocalGenerator.cxx,v $ Module: $RCSfile: cmLocalGenerator.cxx,v $
Language: C++ Language: C++
Date: $Date: 2009-02-04 22:04:49 $ Date: $Date: 2009-03-23 17:58:41 $
Version: $Revision: 1.269.2.10 $ Version: $Revision: 1.269.2.11 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -1133,9 +1133,10 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
{ {
return this->LanguageToIncludeFlags[lang].c_str(); return this->LanguageToIncludeFlags[lang].c_str();
} }
cmOStringStream includeFlags; cmOStringStream includeFlags;
std::vector<std::string> includes; std::vector<std::string> includes;
this->GetIncludeDirectories(includes); this->GetIncludeDirectories(includes, lang);
std::vector<std::string>::iterator i; std::vector<std::string>::iterator i;
std::string flagVar = "CMAKE_INCLUDE_FLAG_"; std::string flagVar = "CMAKE_INCLUDE_FLAG_";
@ -1241,7 +1242,7 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang)
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs, void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
bool filter_system_dirs) const char* lang)
{ {
// Need to decide whether to automatically include the source and // Need to decide whether to automatically include the source and
// binary directories at the beginning of the include path. // binary directories at the beginning of the include path.
@ -1307,21 +1308,18 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
} }
} }
if(filter_system_dirs) // Load implicit include directories for this language.
std::string impDirVar = "CMAKE_";
impDirVar += lang;
impDirVar += "_IMPLICIT_INCLUDE_DIRECTORIES";
if(const char* value = this->Makefile->GetDefinition(impDirVar.c_str()))
{ {
// Do not explicitly add the standard include path "/usr/include". std::vector<std::string> impDirVec;
// This can cause problems with certain standard library cmSystemTools::ExpandListArgument(value, impDirVec);
// implementations because the wrong headers may be found first. for(std::vector<std::string>::const_iterator i = impDirVec.begin();
emitted.insert("/usr/include"); i != impDirVec.end(); ++i)
if(const char* implicitIncludes = this->Makefile->GetDefinition
("CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES"))
{ {
std::vector<std::string> implicitIncludeVec; emitted.insert(*i);
cmSystemTools::ExpandListArgument(implicitIncludes, implicitIncludeVec);
for(unsigned int k = 0; k < implicitIncludeVec.size(); ++k)
{
emitted.insert(implicitIncludeVec[k]);
}
} }
} }
@ -2127,25 +2125,15 @@ std::string cmLocalGenerator::Convert(RelativeRoot remote,
bool optional) bool optional)
{ {
const char* remotePath = this->GetRelativeRootPath(remote); const char* remotePath = this->GetRelativeRootPath(remote);
// The relative root must have a path (i.e. not FULL or NONE)
assert(remotePath != 0);
if(local && (!optional || this->UseRelativePaths)) if(local && (!optional || this->UseRelativePaths))
{ {
std::vector<std::string> components; std::vector<std::string> components;
std::string result; cmSystemTools::SplitPath(local, components);
switch(remote) std::string result = this->ConvertToRelativePath(components, remotePath);
{
case HOME:
case HOME_OUTPUT:
case START:
case START_OUTPUT:
cmSystemTools::SplitPath(local, components);
result = this->ConvertToRelativePath(components, remotePath);
break;
case FULL:
result = remotePath;
break;
case NONE:
break;
}
return this->ConvertToOutputFormat(result.c_str(), output); return this->ConvertToOutputFormat(result.c_str(), output);
} }
else else

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmLocalGenerator.h,v $ Module: $RCSfile: cmLocalGenerator.h,v $
Language: C++ Language: C++
Date: $Date: 2009-01-13 18:03:52 $ Date: $Date: 2009-03-23 17:58:45 $
Version: $Revision: 1.103.2.3 $ Version: $Revision: 1.103.2.4 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -190,7 +190,7 @@ public:
/** Get the include flags for the current makefile and language. */ /** Get the include flags for the current makefile and language. */
void GetIncludeDirectories(std::vector<std::string>& dirs, void GetIncludeDirectories(std::vector<std::string>& dirs,
bool filter_system_dirs = true); const char* lang = "C");
/** Compute the language used to compile the given source file. */ /** Compute the language used to compile the given source file. */
const char* GetSourceFileLanguage(const cmSourceFile& source); const char* GetSourceFileLanguage(const cmSourceFile& source);

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmLocalUnixMakefileGenerator3.cxx,v $ Module: $RCSfile: cmLocalUnixMakefileGenerator3.cxx,v $
Language: C++ Language: C++
Date: $Date: 2009-01-13 18:03:52 $ Date: $Date: 2009-03-27 15:56:29 $
Version: $Revision: 1.240.2.8 $ Version: $Revision: 1.240.2.10 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -500,7 +500,7 @@ void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile()
infoFileStream infoFileStream
<< "SET(CMAKE_C_INCLUDE_PATH\n"; << "SET(CMAKE_C_INCLUDE_PATH\n";
std::vector<std::string> includeDirs; std::vector<std::string> includeDirs;
this->GetIncludeDirectories(includeDirs, false); this->GetIncludeDirectories(includeDirs);
for(std::vector<std::string>::iterator i = includeDirs.begin(); for(std::vector<std::string>::iterator i = includeDirs.begin();
i != includeDirs.end(); ++i) i != includeDirs.end(); ++i)
{ {
@ -1967,7 +1967,7 @@ cmLocalUnixMakefileGenerator3
cmd += this->Convert(makefile,NONE,SHELL); cmd += this->Convert(makefile,NONE,SHELL);
cmd += " "; cmd += " ";
// Passg down verbosity level. // Pass down verbosity level.
if(this->GetMakeSilentFlag().size()) if(this->GetMakeSilentFlag().size())
{ {
cmd += this->GetMakeSilentFlag(); cmd += this->GetMakeSilentFlag();

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmLocalUnixMakefileGenerator3.h,v $ Module: $RCSfile: cmLocalUnixMakefileGenerator3.h,v $
Language: C++ Language: C++
Date: $Date: 2008-10-24 15:18:52 $ Date: $Date: 2009-03-27 15:56:34 $
Version: $Revision: 1.82.2.1 $ Version: $Revision: 1.82.2.2 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -282,7 +282,7 @@ protected:
void WriteLocalMakefileTargets(std::ostream& ruleFileStream, void WriteLocalMakefileTargets(std::ostream& ruleFileStream,
std::set<cmStdString> &emitted); std::set<cmStdString> &emitted);
// this method Writes the Directory informaiton files // this method Writes the Directory information files
void WriteDirectoryInformationFile(); void WriteDirectoryInformationFile();

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmLocalVisualStudio6Generator.cxx,v $ Module: $RCSfile: cmLocalVisualStudio6Generator.cxx,v $
Language: C++ Language: C++
Date: $Date: 2009-01-13 18:03:53 $ Date: $Date: 2009-03-27 15:56:36 $
Version: $Revision: 1.141.2.4 $ Version: $Revision: 1.141.2.5 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -1712,11 +1712,11 @@ cmLocalVisualStudio6Generator
} }
// Now do the VS6-specific check. // Now do the VS6-specific check.
if(define.find_first_of("=") != define.npos) if(define.find_first_of(" ") != define.npos)
{ {
cmOStringStream e; cmOStringStream e;
e << "WARNING: The VS6 IDE does not support preprocessor definitions " e << "WARNING: The VS6 IDE does not support preprocessor definition "
<< "with values.\n" << "values with spaces.\n"
<< "CMake is dropping a preprocessor definition: " << define << "\n" << "CMake is dropping a preprocessor definition: " << define << "\n"
<< "Consider defining the macro in a (configured) header file.\n"; << "Consider defining the macro in a (configured) header file.\n";
cmSystemTools::Message(e.str().c_str()); cmSystemTools::Message(e.str().c_str());

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmMakeDepend.cxx,v $ Module: $RCSfile: cmMakeDepend.cxx,v $
Language: C++ Language: C++
Date: $Date: 2007-12-15 01:31:27 $ Date: $Date: 2009-03-23 17:58:48 $
Version: $Revision: 1.46 $ Version: $Revision: 1.46.2.1 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -264,30 +264,6 @@ cmDependInformation* cmMakeDepend::GetDependInformation(const char* file,
} }
void cmMakeDepend::GenerateMakefileDependencies()
{
// Now create cmDependInformation objects for files in the directory
cmTargets &tgts = this->Makefile->GetTargets();
for(cmTargets::iterator l = tgts.begin();
l != tgts.end(); l++)
{
const std::vector<cmSourceFile*> &classes = l->second.GetSourceFiles();
for(std::vector<cmSourceFile*>::const_iterator i = classes.begin();
i != classes.end(); ++i)
{
if(!(*i)->GetPropertyAsBool("HEADER_FILE_ONLY"))
{
cmDependInformation* info =
this->GetDependInformation((*i)->GetFullPath().c_str(),0);
this->AddFileToSearchPath(info->FullPath.c_str());
info->SourceFile = *i;
this->GenerateDependInformation(info);
}
}
}
}
// find the full path to fname by searching the this->IncludeDirectories array // find the full path to fname by searching the this->IncludeDirectories array
std::string cmMakeDepend::FullPath(const char* fname, const char *extraPath) std::string cmMakeDepend::FullPath(const char* fname, const char *extraPath)
{ {
@ -362,37 +338,3 @@ void cmMakeDepend::AddSearchPath(const char* path)
{ {
this->IncludeDirectories.push_back(path); this->IncludeDirectories.push_back(path);
} }
// Add a directory to the search path
void cmMakeDepend::AddFileToSearchPath(const char* file)
{
std::string filepath = file;
std::string::size_type pos = filepath.rfind('/');
if(pos != std::string::npos)
{
std::string path = filepath.substr(0, pos);
if(std::find(this->IncludeDirectories.begin(),
this->IncludeDirectories.end(), path)
== this->IncludeDirectories.end())
{
this->IncludeDirectories.push_back(path);
return;
}
}
}
const cmDependInformation*
cmMakeDepend::GetDependInformationForSourceFile(const cmSourceFile &sf) const
{
for(DependInformationMapType::const_iterator i =
this->DependInformationMap.begin();
i != this->DependInformationMap.end(); ++i)
{
const cmDependInformation* info = i->second;
if(info->SourceFile == &sf)
{
return info;
}
}
return 0;
}

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmMakeDepend.h,v $ Module: $RCSfile: cmMakeDepend.h,v $
Language: C++ Language: C++
Date: $Date: 2006-05-12 16:29:09 $ Date: $Date: 2009-03-23 17:58:48 $
Version: $Revision: 1.24 $ Version: $Revision: 1.24.10.1 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -96,35 +96,18 @@ public:
*/ */
virtual void SetMakefile(cmMakefile* makefile); virtual void SetMakefile(cmMakefile* makefile);
/**
* Get the depend info struct for a source file
*/
const cmDependInformation
*GetDependInformationForSourceFile(const cmSourceFile &sf) const;
/** /**
* Add a directory to the search path for include files. * Add a directory to the search path for include files.
*/ */
virtual void AddSearchPath(const char*); virtual void AddSearchPath(const char*);
/**
* Generate dependencies for all the sources of all the targets
* in the makefile.
*/
void GenerateMakefileDependencies();
/** /**
* Generate dependencies for the file given. Returns a pointer to * Generate dependencies for the file given. Returns a pointer to
* the cmDependInformation object for the file. * the cmDependInformation object for the file.
*/ */
const cmDependInformation* FindDependencies(const char* file); const cmDependInformation* FindDependencies(const char* file);
protected: protected:
/**
* Add a source file to the search path.
*/
void AddFileToSearchPath(const char* filepath);
/** /**
* Compute the depend information for this class. * Compute the depend information for this class.
*/ */

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmMakefile.cxx,v $ Module: $RCSfile: cmMakefile.cxx,v $
Language: C++ Language: C++
Date: $Date: 2009-02-04 16:44:17 $ Date: $Date: 2009-03-27 15:56:41 $
Version: $Revision: 1.463.2.12 $ Version: $Revision: 1.463.2.14 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -83,7 +83,7 @@ cmMakefile::cmMakefile()
this->AddSourceGroup("", "^.*$"); this->AddSourceGroup("", "^.*$");
this->AddSourceGroup this->AddSourceGroup
("Source Files", ("Source Files",
"\\.(C|M|c|c\\+\\+|cc|cpp|cxx|f|f90|for|fpp" "\\.(C|M|c|c\\+\\+|cc|cpp|cxx|f|F|f90|for|fpp"
"|ftn|m|mm|rc|def|r|odl|idl|hpj|bat)$"); "|ftn|m|mm|rc|def|r|odl|idl|hpj|bat)$");
this->AddSourceGroup("Header Files", this->AddSourceGroup("Header Files",
"\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$"); "\\.(h|hh|h\\+\\+|hm|hpp|hxx|in|txx|inl)$");
@ -1208,10 +1208,10 @@ bool cmMakefile::ParseDefineFlag(std::string const& def, bool remove)
return false; return false;
} }
// VS6 IDE does not support definitions with values. // VS6 IDE does not support definition values with spaces.
if((strcmp(this->LocalGenerator->GetGlobalGenerator()->GetName(), if((strcmp(this->LocalGenerator->GetGlobalGenerator()->GetName(),
"Visual Studio 6") == 0) && "Visual Studio 6") == 0) &&
(def.find("=") != def.npos)) (def.find(" ") != def.npos))
{ {
return false; return false;
} }
@ -1535,6 +1535,21 @@ void cmMakefile::AddSubDirectory(const char* srcPath, const char *binPath,
} }
} }
// Make sure the binary directory is unique.
cmGlobalGenerator* gg = this->LocalGenerator->GetGlobalGenerator();
if(!gg->BinaryDirectoryIsNew(binPath))
{
cmOStringStream e;
e << "The binary directory\n"
<< " " << binPath << "\n"
<< "is already used to build another source directory, so it cannot "
<< "be used to build source directory\n"
<< " " << srcPath << "\n"
<< "Specify a unique binary directory name.";
this->IssueMessage(cmake::FATAL_ERROR, e.str());
return;
}
// create a new local generator and set its parent // create a new local generator and set its parent
cmLocalGenerator *lg2 = cmLocalGenerator *lg2 =
this->LocalGenerator->GetGlobalGenerator()->CreateLocalGenerator(); this->LocalGenerator->GetGlobalGenerator()->CreateLocalGenerator();
@ -3460,7 +3475,7 @@ void cmMakefile::DefineProperties(cmake *cm)
"in the directory's parent.\n" "in the directory's parent.\n"
"CMake will automatically drop some definitions that " "CMake will automatically drop some definitions that "
"are not supported by the native build tool. " "are not supported by the native build tool. "
"The VS6 IDE does not support definitions with values " "The VS6 IDE does not support definition values with spaces "
"(but NMake does).\n" "(but NMake does).\n"
"Dislaimer: Most native build tools have poor support for escaping " "Dislaimer: Most native build tools have poor support for escaping "
"certain values. CMake has work-arounds for many cases but some " "certain values. CMake has work-arounds for many cases but some "

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmMakefileTargetGenerator.cxx,v $ Module: $RCSfile: cmMakefileTargetGenerator.cxx,v $
Language: C++ Language: C++
Date: $Date: 2008-10-24 15:18:52 $ Date: $Date: 2009-03-23 17:58:48 $
Version: $Revision: 1.93.2.7 $ Version: $Revision: 1.93.2.8 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -268,8 +268,7 @@ void cmMakefileTargetGenerator::WriteTargetLanguageFlags()
// Add the export symbol definition for shared library objects. // Add the export symbol definition for shared library objects.
if(const char* exportMacro = this->Target->GetExportMacro()) if(const char* exportMacro = this->Target->GetExportMacro())
{ {
flags += "-D"; this->LocalGenerator->AppendDefines(defines, exportMacro, lang);
flags += exportMacro;
} }
// Add preprocessor definitions for this target and configuration. // Add preprocessor definitions for this target and configuration.

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmProjectCommand.h,v $ Module: $RCSfile: cmProjectCommand.h,v $
Language: C++ Language: C++
Date: $Date: 2008-01-23 15:27:59 $ Date: $Date: 2009-03-27 15:56:45 $
Version: $Revision: 1.16 $ Version: $Revision: 1.16.2.1 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -64,14 +64,16 @@ public:
virtual const char* GetFullDocumentation() virtual const char* GetFullDocumentation()
{ {
return return
" project(projectname [CXX] [C] [Java])\n" " project(<projectname> [languageName1 languageName2 ... ] )\n"
"Sets the name of the project. " "Sets the name of the project. "
"This creates the variables projectname_BINARY_DIR and " "Additionally this sets the variables <projectName>_BINARY_DIR and "
"projectname_SOURCE_DIR. " "<projectName>_SOURCE_DIR to the respective values.\n"
"Optionally you can specify which languages your project supports. " "Optionally you can specify which languages your project supports. "
"By default all languages are supported. If you do not have a " "Example languages are CXX (i.e. C++), C, Fortran, etc. "
"C++ compiler, but want" "By default C and CXX are enabled. E.g. if you do not have a "
" to build a c program with cmake, then use this option."; "C++ compiler, you can disable the check for it by explicitely listing "
"the languages you want to support, e.g. C. By using the special "
"language \"NONE\" all checks for any language can be disabled.";
} }
cmTypeMacro(cmProjectCommand, cmCommand); cmTypeMacro(cmProjectCommand, cmCommand);

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmSourceFile.cxx,v $ Module: $RCSfile: cmSourceFile.cxx,v $
Language: C++ Language: C++
Date: $Date: 2008-10-24 15:18:54 $ Date: $Date: 2009-03-27 15:56:47 $
Version: $Revision: 1.47.2.4 $ Version: $Revision: 1.47.2.6 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -246,25 +246,6 @@ void cmSourceFile::CheckExtension()
this->SetProperty("EXTERNAL_OBJECT", "1"); this->SetProperty("EXTERNAL_OBJECT", "1");
} }
// Look for header files.
cmMakefile* mf = this->Location.GetMakefile();
const std::vector<std::string>& hdrExts = mf->GetHeaderExtensions();
if(std::find(hdrExts.begin(), hdrExts.end(), this->Extension) ==
hdrExts.end())
{
// This is not a known header file extension. Mark it as not a
// header unless the user has already explicitly set the property.
if(!this->GetProperty("HEADER_FILE_ONLY"))
{
this->SetProperty("HEADER_FILE_ONLY", "0");
}
}
else
{
// This is a known header file extension. The source cannot be compiled.
this->SetProperty("HEADER_FILE_ONLY", "1");
}
// Try to identify the source file language from the extension. // Try to identify the source file language from the extension.
if(this->Language.empty()) if(this->Language.empty())
{ {
@ -424,7 +405,7 @@ void cmSourceFile::DefineProperties(cmake *cm)
"(ex. \"COMPILE_DEFINITIONS_DEBUG\").\n" "(ex. \"COMPILE_DEFINITIONS_DEBUG\").\n"
"CMake will automatically drop some definitions that " "CMake will automatically drop some definitions that "
"are not supported by the native build tool. " "are not supported by the native build tool. "
"The VS6 IDE does not support definitions with values " "The VS6 IDE does not support definition values with spaces "
"(but NMake does). Xcode does not support per-configuration " "(but NMake does). Xcode does not support per-configuration "
"definitions on source files.\n" "definitions on source files.\n"
"Dislaimer: Most native build tools have poor support for escaping " "Dislaimer: Most native build tools have poor support for escaping "

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmStringCommand.h,v $ Module: $RCSfile: cmStringCommand.h,v $
Language: C++ Language: C++
Date: $Date: 2008-01-23 15:27:59 $ Date: $Date: 2009-03-27 15:56:47 $
Version: $Revision: 1.28 $ Version: $Revision: 1.28.2.1 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -132,9 +132,10 @@ public:
" + Matches preceding pattern one or more times\n" " + Matches preceding pattern one or more times\n"
" ? Matches preceding pattern zero or once only\n" " ? Matches preceding pattern zero or once only\n"
" | Matches a pattern on either side of the |\n" " | Matches a pattern on either side of the |\n"
" () Saves a matched subexpression, which can be referenced in " " () Saves a matched subexpression, which can be referenced \n"
"the REGEX REPLACE operation. Additionally it is saved in the special " " in the REGEX REPLACE operation. Additionally it is saved\n"
"CMake variables CMAKE_MATCH_(0..9)."; " by all regular expression-related commands, including \n"
" e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9).";
} }
cmTypeMacro(cmStringCommand, cmCommand); cmTypeMacro(cmStringCommand, cmCommand);

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmTarget.cxx,v $ Module: $RCSfile: cmTarget.cxx,v $
Language: C++ Language: C++
Date: $Date: 2009-02-04 16:44:17 $ Date: $Date: 2009-03-27 15:56:47 $
Version: $Revision: 1.207.2.13 $ Version: $Revision: 1.207.2.15 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -73,7 +73,9 @@ void cmTarget::DefineProperties(cmake *cm)
"BUILD_WITH_INSTALL_RPATH is a boolean specifying whether to link " "BUILD_WITH_INSTALL_RPATH is a boolean specifying whether to link "
"the target in the build tree with the INSTALL_RPATH. This takes " "the target in the build tree with the INSTALL_RPATH. This takes "
"precedence over SKIP_BUILD_RPATH and avoids the need for relinking " "precedence over SKIP_BUILD_RPATH and avoids the need for relinking "
"before installation."); "before installation. "
"This property is initialized by the value of the variable "
"CMAKE_BUILD_WITH_INSTALL_RPATH if it is set when a target is created.");
cm->DefineProperty cm->DefineProperty
("CLEAN_DIRECT_OUTPUT", cmProperty::TARGET, ("CLEAN_DIRECT_OUTPUT", cmProperty::TARGET,
@ -106,7 +108,7 @@ void cmTarget::DefineProperties(cmake *cm)
"(ex. \"COMPILE_DEFINITIONS_DEBUG\").\n" "(ex. \"COMPILE_DEFINITIONS_DEBUG\").\n"
"CMake will automatically drop some definitions that " "CMake will automatically drop some definitions that "
"are not supported by the native build tool. " "are not supported by the native build tool. "
"The VS6 IDE does not support definitions with values " "The VS6 IDE does not support definition values with spaces "
"(but NMake does).\n" "(but NMake does).\n"
"Dislaimer: Most native build tools have poor support for escaping " "Dislaimer: Most native build tools have poor support for escaping "
"certain values. CMake has work-arounds for many cases but some " "certain values. CMake has work-arounds for many cases but some "
@ -341,14 +343,19 @@ void cmTarget::DefineProperties(cmake *cm)
("INSTALL_RPATH", cmProperty::TARGET, ("INSTALL_RPATH", cmProperty::TARGET,
"The rpath to use for installed targets.", "The rpath to use for installed targets.",
"A semicolon-separated list specifying the rpath " "A semicolon-separated list specifying the rpath "
"to use in installed targets (for platforms that support it)."); "to use in installed targets (for platforms that support it). "
"This property is initialized by the value of the variable "
"CMAKE_INSTALL_RPATH if it is set when a target is created.");
cm->DefineProperty cm->DefineProperty
("INSTALL_RPATH_USE_LINK_PATH", cmProperty::TARGET, ("INSTALL_RPATH_USE_LINK_PATH", cmProperty::TARGET,
"Add paths to linker search and installed rpath.", "Add paths to linker search and installed rpath.",
"INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to true will " "INSTALL_RPATH_USE_LINK_PATH is a boolean that if set to true will "
"append directories in the linker search path and outside the " "append directories in the linker search path and outside the "
"project to the INSTALL_RPATH. "); "project to the INSTALL_RPATH. "
"This property is initialized by the value of the variable "
"CMAKE_INSTALL_RPATH_USE_LINK_PATH if it is set when a target is "
"created.");
cm->DefineProperty cm->DefineProperty
("LINK_FLAGS", cmProperty::TARGET, ("LINK_FLAGS", cmProperty::TARGET,
@ -522,7 +529,9 @@ void cmTarget::DefineProperties(cmake *cm)
"Should rpaths be used for the build tree.", "Should rpaths be used for the build tree.",
"SKIP_BUILD_RPATH is a boolean specifying whether to skip automatic " "SKIP_BUILD_RPATH is a boolean specifying whether to skip automatic "
"generation of an rpath allowing the target to run from the " "generation of an rpath allowing the target to run from the "
"build tree. "); "build tree. "
"This property is initialized by the value of the variable "
"CMAKE_SKIP_BUILD_RPATH if it is set when a target is created.");
cm->DefineProperty cm->DefineProperty
("SOVERSION", cmProperty::TARGET, ("SOVERSION", cmProperty::TARGET,

@ -3,8 +3,8 @@
Program: CMake - Cross-Platform Makefile Generator Program: CMake - Cross-Platform Makefile Generator
Module: $RCSfile: cmake.cxx,v $ Module: $RCSfile: cmake.cxx,v $
Language: C++ Language: C++
Date: $Date: 2009-02-06 21:15:16 $ Date: $Date: 2009-03-23 17:58:49 $
Version: $Revision: 1.375.2.17 $ Version: $Revision: 1.375.2.18 $
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
@ -1363,24 +1363,28 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
if(soName != realName) if(soName != realName)
{ {
std::string fname = cmSystemTools::GetFilenameName(realName); std::string fname = cmSystemTools::GetFilenameName(realName);
if(cmSystemTools::FileExists(soName.c_str())) if(cmSystemTools::FileExists(soName.c_str()) ||
cmSystemTools::FileIsSymlink(soName.c_str()))
{ {
cmSystemTools::RemoveFile(soName.c_str()); cmSystemTools::RemoveFile(soName.c_str());
} }
if(!cmSystemTools::CreateSymlink(fname.c_str(), soName.c_str())) if(!cmSystemTools::CreateSymlink(fname.c_str(), soName.c_str()))
{ {
cmSystemTools::ReportLastSystemError("cmake_symlink_library");
result = 1; result = 1;
} }
} }
if(name != soName) if(name != soName)
{ {
std::string fname = cmSystemTools::GetFilenameName(soName); std::string fname = cmSystemTools::GetFilenameName(soName);
if(cmSystemTools::FileExists(soName.c_str())) if(cmSystemTools::FileExists(name.c_str()) ||
cmSystemTools::FileIsSymlink(name.c_str()))
{ {
cmSystemTools::RemoveFile(name.c_str()); cmSystemTools::RemoveFile(name.c_str());
} }
if(!cmSystemTools::CreateSymlink(fname.c_str(), name.c_str())) if(!cmSystemTools::CreateSymlink(fname.c_str(), name.c_str()))
{ {
cmSystemTools::ReportLastSystemError("cmake_symlink_library");
result = 1; result = 1;
} }
} }
@ -1395,12 +1399,14 @@ int cmake::ExecuteCMakeCommand(std::vector<std::string>& args)
if(name != realName) if(name != realName)
{ {
std::string fname = cmSystemTools::GetFilenameName(realName); std::string fname = cmSystemTools::GetFilenameName(realName);
if(cmSystemTools::FileExists(realName.c_str())) if(cmSystemTools::FileExists(name.c_str()) ||
cmSystemTools::FileIsSymlink(name.c_str()))
{ {
cmSystemTools::RemoveFile(name.c_str()); cmSystemTools::RemoveFile(name.c_str());
} }
if(!cmSystemTools::CreateSymlink(fname.c_str(), name.c_str())) if(!cmSystemTools::CreateSymlink(fname.c_str(), name.c_str()))
{ {
cmSystemTools::ReportLastSystemError("cmake_symlink_executable");
result = 1; result = 1;
} }
} }

@ -3,8 +3,8 @@
Program: BatchMake Program: BatchMake
Module: $RCSfile: SystemInformation.cxx,v $ Module: $RCSfile: SystemInformation.cxx,v $
Language: C++ Language: C++
Date: $Date: 2008-12-31 15:14:33 $ Date: $Date: 2009-04-07 19:32:07 $
Version: $Revision: 1.22.2.6 $ Version: $Revision: 1.22.2.7 $
Copyright (c) 2005 Insight Consortium. All rights reserved. Copyright (c) 2005 Insight Consortium. All rights reserved.
See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details.
@ -2273,7 +2273,7 @@ int SystemInformationImplementation::QueryMemory()
unsigned long av=0; unsigned long av=0;
unsigned long ap=0; unsigned long ap=0;
char buffer[1024]; // for skipping unused lines char buffer[1024]; // for reading lines
int linuxMajor = 0; int linuxMajor = 0;
int linuxMinor = 0; int linuxMinor = 0;
@ -2316,34 +2316,39 @@ int SystemInformationImplementation::QueryMemory()
// new /proc/meminfo format since kernel 2.6.x // new /proc/meminfo format since kernel 2.6.x
// Rigorously, this test should check from the developping version 2.5.x // Rigorously, this test should check from the developping version 2.5.x
// that introduced the new format... // that introduced the new format...
long freeMem; enum { mMemTotal, mMemFree, mBuffers, mCached, mSwapTotal, mSwapFree };
long buffersMem; const char* format[6] =
long cachedMem; { "MemTotal:%lu kB", "MemFree:%lu kB", "Buffers:%lu kB",
"Cached:%lu kB", "SwapTotal:%lu kB", "SwapFree:%lu kB" };
fscanf(fd,"MemTotal:%ld kB\n", &this->TotalPhysicalMemory); bool have[6] = { false, false, false, false, false, false };
fscanf(fd,"MemFree:%ld kB\n", &freeMem); unsigned long value[6];
fscanf(fd,"Buffers:%ld kB\n", &buffersMem); int count = 0;
fscanf(fd,"Cached:%ld kB\n", &cachedMem); while(fgets(buffer, sizeof(buffer), fd))
this->TotalPhysicalMemory /= 1024;
this->AvailablePhysicalMemory = freeMem+cachedMem+buffersMem;
this->AvailablePhysicalMemory /= 1024;
// Skip SwapCached, Active, Inactive, HighTotal, HighFree, LowTotal
// and LowFree.
int i=0;
while(i<7)
{ {
fgets(buffer, sizeof(buffer), fd); // skip a line for(int i=0; i < 6; ++i)
++i; {
if(!have[i] && sscanf(buffer, format[i], &value[i]) == 1)
{
have[i] = true;
++count;
}
}
}
if(count == 6)
{
this->TotalPhysicalMemory = value[mMemTotal] / 1024;
this->AvailablePhysicalMemory =
(value[mMemFree] + value[mBuffers] + value[mCached]) / 1024;
this->TotalVirtualMemory = value[mSwapTotal] / 1024;
this->AvailableVirtualMemory = value[mSwapFree] / 1024;
}
else
{
kwsys_ios::cout << "Problem parsing /proc/meminfo" << kwsys_ios::endl;
fclose(fd);
return 0;
} }
fscanf(fd,"SwapTotal:%ld kB\n", &this->TotalVirtualMemory);
fscanf(fd,"SwapFree:%ld kB\n", &this->AvailableVirtualMemory);
this->TotalVirtualMemory /= 1024;
this->AvailableVirtualMemory /= 1024;
} }
else else
{ {

@ -205,6 +205,10 @@ inline void Realpath(const char *path, kwsys_stl::string & resolved_path)
resolved_path = fullpath; resolved_path = fullpath;
KWSYS_NAMESPACE::SystemTools::ConvertToUnixSlashes(resolved_path); KWSYS_NAMESPACE::SystemTools::ConvertToUnixSlashes(resolved_path);
} }
else
{
resolved_path = path;
}
} }
#else #else
#include <sys/types.h> #include <sys/types.h>
@ -237,8 +241,16 @@ inline void Realpath(const char *path, kwsys_stl::string & resolved_path)
{ {
char resolved_name[KWSYS_SYSTEMTOOLS_MAXPATH]; char resolved_name[KWSYS_SYSTEMTOOLS_MAXPATH];
realpath(path, resolved_name); char *ret = realpath(path, resolved_name);
resolved_path = resolved_name; if(ret)
{
resolved_path = ret;
}
else
{
// if path resolution fails, return what was passed in
resolved_path = path;
}
} }
#endif #endif
@ -3046,6 +3058,11 @@ kwsys_stl::string SystemTools::GetActualCaseForPath(const char* p)
{ {
return p; return p;
} }
// Use original path if conversion back to a long path failed.
if(longPath == shortPath)
{
longPath = p;
}
// make sure drive letter is always upper case // make sure drive letter is always upper case
if(longPath.size() > 1 && longPath[1] == ':') if(longPath.size() > 1 && longPath[1] == ':')
{ {

@ -351,7 +351,9 @@ public:
const char* in_base); const char* in_base);
/** /**
* Get the real path for a given path, removing all symlinks. * Get the real path for a given path, removing all symlinks. In
* the event of an error (non-existent path, permissions issue,
* etc.) the original path is returned.
*/ */
static kwsys_stl::string GetRealPath(const char* path); static kwsys_stl::string GetRealPath(const char* path);

@ -14,6 +14,7 @@ AddCMakeTest(VariableWatch "")
AddCMakeTest(Include "") AddCMakeTest(Include "")
AddCMakeTest(FindBase "") AddCMakeTest(FindBase "")
AddCMakeTest(Toolchain "") AddCMakeTest(Toolchain "")
AddCMakeTest(GetFilenameComponentRealpath "")
# Not ready for Unix testing yet. Coming "soon"... # Not ready for Unix testing yet. Coming "soon"...
# #

@ -0,0 +1,57 @@
set(bindir ${CMAKE_CURRENT_BINARY_DIR})
#
# Test nonexistent REALPATH & ABSOLUTE resolution
#
get_filename_component(nonexistent1 ${bindir}/THIS_IS_A_NONEXISTENT_FILE REALPATH)
get_filename_component(nonexistent2 ${bindir}/THIS_IS_A_NONEXISTENT_FILE ABSOLUTE)
if(NOT nonexistent1 STREQUAL "${bindir}/THIS_IS_A_NONEXISTENT_FILE")
message(FATAL_ERROR "REALPATH is not preserving nonexistent files")
endif()
if(NOT nonexistent2 STREQUAL "${bindir}/THIS_IS_A_NONEXISTENT_FILE")
message(FATAL_ERROR "ABSOLUTE is not preserving nonexistent files")
endif()
#
# Test symbolic link resolution
#
if(UNIX)
# file1 => file2 => file3 (real)
file(WRITE ${bindir}/file3 "test file")
find_program(LN NAMES "ln")
if(LN)
# Create symlinks using "ln -s"
if(NOT EXISTS ${bindir}/file2)
execute_process(COMMAND ${LN} "-s" "${bindir}/file3" "${bindir}/file2")
endif()
if(NOT EXISTS ${bindir}/file1)
execute_process(COMMAND ${LN} "-s" "${bindir}/file2" "${bindir}/file1")
endif()
get_filename_component(file1 ${bindir}/file1 REALPATH)
get_filename_component(file2 ${bindir}/file2 REALPATH)
get_filename_component(file3 ${bindir}/file3 REALPATH)
if(NOT file3 STREQUAL "${bindir}/file3")
message(FATAL_ERROR "CMake fails resolving REALPATH file file3")
endif()
if(NOT file2 STREQUAL "${bindir}/file3")
message(FATAL_ERROR "CMake fails resolving simple symlink")
endif()
if(NOT file1 STREQUAL "${bindir}/file3")
message(FATAL_ERROR "CMake fails resolving double symlink")
endif()
# cleanup
file(REMOVE ${bindir}/file1)
file(REMOVE ${bindir}/file2)
if(EXISTS file1 OR EXISTS file2)
message(FATAL_ERROR "removal of file1 or file2 failed")
endif()
endif(LN)
file(REMOVE ${bindir}/file3)
endif()

@ -0,0 +1,69 @@
# Import targets from the exported build tree.
include(${Import_BINARY_DIR}/../Export/ExportBuildTree.cmake)
# Import targets from the exported install tree.
include(${CMAKE_INSTALL_PREFIX}/lib/exp/exp.cmake)
# Try referencing an executable imported from the install tree.
add_custom_command(
OUTPUT ${Import_BINARY_DIR}/exp_generated.c
COMMAND exp_testExe1 ${Import_BINARY_DIR}/exp_generated.c
DEPENDS exp_testExe1
)
add_custom_command(
OUTPUT ${Import_BINARY_DIR}/exp_generated3.c
COMMAND exp_testExe3 ${Import_BINARY_DIR}/exp_generated3.c
DEPENDS exp_testExe3
)
add_executable(imp_testExe1
imp_testExe1.c
${Import_BINARY_DIR}/exp_generated.c
${Import_BINARY_DIR}/exp_generated3.c
)
# Try linking to a library imported from the install tree.
target_link_libraries(imp_testExe1 exp_testLib2 exp_testLib3 exp_testLib4)
# Try building a plugin to an executable imported from the install tree.
add_library(imp_mod1 MODULE imp_mod1.c)
target_link_libraries(imp_mod1 exp_testExe2)
# Try referencing an executable imported from the build tree.
add_custom_command(
OUTPUT ${Import_BINARY_DIR}/bld_generated.c
COMMAND bld_testExe1 ${Import_BINARY_DIR}/bld_generated.c
DEPENDS bld_testExe1
)
add_custom_command(
OUTPUT ${Import_BINARY_DIR}/bld_generated3.c
COMMAND bld_testExe3 ${Import_BINARY_DIR}/bld_generated3.c
DEPENDS bld_testExe3
)
add_executable(imp_testExe1b
imp_testExe1.c
${Import_BINARY_DIR}/bld_generated.c
${Import_BINARY_DIR}/bld_generated3.c
)
# Try linking to a library imported from the build tree.
target_link_libraries(imp_testExe1b bld_testLib2 bld_testLib3 bld_testLib4)
# Try building a plugin to an executable imported from the build tree.
add_library(imp_mod1b MODULE imp_mod1.c)
target_link_libraries(imp_mod1b bld_testExe2)
# Export/CMakeLists.txt pretends the RelWithDebInfo (as well as Debug)
# configuration should link to debug libs.
foreach(c DEBUG RELWITHDEBINFO)
set_property(TARGET imp_testExe1 PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG)
set_property(TARGET imp_testExe1b PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG)
endforeach(c)
# Create a library to be linked by another directory in this project
# to test transitive linking to otherwise invisible imported targets.
add_library(imp_lib1 STATIC imp_lib1.c)
target_link_libraries(imp_lib1 exp_testLib2)
add_library(imp_lib1b STATIC imp_lib1.c)
target_link_libraries(imp_lib1b bld_testLib2)

@ -0,0 +1,6 @@
extern int testLib2(void);
int imp_lib1(void)
{
return testLib2();
}

@ -6,65 +6,19 @@ if(CMAKE_ANSI_CFLAGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
endif(CMAKE_ANSI_CFLAGS) endif(CMAKE_ANSI_CFLAGS)
# Import targets from the exported build tree. # Import everything in a subdirectory.
include(${Import_BINARY_DIR}/../Export/ExportBuildTree.cmake) add_subdirectory(A)
# Import targets from the exported install tree. # Make sure the imported targets are scoped inside the subdirectory.
include(${CMAKE_INSTALL_PREFIX}/lib/exp/exp.cmake) if(TARGET exp_testLib2)
message(FATAL_ERROR "Imported target exp_testLib2 is not scoped in subdir!")
# Try referencing an executable imported from the install tree. endif()
add_custom_command( if(TARGET bld_testLib2)
OUTPUT ${Import_BINARY_DIR}/exp_generated.c message(FATAL_ERROR "Imported target bld_testLib2 is not scoped in subdir!")
COMMAND exp_testExe1 ${Import_BINARY_DIR}/exp_generated.c endif()
DEPENDS exp_testExe1
) # Test transitive linking to a target imported in the subdirectory.
add_custom_command( add_executable(imp_testTransExe1 imp_testTransExe1.c)
OUTPUT ${Import_BINARY_DIR}/exp_generated3.c target_link_libraries(imp_testTransExe1 imp_lib1)
COMMAND exp_testExe3 ${Import_BINARY_DIR}/exp_generated3.c add_executable(imp_testTransExe1b imp_testTransExe1.c)
DEPENDS exp_testExe3 target_link_libraries(imp_testTransExe1b imp_lib1b)
)
add_executable(imp_testExe1
imp_testExe1.c
${Import_BINARY_DIR}/exp_generated.c
${Import_BINARY_DIR}/exp_generated3.c
)
# Try linking to a library imported from the install tree.
target_link_libraries(imp_testExe1 exp_testLib2 exp_testLib3 exp_testLib4)
# Try building a plugin to an executable imported from the install tree.
add_library(imp_mod1 MODULE imp_mod1.c)
target_link_libraries(imp_mod1 exp_testExe2)
# Try referencing an executable imported from the build tree.
add_custom_command(
OUTPUT ${Import_BINARY_DIR}/bld_generated.c
COMMAND bld_testExe1 ${Import_BINARY_DIR}/bld_generated.c
DEPENDS bld_testExe1
)
add_custom_command(
OUTPUT ${Import_BINARY_DIR}/bld_generated3.c
COMMAND bld_testExe3 ${Import_BINARY_DIR}/bld_generated3.c
DEPENDS bld_testExe3
)
add_executable(imp_testExe1b
imp_testExe1.c
${Import_BINARY_DIR}/bld_generated.c
${Import_BINARY_DIR}/bld_generated3.c
)
# Try linking to a library imported from the build tree.
target_link_libraries(imp_testExe1b bld_testLib2 bld_testLib3 bld_testLib4)
# Try building a plugin to an executable imported from the build tree.
add_library(imp_mod1b MODULE imp_mod1.c)
target_link_libraries(imp_mod1b bld_testExe2)
# Export/CMakeLists.txt pretends the RelWithDebInfo (as well as Debug)
# configuration should link to debug libs.
foreach(c DEBUG RELWITHDEBINFO)
set_property(TARGET imp_testExe1 PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG)
set_property(TARGET imp_testExe1b PROPERTY COMPILE_DEFINITIONS_${c} EXE_DBG)
endforeach(c)

@ -0,0 +1,6 @@
extern int imp_lib1(void);
int main()
{
return imp_lib1();
}

@ -127,6 +127,7 @@ if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
in_interface/module.f90) in_interface/module.f90)
add_definitions(-DFOO -DBAR=1) add_definitions(-DFOO -DBAR=1)
include_directories(${testf_SOURCE_DIR}/include)
add_executable(test_preprocess test_preprocess.F90) add_executable(test_preprocess test_preprocess.F90)
set(TEST_MODULE_DEPENDS 1) set(TEST_MODULE_DEPENDS 1)

@ -0,0 +1,5 @@
#ifdef BAR
PRINT * , 'BAR was defined via ADD_DEFINITIONS'
#else
PRINT *, 'If you can read this something went wrong'
#endif

@ -46,10 +46,6 @@ PROGRAM PPTEST
#endif #endif
! 0 ; <empty> ! 0 ; <empty>
#ifdef BAR #include "test_preprocess.h"
PRINT * , 'BAR was defined via ADD_DEFINITIONS'
#else
PRINT *, 'If you can read this something went wrong'
#endif
END PROGRAM END PROGRAM

@ -86,3 +86,8 @@ ELSE(SOME_CHECK)
ENDIF(SOME_CHECK) ENDIF(SOME_CHECK)
ADD_EXECUTABLE(MacroTest macroTest.c) ADD_EXECUTABLE(MacroTest macroTest.c)
MACRO(GET_CURRENT_FILE var)
SET(${var} ${CMAKE_CURRENT_LIST_FILE})
ENDMACRO(GET_CURRENT_FILE)
INCLUDE(context.cmake)

@ -0,0 +1,10 @@
GET_CURRENT_FILE(current_file)
IF(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}")
MESSAGE(FATAL_ERROR
"Macro file context is broken. Expected:\n"
" ${CMAKE_CURRENT_LIST_FILE}\n"
"but got:\n"
" ${current_file}\n"
"from the macro."
)
ENDIF(NOT "${current_file}" STREQUAL "${CMAKE_CURRENT_LIST_FILE}")

@ -65,14 +65,20 @@ if(NOT BORLAND AND NOT PP_VS70)
set(SEMICOLON "\;") set(SEMICOLON "\;")
endif(NOT BORLAND AND NOT PP_VS70) endif(NOT BORLAND AND NOT PP_VS70)
if(NOT PP_BORLAND AND NOT PP_WATCOM) if(NOT PP_VS6)
# Borland, WMake: multiple spaces # VS 6 IDE: spaces
# The make tool seems to remove extra whitespace from inside # The project parser unconditionally separates arguments at spaces.
# quoted strings when passing to the compiler. It does not have set(STRING_EXTRA "${STRING_EXTRA} ")
# trouble passing to other tools, and the compiler may be directly
# invoked from the command line. if(NOT PP_BORLAND AND NOT PP_WATCOM)
set(STRING_EXTRA "${STRING_EXTRA} ") # Borland, WMake: multiple spaces
endif(NOT PP_BORLAND AND NOT PP_WATCOM) # The make tool seems to remove extra whitespace from inside
# quoted strings when passing to the compiler. It does not have
# trouble passing to other tools, and the compiler may be directly
# invoked from the command line.
set(STRING_EXTRA "${STRING_EXTRA} ")
endif(NOT PP_BORLAND AND NOT PP_WATCOM)
endif(NOT PP_VS6)
if(NOT PP_VS) if(NOT PP_VS)
# VS: , # VS: ,
@ -152,7 +158,7 @@ endif(PP_NMAKE OR PP_UMAKE)
# support it and it is not an operator it is not worthwhile. # support it and it is not an operator it is not worthwhile.
# Compose the final test string. # Compose the final test string.
set(STRING_VALUE "hello `~!@$*)(_+-=}{][:'.?/ ${STRING_EXTRA}world") set(STRING_VALUE "hello`~!@$*)(_+-=}{][:'.?/${STRING_EXTRA}world")
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Function-style macro command-line support: # Function-style macro command-line support:
@ -194,11 +200,7 @@ endif(PP_VS6)
add_definitions(-DOLD_DEF -DOLD_EXPR=2) add_definitions(-DOLD_DEF -DOLD_EXPR=2)
# Make sure old-style definitions are converted to directory property. # Make sure old-style definitions are converted to directory property.
if(PREPROCESS_VS6) set(OLD_DEFS_EXPECTED "OLD_DEF;OLD_EXPR=2")
set(OLD_DEFS_EXPECTED "OLD_DEF")
else(PREPROCESS_VS6)
set(OLD_DEFS_EXPECTED "OLD_DEF;OLD_EXPR=2")
endif(PREPROCESS_VS6)
get_property(OLD_DEFS DIRECTORY PROPERTY COMPILE_DEFINITIONS) get_property(OLD_DEFS DIRECTORY PROPERTY COMPILE_DEFINITIONS)
if(NOT "${OLD_DEFS}" STREQUAL "${OLD_DEFS_EXPECTED}") if(NOT "${OLD_DEFS}" STREQUAL "${OLD_DEFS_EXPECTED}")
message(SEND_ERROR "add_definitions not converted to directory property!") message(SEND_ERROR "add_definitions not converted to directory property!")
@ -225,23 +227,26 @@ foreach(c "" "_DEBUG" "_RELEASE")
) )
endforeach(c) endforeach(c)
# Add definitions with values. VS6 does not support this. # Add definitions with values.
if(NOT PREPROCESS_VS6) if(NOT PREPROCESS_VS6)
set_property( # The path might have spaces, which VS6 does not support.
TARGET Preprocess set(DEF_TARGET_PATH "TARGET_PATH=\"${TARGET_PATH}\"")
APPEND PROPERTY COMPILE_DEFINITIONS set(DEF_FILE_PATH "FILE_PATH=\"${FILE_PATH}\"")
"TARGET_STRING=\"${STRING_VALUE}${SEMICOLON}\""
"TARGET_EXPR=${EXPR}"
"TARGET_PATH=\"${TARGET_PATH}\""
)
set_property(
SOURCE preprocess.c preprocess${VS6}.cxx
APPEND PROPERTY COMPILE_DEFINITIONS
"FILE_STRING=\"${STRING_VALUE}${SEMICOLON}\""
"FILE_EXPR=${EXPR}"
"FILE_PATH=\"${FILE_PATH}\""
)
endif(NOT PREPROCESS_VS6) endif(NOT PREPROCESS_VS6)
set_property(
TARGET Preprocess
APPEND PROPERTY COMPILE_DEFINITIONS
"TARGET_STRING=\"${STRING_VALUE}${SEMICOLON}\""
"TARGET_EXPR=${EXPR}"
${DEF_TARGET_PATH}
)
set_property(
SOURCE preprocess.c preprocess${VS6}.cxx
APPEND PROPERTY COMPILE_DEFINITIONS
"FILE_STRING=\"${STRING_VALUE}${SEMICOLON}\""
"FILE_EXPR=${EXPR}"
${DEF_FILE_PATH}
)
# Helper target for running test manually in build tree. # Helper target for running test manually in build tree.
add_custom_target(drive COMMAND Preprocess) add_custom_target(drive COMMAND Preprocess)

@ -9,7 +9,6 @@
int check_defines_C(void) int check_defines_C(void)
{ {
int result = 1; int result = 1;
#ifndef PREPROCESS_VS6
if(strcmp(FILE_STRING, STRING_VALUE) != 0) if(strcmp(FILE_STRING, STRING_VALUE) != 0)
{ {
fprintf(stderr, fprintf(stderr,
@ -38,7 +37,6 @@ int check_defines_C(void)
result = 0; result = 0;
} }
} }
#endif
#ifdef NDEBUG #ifdef NDEBUG
# ifdef FILE_DEF_DEBUG # ifdef FILE_DEF_DEBUG
{ {

@ -11,7 +11,6 @@ extern "C" int check_defines_C(void);
int check_defines_CXX() int check_defines_CXX()
{ {
int result = 1; int result = 1;
#ifndef PREPROCESS_VS6
if(strcmp(FILE_STRING, STRING_VALUE) != 0) if(strcmp(FILE_STRING, STRING_VALUE) != 0)
{ {
fprintf(stderr, fprintf(stderr,
@ -40,7 +39,6 @@ int check_defines_CXX()
result = 0; result = 0;
} }
} }
#endif
#ifdef NDEBUG #ifdef NDEBUG
# ifdef FILE_DEF_DEBUG # ifdef FILE_DEF_DEBUG
{ {

@ -6,6 +6,7 @@ INCLUDE (${CMAKE_ROOT}/Modules/FindX11.cmake)
MESSAGE("X11_FOUND: ${X11_FOUND}") MESSAGE("X11_FOUND: ${X11_FOUND}")
ADD_EXECUTABLE (UseX11 X11.c) ADD_EXECUTABLE (UseX11 X11.c)
install(TARGETS UseX11 DESTINATION bin)
# so for universal binaries this test will fail if # so for universal binaries this test will fail if
# #
@ -26,10 +27,14 @@ IF(X11_FOUND)
IF(APPLE) IF(APPLE)
ADD_EXECUTABLE(HelloWorldX11 HelloWorldX11.cxx) ADD_EXECUTABLE(HelloWorldX11 HelloWorldX11.cxx)
TARGET_LINK_LIBRARIES(HelloWorldX11 ${X11_LIBRARIES}) TARGET_LINK_LIBRARIES(HelloWorldX11 ${X11_LIBRARIES})
install( TARGETS HelloWorldX11 DESTINATION bin) install(TARGETS HelloWorldX11 DESTINATION bin)
# build a CPack driven installer package
set(CPACK_BINARY_OSXX11 ON CACHE BOOL "" FORCE)
set(CPACK_BINARY_PACKAGEMAKER OFF CACHE BOOL "" FORCE )
set(CPACK_PACKAGE_NAME HelloWorldX11Package) set(CPACK_PACKAGE_NAME HelloWorldX11Package)
set(CPACK_PACKAGE_EXECUTABLES HelloWorldX11 HelloWorldX11) set(CPACK_PACKAGE_EXECUTABLES HelloWorldX11 HelloWorldX11)
include(CPack)
ENDIF(APPLE) ENDIF(APPLE)
ENDIF(X11_FOUND) ENDIF(X11_FOUND)
# build a CPack driven installer package
include(CPack)

Loading…
Cancel
Save