Merge branch 'ImprovedDotSupport2' into dev/strict-mode

Conflicts:
	Source/cmake.cxx
This commit is contained in:
Brad King 2010-12-17 10:32:01 -05:00
commit ad25a968b9
40 changed files with 1210 additions and 649 deletions

View File

@ -180,7 +180,22 @@ MACRO(CMAKE_SETUP_TESTING)
ENDMACRO(CMAKE_SETUP_TESTING)
# Provide a way for Visual Studio Express users to turn OFF the new FOLDER
# organization feature. Default to ON for non-Express users. Express users must
# explicitly turn off this option to build CMake in the Express IDE...
#
OPTION(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON)
MARK_AS_ADVANCED(CMAKE_USE_FOLDERS)
#-----------------------------------------------------------------------
# a macro that only sets the FOLDER target property if it's
# "appropriate"
#-----------------------------------------------------------------------
MACRO(CMAKE_SET_TARGET_FOLDER tgt folder)
IF(CMAKE_USE_FOLDERS)
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
# Really, I just want this to be an "if(TARGET ${tgt})" ...
# but I'm not sure that our min req'd., CMake 2.4.5 can handle
# that... so I'm just activating this for now, with a version
@ -190,6 +205,9 @@ MACRO(CMAKE_SET_TARGET_FOLDER tgt folder)
SET_PROPERTY(TARGET "${tgt}" PROPERTY FOLDER "${folder}")
ENDIF()
ENDIF()
ELSE()
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS OFF)
ENDIF()
ENDMACRO(CMAKE_SET_TARGET_FOLDER)

View File

@ -26,6 +26,8 @@ ELSE(UNIX)
SET(CMAKE_C_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
SET(_INCLUDED_FILE 0)
# Load compiler-specific information.
IF(CMAKE_C_COMPILER_ID)
INCLUDE(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL)

View File

@ -26,6 +26,8 @@ ELSE(UNIX)
SET(CMAKE_CXX_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
SET(_INCLUDED_FILE 0)
# Load compiler-specific information.
IF(CMAKE_CXX_COMPILER_ID)
INCLUDE(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL)

View File

@ -23,8 +23,8 @@
# ===========================
#=============================================================================
# Copyright 2009 Kitware, Inc.
# Copyright 2009 Philip Lowman <philip@yhbt.com>
# Copyright 2009-2010 Kitware, Inc.
# Copyright 2009-2010 Philip Lowman <philip@yhbt.com>
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
@ -47,6 +47,8 @@ function(_DetermineVSServicePackFromCompiler _OUT_VAR _cl_version)
set(_version "vc90")
elseif(${_cl_version} VERSION_EQUAL "15.00.30729.01")
set(_version "vc90sp1")
elseif(${_cl_version} VERSION_EQUAL "16.00.30319.01")
set(_version "vc100")
else()
set(_version "")
endif()

View File

@ -16,6 +16,8 @@
# It also loads the available platform file for the system-compiler
# if it exists.
SET(_INCLUDED_FILE 0)
# Load compiler-specific information.
IF(CMAKE_Fortran_COMPILER_ID)
INCLUDE(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL)

View File

@ -62,7 +62,43 @@
# Default : -
# May be set when invoking cpack in order to trace debug informations
# during CPackDeb run.
# CPACK_DEBIAN_PACKAGE_PREDEPENDS
# Mandatory : NO
# Default : -
# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
# This field is like Depends, except that it also forces dpkg to complete installation of
# the packages named before even starting the installation of the package which declares
# the pre-dependency.
# CPACK_DEBIAN_PACKAGE_ENHANCES
# Mandatory : NO
# Default : -
# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
# This field is similar to Suggests but works in the opposite direction.
# It is used to declare that a package can enhance the functionality of another package.
# CPACK_DEBIAN_PACKAGE_BREAKS
# Mandatory : NO
# Default : -
# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
# When one binary package declares that it breaks another, dpkg will refuse to allow the
# package which declares Breaks be installed unless the broken package is deconfigured first,
# and it will refuse to allow the broken package to be reconfigured.
# CPACK_DEBIAN_PACKAGE_CONFLICTS
# Mandatory : NO
# Default : -
# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
# When one binary package declares a conflict with another using a Conflicts field,
# dpkg will refuse to allow them to be installed on the system at the same time.
# CPACK_DEBIAN_PACKAGE_PROVIDES
# Mandatory : NO
# Default : -
# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
# A virtual package is one which appears in the Provides control field of another package.
# CPACK_DEBIAN_PACKAGE_REPLACES
# Mandatory : NO
# Default : -
# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
# Packages can declare in their control file that they should overwrite
# files in certain other packages, or completely replace other packages.
#=============================================================================
# Copyright 2007-2009 Kitware, Inc.

View File

@ -548,16 +548,16 @@ Vendor: \@CPACK_RPM_PACKAGE_VENDOR\@
# We do only save CPack installed tree in _prepr
# and then restore it in build.
%prep
mv $RPM_BUILD_ROOT \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot
mv $RPM_BUILD_ROOT \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\"
#p build
%install
if [ -e $RPM_BUILD_ROOT ];
then
mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot/* $RPM_BUILD_ROOT
mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot/*\" $RPM_BUILD_ROOT
else
mv \@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot $RPM_BUILD_ROOT
mv \"\@CPACK_TOPLEVEL_DIRECTORY\@/tmpBBroot\" $RPM_BUILD_ROOT
fi
%clean

View File

@ -597,8 +597,7 @@ function(_ep_get_build_command name step cmd_var)
# CMake project. Select build command based on generator.
get_target_property(cmake_generator ${name} _EP_CMAKE_GENERATOR)
if("${CMAKE_GENERATOR}" MATCHES "Make" AND
("${cmake_generator}" STREQUAL "${CMAKE_GENERATOR}" OR
NOT cmake_generator))
("${cmake_generator}" MATCHES "Make" OR NOT cmake_generator))
# The project uses the same Makefile generator. Use recursive make.
set(cmd "$(MAKE)")
if(step STREQUAL "INSTALL")
@ -985,8 +984,15 @@ function(_ep_add_download_command name)
get_filename_component(src_name "${source_dir}" NAME)
get_filename_component(work_dir "${source_dir}" PATH)
set(comment "Performing download step (SVN checkout) for '${name}'")
set(svn_user_pw_args "")
if(svn_username)
set(svn_user_pw_args ${svn_user_pw_args} "--username=${svn_username}")
endif()
if(svn_password)
set(svn_user_pw_args ${svn_user_pw_args} "--password=${svn_password}")
endif()
set(cmd ${Subversion_SVN_EXECUTABLE} co ${svn_repository} ${svn_revision}
--username=${svn_username} --password=${svn_password} ${src_name})
${svn_user_pw_args} ${src_name})
list(APPEND depends ${stamp_dir}/${name}-svninfo.txt)
elseif(git_repository)
find_package(Git)
@ -1125,8 +1131,15 @@ function(_ep_add_update_command name)
get_property(svn_revision TARGET ${name} PROPERTY _EP_SVN_REVISION)
get_property(svn_username TARGET ${name} PROPERTY _EP_SVN_USERNAME)
get_property(svn_password TARGET ${name} PROPERTY _EP_SVN_PASSWORD)
set(svn_user_pw_args "")
if(svn_username)
set(svn_user_pw_args ${svn_user_pw_args} "--username=${svn_username}")
endif()
if(svn_password)
set(svn_user_pw_args ${svn_user_pw_args} "--password=${svn_password}")
endif()
set(cmd ${Subversion_SVN_EXECUTABLE} up ${svn_revision}
--username=${svn_username} --password=${svn_password})
${svn_user_pw_args})
set(always 1)
elseif(git_repository)
if(NOT GIT_EXECUTABLE)

View File

@ -20,7 +20,6 @@
# set(Boost_USE_STATIC_LIBS ON)
# set(Boost_USE_MULTITHREADED ON)
# set(Boost_USE_STATIC_RUNTIME OFF)
# set(Boost_COMPAT_STATIC_RUNTIME OFF)
# find_package( Boost 1.36.0 COMPONENTS date_time filesystem system ... )
#
# if(Boost_FOUND)
@ -94,7 +93,10 @@
#
# Boost_USE_STATIC_RUNTIME If enabled, searches for boost libraries
# linked against a static C++ standard library
# ('s' ABI tag). Defaults to OFF.
# ('s' ABI tag). This option should be set to
# ON or OFF because the default behavior
# if not specified is platform dependent
# for backwards compatibility.
# [Since CMake 2.8.3]
#
# Boost_USE_DEBUG_PYTHON If enabled, searches for boost libraries
@ -114,14 +116,6 @@
# Defaults to OFF.
# [Since CMake 2.8.3]
#
# Boost_COMPAT_STATIC_RUNTIME Set to OFF to disable backwards compatible
# searching for libraries with the 's' ABI
# tag on WIN32 after normal searches. You
# should set this to OFF and also set
# Boost_USE_STATIC_RUNTIME appropriately.
# If not specified, defaults to ON.
# [Since CMake 2.8.3]
#
# Other Variables used by this module which you may want to set.
#
# Boost_ADDITIONAL_VERSIONS A list of version numbers to use for searching
@ -372,9 +366,6 @@ endfunction()
IF(NOT DEFINED Boost_USE_MULTITHREADED)
SET(Boost_USE_MULTITHREADED TRUE)
ENDIF()
if(NOT DEFINED Boost_COMPAT_STATIC_RUNTIME)
set(Boost_COMPAT_STATIC_RUNTIME TRUE)
endif()
if(Boost_FIND_VERSION_EXACT)
# The version may appear in a directory with or without the patch
@ -868,11 +859,11 @@ ELSE (_boost_IN_CACHE)
# 1. Search for static libs compiled against a SHARED C++ standard runtime library (use if found)
# 2. Search for static libs compiled against a STATIC C++ standard runtime library (use if found)
# We maintain this behavior since changing it could break people's builds.
# To disable the ambiguous behavior, the user can
# set Boost_COMPAT_STATIC_RUNTIME to FALSE
# To disable the ambiguous behavior, the user need only
# set Boost_USE_STATIC_RUNTIME either ON or OFF.
set(_boost_STATIC_RUNTIME_WORKAROUND false)
if(Boost_COMPAT_STATIC_RUNTIME AND WIN32 AND Boost_USE_STATIC_LIBS)
if(NOT Boost_USE_STATIC_RUNTIME)
if(WIN32 AND Boost_USE_STATIC_LIBS)
if(NOT DEFINED Boost_USE_STATIC_RUNTIME)
set(_boost_STATIC_RUNTIME_WORKAROUND true)
endif()
endif()

View File

@ -612,8 +612,10 @@ else()
endif()
########################
# Look for the SDK stuff
# Look for the SDK stuff. As of CUDA 3.0 NVSDKCUDA_ROOT has been replaced with
# NVSDKCOMPUTE_ROOT with the old CUDA C contents moved into the C subdirectory
find_path(CUDA_SDK_ROOT_DIR common/inc/cutil.h
"$ENV{NVSDKCOMPUTE_ROOT}/C"
"$ENV{NVSDKCUDA_ROOT}"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\NVIDIA Corporation\\Installed Products\\NVIDIA SDK 10\\Compute;InstallDir]"
"/Developer/GPU\ Computing/C"
@ -941,8 +943,8 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
# we convert the strings to lists (like we want).
if(CUDA_PROPAGATE_HOST_FLAGS)
# nvcc chokes on -g3, so replace it with -g
if(CMAKE_COMPILER_IS_GNUCC)
# nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g
if(CMAKE_COMPILER_IS_GNUCC AND CUDA_VERSION VERSION_LESS "3.0")
string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")
else()
set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")

View File

@ -293,7 +293,7 @@ else()
# If the HDF5 include directory was found, open H5pubconf.h to determine if
# HDF5 was compiled with parallel IO support
set( HDF5_IS_PARALLEL FALSE )
foreach( _dir HDF5_INCLUDE_DIRS )
foreach( _dir IN LISTS HDF5_INCLUDE_DIRS )
if( EXISTS "${_dir}/H5pubconf.h" )
file( STRINGS "${_dir}/H5pubconf.h"
HDF5_HAVE_PARALLEL_DEFINE

View File

@ -81,6 +81,7 @@ set(_MPI_PACKAGE_DIR
lib/openmpi
"MPICH/SDK"
"Microsoft Compute Cluster Pack"
"Microsoft HPC Pack 2008 R2"
)
set(_MPI_PREFIX_PATH)
@ -306,7 +307,7 @@ else (MPI_COMPILE_CMDLINE)
# No MPI compiler to interogate so attempt to find everything with find functions.
find_path(MPI_INCLUDE_PATH mpi.h
HINTS ${_MPI_BASE_DIR} ${_MPI_PREFIX_PATH}
PATH_SUFFIXES include
PATH_SUFFIXES include Inc
)
# Decide between 32-bit and 64-bit libraries for Microsoft's MPI

View File

@ -27,7 +27,7 @@ INCLUDE(CMakeFindFrameworks)
# Search for the python framework on Apple.
CMAKE_FIND_FRAMEWORKS(Python)
FOREACH(_CURRENT_VERSION 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
FOREACH(_CURRENT_VERSION 2.7 2.6 2.5 2.4 2.3 2.2 2.1 2.0 1.6 1.5)
STRING(REPLACE "." "" _CURRENT_VERSION_NO_DOTS ${_CURRENT_VERSION})
IF(WIN32)
FIND_LIBRARY(PYTHON_DEBUG_LIBRARY

View File

@ -242,6 +242,7 @@
# QT_LIBRARY_DIR Path to "lib" of Qt4
# QT_PLUGINS_DIR Path to "plugins" for Qt4
# QT_TRANSLATIONS_DIR Path to "translations" of Qt4
# QT_IMPORTS_DIR Path to "imports" of Qt4
# QT_DOC_DIR Path to "doc" of Qt4
# QT_MKSPECS_DIR Path to "mkspecs" of Qt4
#
@ -445,6 +446,14 @@ MACRO (_QT4_ADJUST_LIB_VARS _camelCaseBasename)
MARK_AS_ADVANCED(QT_${basename}_LIBRARY QT_${basename}_LIBRARY_RELEASE QT_${basename}_LIBRARY_DEBUG QT_${basename}_INCLUDE_DIR)
ENDMACRO (_QT4_ADJUST_LIB_VARS)
function(_QT4_QUERY_QMAKE VAR RESULT)
exec_program(${QT_QMAKE_EXECUTABLE} ARGS "-query ${VAR}" RETURN_VALUE return_code OUTPUT_VARIABLE output )
if(NOT return_code)
file(TO_CMAKE_PATH "${output}" output)
set(${RESULT} ${output} PARENT_SCOPE)
endif(NOT return_code)
endfunction(_QT4_QUERY_QMAKE)
SET(QT4_INSTALLED_VERSION_TOO_OLD FALSE)
@ -470,7 +479,7 @@ IF (QT_QMAKE_EXECUTABLE)
SET(QT4_QMAKE_FOUND FALSE)
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE} ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION)
_qt4_query_qmake(QT_VERSION QTVERSION)
# check for qt3 qmake and then try and find qmake4 or qmake-qt4 in the path
IF("${QTVERSION}" MATCHES "Unknown")
@ -482,8 +491,7 @@ IF (QT_QMAKE_EXECUTABLE)
DOC "The qmake executable for the Qt installation to use"
)
IF(QT_QMAKE_EXECUTABLE)
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_VERSION" OUTPUT_VARIABLE QTVERSION)
_qt4_query_qmake(QT_VERSION QTVERSION)
ENDIF(QT_QMAKE_EXECUTABLE)
ENDIF("${QTVERSION}" MATCHES "Unknown")
@ -559,9 +567,7 @@ IF (QT4_QMAKE_FOUND)
# ask qmake for the mkspecs directory
# we do this first because QT_LIBINFIX might be set
IF (NOT QT_MKSPECS_DIR OR QT_QMAKE_CHANGED)
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QMAKE_MKSPECS"
OUTPUT_VARIABLE qt_mkspecs_dirs )
_qt4_query_qmake(QMAKE_MKSPECS qt_mkspecs_dirs)
# do not replace : on windows as it might be a drive letter
# and windows should already use ; as a separator
IF(NOT WIN32)
@ -592,11 +598,7 @@ IF (QT4_QMAKE_FOUND)
# ask qmake for the library dir as a hint, then search for QtCore library and use that as a reference for finding the
# others and for setting QT_LIBRARY_DIR
IF (NOT QT_QTCORE_LIBRARY OR QT_QMAKE_CHANGED)
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_LIBS"
OUTPUT_VARIABLE QT_LIBRARY_DIR_TMP )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${QT_LIBRARY_DIR_TMP}" QT_LIBRARY_DIR_TMP)
_qt4_query_qmake(QT_INSTALL_LIBS QT_LIBRARY_DIR_TMP)
SET(QT_QTCORE_LIBRARY_RELEASE NOTFOUND)
SET(QT_QTCORE_LIBRARY_DEBUG NOTFOUND)
FIND_LIBRARY(QT_QTCORE_LIBRARY_RELEASE
@ -649,21 +651,13 @@ IF (QT4_QMAKE_FOUND)
# ask qmake for the binary dir
IF (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
EXEC_PROGRAM(${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_BINS"
OUTPUT_VARIABLE qt_bins )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_bins}" qt_bins)
_qt4_query_qmake(QT_INSTALL_BINS qt_bins)
SET(QT_BINARY_DIR ${qt_bins} CACHE INTERNAL "" FORCE)
ENDIF (NOT QT_BINARY_DIR OR QT_QMAKE_CHANGED)
# ask qmake for the include dir
IF (QT_LIBRARY_DIR AND (NOT QT_QTCORE_INCLUDE_DIR OR NOT QT_HEADERS_DIR OR QT_QMAKE_CHANGED))
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_HEADERS"
OUTPUT_VARIABLE qt_headers )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_headers}" qt_headers)
_qt4_query_qmake(QT_INSTALL_HEADERS qt_headers)
SET(QT_QTCORE_INCLUDE_DIR NOTFOUND)
FIND_PATH(QT_QTCORE_INCLUDE_DIR QtCore
HINTS ${qt_headers}
@ -703,22 +697,14 @@ IF (QT4_QMAKE_FOUND)
# ask qmake for the documentation directory
IF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED)
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_DOCS"
OUTPUT_VARIABLE qt_doc_dir )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_doc_dir}" qt_doc_dir)
_qt4_query_qmake(QT_INSTALL_DOCS qt_doc_dir)
SET(QT_DOC_DIR ${qt_doc_dir} CACHE PATH "The location of the Qt docs" FORCE)
ENDIF (QT_LIBRARY_DIR AND NOT QT_DOC_DIR OR QT_QMAKE_CHANGED)
# ask qmake for the plugins directory
IF (QT_LIBRARY_DIR AND NOT QT_PLUGINS_DIR OR QT_QMAKE_CHANGED)
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_PLUGINS"
OUTPUT_VARIABLE qt_plugins_dir )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_plugins_dir}" qt_plugins_dir)
_qt4_query_qmake(QT_INSTALL_PLUGINS qt_plugins_dir)
SET(QT_PLUGINS_DIR NOTFOUND)
foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/plugins")
@ -730,14 +716,27 @@ IF (QT4_QMAKE_FOUND)
# ask qmake for the translations directory
IF (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED)
EXEC_PROGRAM( ${QT_QMAKE_EXECUTABLE}
ARGS "-query QT_INSTALL_TRANSLATIONS"
OUTPUT_VARIABLE qt_translations_dir )
# make sure we have / and not \ as qmake gives on windows
FILE(TO_CMAKE_PATH "${qt_translations_dir}" qt_translations_dir)
_qt4_query_qmake(QT_INSTALL_TRANSLATIONS qt_translations_dir)
SET(QT_TRANSLATIONS_DIR ${qt_translations_dir} CACHE PATH "The location of the Qt translations" FORCE)
ENDIF (QT_LIBRARY_DIR AND NOT QT_TRANSLATIONS_DIR OR QT_QMAKE_CHANGED)
# ask qmake for the imports directory
IF (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED)
_qt4_query_qmake(QT_INSTALL_IMPORTS qt_imports_dir)
if(qt_imports_dir)
SET(QT_IMPORTS_DIR NOTFOUND)
foreach(qt_cross_path ${CMAKE_FIND_ROOT_PATH})
set(qt_cross_paths ${qt_cross_paths} "${qt_cross_path}/imports")
endforeach(qt_cross_path)
FIND_PATH(QT_IMPORTS_DIR NAMES Qt
HINTS ${qt_cross_paths} ${qt_imports_dir}
DOC "The location of the Qt imports"
NO_CMAKE_PATH NO_CMAKE_ENVIRONMENT_PATH NO_SYSTEM_ENVIRONMENT_PATH
NO_CMAKE_SYSTEM_PATH)
mark_as_advanced(QT_IMPORTS_DIR)
endif(qt_imports_dir)
ENDIF (QT_LIBRARY_DIR AND NOT QT_IMPORTS_DIR OR QT_QMAKE_CHANGED)
# Make variables changeble to the advanced user
MARK_AS_ADVANCED( QT_LIBRARY_DIR QT_DOC_DIR QT_MKSPECS_DIR
QT_PLUGINS_DIR QT_TRANSLATIONS_DIR)

View File

@ -52,11 +52,18 @@ FIND_PROGRAM(Subversion_SVN_EXECUTABLE svn
MARK_AS_ADVANCED(Subversion_SVN_EXECUTABLE)
IF(Subversion_SVN_EXECUTABLE)
# the subversion commands should be executed with the C locale, otherwise
# the message (which are parsed) may be translated, Alex
SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}")
SET(ENV{LC_ALL} C)
EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version
OUTPUT_VARIABLE Subversion_VERSION_SVN
OUTPUT_STRIP_TRAILING_WHITESPACE)
# restore the previous LC_ALL
SET(ENV{LC_ALL} ${_Subversion_SAVED_LC_ALL})
STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*"
"\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}")

View File

@ -146,7 +146,7 @@ function(is_file_executable file result_var)
# If file name ends in .exe on Windows, *assume* executable:
#
if(WIN32)
if(WIN32 AND NOT UNIX)
if("${file_full_lower}" MATCHES "\\.exe$")
set(${result_var} 1 PARENT_SCOPE)
return()
@ -156,7 +156,7 @@ function(is_file_executable file result_var)
# to determine ${result_var}. In 99%+? practical cases, the exe name
# match will be sufficient...
#
endif(WIN32)
endif(WIN32 AND NOT UNIX)
# Use the information returned from the Unix shell command "file" to
# determine if ${file_full} should be considered an executable file...
@ -335,7 +335,7 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
# Using find_program on Windows will find dll files that are in the PATH.
# (Converting simple file names into full path names if found.)
#
if(WIN32)
if(WIN32 AND NOT UNIX)
if(NOT resolved)
set(ri "ri-NOTFOUND")
find_program(ri "${item}" PATHS "${exepath};${dirs}" NO_DEFAULT_PATH)
@ -347,7 +347,7 @@ function(gp_resolve_item context item exepath dirs resolved_item_var)
set(ri "ri-NOTFOUND")
endif(ri)
endif(NOT resolved)
endif(WIN32)
endif(WIN32 AND NOT UNIX)
# Provide a hook so that projects can override item resolution
# by whatever logic they choose:
@ -413,7 +413,7 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
string(TOLOWER "${resolved_file}" lower)
if(UNIX)
if(resolved_file MATCHES "^(/lib/|/lib32/|/lib64/|/usr/lib/|/usr/lib32/|/usr/lib64/|/usr/X11R6/)")
if(resolved_file MATCHES "^(/lib/|/lib32/|/lib64/|/usr/lib/|/usr/lib32/|/usr/lib64/|/usr/X11R6/|/usr/bin/)")
set(is_system 1)
endif()
endif()
@ -434,7 +434,27 @@ function(gp_resolved_file_type original_file file exepath dirs type_var)
if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*msvc[^/]+dll)")
set(is_system 1)
endif()
if(UNIX)
# if cygwin, we can get the properly formed windows paths from cygpath
find_program(CYGPATH_EXECUTABLE cygpath)
if(CYGPATH_EXECUTABLE)
execute_process(COMMAND ${CYGPATH_EXECUTABLE} -W
OUTPUT_VARIABLE env_windir
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${CYGPATH_EXECUTABLE} -S
OUTPUT_VARIABLE env_sysdir
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(TOLOWER "${env_windir}" windir)
string(TOLOWER "${env_sysdir}" sysroot)
if(lower MATCHES "^(${sysroot}/sys(tem|wow)|${windir}/sys(tem|wow)|(.*/)*msvc[^/]+dll)")
set(is_system 1)
endif()
endif(CYGPATH_EXECUTABLE)
endif(UNIX)
endif(WIN32)
if(NOT is_system)
get_filename_component(original_path "${original_lower}" PATH)
@ -519,9 +539,9 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
if(APPLE)
set(gp_tool "otool")
endif(APPLE)
if(WIN32)
if(WIN32 AND NOT UNIX) # This is how to check for cygwin, har!
set(gp_tool "dumpbin")
endif(WIN32)
endif(WIN32 AND NOT UNIX)
endif("${gp_tool}" STREQUAL "")
set(gp_tool_known 0)
@ -587,11 +607,22 @@ function(get_prerequisites target prerequisites_var exclude_system recurse exepa
#
get_filename_component(gp_cmd_dir "${gp_cmd}" PATH)
get_filename_component(gp_cmd_dlls_dir "${gp_cmd_dir}/../../Common7/IDE" ABSOLUTE)
# Use cmake paths as a user may have a PATH element ending with a backslash.
# This will escape the list delimiter and create havoc!
if(EXISTS "${gp_cmd_dlls_dir}")
# only add to the path if it is not already in the path
if(NOT "$ENV{PATH}" MATCHES "${gp_cmd_dlls_dir}")
set(gp_found_cmd_dlls_dir 0)
file(TO_CMAKE_PATH "$ENV{PATH}" env_path)
foreach(gp_env_path_element ${env_path})
if("${gp_env_path_element}" STREQUAL "${gp_cmd_dlls_dir}")
set(gp_found_cmd_dlls_dir 1)
endif()
endforeach(gp_env_path_element)
if(NOT gp_found_cmd_dlls_dir)
file(TO_NATIVE_PATH "${gp_cmd_dlls_dir}" gp_cmd_dlls_dir)
set(ENV{PATH} "$ENV{PATH};${gp_cmd_dlls_dir}")
endif(NOT "$ENV{PATH}" MATCHES "${gp_cmd_dlls_dir}")
endif()
endif(EXISTS "${gp_cmd_dlls_dir}")
endif("${gp_tool}" STREQUAL "dumpbin")
#

View File

@ -183,6 +183,8 @@ SET(SRCS
cmGlobalUnixMakefileGenerator3.cxx
cmGlobalUnixMakefileGenerator3.h
cmGraphAdjacencyList.h
cmGraphVizWriter.cxx
cmGraphVizWriter.h
cmInstallGenerator.h
cmInstallGenerator.cxx
cmInstallExportGenerator.cxx

View File

@ -94,6 +94,18 @@ int cmCPackDebGenerator::PackageFiles()
this->GetOption("CPACK_DEBIAN_PACKAGE_SUGGESTS");
const char* debian_pkg_url =
this->GetOption("CPACK_DEBIAN_PACKAGE_HOMEPAGE");
const char* debian_pkg_predep =
this->GetOption("CPACK_DEBIAN_PACKAGE_PREDEPENDS");
const char* debian_pkg_enhances =
this->GetOption("CPACK_DEBIAN_PACKAGE_ENHANCES");
const char* debian_pkg_breaks =
this->GetOption("CPACK_DEBIAN_PACKAGE_BREAKS");
const char* debian_pkg_conflicts =
this->GetOption("CPACK_DEBIAN_PACKAGE_CONFLICTS");
const char* debian_pkg_provides =
this->GetOption("CPACK_DEBIAN_PACKAGE_PROVIDES");
const char* debian_pkg_replaces =
this->GetOption("CPACK_DEBIAN_PACKAGE_REPLACES");
{ // the scope is needed for cmGeneratedFileStream
cmGeneratedFileStream out(ctlfilename.c_str());
@ -102,22 +114,46 @@ int cmCPackDebGenerator::PackageFiles()
out << "Section: " << debian_pkg_section << "\n";
out << "Priority: " << debian_pkg_priority << "\n";
out << "Architecture: " << debian_pkg_arch << "\n";
if(debian_pkg_dep)
if(debian_pkg_dep && *debian_pkg_dep)
{
out << "Depends: " << debian_pkg_dep << "\n";
}
if(debian_pkg_rec)
if(debian_pkg_rec && *debian_pkg_rec)
{
out << "Recommends: " << debian_pkg_rec << "\n";
}
if(debian_pkg_sug)
if(debian_pkg_sug && *debian_pkg_sug)
{
out << "Suggests: " << debian_pkg_sug << "\n";
}
if(debian_pkg_url)
if(debian_pkg_url && *debian_pkg_url)
{
out << "Homepage: " << debian_pkg_url << "\n";
}
if (debian_pkg_predep && *debian_pkg_predep)
{
out << "Pre-Depends: " << debian_pkg_predep << "\n";
}
if (debian_pkg_enhances && *debian_pkg_enhances)
{
out << "Enhances: " << debian_pkg_enhances << "\n";
}
if (debian_pkg_breaks && *debian_pkg_breaks)
{
out << "Breaks: " << debian_pkg_breaks << "\n";
}
if (debian_pkg_conflicts && *debian_pkg_conflicts)
{
out << "Conflicts: " << debian_pkg_conflicts << "\n";
}
if (debian_pkg_provides && *debian_pkg_provides)
{
out << "Provides: " << debian_pkg_provides << "\n";
}
if (debian_pkg_replaces && *debian_pkg_replaces)
{
out << "Replaces: " << debian_pkg_replaces << "\n";
}
unsigned long totalSize = 0;
{
std::string dirName = this->GetOption("CPACK_TEMPORARY_DIRECTORY");

View File

@ -264,7 +264,17 @@ bool cmCTestRunTest::EndTest(size_t completed, size_t total, bool started)
{
*this->TestHandler->LogFile << "Test time = " << buf << std::endl;
}
// Set the working directory to the tests directory
std::string oldpath = cmSystemTools::GetCurrentWorkingDirectory();
cmSystemTools::ChangeDirectory(this->TestProperties->Directory.c_str());
this->DartProcessing();
// restore working directory
cmSystemTools::ChangeDirectory(oldpath.c_str());
// if this is doing MemCheck then all the output needs to be put into
// Output since that is what is parsed by cmCTestMemCheckHandler
if(!this->TestHandler->MemCheck && started)

View File

@ -289,14 +289,10 @@ void cmExtraCodeBlocksGenerator
std::string fileName = *(splitted.end()-1);
splitted.erase(splitted.end() - 1, splitted.end());
// We don't want paths with ".." in them
// reasons are that we don't want files outside the project
// TODO: the path should be normalized first though
// We don't want paths with CMakeFiles in them
// or do we?
// In speedcrunch those where purely internal
if (splitted.size() >= 1
&& relative.find("..") == std::string::npos
&& relative.find("CMakeFiles") == std::string::npos)
{
tree.InsertPath(splitted, 1, fileName);

View File

@ -1873,9 +1873,10 @@ bool cmGlobalGenerator::UseFolderProperty()
return cmSystemTools::IsOn(prop);
}
// By default, this feature is ON:
// By default, this feature is OFF, since it is not supported in the
// Visual Studio Express editions:
//
return true;
return false;
}
//----------------------------------------------------------------------------

View File

@ -323,7 +323,7 @@ void cmGlobalVisualStudio7Generator::WriteTargetsToSolution(
if (cumulativePath.empty())
{
cumulativePath = *iter;
cumulativePath = "CMAKE_FOLDER_GUID_" + *iter;
}
else
{
@ -431,14 +431,22 @@ void cmGlobalVisualStudio7Generator
//----------------------------------------------------------------------------
void cmGlobalVisualStudio7Generator::WriteFolders(std::ostream& fout)
{
const char *prefix = "CMAKE_FOLDER_GUID_";
const std::string::size_type skip_prefix = strlen(prefix);
std::string guidProjectTypeFolder = "2150E333-8FDC-42A3-9474-1A3956D46DE8";
for(std::map<std::string,std::set<std::string> >::iterator iter =
VisualStudioFolders.begin(); iter != VisualStudioFolders.end(); ++iter)
{
std::string fullName = iter->first;
std::string guid = this->GetGUID(fullName.c_str());
std::string nameOnly = cmSystemTools::GetFilenameName(fullName);
cmSystemTools::ReplaceString(fullName, "/", "\\");
if (cmSystemTools::StringStartsWith(fullName.c_str(), prefix))
{
fullName = fullName.substr(skip_prefix);
}
std::string nameOnly = cmSystemTools::GetFilenameName(fullName);
fout << "Project(\"{" <<
guidProjectTypeFolder << "}\") = \"" <<

View File

@ -69,14 +69,6 @@ public:
i.e. "Can I build Debug and Release in the same tree?" */
virtual bool IsMultiConfig() { return true; }
protected:
// Does this VS version link targets to each other if there are
// dependencies in the SLN file? This was done for VS versions
// below 8.
virtual bool VSLinksDependencies() const { return true; }
virtual const char* GetIDEVersion() = 0;
struct TargetCompare
{
bool operator()(cmTarget const* l, cmTarget const* r) const;
@ -87,6 +79,14 @@ protected:
OrderedTargetDependSet(cmGlobalGenerator::TargetDependSet const&);
};
protected:
// Does this VS version link targets to each other if there are
// dependencies in the SLN file? This was done for VS versions
// below 8.
virtual bool VSLinksDependencies() const { return true; }
virtual const char* GetIDEVersion() = 0;
virtual bool ComputeTargetDepends();
class VSDependSet: public std::set<cmStdString> {};
class VSDependMap: public std::map<cmTarget*, VSDependSet> {};

View File

@ -643,7 +643,7 @@ cmGlobalXCodeGenerator::CreateXCodeFileReference(cmSourceFile* sf,
sourcecode += ".c.h";
}
else if(ext == "hxx" || ext == "hpp" || ext == "txx"
|| ext == "pch")
|| ext == "pch" || ext == "hh")
{
sourcecode += ".cpp.h";
}
@ -1424,6 +1424,9 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
std::string defFlags;
bool shared = ((target.GetType() == cmTarget::SHARED_LIBRARY) ||
(target.GetType() == cmTarget::MODULE_LIBRARY));
bool binary = ((target.GetType() == cmTarget::STATIC_LIBRARY) ||
(target.GetType() == cmTarget::EXECUTABLE) ||
shared);
const char* lang = target.GetLinkerLanguage(configName);
std::string cflags;
@ -1442,6 +1445,13 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
// Add shared-library flags if needed.
this->CurrentLocalGenerator->AddSharedFlags(flags, lang, shared);
}
else if(binary)
{
cmSystemTools::Error
("CMake can not determine linker language for target:",
target.GetName());
return;
}
// Add define flags
this->CurrentLocalGenerator->

435
Source/cmGraphVizWriter.cxx Normal file
View File

@ -0,0 +1,435 @@
/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
#include "cmGraphVizWriter.h"
#include "cmMakefile.h"
#include "cmLocalGenerator.h"
#include "cmGlobalGenerator.h"
#include "cmGeneratedFileStream.h"
#include <memory>
static const char* getShapeForTarget(const cmTarget* target)
{
if (!target)
{
return "ellipse";
}
switch ( target->GetType() )
{
case cmTarget::EXECUTABLE:
return "house";
case cmTarget::STATIC_LIBRARY:
return "diamond";
case cmTarget::SHARED_LIBRARY:
return "polygon";
case cmTarget::MODULE_LIBRARY:
return "octagon";
default:
break;
}
return "box";
}
cmGraphVizWriter::cmGraphVizWriter(const std::vector<cmLocalGenerator*>&
localGenerators)
:GraphType("digraph")
,GraphName("GG")
,GraphHeader("node [\n fontsize = \"12\"\n];")
,GraphNodePrefix("node")
,GenerateForExecutables(true)
,GenerateForStaticLibs(true)
,GenerateForSharedLibs(true)
,GenerateForModuleLibs(true)
,LocalGenerators(localGenerators)
,HaveTargetsAndLibs(false)
{
}
void cmGraphVizWriter::ReadSettings(const char* settingsFileName,
const char* fallbackSettingsFileName)
{
cmake cm;
cmGlobalGenerator ggi;
ggi.SetCMakeInstance(&cm);
std::auto_ptr<cmLocalGenerator> lg(ggi.CreateLocalGenerator());
cmMakefile *mf = lg->GetMakefile();
const char* inFileName = settingsFileName;
if ( !cmSystemTools::FileExists(inFileName) )
{
inFileName = fallbackSettingsFileName;
if ( !cmSystemTools::FileExists(inFileName) )
{
return;
}
}
if ( !mf->ReadListFile(0, inFileName) )
{
cmSystemTools::Error("Problem opening GraphViz options file: ",
inFileName);
return;
}
std::cout << "Reading GraphViz options file: " << inFileName << std::endl;
#define __set_if_set(var, cmakeDefinition) \
{ \
const char* value = mf->GetDefinition(cmakeDefinition); \
if ( value ) \
{ \
var = value; \
} \
}
__set_if_set(this->GraphType, "GRAPHVIZ_GRAPH_TYPE");
__set_if_set(this->GraphName, "GRAPHVIZ_GRAPH_NAME");
__set_if_set(this->GraphHeader, "GRAPHVIZ_GRAPH_HEADER");
__set_if_set(this->GraphNodePrefix, "GRAPHVIZ_NODE_PREFIX");
#define __set_bool_if_set(var, cmakeDefinition) \
{ \
const char* value = mf->GetDefinition(cmakeDefinition); \
if ( value ) \
{ \
var = mf->IsOn(cmakeDefinition); \
} \
}
__set_bool_if_set(this->GenerateForExecutables, "GRAPHVIZ_EXECUTABLES");
__set_bool_if_set(this->GenerateForStaticLibs, "GRAPHVIZ_STATIC_LIBS");
__set_bool_if_set(this->GenerateForSharedLibs, "GRAPHVIZ_SHARED_LIBS");
__set_bool_if_set(this->GenerateForModuleLibs , "GRAPHVIZ_MODULE_LIBS");
cmStdString tmpRegexString;
__set_if_set(tmpRegexString, "GRAPHVIZ_TARGET_IGNORE_REGEX");
if (tmpRegexString.size() > 0)
{
if (!this->TargetIgnoreRegex.compile(tmpRegexString.c_str()))
{
std::cerr << "Could not compile bad regex \"" << tmpRegexString << "\""
<< std::endl;
}
}
this->TargetsToIgnore.clear();
const char* ignoreTargets = mf->GetDefinition("GRAPHVIZ_IGNORE_TARGETS");
if ( ignoreTargets )
{
std::vector<std::string> ignoreTargetsVector;
cmSystemTools::ExpandListArgument(ignoreTargets,ignoreTargetsVector);
for(std::vector<std::string>::iterator itvIt = ignoreTargetsVector.begin();
itvIt != ignoreTargetsVector.end();
++ itvIt )
{
this->TargetsToIgnore.insert(itvIt->c_str());
}
}
}
void cmGraphVizWriter::WritePerTargetFiles(const char* fileName)
{
this->CollectTargetsAndLibs();
for(std::map<cmStdString, const cmTarget*>::const_iterator ptrIt =
this->TargetPtrs.begin();
ptrIt != this->TargetPtrs.end();
++ptrIt)
{
if (ptrIt->second == NULL)
{
continue;
}
if (this->GenerateForTargetType(ptrIt->second->GetType()) == false)
{
continue;
}
std::set<std::string> insertedConnections;
std::set<std::string> insertedNodes;
std::string currentFilename = fileName;
currentFilename += ".";
currentFilename += ptrIt->first;
cmGeneratedFileStream str(currentFilename.c_str());
if ( !str )
{
return;
}
std::cout << "Writing " << currentFilename << "..." << std::endl;
this->WriteHeader(str);
this->WriteConnections(ptrIt->first.c_str(),
insertedNodes, insertedConnections, str);
this->WriteFooter(str);
}
}
void cmGraphVizWriter::WriteGlobalFile(const char* fileName)
{
this->CollectTargetsAndLibs();
cmGeneratedFileStream str(fileName);
if ( !str )
{
return;
}
this->WriteHeader(str);
std::cout << "Writing " << fileName << "..." << std::endl;
std::set<std::string> insertedConnections;
std::set<std::string> insertedNodes;
for(std::map<cmStdString, const cmTarget*>::const_iterator ptrIt =
this->TargetPtrs.begin();
ptrIt != this->TargetPtrs.end();
++ptrIt)
{
if (ptrIt->second == NULL)
{
continue;
}
if (this->GenerateForTargetType(ptrIt->second->GetType()) == false)
{
continue;
}
this->WriteConnections(ptrIt->first.c_str(),
insertedNodes, insertedConnections, str);
}
this->WriteFooter(str);
}
void cmGraphVizWriter::WriteHeader(cmGeneratedFileStream& str) const
{
str << this->GraphType << " " << this->GraphName << " {" << std::endl;
str << this->GraphHeader << std::endl;
}
void cmGraphVizWriter::WriteFooter(cmGeneratedFileStream& str) const
{
str << "}" << std::endl;
}
void cmGraphVizWriter::WriteConnections(const char* targetName,
std::set<std::string>& insertedNodes,
std::set<std::string>& insertedConnections,
cmGeneratedFileStream& str) const
{
std::map<cmStdString, const cmTarget* >::const_iterator targetPtrIt =
this->TargetPtrs.find(targetName);
if (targetPtrIt == this->TargetPtrs.end()) // not found at all
{
return;
}
this->WriteNode(targetName, targetPtrIt->second, insertedNodes, str);
if (targetPtrIt->second == NULL) // it's an external library
{
return;
}
std::string myNodeName = this->TargetNamesNodes.find(targetName)->second;
const cmTarget::LinkLibraryVectorType* ll =
&(targetPtrIt->second->GetOriginalLinkLibraries());
for (cmTarget::LinkLibraryVectorType::const_iterator llit = ll->begin();
llit != ll->end();
++ llit )
{
const char* libName = llit->first.c_str();
std::map<cmStdString, cmStdString>::const_iterator libNameIt =
this->TargetNamesNodes.find(libName);
std::string connectionName = myNodeName;
connectionName += "-";
connectionName += libNameIt->second;
if (insertedConnections.find(connectionName) == insertedConnections.end())
{
insertedConnections.insert(connectionName);
this->WriteNode(libName, this->TargetPtrs.find(libName)->second,
insertedNodes, str);
str << " \"" << myNodeName.c_str() << "\" -> \""
<< libNameIt->second.c_str() << "\"";
str << " // " << targetName << " -> " << libName << std::endl;
this->WriteConnections(libName, insertedNodes, insertedConnections, str);
}
}
}
void cmGraphVizWriter::WriteNode(const char* targetName,
const cmTarget* target,
std::set<std::string>& insertedNodes,
cmGeneratedFileStream& str) const
{
if (insertedNodes.find(targetName) == insertedNodes.end())
{
insertedNodes.insert(targetName);
std::map<cmStdString, cmStdString>::const_iterator nameIt =
this->TargetNamesNodes.find(targetName);
str << " \"" << nameIt->second.c_str() << "\" [ label=\""
<< targetName << "\" shape=\"" << getShapeForTarget(target)
<< "\"];" << std::endl;
}
}
void cmGraphVizWriter::CollectTargetsAndLibs()
{
if (this->HaveTargetsAndLibs == false)
{
this->HaveTargetsAndLibs = true;
int cnt = this->CollectAllTargets();
this->CollectAllExternalLibs(cnt);
}
}
int cmGraphVizWriter::CollectAllTargets()
{
int cnt = 0;
// First pass get the list of all cmake targets
for (std::vector<cmLocalGenerator*>::const_iterator lit =
this->LocalGenerators.begin();
lit != this->LocalGenerators.end();
++ lit )
{
const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
for ( cmTargets::const_iterator tit = targets->begin();
tit != targets->end();
++ tit )
{
const char* realTargetName = tit->first.c_str();
if(this->IgnoreThisTarget(realTargetName))
{
// Skip ignored targets
continue;
}
//std::cout << "Found target: " << tit->first.c_str() << std::endl;
cmOStringStream ostr;
ostr << this->GraphNodePrefix << cnt++;
this->TargetNamesNodes[realTargetName] = ostr.str();
this->TargetPtrs[realTargetName] = &tit->second;
}
}
return cnt;
}
int cmGraphVizWriter::CollectAllExternalLibs(int cnt)
{
// Ok, now find all the stuff we link to that is not in cmake
for (std::vector<cmLocalGenerator*>::const_iterator lit =
this->LocalGenerators.begin();
lit != this->LocalGenerators.end();
++ lit )
{
const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
for ( cmTargets::const_iterator tit = targets->begin();
tit != targets->end();
++ tit )
{
const char* realTargetName = tit->first.c_str();
if (this->IgnoreThisTarget(realTargetName))
{
// Skip ignored targets
continue;
}
const cmTarget::LinkLibraryVectorType* ll =
&(tit->second.GetOriginalLinkLibraries());
for (cmTarget::LinkLibraryVectorType::const_iterator llit = ll->begin();
llit != ll->end();
++ llit )
{
const char* libName = llit->first.c_str();
if (this->IgnoreThisTarget(libName))
{
// Skip ignored targets
continue;
}
std::map<cmStdString, const cmTarget*>::const_iterator tarIt =
this->TargetPtrs.find(libName);
if ( tarIt == this->TargetPtrs.end() )
{
cmOStringStream ostr;
ostr << this->GraphNodePrefix << cnt++;
this->TargetNamesNodes[libName] = ostr.str();
this->TargetPtrs[libName] = NULL;
//str << " \"" << ostr.c_str() << "\" [ label=\"" << libName
//<< "\" shape=\"ellipse\"];" << std::endl;
}
}
}
}
return cnt;
}
bool cmGraphVizWriter::IgnoreThisTarget(const char* name)
{
if (this->TargetIgnoreRegex.is_valid())
{
if (this->TargetIgnoreRegex.find(name))
{
return true;
}
}
return (this->TargetsToIgnore.find(name) != this->TargetsToIgnore.end());
}
bool cmGraphVizWriter::GenerateForTargetType(cmTarget::TargetType targetType)
const
{
switch (targetType)
{
case cmTarget::EXECUTABLE:
return this->GenerateForExecutables;
case cmTarget::STATIC_LIBRARY:
return this->GenerateForStaticLibs;
case cmTarget::SHARED_LIBRARY:
return this->GenerateForSharedLibs;
case cmTarget::MODULE_LIBRARY:
return this->GenerateForModuleLibs;
default:
break;
}
return false;
}

84
Source/cmGraphVizWriter.h Normal file
View File

@ -0,0 +1,84 @@
#ifndef CMGRAPHVIZWRITER_H
#define CMGRAPHVIZWRITER_H
/*============================================================================
CMake - Cross Platform Makefile Generator
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
Distributed under the OSI-approved BSD License (the "License");
see accompanying file Copyright.txt for details.
This software is distributed WITHOUT ANY WARRANTY; without even the
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the License for more information.
============================================================================*/
#include "cmStandardIncludes.h"
#include "cmLocalGenerator.h"
#include "cmGeneratedFileStream.h"
#include "cmTarget.h"
#include <cmsys/RegularExpression.hxx>
/** This class implements writing files for graphviz (dot) for graphs
* representing the dependencies between the targets in the project. */
class cmGraphVizWriter
{
public:
cmGraphVizWriter(const std::vector<cmLocalGenerator*>& localGenerators);
void ReadSettings(const char* settingsFileName,
const char* fallbackSettingsFileName);
void WritePerTargetFiles(const char* fileName);
void WriteGlobalFile(const char* fileName);
protected:
void CollectTargetsAndLibs();
int CollectAllTargets();
int CollectAllExternalLibs(int cnt);
void WriteHeader(cmGeneratedFileStream& str) const;
void WriteConnections(const char* targetName,
std::set<std::string>& insertedNodes,
std::set<std::string>& insertedConnections,
cmGeneratedFileStream& str) const;
void WriteNode(const char* targetName, const cmTarget* target,
std::set<std::string>& insertedNodes,
cmGeneratedFileStream& str) const;
void WriteFooter(cmGeneratedFileStream& str) const;
bool IgnoreThisTarget(const char* name);
bool GenerateForTargetType(cmTarget::TargetType targetType) const;
cmStdString GraphType;
cmStdString GraphName;
cmStdString GraphHeader;
cmStdString GraphNodePrefix;
bool GenerateForExecutables;
bool GenerateForStaticLibs;
bool GenerateForSharedLibs;
bool GenerateForModuleLibs;
cmsys::RegularExpression TargetIgnoreRegex;
std::set<cmStdString> TargetsToIgnore;
const std::vector<cmLocalGenerator*>& LocalGenerators;
std::map<cmStdString, const cmTarget*> TargetPtrs;
// maps from the actual target names to node names in dot:
std::map<cmStdString, cmStdString> TargetNamesNodes;
bool HaveTargetsAndLibs;
};
#endif

View File

@ -928,6 +928,14 @@ cmMakefile::AddCustomCommandToOutput(const std::vector<std::string>& outputs,
// Construct a rule file associated with the first output produced.
std::string outName = outputs[0];
outName += ".rule";
const char* dir =
this->LocalGenerator->GetGlobalGenerator()->
GetCMakeCFGInitDirectory();
if(dir && dir[0] == '$')
{
cmSystemTools::ReplaceString(outName, dir,
cmake::GetCMakeFilesDirectory());
}
// Check if the rule file already exists.
file = this->GetSource(outName.c_str());
if(file && file->GetCustomCommand() && !replace)

View File

@ -834,12 +834,16 @@ void cmTarget::DefineProperties(cmake *cm)
"executable with the TARGET_LINK_LIBRARIES command. "
"On all platforms a target-level dependency on the executable is "
"created for targets that link to it. "
"For non-DLL platforms the link rule is simply ignored since "
"the dynamic loader will automatically bind symbols when the "
"module is loaded. "
"For DLL platforms an import library will be created for the "
"exported symbols and then used for linking. "
"All Windows-based systems including Cygwin are DLL platforms.");
"All Windows-based systems including Cygwin are DLL platforms. "
"For non-DLL platforms that require all symbols to be resolved at "
"link time, such as Mac OS X, the module will \"link\" to the "
"executable using a flag like \"-bundle_loader\". "
"For other non-DLL platforms the link rule is simply ignored since "
"the dynamic loader will automatically bind symbols when the "
"module is loaded. "
);
cm->DefineProperty
("Fortran_MODULE_DIRECTORY", cmProperty::TARGET,

View File

@ -32,6 +32,30 @@ static std::string cmVS10EscapeXML(std::string arg)
return arg;
}
static std::string cmVS10EscapeComment(std::string comment)
{
// MSBuild takes the CDATA of a <Message></Message> element and just
// does "echo $CDATA" with no escapes. We must encode the string.
// http://technet.microsoft.com/en-us/library/cc772462%28WS.10%29.aspx
std::string echoable;
for(std::string::iterator c = comment.begin(); c != comment.end(); ++c)
{
switch (*c)
{
case '\r': break;
case '\n': echoable += '\t'; break;
case '"': /* no break */
case '|': /* no break */
case '&': /* no break */
case '<': /* no break */
case '>': /* no break */
case '^': echoable += '^'; /* no break */
default: echoable += *c; break;
}
}
return echoable;
}
cmVisualStudio10TargetGenerator::
cmVisualStudio10TargetGenerator(cmTarget* target,
cmGlobalVisualStudio10Generator* gg)
@ -125,7 +149,10 @@ void cmVisualStudio10TargetGenerator::Generate()
".vcxproj");
if(this->Target->GetType() <= cmTarget::MODULE_LIBRARY)
{
this->ComputeClOptions();
if(!this->ComputeClOptions())
{
return;
}
}
cmMakefile* mf = this->Target->GetMakefile();
std::string path = mf->GetStartOutputDirectory();
@ -325,6 +352,7 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
}
cmLocalVisualStudio7Generator* lg = this->LocalGenerator;
std::string comment = lg->ConstructComment(command);
comment = cmVS10EscapeComment(comment);
std::vector<std::string> *configs =
static_cast<cmGlobalVisualStudio7Generator *>
(this->GlobalGenerator)->GetConfigurations();
@ -347,7 +375,7 @@ cmVisualStudio10TargetGenerator::WriteCustomRule(cmSourceFile* source,
command.GetEscapeAllowMakeVars())
);
this->WritePlatformConfigTag("Message",i->c_str(), 3);
(*this->BuildFileStream ) << comment << "</Message>\n";
(*this->BuildFileStream ) << cmVS10EscapeXML(comment) << "</Message>\n";
this->WritePlatformConfigTag("Command", i->c_str(), 3);
(*this->BuildFileStream ) << script << "</Command>\n";
this->WritePlatformConfigTag("AdditionalInputs", i->c_str(), 3);
@ -949,19 +977,23 @@ OutputLinkIncremental(std::string const& configName)
}
//----------------------------------------------------------------------------
void cmVisualStudio10TargetGenerator::ComputeClOptions()
bool cmVisualStudio10TargetGenerator::ComputeClOptions()
{
std::vector<std::string> const* configs =
this->GlobalGenerator->GetConfigurations();
for(std::vector<std::string>::const_iterator i = configs->begin();
i != configs->end(); ++i)
{
this->ComputeClOptions(*i);
if(!this->ComputeClOptions(*i))
{
return false;
}
}
return true;
}
//----------------------------------------------------------------------------
void cmVisualStudio10TargetGenerator::ComputeClOptions(
bool cmVisualStudio10TargetGenerator::ComputeClOptions(
std::string const& configName)
{
// much of this was copied from here:
@ -984,7 +1016,7 @@ void cmVisualStudio10TargetGenerator::ComputeClOptions(
cmSystemTools::Error
("CMake can not determine linker language for target:",
this->Name.c_str());
return;
return false;
}
if(strcmp(linkLanguage, "C") == 0 || strcmp(linkLanguage, "CXX") == 0
|| strcmp(linkLanguage, "Fortran") == 0)
@ -1044,6 +1076,7 @@ void cmVisualStudio10TargetGenerator::ComputeClOptions(
}
this->ClOptions[configName] = pOptions.release();
return true;
}
//----------------------------------------------------------------------------
@ -1433,8 +1466,9 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
command.GetEscapeAllowMakeVars())
);
}
comment = cmVS10EscapeComment(comment);
this->WriteString("<Message>",3);
(*this->BuildFileStream ) << comment << "</Message>\n";
(*this->BuildFileStream ) << cmVS10EscapeXML(comment) << "</Message>\n";
this->WriteString("<Command>", 3);
(*this->BuildFileStream ) << script;
(*this->BuildFileStream ) << "</Command>" << "\n";
@ -1445,10 +1479,13 @@ void cmVisualStudio10TargetGenerator::WriteEvent(
void cmVisualStudio10TargetGenerator::WriteProjectReferences()
{
cmGlobalGenerator::TargetDependSet const& depends
cmGlobalGenerator::TargetDependSet const& unordered
= this->GlobalGenerator->GetTargetDirectDepends(*this->Target);
typedef cmGlobalVisualStudioGenerator::OrderedTargetDependSet
OrderedTargetDependSet;
OrderedTargetDependSet depends(unordered);
this->WriteString("<ItemGroup>\n", 1);
for( cmGlobalGenerator::TargetDependSet::const_iterator i = depends.begin();
for( OrderedTargetDependSet::const_iterator i = depends.begin();
i != depends.end(); ++i)
{
cmTarget* dt = *i;

View File

@ -50,8 +50,8 @@ private:
void WriteObjSources();
void WritePathAndIncrementalLinkOptions();
void WriteItemDefinitionGroups();
void ComputeClOptions();
void ComputeClOptions(std::string const& configName);
bool ComputeClOptions();
bool ComputeClOptions(std::string const& configName);
void WriteClOptions(std::string const& config,
std::vector<std::string> const & includes);
void WriteRCOptions(std::string const& config,

View File

@ -26,6 +26,7 @@
#include "cmDocumentationFormatterText.h"
#if defined(CMAKE_BUILD_WITH_CMAKE)
# include "cmGraphVizWriter.h"
# include "cmDependsFortran.h" // For -E cmake_copy_f90_mod callback.
# include "cmVariableWatch.h"
# include <cmsys/Terminal.h>
@ -2886,250 +2887,23 @@ void cmake::MarkCliAsUsed(const std::string& variable)
void cmake::GenerateGraphViz(const char* fileName) const
{
cmGeneratedFileStream str(fileName);
if ( !str )
{
return;
}
cmake cm;
cmGlobalGenerator ggi;
ggi.SetCMakeInstance(&cm);
std::auto_ptr<cmLocalGenerator> lg(ggi.CreateLocalGenerator());
cmMakefile *mf = lg->GetMakefile();
#ifdef CMAKE_BUILD_WITH_CMAKE
std::auto_ptr<cmGraphVizWriter> gvWriter(
new cmGraphVizWriter(this->GetGlobalGenerator()->GetLocalGenerators()));
std::string infile = this->GetHomeOutputDirectory();
infile += "/CMakeGraphVizOptions.cmake";
if ( !cmSystemTools::FileExists(infile.c_str()) )
{
infile = this->GetHomeDirectory();
infile += "/CMakeGraphVizOptions.cmake";
if ( !cmSystemTools::FileExists(infile.c_str()) )
{
infile = "";
}
std::string settingsFile = this->GetHomeOutputDirectory();
settingsFile += "/CMakeGraphVizOptions.cmake";
std::string fallbackSettingsFile = this->GetHomeDirectory();
fallbackSettingsFile += "/CMakeGraphVizOptions.cmake";
gvWriter->ReadSettings(settingsFile.c_str(), fallbackSettingsFile.c_str());
gvWriter->WritePerTargetFiles(fileName);
gvWriter->WriteGlobalFile(fileName);
#endif
}
if ( !infile.empty() )
{
if ( !mf->ReadListFile(0, infile.c_str()) )
{
cmSystemTools::Error("Problem opening GraphViz options file: ",
infile.c_str());
return;
}
std::cout << "Read GraphViz options file: " << infile.c_str()
<< std::endl;
}
#define __set_if_not_set(var, value, cmakeDefinition) \
const char* var = mf->GetDefinition(cmakeDefinition); \
if ( !var ) \
{ \
var = value; \
}
__set_if_not_set(graphType, "digraph", "GRAPHVIZ_GRAPH_TYPE");
__set_if_not_set(graphName, "GG", "GRAPHVIZ_GRAPH_NAME");
__set_if_not_set(graphHeader, "node [\n fontsize = \"12\"\n];",
"GRAPHVIZ_GRAPH_HEADER");
__set_if_not_set(graphNodePrefix, "node", "GRAPHVIZ_NODE_PREFIX");
const char* ignoreTargets = mf->GetDefinition("GRAPHVIZ_IGNORE_TARGETS");
std::set<cmStdString> ignoreTargetsSet;
if ( ignoreTargets )
{
std::vector<std::string> ignoreTargetsVector;
cmSystemTools::ExpandListArgument(ignoreTargets,ignoreTargetsVector);
std::vector<std::string>::iterator itvIt;
for ( itvIt = ignoreTargetsVector.begin();
itvIt != ignoreTargetsVector.end();
++ itvIt )
{
ignoreTargetsSet.insert(itvIt->c_str());
}
}
str << graphType << " " << graphName << " {" << std::endl;
str << graphHeader << std::endl;
const cmGlobalGenerator* gg = this->GetGlobalGenerator();
const std::vector<cmLocalGenerator*>& localGenerators =
gg->GetLocalGenerators();
std::vector<cmLocalGenerator*>::const_iterator lit;
// for target deps
// 1 - cmake target
// 2 - external target
// 0 - no deps
std::map<cmStdString, int> targetDeps;
std::map<cmStdString, const cmTarget*> targetPtrs;
std::map<cmStdString, cmStdString> targetNamesNodes;
int cnt = 0;
// First pass get the list of all cmake targets
for ( lit = localGenerators.begin(); lit != localGenerators.end(); ++ lit )
{
const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
cmTargets::const_iterator tit;
for ( tit = targets->begin(); tit != targets->end(); ++ tit )
{
const char* realTargetName = tit->first.c_str();
if ( ignoreTargetsSet.find(realTargetName) != ignoreTargetsSet.end() )
{
// Skip ignored targets
continue;
}
//std::cout << "Found target: " << tit->first.c_str() << std::endl;
cmOStringStream ostr;
ostr << graphNodePrefix << cnt++;
targetNamesNodes[realTargetName] = ostr.str();
targetPtrs[realTargetName] = &tit->second;
}
}
// Ok, now find all the stuff we link to that is not in cmake
for ( lit = localGenerators.begin(); lit != localGenerators.end(); ++ lit )
{
const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
cmTargets::const_iterator tit;
for ( tit = targets->begin(); tit != targets->end(); ++ tit )
{
const cmTarget::LinkLibraryVectorType* ll
= &(tit->second.GetOriginalLinkLibraries());
cmTarget::LinkLibraryVectorType::const_iterator llit;
const char* realTargetName = tit->first.c_str();
if ( ignoreTargetsSet.find(realTargetName) != ignoreTargetsSet.end() )
{
// Skip ignored targets
continue;
}
if ( ll->size() > 0 )
{
targetDeps[realTargetName] = 1;
}
for ( llit = ll->begin(); llit != ll->end(); ++ llit )
{
const char* libName = llit->first.c_str();
std::map<cmStdString, cmStdString>::const_iterator tarIt
= targetNamesNodes.find(libName);
if ( ignoreTargetsSet.find(libName) != ignoreTargetsSet.end() )
{
// Skip ignored targets
continue;
}
if ( tarIt == targetNamesNodes.end() )
{
cmOStringStream ostr;
ostr << graphNodePrefix << cnt++;
targetDeps[libName] = 2;
targetNamesNodes[libName] = ostr.str();
//str << " \"" << ostr.c_str() << "\" [ label=\"" << libName
//<< "\" shape=\"ellipse\"];" << std::endl;
}
else
{
std::map<cmStdString, int>::const_iterator depIt
= targetDeps.find(libName);
if ( depIt == targetDeps.end() )
{
targetDeps[libName] = 1;
}
}
}
}
}
// Write out nodes
std::map<cmStdString, int>::const_iterator depIt;
for ( depIt = targetDeps.begin(); depIt != targetDeps.end(); ++ depIt )
{
const char* newTargetName = depIt->first.c_str();
std::map<cmStdString, cmStdString>::const_iterator tarIt
= targetNamesNodes.find(newTargetName);
if ( tarIt == targetNamesNodes.end() )
{
// We should not be here.
std::cout << __LINE__ << " Cannot find library: " << newTargetName
<< " even though it was added in the previous pass" << std::endl;
abort();
}
str << " \"" << tarIt->second.c_str() << "\" [ label=\""
<< newTargetName << "\" shape=\"";
if ( depIt->second == 1 )
{
std::map<cmStdString, const cmTarget*>::const_iterator tarTypeIt =
targetPtrs.find(newTargetName);
if ( tarTypeIt == targetPtrs.end() )
{
// We should not be here.
std::cout << __LINE__ << " Cannot find library: " << newTargetName
<< " even though it was added in the previous pass" << std::endl;
abort();
}
const cmTarget* tg = tarTypeIt->second;
switch ( tg->GetType() )
{
case cmTarget::EXECUTABLE:
str << "house";
break;
case cmTarget::STATIC_LIBRARY:
str << "diamond";
break;
case cmTarget::SHARED_LIBRARY:
str << "polygon";
break;
case cmTarget::MODULE_LIBRARY:
str << "octagon";
break;
default:
str << "box";
}
}
else
{
str << "ellipse";
}
str << "\"];" << std::endl;
}
// Now generate the connectivity
for ( lit = localGenerators.begin(); lit != localGenerators.end(); ++ lit )
{
const cmTargets* targets = &((*lit)->GetMakefile()->GetTargets());
cmTargets::const_iterator tit;
for ( tit = targets->begin(); tit != targets->end(); ++ tit )
{
std::map<cmStdString, int>::iterator dependIt
= targetDeps.find(tit->first.c_str());
if ( dependIt == targetDeps.end() )
{
continue;
}
std::map<cmStdString, cmStdString>::iterator cmakeTarIt
= targetNamesNodes.find(tit->first.c_str());
const cmTarget::LinkLibraryVectorType* ll
= &(tit->second.GetOriginalLinkLibraries());
cmTarget::LinkLibraryVectorType::const_iterator llit;
for ( llit = ll->begin(); llit != ll->end(); ++ llit )
{
const char* libName = llit->first.c_str();
std::map<cmStdString, cmStdString>::const_iterator tarIt
= targetNamesNodes.find(libName);
if ( tarIt == targetNamesNodes.end() )
{
// We should not be here.
std::cout << __LINE__ << " Cannot find library: " << libName
<< " even though it was added in the previous pass" << std::endl;
abort();
}
str << " \"" << cmakeTarIt->second.c_str() << "\" -> \""
<< tarIt->second.c_str() << "\"" << std::endl;
}
}
}
// TODO: Use dotted or something for external libraries
//str << " \"node0\":f4 -> \"node12\"[color=\"#0000ff\" style=dotted]"
//<< std::endl;
//
str << "}" << std::endl;
}
//----------------------------------------------------------------------------
int cmake::SymlinkLibrary(std::vector<std::string>& args)
@ -3553,7 +3327,7 @@ void cmake::DefineProperties(cmake *cm)
cm->DefineProperty
("USE_FOLDERS", cmProperty::GLOBAL,
"Use the FOLDER target property to organize targets into folders.",
"If not set, CMake treats this property as ON by default. "
"If not set, CMake treats this property as OFF by default. "
"CMake generators that are capable of organizing into a "
"hierarchy of folders use the values of the FOLDER target "
"property to name those folders. See also the documentation "

View File

@ -50,6 +50,8 @@ class cmExternalMakefileProjectGenerator;
class cmDocumentationSection;
class cmPolicies;
class cmListFileBacktrace;
class cmTarget;
class cmGeneratedFileStream;
class cmake
{

View File

@ -15,7 +15,7 @@
SET(KWSYS_DATE_STAMP_YEAR 2010)
# KWSys version date month component. Format is MM.
SET(KWSYS_DATE_STAMP_MONTH 09)
SET(KWSYS_DATE_STAMP_MONTH 10)
# KWSys version date day component. Format is DD.
SET(KWSYS_DATE_STAMP_DAY 28)
SET(KWSYS_DATE_STAMP_DAY 31)

View File

@ -153,6 +153,9 @@ IF(BUILD_TESTING)
ADD_TEST_MACRO(ExportImport ExportImport)
ADD_TEST_MACRO(Unset Unset)
ADD_TEST_MACRO(PolicyScope PolicyScope)
ADD_TEST_MACRO(EmptyLibrary EmptyLibrary)
SET_TESTS_PROPERTIES(EmptyLibrary PROPERTIES
PASS_REGULAR_EXPRESSION "CMake Error: CMake can not determine linker language for target:test")
ADD_TEST_MACRO(CrossCompile CrossCompile)
SET_TESTS_PROPERTIES(CrossCompile PROPERTIES
PASS_REGULAR_EXPRESSION "TRY_RUN.. invoked in cross-compiling mode")
@ -1718,7 +1721,15 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
ENDIF()
ENDIF()
IF(NOT CMAKE_TEST_GENERATOR MATCHES "Xcode")
if(NOT DEFINED CTEST_RUN_Java)
if(APPLE)
set(CTEST_RUN_Java OFF)
else()
set(CTEST_RUN_Java ON)
endif()
endif()
IF(CTEST_RUN_Java)
find_package(Java QUIET)
IF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW)
GET_FILENAME_COMPONENT(JNIPATH ${JAVA_COMPILE} PATH)
@ -1742,7 +1753,7 @@ ${CMake_BINARY_DIR}/bin/cmake -DVERSION=master -P ${CMake_SOURCE_DIR}/Utilities/
ENDIF("${JNI_FILE}" MATCHES "JDK1_2")
ENDIF(JNI_H)
ENDIF(JAVA_COMPILE AND JAVA_RUNTIME AND JAVA_ARCHIVE AND NOT MINGW)
ENDIF(NOT CMAKE_TEST_GENERATOR MATCHES "Xcode")
ENDIF(CTEST_RUN_Java)
# add some cross compiler tests, for now only with makefile based generators
IF(CMAKE_TEST_GENERATOR MATCHES "Makefiles" OR CMAKE_TEST_GENERATOR MATCHES "KDevelop")

View File

@ -77,6 +77,11 @@ message(STATUS "")
list_prerequisites("${CMAKE_COMMAND}" 0 0 1)
message(STATUS "")
message(STATUS "=============================================================================")
string(LENGTH "$ENV{PATH}" PATH_LENGTH_BEGIN)
message(STATUS "Begin PATH length is: ${PATH_LENGTH_BEGIN}")
message(STATUS "")
# Leave the code for these tests in here, but turn them off by default... they
# take longer than they're worth during development...
@ -116,11 +121,11 @@ message(STATUS "")
message(STATUS "=============================================================================")
message(STATUS "Test overriding 'gp_tool' with value unlikely to be found")
message(STATUS "")
if(WIN32 OR APPLE)
set(gp_tool "ldd")
else(WIN32 OR APPLE)
if(APPLE)
set(gp_tool "dumpbin")
else()
set(gp_tool "otool")
endif(WIN32 OR APPLE)
endif()
set(gp_cmd "gp_cmd-NOTFOUND")
list_prerequisites("${CMAKE_COMMAND}" 0 0 0)
set(gp_cmd)
@ -139,6 +144,15 @@ foreach(v ${vs})
endforeach(v)
message(STATUS "")
message(STATUS "=============================================================================")
string(LENGTH "$ENV{PATH}" PATH_LENGTH_END)
message(STATUS "Final PATH length is: ${PATH_LENGTH_END}")
if(PATH_LENGTH_END GREATER ${PATH_LENGTH_BEGIN})
message(FATAL_ERROR "list_prerequisties is endlessly appending the path of gp_tool to the PATH.")
endif()
message(STATUS "")
message(STATUS "=============================================================================")
message(STATUS "End of test")

View File

@ -76,7 +76,8 @@ endif()
file(WRITE
"${CMAKE_CURRENT_BINARY_DIR}/main.cxx"
"int main() { return 0; }"
"int main() { return 0; }
"
)
add_executable(

View File

@ -0,0 +1,4 @@
cmake_minimum_required(VERSION 2.6)
project(TestEmptyLibrary)
add_subdirectory(subdir)

View File

@ -0,0 +1 @@
add_library(test test.h)

View File

@ -0,0 +1 @@
extern int dummy;

View File

@ -7,6 +7,13 @@ find_package(CVS)
find_package(Subversion)
find_package(Git)
option(ExternalProjectTest_USE_FOLDERS "Enable folder grouping in IDEs." ON)
if(ExternalProjectTest_USE_FOLDERS)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
else()
set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
endif()
set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER
"CMakePredefinedTargets-in-ExternalProjectTest")
@ -61,6 +68,15 @@ ExternalProject_Add(${proj}
INSTALL_COMMAND ""
)
set(proj TargetNameSameAsFolder)
ExternalProject_Add(${proj}
BUILD_COMMAND ""
CONFIGURE_COMMAND ""
DOWNLOAD_COMMAND ""
INSTALL_COMMAND ""
)
set_property(TARGET ${proj} PROPERTY FOLDER "${proj}")
set(proj MinimalNoOpProject)
ExternalProject_Add(${proj}
BUILD_COMMAND ""