Merge branch 'target-include-directories' into ninja-generator

This commit is contained in:
David Cole 2012-02-22 16:21:48 -05:00
commit bada88e8e4
151 changed files with 3269 additions and 1094 deletions

View File

@ -1,3 +1,7 @@
SET(CTEST_CUSTOM_ERROR_MATCH
${CTEST_CUSTOM_ERROR_MATCH}
"ERROR:")
SET(CTEST_CUSTOM_WARNING_EXCEPTION SET(CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION} ${CTEST_CUSTOM_WARNING_EXCEPTION}
"xtree.[0-9]+. : warning C4702: unreachable code" "xtree.[0-9]+. : warning C4702: unreachable code"
@ -44,6 +48,7 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"cc-3968 CC: WARNING File.*" # "implicit" truncation by static_cast "cc-3968 CC: WARNING File.*" # "implicit" truncation by static_cast
"ld: warning: directory not found for option .-(F|L)" "ld: warning: directory not found for option .-(F|L)"
"warning.*This version of Mac OS X is unsupported" "warning.*This version of Mac OS X is unsupported"
"clang.*: warning: argument unused during compilation: .-g"
# Ignore clang's summary warning, assuming prior text has matched some # Ignore clang's summary warning, assuming prior text has matched some
# other warning expression: # other warning expression:

View File

@ -130,6 +130,16 @@ _cpack()
COMPREPLY=( $(compgen -f ${cur}) ) COMPREPLY=( $(compgen -f ${cur}) )
return 0 return 0
;; ;;
--help-variable)
local running=$(for x in `cpack --help-variable-list | grep -v "cpack version" `; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0
;;
--help-command)
local running=$(for x in `cpack --help-command-list | grep -v "cpack version" `; do echo ${x} ; done )
COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
return 0
;;
*) *)
;; ;;
esac esac

View File

@ -0,0 +1,206 @@
# - Use MinGW gfortran from VS if a fortran compiler is not found.
# The 'add_fortran_subdirectory' function adds a subdirectory
# to a project that contains a fortran only sub-project. The module
# will check the current compiler and see if it can support fortran.
# If no fortran compiler is found and the compiler is MSVC, then
# this module will find the MinGW gfortran. It will then use
# an external project to build with the MinGW tools. It will also
# create imported targets for the libraries created. This will only
# work if the fortran code is built into a dll, so BUILD_SHARED_LIBS
# is turned on in the project. In addition the CMAKE_GNUtoMS option
# is set to on, so that the MS .lib files are created.
# Usage is as follows:
# cmake_add_fortran_subdirectory(
# <subdir> # name of subdirectory
# PROJECT <project_name> # project name in subdir top CMakeLists.txt
# ARCHIVE_DIR <dir> # dir where project places .lib files
# RUNTIME_DIR <dir> # dir where project places .dll files
# LIBRARIES <lib>... # names of library targets to import
# LINK_LIBRARIES # link interface libraries for LIBRARIES
# [LINK_LIBS <lib> <dep>...]...
# CMAKE_COMMAND_LINE ... # extra command line flags to pass to cmake
# NO_EXTERNAL_INSTALL # skip installation of external project
# )
# Relative paths in ARCHIVE_DIR and RUNTIME_DIR are interpreted with respect
# to the build directory corresponding to the source directory in which the
# function is invoked.
#
# Limitations:
#
# NO_EXTERNAL_INSTALL is required for forward compatibility with a
# future version that supports installation of the external project
# binaries during "make install".
#=============================================================================
# Copyright 2011-2012 Kitware, Inc.
#
# 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.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
set(_MS_MINGW_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})
include(CheckLanguage)
include(ExternalProject)
include(CMakeParseArguments)
function(_setup_mingw_config_and_build source_dir build_dir)
# Look for a MinGW gfortran.
find_program(MINGW_GFORTRAN
NAMES gfortran
PATHS
c:/MinGW/bin
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
)
if(NOT MINGW_GFORTRAN)
message(FATAL_ERROR
"gfortran not found, please install MinGW with the gfortran option."
"Or set the cache variable MINGW_GFORTRAN to the full path. "
" This is required to build")
endif()
# Validate the MinGW gfortran we found.
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(_mingw_target "Target:.*64.*mingw")
else()
set(_mingw_target "Target:.*mingw32")
endif()
execute_process(COMMAND "${MINGW_GFORTRAN}" -v
ERROR_VARIABLE out ERROR_STRIP_TRAILING_WHITESPACE)
if(NOT "${out}" MATCHES "${_mingw_target}")
string(REPLACE "\n" "\n " out " ${out}")
message(FATAL_ERROR
"MINGW_GFORTRAN is set to\n"
" ${MINGW_GFORTRAN}\n"
"which is not a MinGW gfortran for this architecture. "
"The output from -v does not match \"${_mingw_target}\":\n"
"${out}\n"
"Set MINGW_GFORTRAN to a proper MinGW gfortran for this architecture."
)
endif()
# Configure scripts to run MinGW tools with the proper PATH.
get_filename_component(MINGW_PATH ${MINGW_GFORTRAN} PATH)
file(TO_NATIVE_PATH "${MINGW_PATH}" MINGW_PATH)
string(REPLACE "\\" "\\\\" MINGW_PATH "${MINGW_PATH}")
configure_file(
${_MS_MINGW_SOURCE_DIR}/CMakeAddFortranSubdirectory/config_mingw.cmake.in
${build_dir}/config_mingw.cmake
@ONLY)
configure_file(
${_MS_MINGW_SOURCE_DIR}/CMakeAddFortranSubdirectory/build_mingw.cmake.in
${build_dir}/build_mingw.cmake
@ONLY)
endfunction()
function(_add_fortran_library_link_interface library depend_library)
set_target_properties(${library} PROPERTIES
IMPORTED_LINK_INTERFACE_LIBRARIES_NOCONFIG "${depend_library}")
endfunction()
function(cmake_add_fortran_subdirectory subdir)
# Parse arguments to function
set(options NO_EXTERNAL_INSTALL)
set(oneValueArgs PROJECT ARCHIVE_DIR RUNTIME_DIR)
set(multiValueArgs LIBRARIES LINK_LIBRARIES CMAKE_COMMAND_LINE)
cmake_parse_arguments(ARGS "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(NOT ARGS_NO_EXTERNAL_INSTALL)
message(FATAL_ERROR
"Option NO_EXTERNAL_INSTALL is required (for forward compatibility) "
"but was not given."
)
endif()
# if we are not using MSVC without fortran support
# then just use the usual add_subdirectory to build
# the fortran library
check_language(Fortran)
if(NOT (MSVC AND (NOT CMAKE_Fortran_COMPILER)))
add_subdirectory(${subdir})
return()
endif()
# if we have MSVC without Intel fortran then setup
# external projects to build with mingw fortran
set(source_dir "${CMAKE_CURRENT_SOURCE_DIR}/${subdir}")
set(project_name "${ARGS_PROJECT}")
set(library_dir "${ARGS_ARCHIVE_DIR}")
set(binary_dir "${ARGS_RUNTIME_DIR}")
set(libraries ${ARGS_LIBRARIES})
# use the same directory that add_subdirectory would have used
set(build_dir "${CMAKE_CURRENT_BINARY_DIR}/${subdir}")
foreach(dir_var library_dir binary_dir)
if(NOT IS_ABSOLUTE "${${dir_var}}")
get_filename_component(${dir_var}
"${CMAKE_CURRENT_BINARY_DIR}/${${dir_var}}" ABSOLUTE)
endif()
endforeach()
# create build and configure wrapper scripts
_setup_mingw_config_and_build("${source_dir}" "${build_dir}")
# create the external project
externalproject_add(${project_name}_build
SOURCE_DIR ${source_dir}
BINARY_DIR ${build_dir}
CONFIGURE_COMMAND ${CMAKE_COMMAND}
-P ${build_dir}/config_mingw.cmake
BUILD_COMMAND ${CMAKE_COMMAND}
-P ${build_dir}/build_mingw.cmake
INSTALL_COMMAND ""
)
# make the external project always run make with each build
externalproject_add_step(${project_name}_build forcebuild
COMMAND ${CMAKE_COMMAND}
-E remove
${CMAKE_CURRENT_BUILD_DIR}/${project_name}-prefix/src/${project_name}-stamp/${project_name}-build
DEPENDEES configure
DEPENDERS build
ALWAYS 1
)
# create imported targets for all libraries
foreach(lib ${libraries})
add_library(${lib} SHARED IMPORTED GLOBAL)
set_property(TARGET ${lib} APPEND PROPERTY IMPORTED_CONFIGURATIONS NOCONFIG)
set_target_properties(${lib} PROPERTIES
IMPORTED_IMPLIB_NOCONFIG "${library_dir}/lib${lib}.lib"
IMPORTED_LOCATION_NOCONFIG "${binary_dir}/lib${lib}.dll"
)
add_dependencies(${lib} ${project_name}_build)
endforeach()
# now setup link libraries for targets
set(start FALSE)
set(target)
foreach(lib ${ARGS_LINK_LIBRARIES})
if("${lib}" STREQUAL "LINK_LIBS")
set(start TRUE)
else()
if(start)
if(DEFINED target)
# process current target and target_libs
_add_fortran_library_link_interface(${target} "${target_libs}")
# zero out target and target_libs
set(target)
set(target_libs)
endif()
# save the current target and set start to FALSE
set(target ${lib})
set(start FALSE)
else()
# append the lib to target_libs
list(APPEND target_libs "${lib}")
endif()
endif()
endforeach()
# process anything that is left in target and target_libs
if(DEFINED target)
_add_fortran_library_link_interface(${target} "${target_libs}")
endif()
endfunction()

View File

@ -0,0 +1,2 @@
set(ENV{PATH} "@MINGW_PATH@\;$ENV{PATH}")
execute_process(COMMAND "@CMAKE_COMMAND@" --build . )

View File

@ -0,0 +1,9 @@
set(ENV{PATH} "@MINGW_PATH@\;$ENV{PATH}")
set(CMAKE_COMMAND_LINE "@ARGS_CMAKE_COMMAND_LINE@")
execute_process(
COMMAND "@CMAKE_COMMAND@" "-GMinGW Makefiles"
-DCMAKE_Fortran_COMPILER:PATH=@MINGW_GFORTRAN@
-DBUILD_SHARED_LIBS=ON
-DCMAKE_GNUtoMS=ON
${CMAKE_COMMAND_LINE}
"@source_dir@")

View File

@ -93,12 +93,6 @@ IF(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
ENDIF() ENDIF()
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
IF(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
ENDIF(NOT CMAKE_MODULE_EXISTS)
# Create a set of shared library variable specific to C++ # Create a set of shared library variable specific to C++
# For 90% of the systems, these are the same flags as the C versions # For 90% of the systems, these are the same flags as the C versions
# so if these are not set just copy the flags from the c version # so if these are not set just copy the flags from the c version
@ -158,6 +152,14 @@ IF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
SET(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C}) SET(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C})
ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX) ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
IF(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
ENDIF(NOT CMAKE_MODULE_EXISTS)
# repeat for modules # repeat for modules
IF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS) IF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})

View File

@ -50,7 +50,7 @@ IF(NOT CMAKE_Fortran_COMPILER)
# fort77: native F77 compiler under HP-UX (and some older Crays) # fort77: native F77 compiler under HP-UX (and some older Crays)
# frt: Fujitsu F77 compiler # frt: Fujitsu F77 compiler
# pathf90/pathf95/pathf2003: PathScale Fortran compiler # pathf90/pathf95/pathf2003: PathScale Fortran compiler
# pgf77/pgf90/pgf95: Portland Group F77/F90/F95 compilers # pgf77/pgf90/pgf95/pgfortran: Portland Group F77/F90/F95 compilers
# xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers # xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers
# lf95: Lahey-Fujitsu F95 compiler # lf95: Lahey-Fujitsu F95 compiler
# fl32: Microsoft Fortran 77 "PowerStation" compiler # fl32: Microsoft Fortran 77 "PowerStation" compiler
@ -64,8 +64,8 @@ IF(NOT CMAKE_Fortran_COMPILER)
# then 77 or older compilers, gnu is always last in the group, # then 77 or older compilers, gnu is always last in the group,
# so if you paid for a compiler it is picked by default. # so if you paid for a compiler it is picked by default.
SET(CMAKE_Fortran_COMPILER_LIST SET(CMAKE_Fortran_COMPILER_LIST
ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 lf95 xlf95 fort ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 pgfortran lf95 xlf95
gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77 fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77
frt pgf77 xlf fl32 af77 g77 f77 frt pgf77 xlf fl32 af77 g77 f77
) )
@ -73,7 +73,7 @@ IF(NOT CMAKE_Fortran_COMPILER)
SET(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77) SET(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77)
SET(_Fortran_COMPILER_NAMES_Intel ifort ifc efc) SET(_Fortran_COMPILER_NAMES_Intel ifort ifc efc)
SET(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77) SET(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77)
SET(_Fortran_COMPILER_NAMES_PGI pgf95 pgf90 pgf77) SET(_Fortran_COMPILER_NAMES_PGI pgf95 pgfortran pgf90 pgf77)
SET(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90) SET(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90)
SET(_Fortran_COMPILER_NAMES_XL xlf) SET(_Fortran_COMPILER_NAMES_XL xlf)
SET(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf) SET(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf)

View File

@ -0,0 +1,129 @@
# CMAKE_EXPAND_IMPORTED_TARGETS(<var> LIBRARIES lib1 lib2...libN
# [CONFIGURATION <config>] )
#
# CMAKE_EXPAND_IMPORTED_TARGETS() takes a list of libraries and replaces
# all imported targets contained in this list with their actual file paths
# of the referenced libraries on disk, including the libraries from their
# link interfaces.
# If a CONFIGURATION is given, it uses the respective configuration of the
# imported targets if it exists. If no CONFIGURATION is given, it uses
# the first configuration from ${CMAKE_CONFIGURATION_TYPES} if set, otherwise
# ${CMAKE_BUILD_TYPE}.
# This macro is used by all Check*.cmake files which use
# TRY_COMPILE() or TRY_RUN() and support CMAKE_REQUIRED_LIBRARIES , so that
# these checks support imported targets in CMAKE_REQUIRED_LIBRARIES:
# cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
# CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
#=============================================================================
# Copyright 2012 Kitware, Inc.
# Copyright 2009-2012 Alexander Neundorf <neundorf@kde.org>
#
# 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.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(CMakeParseArguments)
function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
set(options )
set(oneValueArgs CONFIGURATION )
set(multiValueArgs LIBRARIES )
cmake_parse_arguments(CEIT "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(CEIT_UNPARSED_ARGUMENTS)
message(FATAL_ERROR "Unknown keywords given to CMAKE_EXPAND_IMPORTED_TARGETS(): \"${CEIT_UNPARSED_ARGUMENTS}\"")
endif()
if(NOT CEIT_CONFIGURATION)
if(CMAKE_CONFIGURATION_TYPES)
list(GET CMAKE_CONFIGURATION_TYPES 0 CEIT_CONFIGURATION)
else()
set(CEIT_CONFIGURATION ${CMAKE_BUILD_TYPE})
endif()
endif()
# handle imported library targets
set(_CCSR_REQ_LIBS ${CEIT_LIBRARIES})
set(_CHECK_FOR_IMPORTED_TARGETS TRUE)
set(_CCSR_LOOP_COUNTER 0)
while(_CHECK_FOR_IMPORTED_TARGETS)
math(EXPR _CCSR_LOOP_COUNTER "${_CCSR_LOOP_COUNTER} + 1 ")
set(_CCSR_NEW_REQ_LIBS )
set(_CHECK_FOR_IMPORTED_TARGETS FALSE)
foreach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
get_target_property(_importedConfigs "${_CURRENT_LIB}" IMPORTED_CONFIGURATIONS)
if (_importedConfigs)
# message(STATUS "Detected imported target ${_CURRENT_LIB}")
# Ok, so this is an imported target.
# First we get the imported configurations.
# Then we get the location of the actual library on disk of the first configuration.
# then we'll get its link interface libraries property,
# iterate through it and replace all imported targets we find there
# with there actual location.
# guard against infinite loop: abort after 100 iterations ( 100 is arbitrary chosen)
if ("${_CCSR_LOOP_COUNTER}" LESS 100)
set(_CHECK_FOR_IMPORTED_TARGETS TRUE)
# else ("${_CCSR_LOOP_COUNTER}" LESS 1)
# message(STATUS "********* aborting loop, counter : ${_CCSR_LOOP_COUNTER}")
endif ("${_CCSR_LOOP_COUNTER}" LESS 100)
# if one of the imported configurations equals ${CMAKE_TRY_COMPILE_CONFIGURATION},
# use it, otherwise simply use the first one:
list(FIND _importedConfigs "${CEIT_CONFIGURATION}" _configIndexToUse)
if("${_configIndexToUse}" EQUAL -1)
set(_configIndexToUse 0)
endif("${_configIndexToUse}" EQUAL -1)
list(GET _importedConfigs ${_configIndexToUse} _importedConfigToUse)
get_target_property(_importedLocation "${_CURRENT_LIB}" IMPORTED_LOCATION_${_importedConfigToUse})
get_target_property(_linkInterfaceLibs "${_CURRENT_LIB}" IMPORTED_LINK_INTERFACE_LIBRARIES_${_importedConfigToUse} )
list(APPEND _CCSR_NEW_REQ_LIBS "${_importedLocation}")
# message(STATUS "Appending lib ${_CURRENT_LIB} as ${_importedLocation}")
if(_linkInterfaceLibs)
foreach(_currentLinkInterfaceLib ${_linkInterfaceLibs})
# message(STATUS "Appending link interface lib ${_currentLinkInterfaceLib}")
if(_currentLinkInterfaceLib)
list(APPEND _CCSR_NEW_REQ_LIBS "${_currentLinkInterfaceLib}" )
endif(_currentLinkInterfaceLib)
endforeach(_currentLinkInterfaceLib "${_linkInterfaceLibs}")
endif(_linkInterfaceLibs)
else(_importedConfigs)
# "Normal" libraries are just used as they are.
list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
# message(STATUS "Appending lib directly: ${_CURRENT_LIB}")
endif(_importedConfigs)
endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
set(_CCSR_REQ_LIBS ${_CCSR_NEW_REQ_LIBS} )
endwhile(_CHECK_FOR_IMPORTED_TARGETS)
# Finally we iterate once more over all libraries. This loop only removes
# all remaining imported target names (there shouldn't be any left anyway).
set(_CCSR_NEW_REQ_LIBS )
foreach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
get_target_property(_importedConfigs "${_CURRENT_LIB}" IMPORTED_CONFIGURATIONS)
if (NOT _importedConfigs)
list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
# message(STATUS "final: appending ${_CURRENT_LIB}")
else (NOT _importedConfigs)
# message(STATUS "final: skipping ${_CURRENT_LIB}")
endif (NOT _importedConfigs)
endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
# message(STATUS "setting -${_RESULT}- to -${_CCSR_NEW_REQ_LIBS}-")
set(${_RESULT} "${_CCSR_NEW_REQ_LIBS}" PARENT_SCOPE)
endfunction()

View File

@ -109,6 +109,14 @@ IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG}) SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
ENDIF() ENDIF()
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
IF(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
ENDIF(NOT CMAKE_MODULE_EXISTS)
# repeat for modules # repeat for modules
IF(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS) IF(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})

View File

@ -1,5 +1,7 @@
# - Build binary and source package installers ##section Variables common to all CPack generators
# ##end
##module
# - Build binary and source package installers.
# The CPack module generates binary and source installers in a variety # The CPack module generates binary and source installers in a variety
# of formats using the cpack program. Inclusion of the CPack module # of formats using the cpack program. Inclusion of the CPack module
# adds two new targets to the resulting makefiles, package and # adds two new targets to the resulting makefiles, package and
@ -29,16 +31,16 @@
# on a per-generator basis. It only need contain overrides. # on a per-generator basis. It only need contain overrides.
# #
# Here's how it works: # Here's how it works:
# - cpack runs # - cpack runs
# - it includes CPackConfig.cmake # - it includes CPackConfig.cmake
# - it iterates over the generators listed in that file's # - it iterates over the generators listed in that file's
# CPACK_GENERATOR list variable (unless told to use just a # CPACK_GENERATOR list variable (unless told to use just a
# specific one via -G on the command line...) # specific one via -G on the command line...)
# #
# - foreach generator, it then # - foreach generator, it then
# - sets CPACK_GENERATOR to the one currently being iterated # - sets CPACK_GENERATOR to the one currently being iterated
# - includes the CPACK_PROJECT_CONFIG_FILE # - includes the CPACK_PROJECT_CONFIG_FILE
# - produces the package for that generator # - produces the package for that generator
# #
# This is the key: For each generator listed in CPACK_GENERATOR # This is the key: For each generator listed in CPACK_GENERATOR
# in CPackConfig.cmake, cpack will *reset* CPACK_GENERATOR # in CPackConfig.cmake, cpack will *reset* CPACK_GENERATOR
@ -48,174 +50,180 @@
# Before including this CPack module in your CMakeLists.txt file, # Before including this CPack module in your CMakeLists.txt file,
# there are a variety of variables that can be set to customize # there are a variety of variables that can be set to customize
# the resulting installers. The most commonly-used variables are: # the resulting installers. The most commonly-used variables are:
##end
# #
##variable
# CPACK_PACKAGE_NAME - The name of the package (or application). If # CPACK_PACKAGE_NAME - The name of the package (or application). If
# not specified, defaults to the project name. # not specified, defaults to the project name.
##end
# #
# CPACK_PACKAGE_VENDOR - The name of the package vendor (e.g., ##variable
# CPACK_PACKAGE_VENDOR - The name of the package vendor. (e.g.,
# "Kitware"). # "Kitware").
##end
# #
##variable
# CPACK_PACKAGE_VERSION_MAJOR - Package major Version # CPACK_PACKAGE_VERSION_MAJOR - Package major Version
##end
# #
##variable
# CPACK_PACKAGE_VERSION_MINOR - Package minor Version # CPACK_PACKAGE_VERSION_MINOR - Package minor Version
##end
# #
##variable
# CPACK_PACKAGE_VERSION_PATCH - Package patch Version # CPACK_PACKAGE_VERSION_PATCH - Package patch Version
##end
# #
##variable
# CPACK_PACKAGE_DESCRIPTION_FILE - A text file used to describe the # CPACK_PACKAGE_DESCRIPTION_FILE - A text file used to describe the
# project. Used, for example, the introduction screen of a # project. Used, for example, the introduction screen of a
# CPack-generated Windows installer to describe the project. # CPack-generated Windows installer to describe the project.
##end
# #
##variable
# CPACK_PACKAGE_DESCRIPTION_SUMMARY - Short description of the # CPACK_PACKAGE_DESCRIPTION_SUMMARY - Short description of the
# project (only a few words). # project (only a few words).
##end
# #
##variable
# CPACK_PACKAGE_FILE_NAME - The name of the package file to generate, # CPACK_PACKAGE_FILE_NAME - The name of the package file to generate,
# not including the extension. For example, cmake-2.6.1-Linux-i686. # not including the extension. For example, cmake-2.6.1-Linux-i686.
##end
# #
##variable
# CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the # CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the
# target system, e.g., "CMake 2.5". # target system, e.g., "CMake 2.5".
##end
# #
##variable
# CPACK_PROJECT_CONFIG_FILE - File included at cpack time, once per # CPACK_PROJECT_CONFIG_FILE - File included at cpack time, once per
# generator after setting CPACK_GENERATOR to the actual generator # generator after setting CPACK_GENERATOR to the actual generator
# being used. Allows per-generator setting of CPACK_* variables at # being used. Allows per-generator setting of CPACK_* variables at
# cpack time. # cpack time.
##end
# #
##variable
# CPACK_RESOURCE_FILE_LICENSE - License file for the project, which # CPACK_RESOURCE_FILE_LICENSE - License file for the project, which
# will typically be displayed to the user (often with an explicit # will typically be displayed to the user (often with an explicit
# "Accept" button, for graphical installers) prior to installation. # "Accept" button, for graphical installers) prior to installation.
##end
# #
##variable
# CPACK_RESOURCE_FILE_README - ReadMe file for the project, which # CPACK_RESOURCE_FILE_README - ReadMe file for the project, which
# typically describes in some detail # typically describes in some detail
##end
# #
##variable
# CPACK_RESOURCE_FILE_WELCOME - Welcome file for the project, which # CPACK_RESOURCE_FILE_WELCOME - Welcome file for the project, which
# welcomes users to this installer. Typically used in the graphical # welcomes users to this installer. Typically used in the graphical
# installers on Windows and Mac OS X. # installers on Windows and Mac OS X.
##end
# #
##variable
# CPACK_MONOLITHIC_INSTALL - Disables the component-based # CPACK_MONOLITHIC_INSTALL - Disables the component-based
# installation mechanism, so that all components are always installed. # installation mechanism, so that all components are always installed.
##end
# #
##variable
# CPACK_GENERATOR - List of CPack generators to use. If not # CPACK_GENERATOR - List of CPack generators to use. If not
# specified, CPack will create a set of options (e.g., # specified, CPack will create a set of options (e.g.,
# CPACK_BINARY_NSIS) allowing the user to enable/disable individual # CPACK_BINARY_NSIS) allowing the user to enable/disable individual
# generators. # generators.
##end
# #
##variable
# CPACK_OUTPUT_CONFIG_FILE - The name of the CPack configuration file # CPACK_OUTPUT_CONFIG_FILE - The name of the CPack configuration file
# for binary installers that will be generated by the CPack # for binary installers that will be generated by the CPack
# module. Defaults to CPackConfig.cmake. # module. Defaults to CPackConfig.cmake.
##end
# #
##variable
# CPACK_PACKAGE_EXECUTABLES - Lists each of the executables along # CPACK_PACKAGE_EXECUTABLES - Lists each of the executables along
# with a text label, to be used to create Start Menu shortcuts on # with a text label, to be used to create Start Menu shortcuts on
# Windows. For example, setting this to the list ccmake;CMake will # Windows. For example, setting this to the list ccmake;CMake will
# create a shortcut named "CMake" that will execute the installed # create a shortcut named "CMake" that will execute the installed
# executable ccmake. # executable ccmake.
##end
# #
##variable
# CPACK_STRIP_FILES - List of files to be stripped. Starting with # CPACK_STRIP_FILES - List of files to be stripped. Starting with
# CMake 2.6.0 CPACK_STRIP_FILES will be a boolean variable which # CMake 2.6.0 CPACK_STRIP_FILES will be a boolean variable which
# enables stripping of all files (a list of files evaluates to TRUE # enables stripping of all files (a list of files evaluates to TRUE
# in CMake, so this change is compatible). # in CMake, so this change is compatible).
##end
# #
# The following CPack variables are specific to source packages, and # The following CPack variables are specific to source packages, and
# will not affect binary packages: # will not affect binary packages:
# #
##variable
# CPACK_SOURCE_PACKAGE_FILE_NAME - The name of the source package, # CPACK_SOURCE_PACKAGE_FILE_NAME - The name of the source package,
# e.g., cmake-2.6.1 # e.g., cmake-2.6.1
##end
# #
##variable
# CPACK_SOURCE_STRIP_FILES - List of files in the source tree that # CPACK_SOURCE_STRIP_FILES - List of files in the source tree that
# will be stripped. Starting with CMake 2.6.0 # will be stripped. Starting with CMake 2.6.0
# CPACK_SOURCE_STRIP_FILES will be a boolean variable which enables # CPACK_SOURCE_STRIP_FILES will be a boolean variable which enables
# stripping of all files (a list of files evaluates to TRUE in CMake, # stripping of all files (a list of files evaluates to TRUE in CMake,
# so this change is compatible). # so this change is compatible).
##end
# #
##variable
# CPACK_SOURCE_GENERATOR - List of generators used for the source # CPACK_SOURCE_GENERATOR - List of generators used for the source
# packages. As with CPACK_GENERATOR, if this is not specified then # packages. As with CPACK_GENERATOR, if this is not specified then
# CPack will create a set of options (e.g., CPACK_SOURCE_ZIP) # CPack will create a set of options (e.g., CPACK_SOURCE_ZIP)
# allowing users to select which packages will be generated. # allowing users to select which packages will be generated.
##end
# #
##variable
# CPACK_SOURCE_OUTPUT_CONFIG_FILE - The name of the CPack # CPACK_SOURCE_OUTPUT_CONFIG_FILE - The name of the CPack
# configuration file for source installers that will be generated by # configuration file for source installers that will be generated by
# the CPack module. Defaults to CPackSourceConfig.cmake. # the CPack module. Defaults to CPackSourceConfig.cmake.
##end
# #
##variable
# CPACK_SOURCE_IGNORE_FILES - Pattern of files in the source tree # CPACK_SOURCE_IGNORE_FILES - Pattern of files in the source tree
# that won't be packaged when building a source package. This is a # that won't be packaged when building a source package. This is a
# list of patterns, e.g., /CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.* # list of patterns, e.g., /CVS/;/\\.svn/;\\.swp$;\\.#;/#;.*~;cscope.*
# ##end
# The following variables are specific to the DragNDrop installers
# built on Mac OS X:
#
# CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
# image. Defaults to CPACK_PACKAGE_FILE_NAME.
#
# CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
# (UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
# bzip2-compressed). Refer to hdiutil(1) for more information on
# other available formats.
#
# CPACK_DMG_DS_STORE - Path to a custom .DS_Store file which e.g.
# can be used to specify the Finder window position/geometry and
# layout (such as hidden toolbars, placement of the icons etc.).
# This file has to be generated by the Finder (either manually or
# through OSA-script) using a normal folder from which the .DS_Store
# file can then be extracted.
#
# CPACK_DMG_BACKGROUND_IMAGE - Path to an image file which is to be
# used as the background for the Finder Window when the disk image
# is opened. By default no background image is set. The background
# image is applied after applying the custom .DS_Store file.
#
# CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
# operate on disk image files on Mac OS X. This variable can be used
# to override the automatically detected command (or specify its
# location if the auto-detection fails to find it.)
#
# CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
# extended attributes on files and directories on Mac OS X. This
# variable can be used to override the automatically detected
# command (or specify its location if the auto-detection fails to
# find it.)
#
# CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
# resources on Mac OS X. This variable can be used to override the
# automatically detected command (or specify its location if the
# auto-detection fails to find it.)
#
# The following variable is specific to installers build on Mac OS X
# using PackageMaker:
#
# CPACK_OSX_PACKAGE_VERSION - The version of Mac OS X that the
# resulting PackageMaker archive should be compatible
# with. Different versions of Mac OS X support different
# features. For example, CPack can only build component-based
# installers for Mac OS X 10.4 or newer, and can only build
# installers that download component son-the-fly for Mac OS X 10.5
# or newer. If left blank, this value will be set to the minimum
# version of Mac OS X that supports the requested features. Set this
# variable to some value (e.g., 10.4) only if you want to guarantee
# that your installer will work on that version of Mac OS X, and
# don't mind missing extra features available in the installer
# shipping with later versions of Mac OS X.
# #
# The following variables are for advanced uses of CPack: # The following variables are for advanced uses of CPack:
# #
##variable
# CPACK_CMAKE_GENERATOR - What CMake generator should be used if the # CPACK_CMAKE_GENERATOR - What CMake generator should be used if the
# project is CMake project. Defaults to the value of CMAKE_GENERATOR; # project is CMake project. Defaults to the value of CMAKE_GENERATOR;
# few users will want to change this setting. # few users will want to change this setting.
##end
# #
##variable
# CPACK_INSTALL_CMAKE_PROJECTS - List of four values that specify # CPACK_INSTALL_CMAKE_PROJECTS - List of four values that specify
# what project to install. The four values are: Build directory, # what project to install. The four values are: Build directory,
# Project Name, Project Component, Directory. If omitted, CPack will # Project Name, Project Component, Directory. If omitted, CPack will
# build an installer that installers everything. # build an installer that installers everything.
##end
# #
##variable
# CPACK_SYSTEM_NAME - System name, defaults to the value of # CPACK_SYSTEM_NAME - System name, defaults to the value of
# ${CMAKE_SYSTEM_NAME}. # ${CMAKE_SYSTEM_NAME}.
##end
# #
##variable
# CPACK_PACKAGE_VERSION - Package full version, used internally. By # CPACK_PACKAGE_VERSION - Package full version, used internally. By
# default, this is built from CPACK_PACKAGE_VERSION_MAJOR, # default, this is built from CPACK_PACKAGE_VERSION_MAJOR,
# CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH. # CPACK_PACKAGE_VERSION_MINOR, and CPACK_PACKAGE_VERSION_PATCH.
##end
# #
##variable
# CPACK_TOPLEVEL_TAG - Directory for the installed files. # CPACK_TOPLEVEL_TAG - Directory for the installed files.
##end
# #
##variable
# CPACK_INSTALL_COMMANDS - Extra commands to install components. # CPACK_INSTALL_COMMANDS - Extra commands to install components.
##end
# #
##variable
# CPACK_INSTALLED_DIRECTORIES - Extra directories to install. # CPACK_INSTALLED_DIRECTORIES - Extra directories to install.
##end
# #
#============================================================================= #=============================================================================
@ -259,7 +267,7 @@ MACRO(cpack_set_if_not_set name value)
ENDIF(NOT DEFINED "${name}") ENDIF(NOT DEFINED "${name}")
ENDMACRO(cpack_set_if_not_set) ENDMACRO(cpack_set_if_not_set)
# Macro to encode variables for the configuration file # cpack_encode_variables - Macro to encode variables for the configuration file
# find any variable that starts with CPACK and create a variable # find any variable that starts with CPACK and create a variable
# _CPACK_OTHER_VARIABLES_ that contains SET commands for # _CPACK_OTHER_VARIABLES_ that contains SET commands for
# each cpack variable. _CPACK_OTHER_VARIABLES_ is then # each cpack variable. _CPACK_OTHER_VARIABLES_ is then

View File

@ -1,25 +1,37 @@
##section Variables specific to CPack Bundle generator
##end
##module
# - CPack Bundle generator (Mac OS X) specific options # - CPack Bundle generator (Mac OS X) specific options
# #
# Installers built on Mac OS X using the Bundle generator use the # Installers built on Mac OS X using the Bundle generator use the
# aforementioned DragNDrop variables, plus the following Bundle-specific # aforementioned DragNDrop variables, plus the following Bundle-specific
# parameters: # parameters:
##end
# #
##variable
# CPACK_BUNDLE_NAME - The name of the generated bundle. This # CPACK_BUNDLE_NAME - The name of the generated bundle. This
# appears in the OSX finder as the bundle name. Required. # appears in the OSX finder as the bundle name. Required.
##end
# #
##variable
# CPACK_BUNDLE_PLIST - Path to an OSX plist file that will be used # CPACK_BUNDLE_PLIST - Path to an OSX plist file that will be used
# as the Info.plist for the generated bundle. This assumes that # as the Info.plist for the generated bundle. This assumes that
# the caller has generated or specified their own Info.plist file. # the caller has generated or specified their own Info.plist file.
# Required. # Required.
##end
# #
##variable
# CPACK_BUNDLE_ICON - Path to an OSX icns file that will be used as # CPACK_BUNDLE_ICON - Path to an OSX icns file that will be used as
# the icon for the generated bundle. This is the icon that appears # the icon for the generated bundle. This is the icon that appears
# in the OSX finder for the bundle, and in the OSX dock when the # in the OSX finder for the bundle, and in the OSX dock when the
# bundle is opened. Required. # bundle is opened. Required.
##end
# #
##variable
# CPACK_BUNDLE_STARTUP_SCRIPT - Path to an executable or script that # CPACK_BUNDLE_STARTUP_SCRIPT - Path to an executable or script that
# will be run whenever an end-user double-clicks the generated bundle # will be run whenever an end-user double-clicks the generated bundle
# in the OSX Finder. Optional. # in the OSX Finder. Optional.
##end
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2009 Kitware, Inc.

View File

@ -1,3 +1,6 @@
##section Variables concerning CPack Components
##end
##module
# - Build binary and source package installers # - Build binary and source package installers
# #
# The CPackComponent module is the module which handles # The CPackComponent module is the module which handles
@ -20,7 +23,54 @@
# components are identified by the COMPONENT argument of CMake's # components are identified by the COMPONENT argument of CMake's
# INSTALL commands, and should be further described by the following # INSTALL commands, and should be further described by the following
# CPack commands: # CPack commands:
##end
# #
##variable
# CPACK_COMPONENTS_ALL - The list of component to install.
#
# The default value of this variable is computed by CPack
# and contains all components defined by the project. The
# user may set it to only include the specified components.
##end
#
##variable
# CPACK_<GENNAME>_COMPONENT_INSTALL - Enable/Disable component install for
# CPack generator <GENNAME>.
#
# Each CPack Generator (RPM, DEB, ARCHIVE, NSIS, DMG, etc...) has a legacy
# default behavior. e.g. RPM builds monolithic whereas NSIS builds component.
# One can change the default behavior by setting this variable to 0/1 or OFF/ON.
##end
##variable
# CPACK_COMPONENTS_GROUPING - Specify how components are grouped for multi-package
# component-aware CPack generators.
#
# Some generators like RPM or ARCHIVE family (TGZ, ZIP, ...) generates several
# packages files when asked for component packaging. They group the component
# differently depending on the value of this variable:
# - ONE_PER_GROUP (default): creates one package file per component group
# - ALL_COMPONENTS_IN_ONE : creates a single package with all (requested) component
# - IGNORE : creates one package per component, i.e. IGNORE component group
# One can specify different grouping for different CPack generator by using
# a CPACK_PROJECT_CONFIG_FILE.
##end
##variable
# CPACK_COMPONENT_<compName>_DISPLAY_NAME - The name to be displayed for a component.
##end
##variable
# CPACK_COMPONENT_<compName>_DESCRIPTION - The description of a component.
##end
##variable
# CPACK_COMPONENT_<compName>_GROUP - The group of a component.
##end
##variable
# CPACK_COMPONENT_<compName>_DEPENDS - The dependencies (list of components)
# on which this component depends.
##end
##variable
# CPACK_COMPONENT_<compName>_REQUIRED - True is this component is required.
##end
##macro
# cpack_add_component - Describes a CPack installation component # cpack_add_component - Describes a CPack installation component
# named by the COMPONENT argument to a CMake INSTALL command. # named by the COMPONENT argument to a CMake INSTALL command.
# #
@ -90,7 +140,9 @@
# create a file with some name based on CPACK_PACKAGE_FILE_NAME and # create a file with some name based on CPACK_PACKAGE_FILE_NAME and
# the name of the component. See cpack_configure_downloads for more # the name of the component. See cpack_configure_downloads for more
# information. # information.
##end
# #
##macro
# cpack_add_component_group - Describes a group of related CPack # cpack_add_component_group - Describes a group of related CPack
# installation components. # installation components.
# #
@ -134,7 +186,9 @@
# #
# BOLD_TITLE indicates that the group title should appear in bold, # BOLD_TITLE indicates that the group title should appear in bold,
# to call the user's attention to the group. # to call the user's attention to the group.
##end
# #
##macro
# cpack_add_install_type - Add a new installation type containing a # cpack_add_install_type - Add a new installation type containing a
# set of predefined component selections to the graphical installer. # set of predefined component selections to the graphical installer.
# #
@ -153,7 +207,9 @@
# DISPLAY_NAME is the displayed name of the install type, which will # DISPLAY_NAME is the displayed name of the install type, which will
# typically show up in a drop-down box within a graphical # typically show up in a drop-down box within a graphical
# installer. This value can be any string. # installer. This value can be any string.
##end
# #
##macro
# cpack_configure_downloads - Configure CPack to download selected # cpack_configure_downloads - Configure CPack to download selected
# components on-the-fly as part of the installation process. # components on-the-fly as part of the installation process.
# #
@ -203,6 +259,7 @@
# that can be called from Windows' Add/Remove Programs dialog (via the # that can be called from Windows' Add/Remove Programs dialog (via the
# "Modify" button) to change the set of installed components. NO_ADD_REMOVE # "Modify" button) to change the set of installed components. NO_ADD_REMOVE
# turns off this behavior. This option is ignored on Mac OS X. # turns off this behavior. This option is ignored on Mac OS X.
##endmacro
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2009 Kitware, Inc.

70
Modules/CPackDMG.cmake Normal file
View File

@ -0,0 +1,70 @@
##section Variables specific to CPack DragNDrop generator
##end
##module
# - DragNDrop CPack generator (Mac OS X).
# The following variables are specific to the DragNDrop installers
# built on Mac OS X:
##end
#
##variable
# CPACK_DMG_VOLUME_NAME - The volume name of the generated disk
# image. Defaults to CPACK_PACKAGE_FILE_NAME.
##end
#
##variable
# CPACK_DMG_FORMAT - The disk image format. Common values are UDRO
# (UDIF read-only), UDZO (UDIF zlib-compressed) or UDBZ (UDIF
# bzip2-compressed). Refer to hdiutil(1) for more information on
# other available formats.
##end
#
##variable
# CPACK_DMG_DS_STORE - Path to a custom .DS_Store file which e.g.
# can be used to specify the Finder window position/geometry and
# layout (such as hidden toolbars, placement of the icons etc.).
# This file has to be generated by the Finder (either manually or
# through OSA-script) using a normal folder from which the .DS_Store
# file can then be extracted.
##end
#
##variable
# CPACK_DMG_BACKGROUND_IMAGE - Path to an image file which is to be
# used as the background for the Finder Window when the disk image
# is opened. By default no background image is set. The background
# image is applied after applying the custom .DS_Store file.
##end
#
##variable
# CPACK_COMMAND_HDIUTIL - Path to the hdiutil(1) command used to
# operate on disk image files on Mac OS X. This variable can be used
# to override the automatically detected command (or specify its
# location if the auto-detection fails to find it.)
##end
#
##variable
# CPACK_COMMAND_SETFILE - Path to the SetFile(1) command used to set
# extended attributes on files and directories on Mac OS X. This
# variable can be used to override the automatically detected
# command (or specify its location if the auto-detection fails to
# find it.)
##end
#
##variable
# CPACK_COMMAND_REZ - Path to the Rez(1) command used to compile
# resources on Mac OS X. This variable can be used to override the
# automatically detected command (or specify its location if the
# auto-detection fails to find it.)
##end
#=============================================================================
# Copyright 2006-2012 Kitware, Inc.
#
# 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.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)

View File

@ -1,3 +1,6 @@
##section Variables specific to CPack Debian (DEB) generator
##end
##module
# - The builtin (binary) CPack Deb generator (Unix only) # - The builtin (binary) CPack Deb generator (Unix only)
# CPackDeb may be used to create Deb package using CPack. # CPackDeb may be used to create Deb package using CPack.
# CPackDeb is a CPack generator thus it uses the CPACK_XXX variables # CPackDeb is a CPack generator thus it uses the CPACK_XXX variables
@ -11,43 +14,63 @@
# the wiki: # the wiki:
# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29 # http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#DEB_.28UNIX_only.29
# However as a handy reminder here comes the list of specific variables: # However as a handy reminder here comes the list of specific variables:
##end
# #
##variable
# CPACK_DEBIAN_PACKAGE_NAME # CPACK_DEBIAN_PACKAGE_NAME
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_NAME (lower case) # Default : CPACK_PACKAGE_NAME (lower case)
# The debian package summary # The debian package summary
##end
##variable
# CPACK_DEBIAN_PACKAGE_VERSION # CPACK_DEBIAN_PACKAGE_VERSION
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_VERSION # Default : CPACK_PACKAGE_VERSION
# The debian package version # The debian package version
##end
##variable
# CPACK_DEBIAN_PACKAGE_ARCHITECTURE # CPACK_DEBIAN_PACKAGE_ARCHITECTURE
# Mandatory : YES # Mandatory : YES
# Default : Output of dpkg --print-architecture (or i386 if dpkg is not found) # Default : Output of dpkg --print-architecture (or i386 if dpkg is not found)
# The debian package architecture # The debian package architecture
##end
##variable
# CPACK_DEBIAN_PACKAGE_DEPENDS # CPACK_DEBIAN_PACKAGE_DEPENDS
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to set deb dependencies. # May be used to set deb dependencies.
##end
##variable
# CPACK_DEBIAN_PACKAGE_MAINTAINER # CPACK_DEBIAN_PACKAGE_MAINTAINER
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_CONTACT # Default : CPACK_PACKAGE_CONTACT
# The debian package maintainer # The debian package maintainer
##end
##variable
# CPACK_DEBIAN_PACKAGE_DESCRIPTION # CPACK_DEBIAN_PACKAGE_DESCRIPTION
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY # Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
# The debian package description # The debian package description
##end
##variable
# CPACK_DEBIAN_PACKAGE_SECTION # CPACK_DEBIAN_PACKAGE_SECTION
# Mandatory : YES # Mandatory : YES
# Default : 'devel' # Default : 'devel'
# The debian package section # The debian package section
##end
##variable
# CPACK_DEBIAN_PACKAGE_PRIORITY # CPACK_DEBIAN_PACKAGE_PRIORITY
# Mandatory : YES # Mandatory : YES
# Default : 'optional' # Default : 'optional'
# The debian package priority # The debian package priority
##end
##variable
# CPACK_DEBIAN_PACKAGE_HOMEPAGE # CPACK_DEBIAN_PACKAGE_HOMEPAGE
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# The URL of the web site for this package # The URL of the web site for this package
##end
##variable
# CPACK_DEBIAN_PACKAGE_SHLIBDEPS # CPACK_DEBIAN_PACKAGE_SHLIBDEPS
# Mandatory : NO # Mandatory : NO
# Default : OFF # Default : OFF
@ -57,11 +80,15 @@
# if you use this feature, because if you don't dpkg-shlibdeps # if you use this feature, because if you don't dpkg-shlibdeps
# may fail to find your own shared libs. # may fail to find your own shared libs.
# See http://www.cmake.org/Wiki/CMake_RPATH_handling. # See http://www.cmake.org/Wiki/CMake_RPATH_handling.
##end
##variable
# CPACK_DEBIAN_PACKAGE_DEBUG # CPACK_DEBIAN_PACKAGE_DEBUG
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be set when invoking cpack in order to trace debug information # May be set when invoking cpack in order to trace debug information
# during CPackDeb run. # during CPackDeb run.
##end
##variable
# CPACK_DEBIAN_PACKAGE_PREDEPENDS # CPACK_DEBIAN_PACKAGE_PREDEPENDS
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
@ -69,12 +96,16 @@
# This field is like Depends, except that it also forces dpkg to complete installation of # 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 packages named before even starting the installation of the package which declares
# the pre-dependency. # the pre-dependency.
##end
##variable
# CPACK_DEBIAN_PACKAGE_ENHANCES # CPACK_DEBIAN_PACKAGE_ENHANCES
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps # 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. # 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. # It is used to declare that a package can enhance the functionality of another package.
##end
##variable
# CPACK_DEBIAN_PACKAGE_BREAKS # CPACK_DEBIAN_PACKAGE_BREAKS
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
@ -82,23 +113,30 @@
# When one binary package declares that it breaks another, dpkg will refuse to allow the # 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, # 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. # and it will refuse to allow the broken package to be reconfigured.
##end
##variable
# CPACK_DEBIAN_PACKAGE_CONFLICTS # CPACK_DEBIAN_PACKAGE_CONFLICTS
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps # 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, # 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. # dpkg will refuse to allow them to be installed on the system at the same time.
##end
##variable
# CPACK_DEBIAN_PACKAGE_PROVIDES # CPACK_DEBIAN_PACKAGE_PROVIDES
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps # 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. # A virtual package is one which appears in the Provides control field of another package.
##end
##variable
# CPACK_DEBIAN_PACKAGE_REPLACES # CPACK_DEBIAN_PACKAGE_REPLACES
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps # see http://www.debian.org/doc/debian-policy/ch-relationships.html#s-binarydeps
# Packages can declare in their control file that they should overwrite # Packages can declare in their control file that they should overwrite
# files in certain other packages, or completely replace other packages. # files in certain other packages, or completely replace other packages.
##end
#============================================================================= #=============================================================================
# Copyright 2007-2009 Kitware, Inc. # Copyright 2007-2009 Kitware, Inc.

View File

@ -1,70 +1,112 @@
##section Variables specific to CPack NSIS generator
##end
##module
# - CPack NSIS generator specific options # - CPack NSIS generator specific options
# #
# The following variables are specific to the graphical installers built # The following variables are specific to the graphical installers built
# on Windows using the Nullsoft Installation System. # on Windows using the Nullsoft Installation System.
##end
# #
##variable
# CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when # CPACK_PACKAGE_INSTALL_REGISTRY_KEY - Registry key used when
# installing this project. # installing this project.
##end
# #
##variable
# CPACK_NSIS_INSTALL_ROOT - The default installation directory presented # CPACK_NSIS_INSTALL_ROOT - The default installation directory presented
# to the end user by the NSIS installer is under this root dir. The full # to the end user by the NSIS installer is under this root dir. The full
# directory presented to the end user is: # directory presented to the end user is:
# ${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY} # ${CPACK_NSIS_INSTALL_ROOT}/${CPACK_PACKAGE_INSTALL_DIRECTORY}
##end
# #
##variable
# CPACK_NSIS_MUI_ICON - The icon file (.ico) for the generated # CPACK_NSIS_MUI_ICON - The icon file (.ico) for the generated
# install program. # install program.
##end
# #
##variable
# CPACK_NSIS_MUI_UNIICON - The icon file (.ico) for the generated # CPACK_NSIS_MUI_UNIICON - The icon file (.ico) for the generated
# uninstall program. # uninstall program.
##end
# #
##variable
# CPACK_PACKAGE_ICON - A branding image that will be displayed inside # CPACK_PACKAGE_ICON - A branding image that will be displayed inside
# the installer. # the installer.
##end
# #
##variable
# CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that will # CPACK_NSIS_EXTRA_INSTALL_COMMANDS - Extra NSIS commands that will
# be added to the install Section. # be added to the install Section.
##end
# #
##variable
# CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra NSIS commands that will # CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS - Extra NSIS commands that will
# be added to the uninstall Section. # be added to the uninstall Section.
##end
# #
##variable
# CPACK_NSIS_COMPRESSOR - The arguments that will be passed to the # CPACK_NSIS_COMPRESSOR - The arguments that will be passed to the
# NSIS SetCompressor command. # NSIS SetCompressor command.
##end
# #
##variable
# CPACK_NSIS_MODIFY_PATH - If this is set to "ON", then an extra page # CPACK_NSIS_MODIFY_PATH - If this is set to "ON", then an extra page
# will appear in the installer that will allow the user to choose # will appear in the installer that will allow the user to choose
# whether the program directory should be added to the system PATH # whether the program directory should be added to the system PATH
# variable. # variable.
##end
# #
##variable
# CPACK_NSIS_DISPLAY_NAME - The display name string that appears in # CPACK_NSIS_DISPLAY_NAME - The display name string that appears in
# the Windows Add/Remove Program control panel # the Windows Add/Remove Program control panel
##end
# #
##variable
# CPACK_NSIS_PACKAGE_NAME - The title displayed at the top of the # CPACK_NSIS_PACKAGE_NAME - The title displayed at the top of the
# installer. # installer.
##end
# #
##variable
# CPACK_NSIS_INSTALLED_ICON_NAME - A path to the executable that # CPACK_NSIS_INSTALLED_ICON_NAME - A path to the executable that
# contains the installer icon. # contains the installer icon.
##end
# #
##variable
# CPACK_NSIS_HELP_LINK - URL to a web site providing assistance in # CPACK_NSIS_HELP_LINK - URL to a web site providing assistance in
# installing your application. # installing your application.
##end
# #
##variable
# CPACK_NSIS_URL_INFO_ABOUT - URL to a web site providing more # CPACK_NSIS_URL_INFO_ABOUT - URL to a web site providing more
# information about your application. # information about your application.
##end
# #
##variable
# CPACK_NSIS_CONTACT - Contact information for questions and comments # CPACK_NSIS_CONTACT - Contact information for questions and comments
# about the installation process. # about the installation process.
##end
# #
##variable
# CPACK_NSIS_CREATE_ICONS_EXTRA - Additional NSIS commands for # CPACK_NSIS_CREATE_ICONS_EXTRA - Additional NSIS commands for
# creating start menu shortcuts. # creating start menu shortcuts.
##end
# #
##variable
# CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to # CPACK_NSIS_DELETE_ICONS_EXTRA -Additional NSIS commands to
# uninstall start menu shortcuts. # uninstall start menu shortcuts.
##end
# #
##variable
# CPACK_NSIS_EXECUTABLES_DIRECTORY - Creating NSIS start menu links # CPACK_NSIS_EXECUTABLES_DIRECTORY - Creating NSIS start menu links
# assumes that they are in 'bin' unless this variable is set. # assumes that they are in 'bin' unless this variable is set.
# For example, you would set this to 'exec' if your executables are # For example, you would set this to 'exec' if your executables are
# in an exec directory. # in an exec directory.
##end
# #
##variable
# CPACK_NSIS_MUI_FINISHPAGE_RUN - Specify an executable to add an option # CPACK_NSIS_MUI_FINISHPAGE_RUN - Specify an executable to add an option
# to run on the finish page of the NSIS installer. # to run on the finish page of the NSIS installer.
##end
#============================================================================= #=============================================================================
# Copyright 2006-2009 Kitware, Inc. # Copyright 2006-2009 Kitware, Inc.

View File

@ -0,0 +1,34 @@
##section Variables specific to CPack PackageMaker generator
##end
##module
# - PackageMaker CPack generator (Mac OS X).
# The following variable is specific to installers build on Mac OS X
# using PackageMaker:
#
##variable
# CPACK_OSX_PACKAGE_VERSION - The version of Mac OS X that the
# resulting PackageMaker archive should be compatible
# with. Different versions of Mac OS X support different
# features. For example, CPack can only build component-based
# installers for Mac OS X 10.4 or newer, and can only build
# installers that download component son-the-fly for Mac OS X 10.5
# or newer. If left blank, this value will be set to the minimum
# version of Mac OS X that supports the requested features. Set this
# variable to some value (e.g., 10.4) only if you want to guarantee
# that your installer will work on that version of Mac OS X, and
# don't mind missing extra features available in the installer
# shipping with later versions of Mac OS X.
##end
#=============================================================================
# Copyright 2006-2012 Kitware, Inc.
#
# 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.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)

View File

@ -1,3 +1,6 @@
##section Variables specific to CPack RPM generator
##end
##module
# - The builtin (binary) CPack RPM generator (Unix only) # - The builtin (binary) CPack RPM generator (Unix only)
# CPackRPM may be used to create RPM package using CPack. # CPackRPM may be used to create RPM package using CPack.
# CPackRPM is a CPack generator thus it uses the CPACK_XXX variables # CPackRPM is a CPack generator thus it uses the CPACK_XXX variables
@ -15,52 +18,67 @@
# You'll find a detailed usage of CPackRPM on the wiki: # You'll find a detailed usage of CPackRPM on the wiki:
# http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29 # http://www.cmake.org/Wiki/CMake:CPackPackageGenerators#RPM_.28Unix_Only.29
# However as a handy reminder here comes the list of specific variables: # However as a handy reminder here comes the list of specific variables:
##end
# #
# CPACK_RPM_PACKAGE_SUMMARY ##variable
# CPACK_RPM_PACKAGE_SUMMARY - The RPM package summary.
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY # Default : CPACK_PACKAGE_DESCRIPTION_SUMMARY
# The RPM package summary ##end
# CPACK_RPM_PACKAGE_NAME ##variable
# CPACK_RPM_PACKAGE_NAME - The RPM package name.
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_NAME # Default : CPACK_PACKAGE_NAME
# The RPM package name ##end
# CPACK_RPM_PACKAGE_VERSION ##variable
# CPACK_RPM_PACKAGE_VERSION - The RPM package version.
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_VERSION # Default : CPACK_PACKAGE_VERSION
# The RPM package version ##end
# CPACK_RPM_PACKAGE_ARCHITECTURE ##variable
# CPACK_RPM_PACKAGE_ARCHITECTURE - The RPM package architecture.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# The RPM package architecture. This may be set to "noarch" if you # This may be set to "noarch" if you
# know you are building a noarch package. # know you are building a noarch package.
# CPACK_RPM_PACKAGE_RELEASE ##end
##variable
# CPACK_RPM_PACKAGE_RELEASE - The RPM package release.
# Mandatory : YES # Mandatory : YES
# Default : 1 # Default : 1
# The RPM package release. This is the numbering of the RPM package # This is the numbering of the RPM package
# itself, i.e. the version of the packaging and not the version of the # itself, i.e. the version of the packaging and not the version of the
# content (see CPACK_RPM_PACKAGE_VERSION). One may change the default # content (see CPACK_RPM_PACKAGE_VERSION). One may change the default
# value if the previous packaging was buggy and/or you want to put here # value if the previous packaging was buggy and/or you want to put here
# a fancy Linux distro specific numbering. # a fancy Linux distro specific numbering.
# CPACK_RPM_PACKAGE_LICENSE ##end
##variable
# CPACK_RPM_PACKAGE_LICENSE - The RPM package license policy.
# Mandatory : YES # Mandatory : YES
# Default : "unknown" # Default : "unknown"
# The RPM package license policy. ##end
# CPACK_RPM_PACKAGE_GROUP ##variable
# CPACK_RPM_PACKAGE_GROUP - The RPM package group.
# Mandatory : YES # Mandatory : YES
# Default : "unknown" # Default : "unknown"
# The RPM package group. ##end
# CPACK_RPM_PACKAGE_VENDOR ##variable
# CPACK_RPM_PACKAGE_VENDOR - The RPM package vendor.
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_VENDOR if set or "unknown" # Default : CPACK_PACKAGE_VENDOR if set or "unknown"
# The RPM package vendor. ##end
# CPACK_RPM_PACKAGE_URL ##variable
# CPACK_RPM_PACKAGE_URL - The projects URL.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# The projects URL. ##end
# CPACK_RPM_PACKAGE_DESCRIPTION ##variable
# CPACK_RPM_PACKAGE_DESCRIPTION - RPM package description.
# Mandatory : YES # Mandatory : YES
# Default : CPACK_PACKAGE_DESCRIPTION_FILE if set or "no package description available" # Default : CPACK_PACKAGE_DESCRIPTION_FILE if set or "no package description available"
# CPACK_RPM_COMPRESSION_TYPE ##end
##variable
# CPACK_RPM_COMPRESSION_TYPE - RPM compression type.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to override RPM compression type to be used # May be used to override RPM compression type to be used
@ -68,7 +86,9 @@
# to lzma or xz compression whereas older cannot use such RPM. # to lzma or xz compression whereas older cannot use such RPM.
# Using this one can enforce compression type to be used. # Using this one can enforce compression type to be used.
# Possible value are: lzma, xz, bzip2 and gzip. # Possible value are: lzma, xz, bzip2 and gzip.
# CPACK_RPM_PACKAGE_REQUIRES ##end
##variable
# CPACK_RPM_PACKAGE_REQUIRES - RPM spec requires field.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to set RPM dependencies (requires). # May be used to set RPM dependencies (requires).
@ -77,22 +97,30 @@
# set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8") # set(CPACK_RPM_PACKAGE_REQUIRES "python >= 2.5.0, cmake >= 2.8")
# The required package list of an RPM file could be printed with # The required package list of an RPM file could be printed with
# rpm -qp --requires file.rpm # rpm -qp --requires file.rpm
# CPACK_RPM_PACKAGE_SUGGESTS ##end
##variable
# CPACK_RPM_PACKAGE_SUGGESTS - RPM spec suggest field.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to set weak RPM dependencies (suggests). # May be used to set weak RPM dependencies (suggests).
# Note that you must enclose the complete requires string between quotes. # Note that you must enclose the complete requires string between quotes.
# CPACK_RPM_PACKAGE_PROVIDES ##end
##variable
# CPACK_RPM_PACKAGE_PROVIDES - RPM spec provides field.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to set RPM dependencies (provides). # May be used to set RPM dependencies (provides).
# The provided package list of an RPM file could be printed with # The provided package list of an RPM file could be printed with
# rpm -qp --provides file.rpm # rpm -qp --provides file.rpm
# CPACK_RPM_PACKAGE_OBSOLETES ##end
##variable
# CPACK_RPM_PACKAGE_OBSOLETES - RPM spec obsoletes field.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to set RPM packages that are obsoleted by this one. # May be used to set RPM packages that are obsoleted by this one.
# CPACK_RPM_PACKAGE_RELOCATABLE ##end
##variable
# CPACK_RPM_PACKAGE_RELOCATABLE - build a relocatable RPM.
# Mandatory : NO # Mandatory : NO
# Default : CPACK_PACKAGE_RELOCATABLE # Default : CPACK_PACKAGE_RELOCATABLE
# If this variable is set to TRUE or ON CPackRPM will try # If this variable is set to TRUE or ON CPackRPM will try
@ -103,7 +131,9 @@
# If CPACK_SET_DESTDIR is set then you will get a warning message # If CPACK_SET_DESTDIR is set then you will get a warning message
# but if there is file installed with absolute path you'll get # but if there is file installed with absolute path you'll get
# unexpected behavior. # unexpected behavior.
# CPACK_RPM_SPEC_INSTALL_POST [deprecated] ##end
##variable
# CPACK_RPM_SPEC_INSTALL_POST - [deprecated].
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# This way of specifying post-install script is deprecated use # This way of specifying post-install script is deprecated use
@ -111,23 +141,31 @@
# May be used to set an RPM post-install command inside the spec file. # May be used to set an RPM post-install command inside the spec file.
# For example setting it to "/bin/true" may be used to prevent # For example setting it to "/bin/true" may be used to prevent
# rpmbuild to strip binaries. # rpmbuild to strip binaries.
# CPACK_RPM_SPEC_MORE_DEFINE ##end
##variable
# CPACK_RPM_SPEC_MORE_DEFINE - RPM extended spec definitions lines.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to add any %define lines to the generated spec file. # May be used to add any %define lines to the generated spec file.
# CPACK_RPM_PACKAGE_DEBUG ##end
##variable
# CPACK_RPM_PACKAGE_DEBUG - Toggle CPackRPM debug output.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be set when invoking cpack in order to trace debug information # May be set when invoking cpack in order to trace debug information
# during CPack RPM run. For example you may launch CPack like this # during CPack RPM run. For example you may launch CPack like this
# cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM # cpack -D CPACK_RPM_PACKAGE_DEBUG=1 -G RPM
# CPACK_RPM_USER_BINARY_SPECFILE ##end
##variable
# CPACK_RPM_USER_BINARY_SPECFILE - A user provided spec file.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be set by the user in order to specify a USER binary spec file # May be set by the user in order to specify a USER binary spec file
# to be used by CPackRPM instead of generating the file. # to be used by CPackRPM instead of generating the file.
# The specified file will be processed by CONFIGURE_FILE( @ONLY). # The specified file will be processed by CONFIGURE_FILE( @ONLY).
# CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE ##end
##variable
# CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE - Spec file template.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# If set CPack will generate a template for USER specified binary # If set CPack will generate a template for USER specified binary
@ -135,6 +173,8 @@
# cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM # cpack -D CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE=1 -G RPM
# The user may then use this file in order to hand-craft is own # The user may then use this file in order to hand-craft is own
# binary spec file which may be used with CPACK_RPM_USER_BINARY_SPECFILE. # binary spec file which may be used with CPACK_RPM_USER_BINARY_SPECFILE.
##end
##variable
# CPACK_RPM_PRE_INSTALL_SCRIPT_FILE # CPACK_RPM_PRE_INSTALL_SCRIPT_FILE
# CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE # CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE
# Mandatory : NO # Mandatory : NO
@ -143,11 +183,13 @@
# The refered script file(s) will be read and directly # The refered script file(s) will be read and directly
# put after the %pre or %preun section # put after the %pre or %preun section
# If CPACK_RPM_COMPONENT_INSTALL is set to ON the (un)install script for # If CPACK_RPM_COMPONENT_INSTALL is set to ON the (un)install script for
# each component can be overriden with # each component can be overridden with
# CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE and # CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE and
# CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE # CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE
# One may verify which scriptlet has been included with # One may verify which scriptlet has been included with
# rpm -qp --scripts package.rpm # rpm -qp --scripts package.rpm
##end
##variable
# CPACK_RPM_POST_INSTALL_SCRIPT_FILE # CPACK_RPM_POST_INSTALL_SCRIPT_FILE
# CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE # CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE
# Mandatory : NO # Mandatory : NO
@ -156,26 +198,31 @@
# The refered script file(s) will be read and directly # The refered script file(s) will be read and directly
# put after the %post or %postun section # put after the %post or %postun section
# If CPACK_RPM_COMPONENT_INSTALL is set to ON the (un)install script for # If CPACK_RPM_COMPONENT_INSTALL is set to ON the (un)install script for
# each component can be overriden with # each component can be overridden with
# CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE and # CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE and
# CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE # CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE
# One may verify which scriptlet has been included with # One may verify which scriptlet has been included with
# rpm -qp --scripts package.rpm # rpm -qp --scripts package.rpm
##end
##variable
# CPACK_RPM_USER_FILELIST # CPACK_RPM_USER_FILELIST
# CPACK_RPM_<COMPONENT>_USER_FILELIST # CPACK_RPM_<COMPONENT>_USER_FILELIST
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to explicitely specify %(<directive>) file line # May be used to explicitly specify %(<directive>) file line
# in the spec file. Like %config(noreplace) or any other directive # in the spec file. Like %config(noreplace) or any other directive
# that be found in the %files section. Since CPackRPM is generating # that be found in the %files section. Since CPackRPM is generating
# the list of files (and directories) the user specified files of # the list of files (and directories) the user specified files of
# the CPACK_RPM_<COMPONENT>_USER_FILELIST list will be removed from the generated list. # the CPACK_RPM_<COMPONENT>_USER_FILELIST list will be removed from the generated list.
# CPACK_RPM_CHANGELOG_FILE ##end
##variable
# CPACK_RPM_CHANGELOG_FILE - RPM changelog file.
# Mandatory : NO # Mandatory : NO
# Default : - # Default : -
# May be used to embed a changelog in the spec file. # May be used to embed a changelog in the spec file.
# The refered file will be read and directly put after the %changelog # The refered file will be read and directly put after the %changelog
# section. # section.
##end
#============================================================================= #=============================================================================
# Copyright 2007-2009 Kitware, Inc. # Copyright 2007-2009 Kitware, Inc.

View File

@ -9,6 +9,7 @@
#============================================================================= #=============================================================================
# Copyright 2006-2011 Kitware, Inc. # Copyright 2006-2011 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org> # Copyright 2006 Alexander Neundorf <neundorf@kde.org>
# Copyright 2011 Matthias Kretz <kretz@kde.org>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -35,6 +36,7 @@ MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
FAIL_REGEX "[Uu]nknown option" # HP FAIL_REGEX "[Uu]nknown option" # HP
FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro FAIL_REGEX "[Ww]arning: [Oo]ption" # SunPro
FAIL_REGEX "command option .* is not recognized" # XL FAIL_REGEX "command option .* is not recognized" # XL
FAIL_REGEX "WARNING: unknown flag:" # Open64
) )
SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
ENDMACRO (CHECK_C_COMPILER_FLAG) ENDMACRO (CHECK_C_COMPILER_FLAG)

View File

@ -24,6 +24,9 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR) MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$") IF("${VAR}" MATCHES "^${VAR}$")
SET(_FAIL_REGEX) SET(_FAIL_REGEX)
@ -40,8 +43,10 @@ MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
SET(MACRO_CHECK_FUNCTION_DEFINITIONS SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}") "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES) ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)

View File

@ -24,13 +24,18 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR) MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$") IF("${VAR}" MATCHES "^${VAR}$")
SET(MACRO_CHECK_FUNCTION_DEFINITIONS SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}") "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES) ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)

View File

@ -9,6 +9,7 @@
#============================================================================= #=============================================================================
# Copyright 2006-2010 Kitware, Inc. # Copyright 2006-2010 Kitware, Inc.
# Copyright 2006 Alexander Neundorf <neundorf@kde.org> # Copyright 2006 Alexander Neundorf <neundorf@kde.org>
# Copyright 2011 Matthias Kretz <kretz@kde.org>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -27,6 +28,7 @@ MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}") SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT} CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}
# Some compilers do not fail with a bad flag # Some compilers do not fail with a bad flag
FAIL_REGEX "command line option .* is valid for .* but not for C\\\\+\\\\+" # GNU
FAIL_REGEX "unrecognized .*option" # GNU FAIL_REGEX "unrecognized .*option" # GNU
FAIL_REGEX "unknown .*option" # Clang FAIL_REGEX "unknown .*option" # Clang
FAIL_REGEX "ignoring unknown option" # MSVC FAIL_REGEX "ignoring unknown option" # MSVC
@ -36,6 +38,7 @@ MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
FAIL_REGEX "command option .* is not recognized" # XL FAIL_REGEX "command option .* is not recognized" # XL
FAIL_REGEX "not supported in this configuration; ignored" # AIX FAIL_REGEX "not supported in this configuration; ignored" # AIX
FAIL_REGEX "File with unknown suffix passed to linker" # PGI FAIL_REGEX "File with unknown suffix passed to linker" # PGI
FAIL_REGEX "WARNING: unknown flag:" # Open64
) )
SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}") SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
ENDMACRO (CHECK_CXX_COMPILER_FLAG) ENDMACRO (CHECK_CXX_COMPILER_FLAG)

View File

@ -24,6 +24,9 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR) MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$") IF("${VAR}" MATCHES "^${VAR}$")
SET(_FAIL_REGEX) SET(_FAIL_REGEX)
@ -41,8 +44,10 @@ MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
SET(MACRO_CHECK_FUNCTION_DEFINITIONS SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}") "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES) ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES) SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)

View File

@ -24,13 +24,18 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR) MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$") IF("${VAR}" MATCHES "^${VAR}$")
SET(MACRO_CHECK_FUNCTION_DEFINITIONS SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}") "-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES) ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES) SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)

View File

@ -22,12 +22,17 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE) macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
if(NOT DEFINED ${VARIABLE}) if(NOT DEFINED ${VARIABLE})
message(STATUS "Looking for Fortran ${FUNCTION}") message(STATUS "Looking for Fortran ${FUNCTION}")
if(CMAKE_REQUIRED_LIBRARIES) if(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
else(CMAKE_REQUIRED_LIBRARIES) else(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
endif(CMAKE_REQUIRED_LIBRARIES) endif(CMAKE_REQUIRED_LIBRARIES)

View File

@ -27,14 +27,19 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE) MACRO(CHECK_FUNCTION_EXISTS FUNCTION VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$") IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
SET(MACRO_CHECK_FUNCTION_DEFINITIONS SET(MACRO_CHECK_FUNCTION_DEFINITIONS
"-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}") "-DCHECK_FUNCTION_EXISTS=${FUNCTION} ${CMAKE_REQUIRED_FLAGS}")
MESSAGE(STATUS "Looking for ${FUNCTION}") MESSAGE(STATUS "Looking for ${FUNCTION}")
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES) ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES) SET(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)

View File

@ -44,7 +44,7 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in" CONFIGURE_FILE("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
"${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c" @ONLY IMMEDIATE) "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c" @ONLY IMMEDIATE)
MESSAGE(STATUS "Looking for include files ${VARIABLE}") MESSAGE(STATUS "Looking for include files ${INCLUDE}")
TRY_COMPILE(${VARIABLE} TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckIncludeFiles.c
@ -54,15 +54,15 @@ MACRO(CHECK_INCLUDE_FILES INCLUDE VARIABLE)
"${CHECK_INCLUDE_FILES_INCLUDE_DIRS}" "${CHECK_INCLUDE_FILES_INCLUDE_DIRS}"
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
IF(${VARIABLE}) IF(${VARIABLE})
MESSAGE(STATUS "Looking for include files ${VARIABLE} - found") MESSAGE(STATUS "Looking for include files ${INCLUDE} - found")
SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${VARIABLE}") SET(${VARIABLE} 1 CACHE INTERNAL "Have include ${INCLUDE}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if files ${INCLUDE} " "Determining if files ${INCLUDE} "
"exist passed with the following output:\n" "exist passed with the following output:\n"
"${OUTPUT}\n\n") "${OUTPUT}\n\n")
ELSE(${VARIABLE}) ELSE(${VARIABLE})
MESSAGE(STATUS "Looking for include files ${VARIABLE} - not found.") MESSAGE(STATUS "Looking for include files ${INCLUDE} - not found.")
SET(${VARIABLE} "" CACHE INTERNAL "Have includes ${VARIABLE}") SET(${VARIABLE} "" CACHE INTERNAL "Have includes ${INCLUDE}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if files ${INCLUDE} " "Determining if files ${INCLUDE} "
"exist failed with the following output:\n" "exist failed with the following output:\n"

View File

@ -0,0 +1,65 @@
# - Check if a language can be enabled
# Usage:
# check_language(<lang>)
# where <lang> is a language that may be passed to enable_language()
# such as "Fortran". If CMAKE_<lang>_COMPILER is already defined the
# check does nothing. Otherwise it tries enabling the language in a
# test project. The result is cached in CMAKE_<lang>_COMPILER as the
# compiler that was found, or NOTFOUND if the language cannot be enabled.
#
# Example:
# check_language(Fortran)
# if(CMAKE_Fortran_COMPILER)
# enable_language(Fortran)
# else()
# message(STATUS "No Fortran support")
# endif()
#=============================================================================
# Copyright 2009-2012 Kitware, Inc.
#
# 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.
#=============================================================================
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
macro(check_language lang)
if(NOT DEFINED CMAKE_${lang}_COMPILER)
set(_desc "Looking for a ${lang} compiler")
message(STATUS ${_desc})
file(REMOVE_RECURSE ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang})
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}/CMakeLists.txt"
"cmake_minimum_required(VERSION 2.8)
project(Check${lang} ${lang})
file(WRITE \"\${CMAKE_CURRENT_BINARY_DIR}/result.cmake\"
\"set(CMAKE_${lang}_COMPILER \\\"\${CMAKE_${lang}_COMPILER}\\\")\\n\"
)
")
execute_process(
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}
COMMAND ${CMAKE_COMMAND} . -G ${CMAKE_GENERATOR}
OUTPUT_VARIABLE output
ERROR_VARIABLE output
RESULT_VARIABLE result
)
include(${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/Check${lang}/result.cmake OPTIONAL)
if(CMAKE_${lang}_COMPILER AND "${result}" STREQUAL "0")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"${_desc} passed with the following output:\n"
"${output}\n")
else()
set(CMAKE_${lang}_COMPILER NOTFOUND)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"${_desc} failed with the following output:\n"
"${output}\n")
endif()
message(STATUS "${_desc} - ${CMAKE_${lang}_COMPILER}")
set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER}" CACHE FILEPATH "${lang} compiler")
mark_as_advanced(CMAKE_${lang}_COMPILER)
endif()
endmacro()

View File

@ -26,6 +26,9 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE) MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$") IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
SET(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION SET(MACRO_CHECK_LIBRARY_EXISTS_DEFINITION
@ -33,8 +36,10 @@ MACRO(CHECK_LIBRARY_EXISTS LIBRARY FUNCTION LOCATION VARIABLE)
MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY}") MESSAGE(STATUS "Looking for ${FUNCTION} in ${LIBRARY}")
SET(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY}) SET(CHECK_LIBRARY_EXISTS_LIBRARIES ${LIBRARY})
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_LIBRARY_EXISTS_LIBRARIES SET(CHECK_LIBRARY_EXISTS_LIBRARIES
${CHECK_LIBRARY_EXISTS_LIBRARIES} ${CMAKE_REQUIRED_LIBRARIES}) ${CHECK_LIBRARY_EXISTS_LIBRARIES} ${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES})
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)
TRY_COMPILE(${VARIABLE} TRY_COMPILE(${VARIABLE}
${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}

View File

@ -34,8 +34,11 @@
# License text for the above reference.) # License text for the above reference.)
# #
include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
get_filename_component(__check_proto_def_dir "${CMAKE_CURRENT_LIST_FILE}" PATH) get_filename_component(__check_proto_def_dir "${CMAKE_CURRENT_LIST_FILE}" PATH)
function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE) function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIABLE)
if ("${_VARIABLE}" MATCHES "^${_VARIABLE}$") if ("${_VARIABLE}" MATCHES "^${_VARIABLE}$")
@ -43,8 +46,10 @@ function(CHECK_PROTOTYPE_DEFINITION _FUNCTION _PROTOTYPE _RETURN _HEADER _VARIAB
set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS}) set(CHECK_PROTOTYPE_DEFINITION_FLAGS ${CMAKE_REQUIRED_FLAGS})
if (CMAKE_REQUIRED_LIBRARIES) if (CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(CHECK_PROTOTYPE_DEFINITION_LIBS set(CHECK_PROTOTYPE_DEFINITION_LIBS
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
else(CMAKE_REQUIRED_LIBRARIES) else(CMAKE_REQUIRED_LIBRARIES)
set(CHECK_PROTOTYPE_DEFINITION_LIBS) set(CHECK_PROTOTYPE_DEFINITION_LIBS)
endif(CMAKE_REQUIRED_LIBRARIES) endif(CMAKE_REQUIRED_LIBRARIES)

View File

@ -35,6 +35,9 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE) MACRO(CHECK_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
_CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" ) _CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.c" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
ENDMACRO(CHECK_SYMBOL_EXISTS) ENDMACRO(CHECK_SYMBOL_EXISTS)
@ -44,8 +47,10 @@ MACRO(_CHECK_SYMBOL_EXISTS SOURCEFILE SYMBOL FILES VARIABLE)
SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n") SET(CMAKE_CONFIGURABLE_FILE_CONTENT "/* */\n")
SET(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS}) SET(MACRO_CHECK_SYMBOL_EXISTS_FLAGS ${CMAKE_REQUIRED_FLAGS})
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_SYMBOL_EXISTS_LIBS SET(CHECK_SYMBOL_EXISTS_LIBS
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES) ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_SYMBOL_EXISTS_LIBS) SET(CHECK_SYMBOL_EXISTS_LIBS)
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)

View File

@ -47,6 +47,7 @@
# License text for the above reference.) # License text for the above reference.)
include(CheckIncludeFile) include(CheckIncludeFile)
include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
cmake_policy(PUSH) cmake_policy(PUSH)
cmake_minimum_required(VERSION 2.6 FATAL_ERROR) cmake_minimum_required(VERSION 2.6 FATAL_ERROR)
@ -76,6 +77,10 @@ function(__check_type_size_impl type var map builtin)
endforeach() endforeach()
# Perform the check. # Perform the check.
# this one translates potentially used imported library targets to their files on disk
cmake_expand_imported_targets(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.c) set(src ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.c)
set(bin ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.bin) set(bin ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CheckTypeSize/${var}.bin)
configure_file(${__check_type_size_dir}/CheckTypeSize.c.in ${src} @ONLY) configure_file(${__check_type_size_dir}/CheckTypeSize.c.in ${src} @ONLY)
@ -84,7 +89,7 @@ function(__check_type_size_impl type var map builtin)
CMAKE_FLAGS CMAKE_FLAGS
"-DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}" "-DCOMPILE_DEFINITIONS:STRING=${CMAKE_REQUIRED_FLAGS}"
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}" "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}"
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}" "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}"
OUTPUT_VARIABLE output OUTPUT_VARIABLE output
COPY_FILE ${bin} COPY_FILE ${bin}
) )

View File

@ -26,14 +26,19 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE) MACRO(CHECK_VARIABLE_EXISTS VAR VARIABLE)
IF("${VARIABLE}" MATCHES "^${VARIABLE}$") IF("${VARIABLE}" MATCHES "^${VARIABLE}$")
SET(MACRO_CHECK_VARIABLE_DEFINITIONS SET(MACRO_CHECK_VARIABLE_DEFINITIONS
"-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}") "-DCHECK_VARIABLE_EXISTS=${VAR} ${CMAKE_REQUIRED_FLAGS}")
MESSAGE(STATUS "Looking for ${VAR}") MESSAGE(STATUS "Looking for ${VAR}")
IF(CMAKE_REQUIRED_LIBRARIES) IF(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${CMAKE_REQUIRED_LIBRARIES}") "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES) ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES) SET(CHECK_VARIABLE_EXISTS_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES) ENDIF(CMAKE_REQUIRED_LIBRARIES)

View File

@ -125,7 +125,7 @@
# #
# set_package_properties(LibXml2 PROPERTIES TYPE RECOMMENDED # set_package_properties(LibXml2 PROPERTIES TYPE RECOMMENDED
# PURPOSE "Enables HTML-import in MyWordProcessor") # PURPOSE "Enables HTML-import in MyWordProcessor")
# ... # ...
# set_package_properties(LibXml2 PROPERTIES TYPE OPTIONAL # set_package_properties(LibXml2 PROPERTIES TYPE OPTIONAL
# PURPOSE "Enables odt-export in MyWordProcessor") # PURPOSE "Enables odt-export in MyWordProcessor")
# #

View File

@ -12,8 +12,8 @@
# #
#============================================================================= #=============================================================================
# Copyright 2009 Kitware, Inc. # Copyright 2009-2011 Kitware, Inc.
# Copyright 2009 Philip Lowman <philip@yhbt.com> # Copyright 2009-2011 Philip Lowman <philip@yhbt.com>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -25,8 +25,7 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
find_path(ALSA_INCLUDE_DIR NAMES asoundlib.h find_path(ALSA_INCLUDE_DIR NAMES alsa/asoundlib.h
PATH_SUFFIXES alsa
DOC "The ALSA (asound) include directory" DOC "The ALSA (asound) include directory"
) )
@ -34,8 +33,8 @@ find_library(ALSA_LIBRARY NAMES asound
DOC "The ALSA (asound) library" DOC "The ALSA (asound) library"
) )
if(ALSA_INCLUDE_DIR AND EXISTS "${ALSA_INCLUDE_DIR}/version.h") if(ALSA_INCLUDE_DIR AND EXISTS "${ALSA_INCLUDE_DIR}/alsa/version.h")
file(STRINGS "${ALSA_INCLUDE_DIR}/version.h" alsa_version_str REGEX "^#define[\t ]+SND_LIB_VERSION_STR[\t ]+\".*\"") file(STRINGS "${ALSA_INCLUDE_DIR}/alsa/version.h" alsa_version_str REGEX "^#define[\t ]+SND_LIB_VERSION_STR[\t ]+\".*\"")
string(REGEX REPLACE "^.*SND_LIB_VERSION_STR[\t ]+\"([^\"]*)\".*$" "\\1" ALSA_VERSION_STRING "${alsa_version_str}") string(REGEX REPLACE "^.*SND_LIB_VERSION_STR[\t ]+\"([^\"]*)\".*$" "\\1" ALSA_VERSION_STRING "${alsa_version_str}")
unset(alsa_version_str) unset(alsa_version_str)

View File

@ -23,6 +23,7 @@
########## ##########
### List of vendors (BLA_VENDOR) valid in this module ### List of vendors (BLA_VENDOR) valid in this module
## Goto,ATLAS PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,Intel10_32 (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model), ## Goto,ATLAS PhiPACK,CXML,DXML,SunPerf,SCSL,SGIMATH,IBMESSL,Intel10_32 (intel mkl v10 32 bit),Intel10_64lp (intel mkl v10 64 bit,lp thread model, lp64 model),
## Intel10_64lp_seq (intel mkl v10 64 bit,sequential code, lp64 model),
## Intel( older versions of mkl 32 and 64 bit), ACML,ACML_MP,ACML_GPU,Apple, NAS, Generic ## Intel( older versions of mkl 32 and 64 bit), ACML,ACML_MP,ACML_GPU,Apple, NAS, Generic
# C/CXX should be enabled to use Intel mkl # C/CXX should be enabled to use Intel mkl
@ -85,6 +86,7 @@ if (NOT _libdir)
set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH) set(_libdir /usr/local/lib /usr/lib /usr/local/lib64 /usr/lib64 ENV LD_LIBRARY_PATH)
endif () endif ()
endif () endif ()
foreach(_library ${_list}) foreach(_library ${_list})
set(_combined_name ${_combined_name}_${_library}) set(_combined_name ${_combined_name}_${_library})
@ -115,7 +117,7 @@ foreach(_library ${_list})
endforeach(_library ${_list}) endforeach(_library ${_list})
if(_libraries_work) if(_libraries_work)
# Test this combination of libraries. # Test this combination of libraries.
set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_threads}) set(CMAKE_REQUIRED_LIBRARIES ${_flags} ${${LIBRARIES}} ${_thread})
# message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}") # message("DEBUG: CMAKE_REQUIRED_LIBRARIES = ${CMAKE_REQUIRED_LIBRARIES}")
if (_CHECK_FORTRAN) if (_CHECK_FORTRAN)
check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS) check_fortran_function_exists("${_name}" ${_prefix}${_combined_name}_WORKS)
@ -460,117 +462,99 @@ if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) else(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED) endif(BLAS_FIND_QUIETLY OR NOT BLAS_FIND_REQUIRED)
if (WIN32)
set(BLAS_SEARCH_LIBS "")
if(BLA_F95) if(BLA_F95)
if(NOT BLAS95_LIBRARIES) set(BLAS_mkl_SEARCH_SYMBOL SGEMM)
check_fortran_libraries( set(_LIBRARIES BLAS95_LIBRARIES)
BLAS95_LIBRARIES if (WIN32)
BLAS list(APPEND BLAS_SEARCH_LIBS
sgemm "mkl_blas95 mkl_intel_c mkl_intel_thread mkl_core libguide40")
"" else (WIN32)
"mkl_blas95;mkl_intel_c;mkl_intel_thread;mkl_core;libguide40" if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
"" list(APPEND BLAS_SEARCH_LIBS
) "mkl_blas95 mkl_intel mkl_intel_thread mkl_core guide")
endif(NOT BLAS95_LIBRARIES) endif ()
else(BLA_F95) if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
if(NOT BLAS_LIBRARIES) # old version
check_fortran_libraries( list(APPEND BLAS_SEARCH_LIBS
BLAS_LIBRARIES "mkl_blas95 mkl_intel_lp64 mkl_intel_thread mkl_core guide")
BLAS
SGEMM # mkl >= 10.3
"" if (CMAKE_C_COMPILER MATCHES ".+gcc.*")
"mkl_c_dll;mkl_intel_thread_dll;mkl_core_dll;libguide40" list(APPEND BLAS_SEARCH_LIBS
"" "mkl_blas95_lp64 mkl_intel_lp64 mkl_gnu_thread mkl_core")
) set(LM "${LM};-lgomp")
endif(NOT BLAS_LIBRARIES) else ()
endif(BLA_F95) list(APPEND BLAS_SEARCH_LIBS
else(WIN32) "mkl_blas95_lp64 mkl_intel_lp64 mkl_intel_thread mkl_core iomp5")
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All") endif ()
if(BLA_F95) endif ()
if(NOT BLAS95_LIBRARIES) endif (WIN32)
if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl_blas95_lp64 mkl_intel_lp64 mkl_sequential mkl_core")
endif ()
else (BLA_F95)
set(BLAS_mkl_SEARCH_SYMBOL sgemm)
set(_LIBRARIES BLAS_LIBRARIES)
if (WIN32)
list(APPEND BLAS_SEARCH_LIBS
"mkl_c_dll mkl_intel_thread_dll mkl_core_dll libguide40")
else (WIN32)
if (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel mkl_intel_thread mkl_core guide")
endif ()
if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
# old version
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_intel_thread mkl_core guide")
# mkl >= 10.3
if (CMAKE_C_COMPILER MATCHES ".+gcc.*")
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_gnu_thread mkl_core")
set(LM "${LM};-lgomp")
else ()
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_intel_thread mkl_core iomp5")
endif ()
endif ()
#older vesions of intel mkl libs
if (BLA_VENDOR STREQUAL "Intel" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl")
list(APPEND BLAS_SEARCH_LIBS
"mkl_ia32")
list(APPEND BLAS_SEARCH_LIBS
"mkl_em64t")
endif ()
endif (WIN32)
if (BLA_VENDOR STREQUAL "Intel10_64lp_seq" OR BLA_VENDOR STREQUAL "All")
list(APPEND BLAS_SEARCH_LIBS
"mkl_intel_lp64 mkl_sequential mkl_core")
endif ()
endif (BLA_F95)
foreach (IT ${BLAS_SEARCH_LIBS})
string(REPLACE " " ";" SEARCH_LIBS ${IT})
if (${_LIBRARIES})
else ()
check_fortran_libraries( check_fortran_libraries(
BLAS95_LIBRARIES ${_LIBRARIES}
BLAS BLAS
sgemm ${BLAS_mkl_SEARCH_SYMBOL}
"" ""
"mkl_blas95;mkl_intel;mkl_intel_thread;mkl_core;guide" "${SEARCH_LIBS}"
"${CMAKE_THREAD_LIBS_INIT};${LM}" "${CMAKE_THREAD_LIBS_INIT};${LM}"
) )
endif(NOT BLAS95_LIBRARIES) endif ()
else(BLA_F95) endforeach ()
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl_intel;mkl_intel_thread;mkl_core;guide"
"${CMAKE_THREAD_LIBS_INIT}"
"${LM}"
)
endif(NOT BLAS_LIBRARIES)
endif(BLA_F95)
endif (BLA_VENDOR STREQUAL "Intel10_32" OR BLA_VENDOR STREQUAL "All")
if (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
if(BLA_F95)
if(NOT BLAS95_LIBRARIES)
check_fortran_libraries(
BLAS95_LIBRARIES
BLAS
sgemm
""
"mkl_blas95;mkl_intel_lp64;mkl_intel_thread;mkl_core;guide"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS95_LIBRARIES)
else(BLA_F95)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl_intel_lp64;mkl_intel_thread;mkl_core;guide"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS_LIBRARIES)
endif(BLA_F95)
endif (BLA_VENDOR STREQUAL "Intel10_64lp" OR BLA_VENDOR STREQUAL "All")
endif (WIN32)
#older vesions of intel mkl libs
# BLAS in intel mkl library? (shared)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl;guide"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS_LIBRARIES)
#BLAS in intel mkl library? (static, 32bit)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl_ia32;guide"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS_LIBRARIES)
#BLAS in intel mkl library? (static, em64t 64bit)
if(NOT BLAS_LIBRARIES)
check_fortran_libraries(
BLAS_LIBRARIES
BLAS
sgemm
""
"mkl_em64t;guide"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT BLAS_LIBRARIES)
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") endif (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")

View File

@ -906,7 +906,7 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS: '${format}'. Use OBJ or PTX.") message( FATAL_ERROR "Invalid format flag passed to CUDA_WRAP_SRCS: '${format}'. Use OBJ or PTX.")
endif() endif()
# Set up all the command line flags here, so that they can be overriden on a per target basis. # Set up all the command line flags here, so that they can be overridden on a per target basis.
set(nvcc_flags "") set(nvcc_flags "")

View File

@ -3,6 +3,7 @@
# FREETYPE_LIBRARIES, the library to link against # FREETYPE_LIBRARIES, the library to link against
# FREETYPE_FOUND, if false, do not try to link to FREETYPE # FREETYPE_FOUND, if false, do not try to link to FREETYPE
# FREETYPE_INCLUDE_DIRS, where to find headers. # FREETYPE_INCLUDE_DIRS, where to find headers.
# FREETYPE_VERSION_STRING, the version of freetype found (since CMake 2.8.8)
# This is the concatenation of the paths: # This is the concatenation of the paths:
# FREETYPE_INCLUDE_DIR_ft2build # FREETYPE_INCLUDE_DIR_ft2build
# FREETYPE_INCLUDE_DIR_freetype2 # FREETYPE_INCLUDE_DIR_freetype2
@ -77,10 +78,33 @@ IF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2) ENDIF(FREETYPE_INCLUDE_DIR_ft2build AND FREETYPE_INCLUDE_DIR_freetype2)
SET(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}") SET(FREETYPE_LIBRARIES "${FREETYPE_LIBRARY}")
IF(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
FILE(STRINGS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h" freetype_version_str
REGEX "^#[\t ]*define[\t ]+FREETYPE_(MAJOR|MINOR|PATCH)[\t ]+[0-9]+$")
UNSET(FREETYPE_VERSION_STRING)
FOREACH(VPART MAJOR MINOR PATCH)
FOREACH(VLINE ${freetype_version_str})
IF(VLINE MATCHES "^#[\t ]*define[\t ]+FREETYPE_${VPART}")
STRING(REGEX REPLACE "^#[\t ]*define[\t ]+FREETYPE_${VPART}[\t ]+([0-9]+)$" "\\1"
FREETYPE_VERSION_PART "${VLINE}")
IF(FREETYPE_VERSION_STRING)
SET(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_STRING}.${FREETYPE_VERSION_PART}")
ELSE(FREETYPE_VERSION_STRING)
SET(FREETYPE_VERSION_STRING "${FREETYPE_VERSION_PART}")
ENDIF(FREETYPE_VERSION_STRING)
UNSET(FREETYPE_VERSION_PART)
ENDIF()
ENDFOREACH(VLINE)
ENDFOREACH(VPART)
ENDIF(FREETYPE_INCLUDE_DIR_freetype2 AND EXISTS "${FREETYPE_INCLUDE_DIR_freetype2}/freetype/freetype.h")
# handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set FREETYPE_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype DEFAULT_MSG FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Freetype
REQUIRED_VARS FREETYPE_LIBRARY FREETYPE_INCLUDE_DIRS
VERSION_VAR FREETYPE_VERSION_STRING)
MARK_AS_ADVANCED(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build) MARK_AS_ADVANCED(FREETYPE_LIBRARY FREETYPE_INCLUDE_DIR_freetype2 FREETYPE_INCLUDE_DIR_ft2build)

View File

@ -64,25 +64,23 @@ ELSE (WIN32)
ENDIF (WIN32) ENDIF (WIN32)
SET( GLUT_FOUND "NO" ) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
IF(GLUT_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(GLUT REQUIRED_VARS GLUT_glut_LIBRARY GLUT_INCLUDE_DIR)
IF(GLUT_glut_LIBRARY)
# Is -lXi and -lXmu required on all platforms that have it?
# If not, we need some way to figure out what platform we are on.
SET( GLUT_LIBRARIES
${GLUT_glut_LIBRARY}
${GLUT_Xmu_LIBRARY}
${GLUT_Xi_LIBRARY}
${GLUT_cocoa_LIBRARY}
)
SET( GLUT_FOUND "YES" )
#The following deprecated settings are for backwards compatibility with CMake1.4 IF (GLUT_FOUND)
SET (GLUT_LIBRARY ${GLUT_LIBRARIES}) # Is -lXi and -lXmu required on all platforms that have it?
SET (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR}) # If not, we need some way to figure out what platform we are on.
SET( GLUT_LIBRARIES
${GLUT_glut_LIBRARY}
${GLUT_Xmu_LIBRARY}
${GLUT_Xi_LIBRARY}
${GLUT_cocoa_LIBRARY}
)
ENDIF(GLUT_glut_LIBRARY) #The following deprecated settings are for backwards compatibility with CMake1.4
ENDIF(GLUT_INCLUDE_DIR) SET (GLUT_LIBRARY ${GLUT_LIBRARIES})
SET (GLUT_INCLUDE_PATH ${GLUT_INCLUDE_DIR})
ENDIF(GLUT_FOUND)
MARK_AS_ADVANCED( MARK_AS_ADVANCED(
GLUT_INCLUDE_DIR GLUT_INCLUDE_DIR

View File

@ -61,6 +61,17 @@ FIND_PACKAGE_HANDLE_STANDARD_ARGS(Gettext
INCLUDE(CMakeParseArguments) INCLUDE(CMakeParseArguments)
FUNCTION(_GETTEXT_GET_UNIQUE_TARGET_NAME _name _unique_name)
SET(propertyName "_GETTEXT_UNIQUE_COUNTER_${_name}")
GET_PROPERTY(currentCounter GLOBAL PROPERTY "${propertyName}")
IF(NOT currentCounter)
SET(currentCounter 1)
ENDIF()
SET(${_unique_name} "${_name}_${currentCounter}" PARENT_SCOPE)
MATH(EXPR currentCounter "${currentCounter} + 1")
SET_PROPERTY(GLOBAL PROPERTY ${propertyName} ${currentCounter} )
ENDFUNCTION()
MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg) MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
# make it a real variable, so we can modify it here # make it a real variable, so we can modify it here
SET(_firstPoFile "${_firstPoFileArg}") SET(_firstPoFile "${_firstPoFileArg}")
@ -94,7 +105,15 @@ MACRO(GETTEXT_CREATE_TRANSLATIONS _potFile _firstPoFileArg)
ENDFOREACH (_currentPoFile ) ENDFOREACH (_currentPoFile )
ADD_CUSTOM_TARGET(translations ${_addToAll} DEPENDS ${_gmoFiles}) IF(NOT TARGET translations)
ADD_CUSTOM_TARGET(translations)
ENDIF()
_GETTEXT_GET_UNIQUE_TARGET_NAME(translations uniqueTargetName)
ADD_CUSTOM_TARGET(${uniqueTargetName} ${_addToAll} DEPENDS ${_gmoFiles})
ADD_DEPENDENCIES(translations ${uniqueTargetName})
ENDMACRO(GETTEXT_CREATE_TRANSLATIONS ) ENDMACRO(GETTEXT_CREATE_TRANSLATIONS )
@ -133,11 +152,20 @@ FUNCTION(GETTEXT_PROCESS_POT_FILE _potFile)
LIST(APPEND _gmoFiles ${_gmoFile}) LIST(APPEND _gmoFiles ${_gmoFile})
ENDFOREACH (_lang ) ENDFOREACH (_lang )
IF(NOT TARGET potfiles)
ADD_CUSTOM_TARGET(potfiles)
ENDIF()
_GETTEXT_GET_UNIQUE_TARGET_NAME( potfiles uniqueTargetName)
IF(_parsedArguments_ALL) IF(_parsedArguments_ALL)
ADD_CUSTOM_TARGET(potfiles ALL DEPENDS ${_gmoFiles}) ADD_CUSTOM_TARGET(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
ELSE(_parsedArguments_ALL) ELSE(_parsedArguments_ALL)
ADD_CUSTOM_TARGET(potfiles DEPENDS ${_gmoFiles}) ADD_CUSTOM_TARGET(${uniqueTargetName} DEPENDS ${_gmoFiles})
ENDIF(_parsedArguments_ALL) ENDIF(_parsedArguments_ALL)
ADD_DEPENDENCIES(potfiles ${uniqueTargetName})
ENDFUNCTION(GETTEXT_PROCESS_POT_FILE) ENDFUNCTION(GETTEXT_PROCESS_POT_FILE)
@ -165,11 +193,21 @@ FUNCTION(GETTEXT_PROCESS_PO_FILES _lang)
LIST(APPEND _gmoFiles ${_gmoFile}) LIST(APPEND _gmoFiles ${_gmoFile})
ENDFOREACH(_current_PO_FILE) ENDFOREACH(_current_PO_FILE)
IF(NOT TARGET pofiles)
ADD_CUSTOM_TARGET(pofiles)
ENDIF()
_GETTEXT_GET_UNIQUE_TARGET_NAME( pofiles uniqueTargetName)
IF(_parsedArguments_ALL) IF(_parsedArguments_ALL)
ADD_CUSTOM_TARGET(pofiles ALL DEPENDS ${_gmoFiles}) ADD_CUSTOM_TARGET(${uniqueTargetName} ALL DEPENDS ${_gmoFiles})
ELSE(_parsedArguments_ALL) ELSE(_parsedArguments_ALL)
ADD_CUSTOM_TARGET(pofiles DEPENDS ${_gmoFiles}) ADD_CUSTOM_TARGET(${uniqueTargetName} DEPENDS ${_gmoFiles})
ENDIF(_parsedArguments_ALL) ENDIF(_parsedArguments_ALL)
ADD_DEPENDENCIES(pofiles ${uniqueTargetName})
ENDFUNCTION(GETTEXT_PROCESS_PO_FILES) ENDFUNCTION(GETTEXT_PROCESS_PO_FILES)
IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE ) IF (GETTEXT_MSGMERGE_EXECUTABLE AND GETTEXT_MSGFMT_EXECUTABLE )

View File

@ -169,7 +169,7 @@ FOREACH(component ${ImageMagick_FIND_COMPONENTS}
LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_${component}_EXECUTABLE) LIST(APPEND ImageMagick_REQUIRED_VARS ImageMagick_${component}_EXECUTABLE)
ENDIF(is_requested GREATER -1) ENDIF(is_requested GREATER -1)
ELSEIF(ImageMagick_${component}_EXECUTABLE) ELSEIF(ImageMagick_${component}_EXECUTABLE)
# if no components were requested explicitely put all (default) executables # if no components were requested explicitly put all (default) executables
# in the list # in the list
LIST(APPEND ImageMagick_DEFAULT_EXECUTABLES "${ImageMagick_${component}_EXECUTABLE}") LIST(APPEND ImageMagick_DEFAULT_EXECUTABLES "${ImageMagick_${component}_EXECUTABLE}")
ENDIF(ImageMagick_FIND_COMPONENTS) ENDIF(ImageMagick_FIND_COMPONENTS)

View File

@ -219,40 +219,69 @@ if (BLA_VENDOR STREQUAL "Generic" OR
endif ( NOT LAPACK_LIBRARIES ) endif ( NOT LAPACK_LIBRARIES )
endif () endif ()
#intel lapack #intel lapack
if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") if (BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
if (NOT WIN32)
set(LM "-lm")
endif ()
if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) if (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) if(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
find_PACKAGE(Threads) find_PACKAGE(Threads)
else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) else(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED) endif(LAPACK_FIND_QUIETLY OR NOT LAPACK_FIND_REQUIRED)
if (BLA_F95) if (BLA_F95)
if(NOT LAPACK95_LIBRARIES) if(NOT LAPACK95_LIBRARIES)
check_lapack_libraries( # old
LAPACK95_LIBRARIES check_lapack_libraries(
LAPACK LAPACK95_LIBRARIES
cheev LAPACK
"" cheev
"mkl_lapack95" ""
"${BLAS95_LIBRARIES}" "mkl_lapack95"
"${CMAKE_THREAD_LIBS_INIT}" "${BLAS95_LIBRARIES}"
) "${CMAKE_THREAD_LIBS_INIT};${LM}"
endif(NOT LAPACK95_LIBRARIES) )
else(BLA_F95) endif(NOT LAPACK95_LIBRARIES)
if(NOT LAPACK_LIBRARIES) if(NOT LAPACK95_LIBRARIES)
check_lapack_libraries( # new >= 10.3
LAPACK_LIBRARIES check_lapack_libraries(
LAPACK LAPACK95_LIBRARIES
cheev LAPACK
"" CHEEV
"mkl_lapack" ""
"${BLAS_LIBRARIES}" "mkl_intel_lp64"
"${CMAKE_THREAD_LIBS_INIT}" "${BLAS95_LIBRARIES}"
) "${CMAKE_THREAD_LIBS_INIT};${LM}"
endif(NOT LAPACK_LIBRARIES) )
endif(BLA_F95) endif(NOT LAPACK95_LIBRARIES)
else(BLA_F95)
if(NOT LAPACK_LIBRARIES)
# old
check_lapack_libraries(
LAPACK_LIBRARIES
LAPACK
cheev
""
"mkl_lapack"
"${BLAS_LIBRARIES}"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT LAPACK_LIBRARIES)
if(NOT LAPACK_LIBRARIES)
# new >= 10.3
check_lapack_libraries(
LAPACK_LIBRARIES
LAPACK
cheev
""
"mkl_gf_lp64"
"${BLAS_LIBRARIES}"
"${CMAKE_THREAD_LIBS_INIT};${LM}"
)
endif(NOT LAPACK_LIBRARIES)
endif(BLA_F95)
endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX) endif (_LANGUAGES_ MATCHES C OR _LANGUAGES_ MATCHES CXX)
endif(BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All") endif(BLA_VENDOR MATCHES "Intel*" OR BLA_VENDOR STREQUAL "All")
else(BLAS_FOUND) else(BLAS_FOUND)
message(STATUS "LAPACK requires BLAS") message(STATUS "LAPACK requires BLAS")
endif(BLAS_FOUND) endif(BLAS_FOUND)

View File

@ -54,8 +54,9 @@ endif()
# itself includes this FindLibArchive when built with an older CMake that does # itself includes this FindLibArchive when built with an older CMake that does
# not provide it. The older CMake also does not have CMAKE_CURRENT_LIST_DIR.) # not provide it. The older CMake also does not have CMAKE_CURRENT_LIST_DIR.)
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(LibArchive DEFAULT_MSG find_package_handle_standard_args(LibArchive
LibArchive_LIBRARY LibArchive_INCLUDE_DIR REQUIRED_VARS LibArchive_LIBRARY LibArchive_INCLUDE_DIR
VERSION_VAR LibArchive_VERSION
) )
set(LibArchive_FOUND ${LIBARCHIVE_FOUND}) set(LibArchive_FOUND ${LIBARCHIVE_FOUND})
unset(LIBARCHIVE_FOUND) unset(LIBARCHIVE_FOUND)

View File

@ -5,6 +5,7 @@
# LIBXSLT_INCLUDE_DIR - the LibXslt include directory # LIBXSLT_INCLUDE_DIR - the LibXslt include directory
# LIBXSLT_LIBRARIES - Link these to LibXslt # LIBXSLT_LIBRARIES - Link these to LibXslt
# LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt # LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt
# LIBXSLT_VERSION_STRING - version of LibXslt found (since CMake 2.8.8)
# Additionally, the following two variables are set (but not required for using xslt): # Additionally, the following two variables are set (but not required for using xslt):
# LIBXSLT_EXSLT_LIBRARIES - Link to these if you need to link against the exslt library # LIBXSLT_EXSLT_LIBRARIES - Link to these if you need to link against the exslt library
# LIBXSLT_XSLTPROC_EXECUTABLE - Contains the full path to the xsltproc executable if found # LIBXSLT_XSLTPROC_EXECUTABLE - Contains the full path to the xsltproc executable if found
@ -51,10 +52,21 @@ SET(LIBXSLT_EXSLT_LIBRARIES ${LIBXSLT_EXSLT_LIBRARY} )
FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc) FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc)
# handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if IF(PC_LIBXSLT_VERSION)
# all listed variables are TRUE SET(LIBXSLT_VERSION_STRING ${PC_LIBXSLT_VERSION})
ELSEIF(LIBXSLT_INCLUDE_DIR AND EXISTS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h")
FILE(STRINGS "${LIBXSLT_INCLUDE_DIR}/libxslt/xsltconfig.h" libxslt_version_str
REGEX "^#define[\t ]+LIBXSLT_DOTTED_VERSION[\t ]+\".*\"")
STRING(REGEX REPLACE "^#define[\t ]+LIBXSLT_DOTTED_VERSION[\t ]+\"([^\"]*)\".*" "\\1"
LIBXSLT_VERSION_STRING "${libxslt_version_str}")
UNSET(libxslt_version_str)
ENDIF()
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXslt DEFAULT_MSG LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR) FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXslt
REQUIRED_VARS LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR
VERSION_VAR LIBXSLT_VERSION_STRING)
MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR
LIBXSLT_LIBRARIES LIBXSLT_LIBRARIES

View File

@ -13,6 +13,7 @@
#============================================================================= #=============================================================================
# Copyright 2009 Kitware, Inc. # Copyright 2009 Kitware, Inc.
# Copyright 2008-2009 André Rigland Brodtkorb <Andre.Brodtkorb@ifi.uio.no> # Copyright 2008-2009 André Rigland Brodtkorb <Andre.Brodtkorb@ifi.uio.no>
# Copyright 2012 Rolf Eike Beer <eike@sf-mail.de>
# #
# Distributed under the OSI-approved BSD License (the "License"); # Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details. # see accompanying file Copyright.txt for details.
@ -24,31 +25,59 @@
# (To distribute this file outside of CMake, substitute the full # (To distribute this file outside of CMake, substitute the full
# License text for the above reference.) # License text for the above reference.)
include(CheckCSourceCompiles) get_property(_ENABLED_LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
include(CheckCXXSourceCompiles) list(FIND _ENABLED_LANGUAGES "C" _HAVE_LANGUAGE_C)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) list(FIND _ENABLED_LANGUAGES "CXX" _HAVE_LANGUAGE_CXX)
unset(_ENABLED_LANGUAGES)
set(OpenMP_C_FLAG_CANDIDATES set(_OPENMP_REQUIRED_VARS)
#Gnu
"-fopenmp" function(_OPENMP_FLAG_CANDIDATES LANG)
#Microsoft Visual Studio set(OpenMP_FLAG_CANDIDATES
"/openmp" #GNU
#Intel windows "-fopenmp"
"-Qopenmp" #Microsoft Visual Studio
#Intel "/openmp"
"-openmp" #Intel windows
#Empty, if compiler automatically accepts openmp "-Qopenmp"
" " #PathScale, Intel
#Sun "-openmp"
"-xopenmp" #Empty, if compiler automatically accepts openmp
#HP " "
"+Oopenmp" #Sun
#IBM XL C/c++ "-xopenmp"
"-qsmp" #HP
#Portland Group "+Oopenmp"
"-mp" #IBM XL C/c++
) "-qsmp"
set(OpenMP_CXX_FLAG_CANDIDATES ${OpenMP_C_FLAG_CANDIDATES}) #Portland Group, MIPSpro
"-mp"
)
set(OMP_FLAG_GNU "-fopenmp")
set(OMP_FLAG_HP "+Oopenmp")
if(WIN32)
set(OMP_FLAG_Intel "-Qopenmp")
else()
set(OMP_FLAG_Intel "-openmp")
endif()
set(OMP_FLAG_MIPSpro "-mp")
set(OMP_FLAG_MSVC "/openmp")
set(OMP_FLAG_PathScale "-openmp")
set(OMP_FLAG_PGI "-mp")
set(OMP_FLAG_SunPro "-xopenmp")
set(OMP_FLAG_XL "-qsmp")
# Move the flag that matches the compiler to the head of the list,
# this is faster and doesn't clutter the output that much. If that
# flag doesn't work we will still try all.
if(OMP_FLAG_${CMAKE_${LANG}_COMPILER_ID})
list(REMOVE_ITEM OpenMP_FLAG_CANDIDATES "${OMP_FLAG_${CMAKE_${LANG}_COMPILER_ID}}")
list(INSERT OpenMP_FLAG_CANDIDATES 0 "${OMP_FLAG_${CMAKE_${LANG}_COMPILER_ID}}")
endif()
set(OpenMP_${LANG}_FLAG_CANDIDATES "${OpenMP_FLAG_CANDIDATES}" PARENT_SCOPE)
endfunction(_OPENMP_FLAG_CANDIDATES)
# sample openmp source code to test # sample openmp source code to test
set(OpenMP_C_TEST_SOURCE set(OpenMP_C_TEST_SOURCE
@ -62,53 +91,85 @@ int main() {
#endif #endif
} }
") ")
# use the same source for CXX as C for now
set(OpenMP_CXX_TEST_SOURCE ${OpenMP_C_TEST_SOURCE})
# if these are set then do not try to find them again,
# by avoiding any try_compiles for the flags
if(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS)
set(OpenMP_C_FLAG_CANDIDATES)
set(OpenMP_CXX_FLAG_CANDIDATES)
endif(DEFINED OpenMP_C_FLAGS AND DEFINED OpenMP_CXX_FLAGS)
# check c compiler # check c compiler
foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) if(NOT _HAVE_LANGUAGE_C EQUAL -1)
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") # if these are set then do not try to find them again,
set(CMAKE_REQUIRED_FLAGS "${FLAG}") # by avoiding any try_compiles for the flags
unset(OpenMP_FLAG_DETECTED CACHE) if(OpenMP_C_FLAGS)
message(STATUS "Try OpenMP C flag = [${FLAG}]") unset(OpenMP_C_FLAG_CANDIDATES)
check_c_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED) else()
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") _OPENMP_FLAG_CANDIDATES("C")
if(OpenMP_FLAG_DETECTED) include(CheckCSourceCompiles)
set(OpenMP_C_FLAGS_INTERNAL "${FLAG}") endif()
break()
endif(OpenMP_FLAG_DETECTED) foreach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES}) set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
set(CMAKE_REQUIRED_FLAGS "${FLAG}")
unset(OpenMP_FLAG_DETECTED CACHE)
message(STATUS "Try OpenMP C flag = [${FLAG}]")
check_c_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
if(OpenMP_FLAG_DETECTED)
set(OpenMP_C_FLAGS_INTERNAL "${FLAG}")
break()
endif(OpenMP_FLAG_DETECTED)
endforeach(FLAG ${OpenMP_C_FLAG_CANDIDATES})
set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}"
CACHE STRING "C compiler flags for OpenMP parallization")
list(APPEND _OPENMP_REQUIRED_VARS OpenMP_C_FLAGS)
unset(OpenMP_C_FLAG_CANDIDATES)
endif()
# check cxx compiler # check cxx compiler
foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES}) if(NOT _HAVE_LANGUAGE_CXX EQUAL -1)
set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}") # if these are set then do not try to find them again,
set(CMAKE_REQUIRED_FLAGS "${FLAG}") # by avoiding any try_compiles for the flags
unset(OpenMP_FLAG_DETECTED CACHE) if(OpenMP_CXX_FLAGS)
message(STATUS "Try OpenMP CXX flag = [${FLAG}]") unset(OpenMP_CXX_FLAG_CANDIDATES)
check_cxx_source_compiles("${OpenMP_C_TEST_SOURCE}" OpenMP_FLAG_DETECTED) else()
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}") _OPENMP_FLAG_CANDIDATES("CXX")
if(OpenMP_FLAG_DETECTED) include(CheckCXXSourceCompiles)
set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}")
break()
endif(OpenMP_FLAG_DETECTED)
endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
set(OpenMP_C_FLAGS "${OpenMP_C_FLAGS_INTERNAL}" # use the same source for CXX as C for now
CACHE STRING "C compiler flags for OpenMP parallization") set(OpenMP_CXX_TEST_SOURCE ${OpenMP_C_TEST_SOURCE})
endif()
set(OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS_INTERNAL}" foreach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
CACHE STRING "C++ compiler flags for OpenMP parallization") set(SAFE_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
# handle the standard arguments for find_package set(CMAKE_REQUIRED_FLAGS "${FLAG}")
find_package_handle_standard_args(OpenMP DEFAULT_MSG unset(OpenMP_FLAG_DETECTED CACHE)
OpenMP_C_FLAGS OpenMP_CXX_FLAGS ) message(STATUS "Try OpenMP CXX flag = [${FLAG}]")
check_cxx_source_compiles("${OpenMP_CXX_TEST_SOURCE}" OpenMP_FLAG_DETECTED)
set(CMAKE_REQUIRED_FLAGS "${SAFE_CMAKE_REQUIRED_FLAGS}")
if(OpenMP_FLAG_DETECTED)
set(OpenMP_CXX_FLAGS_INTERNAL "${FLAG}")
break()
endif(OpenMP_FLAG_DETECTED)
endforeach(FLAG ${OpenMP_CXX_FLAG_CANDIDATES})
mark_as_advanced( set(OpenMP_CXX_FLAGS "${OpenMP_CXX_FLAGS_INTERNAL}"
OpenMP_C_FLAGS CACHE STRING "C++ compiler flags for OpenMP parallization")
OpenMP_CXX_FLAGS
) list(APPEND _OPENMP_REQUIRED_VARS OpenMP_CXX_FLAGS)
unset(OpenMP_CXX_FLAG_CANDIDATES)
unset(OpenMP_CXX_TEST_SOURCE)
endif()
unset(_HAVE_LANGUAGE_C)
unset(_HAVE_LANGUAGE_CXX)
if(_OPENMP_REQUIRED_VARS)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(OpenMP
REQUIRED_VARS ${_OPENMP_REQUIRED_VARS})
mark_as_advanced(${_OPENMP_REQUIRED_VARS})
unset(_OPENMP_REQUIRED_VARS)
else()
message(SEND_ERROR "FindOpenMP requires C or CXX language to be enabled")
endif()

View File

@ -1,8 +1,9 @@
# - Find perl # - Find perl
# this module looks for Perl # this module looks for Perl
# #
# PERL_EXECUTABLE - the full path to perl # PERL_EXECUTABLE - the full path to perl
# PERL_FOUND - If false, don't attempt to use perl. # PERL_FOUND - If false, don't attempt to use perl.
# PERL_VERSION_STRING - version of perl found (since CMake 2.8.8)
#============================================================================= #=============================================================================
# Copyright 2001-2009 Kitware, Inc. # Copyright 2001-2009 Kitware, Inc.
@ -39,12 +40,44 @@ FIND_PROGRAM(PERL_EXECUTABLE
PATHS ${PERL_POSSIBLE_BIN_PATHS} PATHS ${PERL_POSSIBLE_BIN_PATHS}
) )
IF(PERL_EXECUTABLE)
### PERL_VERSION
EXECUTE_PROCESS(
COMMAND
${PERL_EXECUTABLE} -V:version
OUTPUT_VARIABLE
PERL_VERSION_OUTPUT_VARIABLE
RESULT_VARIABLE
PERL_VERSION_RESULT_VARIABLE
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
IF(NOT PERL_VERSION_RESULT_VARIABLE AND NOT PERL_VERSION_OUTPUT_VARIABLE MATCHES "^version='UNKNOWN'")
STRING(REGEX REPLACE "version='([^']+)'.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
ELSE()
EXECUTE_PROCESS(
COMMAND ${PERL_EXECUTABLE} -v
OUTPUT_VARIABLE PERL_VERSION_OUTPUT_VARIABLE
RESULT_VARIABLE PERL_VERSION_RESULT_VARIABLE
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
)
IF(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl.*[ \\(]v([0-9\\._]+)[ \\)]")
STRING(REGEX REPLACE ".*This is perl.*[ \\(]v([0-9\\._]+)[ \\)].*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
ELSEIF(NOT PERL_VERSION_RESULT_VARIABLE AND PERL_VERSION_OUTPUT_VARIABLE MATCHES "This is perl, version ([0-9\\._]+) +")
STRING(REGEX REPLACE ".*This is perl, version ([0-9\\._]+) +.*" "\\1" PERL_VERSION_STRING ${PERL_VERSION_OUTPUT_VARIABLE})
ENDIF()
ENDIF()
ENDIF(PERL_EXECUTABLE)
# Deprecated settings for compatibility with CMake1.4 # Deprecated settings for compatibility with CMake1.4
SET(PERL ${PERL_EXECUTABLE}) SET(PERL ${PERL_EXECUTABLE})
# handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if # handle the QUIETLY and REQUIRED arguments and set PERL_FOUND to TRUE if
# all listed variables are TRUE # all listed variables are TRUE
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl DEFAULT_MSG PERL_EXECUTABLE) FIND_PACKAGE_HANDLE_STANDARD_ARGS(Perl
REQUIRED_VARS PERL_EXECUTABLE
VERSION_VAR PERL_VERSION_STRING)
MARK_AS_ADVANCED(PERL_EXECUTABLE) MARK_AS_ADVANCED(PERL_EXECUTABLE)

View File

@ -55,19 +55,6 @@ if (PERL_EXECUTABLE)
string(REGEX REPLACE "prefix='([^']+)'.*" "\\1" PERL_PREFIX ${PERL_PREFIX_OUTPUT_VARIABLE}) string(REGEX REPLACE "prefix='([^']+)'.*" "\\1" PERL_PREFIX ${PERL_PREFIX_OUTPUT_VARIABLE})
endif (NOT PERL_PREFIX_RESULT_VARIABLE) endif (NOT PERL_PREFIX_RESULT_VARIABLE)
### PERL_VERSION
execute_process(
COMMAND
${PERL_EXECUTABLE} -V:version
OUTPUT_VARIABLE
PERL_VERSION_OUTPUT_VARIABLE
RESULT_VARIABLE
PERL_VERSION_RESULT_VARIABLE
)
if (NOT PERL_VERSION_RESULT_VARIABLE)
string(REGEX REPLACE "version='([^']+)'.*" "\\1" PERL_VERSION ${PERL_VERSION_OUTPUT_VARIABLE})
endif (NOT PERL_VERSION_RESULT_VARIABLE)
### PERL_ARCHNAME ### PERL_ARCHNAME
execute_process( execute_process(
COMMAND COMMAND
@ -107,6 +94,7 @@ if (PERL_EXECUTABLE)
) )
if (NOT PERL_SITESEARCH_RESULT_VARIABLE) if (NOT PERL_SITESEARCH_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITESEARCH ${PERL_SITESEARCH_OUTPUT_VARIABLE}) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITESEARCH ${PERL_SITESEARCH_OUTPUT_VARIABLE})
file(TO_CMAKE_PATH "${PERL_SITESEARCH}" PERL_SITESEARCH)
endif (NOT PERL_SITESEARCH_RESULT_VARIABLE) endif (NOT PERL_SITESEARCH_RESULT_VARIABLE)
### PERL_SITELIB ### PERL_SITELIB
@ -120,6 +108,7 @@ if (PERL_EXECUTABLE)
) )
if (NOT PERL_SITELIB_RESULT_VARIABLE) if (NOT PERL_SITELIB_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITELIB ${PERL_SITELIB_OUTPUT_VARIABLE}) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_SITELIB ${PERL_SITELIB_OUTPUT_VARIABLE})
file(TO_CMAKE_PATH "${PERL_SITELIB}" PERL_SITELIB)
endif (NOT PERL_SITELIB_RESULT_VARIABLE) endif (NOT PERL_SITELIB_RESULT_VARIABLE)
### PERL_VENDORARCH ### PERL_VENDORARCH
@ -133,6 +122,7 @@ if (PERL_EXECUTABLE)
) )
if (NOT PERL_VENDORARCH_RESULT_VARIABLE) if (NOT PERL_VENDORARCH_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORARCH ${PERL_VENDORARCH_OUTPUT_VARIABLE}) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORARCH ${PERL_VENDORARCH_OUTPUT_VARIABLE})
file(TO_CMAKE_PATH "${PERL_VENDORARCH}" PERL_VENDORARCH)
endif (NOT PERL_VENDORARCH_RESULT_VARIABLE) endif (NOT PERL_VENDORARCH_RESULT_VARIABLE)
### PERL_VENDORLIB ### PERL_VENDORLIB
@ -146,6 +136,7 @@ if (PERL_EXECUTABLE)
) )
if (NOT PERL_VENDORLIB_RESULT_VARIABLE) if (NOT PERL_VENDORLIB_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORLIB ${PERL_VENDORLIB_OUTPUT_VARIABLE}) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_VENDORLIB ${PERL_VENDORLIB_OUTPUT_VARIABLE})
file(TO_CMAKE_PATH "${PERL_VENDORLIB}" PERL_VENDORLIB)
endif (NOT PERL_VENDORLIB_RESULT_VARIABLE) endif (NOT PERL_VENDORLIB_RESULT_VARIABLE)
macro(perl_adjust_darwin_lib_variable varname) macro(perl_adjust_darwin_lib_variable varname)
@ -186,6 +177,7 @@ if (PERL_EXECUTABLE)
if (NOT PERL_ARCHLIB_RESULT_VARIABLE) if (NOT PERL_ARCHLIB_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE}) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_ARCHLIB ${PERL_ARCHLIB_OUTPUT_VARIABLE})
perl_adjust_darwin_lib_variable( ARCHLIB ) perl_adjust_darwin_lib_variable( ARCHLIB )
file(TO_CMAKE_PATH "${PERL_ARCHLIB}" PERL_ARCHLIB)
endif (NOT PERL_ARCHLIB_RESULT_VARIABLE) endif (NOT PERL_ARCHLIB_RESULT_VARIABLE)
### PERL_PRIVLIB ### PERL_PRIVLIB
@ -200,28 +192,10 @@ if (PERL_EXECUTABLE)
if (NOT PERL_PRIVLIB_RESULT_VARIABLE) if (NOT PERL_PRIVLIB_RESULT_VARIABLE)
string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_PRIVLIB ${PERL_PRIVLIB_OUTPUT_VARIABLE}) string(REGEX REPLACE "install[a-z]+='([^']+)'.*" "\\1" PERL_PRIVLIB ${PERL_PRIVLIB_OUTPUT_VARIABLE})
perl_adjust_darwin_lib_variable( PRIVLIB ) perl_adjust_darwin_lib_variable( PRIVLIB )
file(TO_CMAKE_PATH "${PERL_PRIVLIB}" PERL_PRIVLIB)
endif (NOT PERL_PRIVLIB_RESULT_VARIABLE) endif (NOT PERL_PRIVLIB_RESULT_VARIABLE)
### PERL_POSSIBLE_LIBRARY_NAMES
### PERL_POSSIBLE_INCLUDE_PATHS
set(PERL_POSSIBLE_INCLUDE_PATHS
${PERL_ARCHLIB}/CORE
/usr/lib/perl5/${PERL_VERSION}/${PERL_ARCHNAME}/CORE
/usr/lib/perl/${PERL_VERSION}/${PERL_ARCHNAME}/CORE
/usr/lib/perl5/${PERL_VERSION}/CORE
/usr/lib/perl/${PERL_VERSION}/CORE
)
### PERL_POSSIBLE_LIB_PATHS
set(PERL_POSSIBLE_LIB_PATHS
${PERL_ARCHLIB}/CORE
/usr/lib/perl5/${PERL_VERSION}/${PERL_ARCHNAME}/CORE
/usr/lib/perl/${PERL_VERSION}/${PERL_ARCHNAME}/CORE
/usr/lib/perl5/${PERL_VERSION}/CORE
/usr/lib/perl/${PERL_VERSION}/CORE
)
### PERL_POSSIBLE_LIBRARY_NAME
execute_process( execute_process(
COMMAND COMMAND
${PERL_EXECUTABLE} -V:libperl ${PERL_EXECUTABLE} -V:libperl
@ -231,10 +205,9 @@ if (PERL_EXECUTABLE)
PERL_LIBRARY_RESULT_VARIABLE PERL_LIBRARY_RESULT_VARIABLE
) )
if (NOT PERL_LIBRARY_RESULT_VARIABLE) if (NOT PERL_LIBRARY_RESULT_VARIABLE)
foreach(_perl_lib_path ${PERL_POSSIBLE_LIB_PATHS}) string(REGEX REPLACE "libperl='([^']+)'.*" "\\1" PERL_POSSIBLE_LIBRARY_NAMES ${PERL_LIBRARY_OUTPUT_VARIABLE})
string(REGEX REPLACE "libperl='([^']+)'" "\\1" PERL_LIBRARY_OUTPUT_VARIABLE ${PERL_LIBRARY_OUTPUT_VARIABLE}) else (NOT PERL_LIBRARY_RESULT_VARIABLE)
set(PERL_POSSIBLE_LIBRARY_NAME ${PERL_POSSIBLE_LIBRARY_NAME} "${_perl_lib_path}/${PERL_LIBRARY_OUTPUT_VARIABLE}") set(PERL_POSSIBLE_LIBRARY_NAMES perl${PERL_VERSION_STRING} perl)
endforeach(_perl_lib_path ${PERL_POSSIBLE_LIB_PATHS})
endif (NOT PERL_LIBRARY_RESULT_VARIABLE) endif (NOT PERL_LIBRARY_RESULT_VARIABLE)
### PERL_INCLUDE_PATH ### PERL_INCLUDE_PATH
@ -242,17 +215,23 @@ if (PERL_EXECUTABLE)
NAMES NAMES
perl.h perl.h
PATHS PATHS
${PERL_POSSIBLE_INCLUDE_PATHS} ${PERL_ARCHLIB}/CORE
/usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
/usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
/usr/lib/perl5/${PERL_VERSION_STRING}/CORE
/usr/lib/perl/${PERL_VERSION_STRING}/CORE
) )
### PERL_LIBRARY ### PERL_LIBRARY
find_library(PERL_LIBRARY find_library(PERL_LIBRARY
NAMES NAMES
${PERL_POSSIBLE_LIBRARY_NAME} ${PERL_POSSIBLE_LIBRARY_NAMES}
perl${PERL_VERSION}
perl
PATHS PATHS
${PERL_POSSIBLE_LIB_PATHS} ${PERL_ARCHLIB}/CORE
/usr/lib/perl5/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
/usr/lib/perl/${PERL_VERSION_STRING}/${PERL_ARCHNAME}/CORE
/usr/lib/perl5/${PERL_VERSION_STRING}/CORE
/usr/lib/perl/${PERL_VERSION_STRING}/CORE
) )
endif (PERL_EXECUTABLE) endif (PERL_EXECUTABLE)
@ -261,15 +240,16 @@ endif (PERL_EXECUTABLE)
# all listed variables are TRUE # all listed variables are TRUE
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(PerlLibs REQUIRED_VARS PERL_LIBRARY PERL_INCLUDE_PATH find_package_handle_standard_args(PerlLibs REQUIRED_VARS PERL_LIBRARY PERL_INCLUDE_PATH
VERSION_VAR PERL_VERSION) VERSION_VAR PERL_VERSION_STRING)
# Introduced after CMake 2.6.4 to bring module into compliance # Introduced after CMake 2.6.4 to bring module into compliance
set(PERL_INCLUDE_DIR ${PERL_INCLUDE_PATH}) set(PERL_INCLUDE_DIR ${PERL_INCLUDE_PATH})
set(PERL_INCLUDE_DIRS ${PERL_INCLUDE_PATH}) set(PERL_INCLUDE_DIRS ${PERL_INCLUDE_PATH})
set(PERL_LIBRARIES ${PERL_LIBRARY}) set(PERL_LIBRARIES ${PERL_LIBRARY})
# For backward compatibility with CMake before 2.8.8
set(PERL_VERSION ${PERL_VERSION_STRING})
mark_as_advanced( mark_as_advanced(
PERL_INCLUDE_PATH PERL_INCLUDE_PATH
PERL_EXECUTABLE
PERL_LIBRARY PERL_LIBRARY
) )

View File

@ -13,14 +13,17 @@
# When the 'QUIET' argument is set, no status messages will be printed. # When the 'QUIET' argument is set, no status messages will be printed.
# #
# It sets the following variables: # It sets the following variables:
# PKG_CONFIG_FOUND ... true if pkg-config works on the system # PKG_CONFIG_FOUND ... true if pkg-config works on the system
# PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program # PKG_CONFIG_EXECUTABLE ... pathname of the pkg-config program
# <PREFIX>_FOUND ... set to 1 if module(s) exist # PKG_CONFIG_VERSION_STRING ... the version of the pkg-config program found
# (since CMake 2.8.8)
# PKG_CONFIG_FOUND ... if pkg-config executable was found
# #
# For the following variables two sets of values exist; first one is the # For the following variables two sets of values exist; first one is the
# common one and has the given PREFIX. The second set contains flags # common one and has the given PREFIX. The second set contains flags
# which are given out when pkgconfig was called with the '--static' # which are given out when pkgconfig was called with the '--static'
# option. # option.
# <XPREFIX>_FOUND ... set to 1 if module(s) exist
# <XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l') # <XPREFIX>_LIBRARIES ... only the libraries (w/o the '-l')
# <XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L') # <XPREFIX>_LIBRARY_DIRS ... the paths of the libraries (w/o the '-L')
# <XPREFIX>_LDFLAGS ... all required linker flags # <XPREFIX>_LDFLAGS ... all required linker flags
@ -89,9 +92,17 @@ set(PKG_CONFIG_VERSION 1)
find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable") find_program(PKG_CONFIG_EXECUTABLE NAMES pkg-config DOC "pkg-config executable")
mark_as_advanced(PKG_CONFIG_EXECUTABLE) mark_as_advanced(PKG_CONFIG_EXECUTABLE)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) if (PKG_CONFIG_EXECUTABLE)
find_package_handle_standard_args(PkgConfig DEFAULT_MSG PKG_CONFIG_EXECUTABLE) execute_process(COMMAND ${PKG_CONFIG_EXECUTABLE} --version
OUTPUT_VARIABLE PKG_CONFIG_VERSION_STRING
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif (PKG_CONFIG_EXECUTABLE)
include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
find_package_handle_standard_args(PkgConfig
REQUIRED_VARS PKG_CONFIG_EXECUTABLE
VERSION_VAR PKG_CONFIG_VERSION_STRING)
# Unsets the given variables # Unsets the given variables
macro(_pkgconfig_unset var) macro(_pkgconfig_unset var)

View File

@ -183,11 +183,14 @@ ENDIF(QT_UIC_EXECUTABLE)
IF (WIN32) IF (WIN32)
FIND_LIBRARY(QT_QTMAIN_LIBRARY qtmain FIND_LIBRARY(QT_QTMAIN_LIBRARY qtmain
HINTS
$ENV{QTDIR}/lib
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.1;InstallDir]/lib"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.2.0;InstallDir]/lib"
"[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib" "[HKEY_CURRENT_USER\\Software\\Trolltech\\Qt3Versions\\3.1.0;InstallDir]/lib"
PATHS
"$ENV{ProgramFiles}/qt/lib" "$ENV{ProgramFiles}/qt/lib"
$ENV{QTDIR}/lib "C:/Program Files/qt/lib" "C:/Program Files/qt/lib"
DOC "This Library is only needed by and included with Qt3 on MSWindows. It should be NOTFOUND, undefined or IGNORE otherwise." DOC "This Library is only needed by and included with Qt3 on MSWindows. It should be NOTFOUND, undefined or IGNORE otherwise."
) )
ENDIF (WIN32) ENDIF (WIN32)

View File

@ -588,8 +588,9 @@ IF (QT_QMAKE_EXECUTABLE AND QTVERSION)
SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE) SET(QT_LIBRARY_DIR ${QT_LIBRARY_DIR_TMP} CACHE INTERNAL "Qt library dir" FORCE)
SET(QT_QTCORE_FOUND 1) SET(QT_QTCORE_FOUND 1)
ELSE() ELSE()
MESSAGE("Warning: QT_QMAKE_EXECUTABLE reported QT_INSTALL_LIBS as ${QT_LIBRARY_DIR_TMP}") MESSAGE(WARNING "${QT_QMAKE_EXECUTABLE} reported QT_INSTALL_LIBS as \"${QT_LIBRARY_DIR_TMP}\" "
MESSAGE("Warning: But QtCore couldn't be found. Qt must NOT be installed correctly, or it wasn't found for cross compiling.") "but QtCore could not be found there. "
"Qt is NOT installed correctly for the target build environment.")
IF(Qt4_FIND_REQUIRED) IF(Qt4_FIND_REQUIRED)
MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.") MESSAGE( FATAL_ERROR "Could NOT find QtCore. Check ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log for more details.")
ENDIF(Qt4_FIND_REQUIRED) ENDIF(Qt4_FIND_REQUIRED)

View File

@ -61,49 +61,44 @@ FIND_PROGRAM(RUBY_EXECUTABLE NAMES ${_RUBY_POSSIBLE_EXECUTABLE_NAMES})
IF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR) IF(RUBY_EXECUTABLE AND NOT RUBY_VERSION_MAJOR)
FUNCTION(_RUBY_CONFIG_VAR RBVAR OUTVAR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print RbConfig::CONFIG['${RBVAR}']"
RESULT_VARIABLE _RUBY_SUCCESS
OUTPUT_VARIABLE _RUBY_OUTPUT
ERROR_QUIET)
IF(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['${RBVAR}']"
RESULT_VARIABLE _RUBY_SUCCESS
OUTPUT_VARIABLE _RUBY_OUTPUT
ERROR_QUIET)
ENDIF(_RUBY_SUCCESS OR NOT _RUBY_OUTPUT)
SET(${OUTVAR} "${_RUBY_OUTPUT}" PARENT_SCOPE)
ENDFUNCTION(_RUBY_CONFIG_VAR)
# query the ruby version # query the ruby version
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['MAJOR']" _RUBY_CONFIG_VAR("MAJOR" RUBY_VERSION_MAJOR)
OUTPUT_VARIABLE RUBY_VERSION_MAJOR) _RUBY_CONFIG_VAR("MINOR" RUBY_VERSION_MINOR)
_RUBY_CONFIG_VAR("TEENY" RUBY_VERSION_PATCH)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['MINOR']"
OUTPUT_VARIABLE RUBY_VERSION_MINOR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['TEENY']"
OUTPUT_VARIABLE RUBY_VERSION_PATCH)
# query the different directories # query the different directories
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['archdir']" _RUBY_CONFIG_VAR("archdir" RUBY_ARCH_DIR)
OUTPUT_VARIABLE RUBY_ARCH_DIR) _RUBY_CONFIG_VAR("arch" RUBY_ARCH)
_RUBY_CONFIG_VAR("rubyhdrdir" RUBY_HDR_DIR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['arch']" _RUBY_CONFIG_VAR("libdir" RUBY_POSSIBLE_LIB_DIR)
OUTPUT_VARIABLE RUBY_ARCH) _RUBY_CONFIG_VAR("rubylibdir" RUBY_RUBY_LIB_DIR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['rubyhdrdir']"
OUTPUT_VARIABLE RUBY_HDR_DIR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['libdir']"
OUTPUT_VARIABLE RUBY_POSSIBLE_LIB_DIR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['rubylibdir']"
OUTPUT_VARIABLE RUBY_RUBY_LIB_DIR)
# site_ruby # site_ruby
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitearchdir']" _RUBY_CONFIG_VAR("sitearchdir" RUBY_SITEARCH_DIR)
OUTPUT_VARIABLE RUBY_SITEARCH_DIR) _RUBY_CONFIG_VAR("sitelibdir" RUBY_SITELIB_DIR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['sitelibdir']"
OUTPUT_VARIABLE RUBY_SITELIB_DIR)
# vendor_ruby available ? # vendor_ruby available ?
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r vendor-specific -e "print 'true'" EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r vendor-specific -e "print 'true'"
OUTPUT_VARIABLE RUBY_HAS_VENDOR_RUBY ERROR_QUIET) OUTPUT_VARIABLE RUBY_HAS_VENDOR_RUBY ERROR_QUIET)
IF(RUBY_HAS_VENDOR_RUBY) IF(RUBY_HAS_VENDOR_RUBY)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorlibdir']" _RUBY_CONFIG_VAR("vendorlibdir" RUBY_VENDORLIB_DIR)
OUTPUT_VARIABLE RUBY_VENDORLIB_DIR) _RUBY_CONFIG_VAR("vendorarchdir" RUBY_VENDORARCH_DIR)
EXECUTE_PROCESS(COMMAND ${RUBY_EXECUTABLE} -r rbconfig -e "print Config::CONFIG['vendorarchdir']"
OUTPUT_VARIABLE RUBY_VENDORARCH_DIR)
ENDIF(RUBY_HAS_VENDOR_RUBY) ENDIF(RUBY_HAS_VENDOR_RUBY)
# save the results in the cache so we don't have to run ruby the next time again # save the results in the cache so we don't have to run ruby the next time again

View File

@ -81,7 +81,6 @@ FIND_PATH(SDL_INCLUDE_DIR SDL.h
/opt/csw # Blastwave /opt/csw # Blastwave
/opt /opt
) )
#MESSAGE("SDL_INCLUDE_DIR is ${SDL_INCLUDE_DIR}")
# SDL-1.1 is the name used by FreeBSD ports... # SDL-1.1 is the name used by FreeBSD ports...
# don't confuse it for the version number. # don't confuse it for the version number.
@ -97,8 +96,6 @@ FIND_LIBRARY(SDL_LIBRARY_TEMP
/opt /opt
) )
#MESSAGE("SDL_LIBRARY_TEMP is ${SDL_LIBRARY_TEMP}")
IF(NOT SDL_BUILDING_LIBRARY) IF(NOT SDL_BUILDING_LIBRARY)
IF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework") IF(NOT ${SDL_INCLUDE_DIR} MATCHES ".framework")
# Non-OS X framework versions expect you to also dynamically link to # Non-OS X framework versions expect you to also dynamically link to
@ -134,7 +131,6 @@ IF(MINGW)
SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW")
ENDIF(MINGW) ENDIF(MINGW)
SET(SDL_FOUND "NO")
IF(SDL_LIBRARY_TEMP) IF(SDL_LIBRARY_TEMP)
# For SDLmain # For SDLmain
IF(NOT SDL_BUILDING_LIBRARY) IF(NOT SDL_BUILDING_LIBRARY)
@ -169,9 +165,9 @@ IF(SDL_LIBRARY_TEMP)
SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found") SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found")
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI # Set the temp variable to INTERNAL so it is not seen in the CMake GUI
SET(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "") SET(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "")
SET(SDL_FOUND "YES")
ENDIF(SDL_LIBRARY_TEMP) ENDIF(SDL_LIBRARY_TEMP)
#MESSAGE("SDL_LIBRARY is ${SDL_LIBRARY}") INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL
REQUIRED_VARS SDL_LIBRARY SDL_INCLUDE_DIR)

View File

@ -68,8 +68,7 @@ FIND_LIBRARY(SDLIMAGE_LIBRARY
/opt /opt
) )
SET(SDLIMAGE_FOUND "NO") INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
IF(SDLIMAGE_LIBRARY AND SDLIMAGE_INCLUDE_DIR)
SET(SDLIMAGE_FOUND "YES")
ENDIF(SDLIMAGE_LIBRARY AND SDLIMAGE_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLIMAGE
REQUIRED_VARS SDLIMAGE_LIBRARY SDLIMAGE_INCLUDE_DIR)

View File

@ -68,8 +68,7 @@ FIND_LIBRARY(SDLMIXER_LIBRARY
/opt /opt
) )
SET(SDLMIXER_FOUND "NO") INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
IF(SDLMIXER_LIBRARY AND SDLMIXER_INCLUDE_DIR)
SET(SDLMIXER_FOUND "YES")
ENDIF(SDLMIXER_LIBRARY AND SDLMIXER_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLMIXER
REQUIRED_VARS SDLMIXER_LIBRARY SDLMIXER_INCLUDE_DIR)

View File

@ -67,8 +67,7 @@ FIND_LIBRARY(SDLNET_LIBRARY
/opt /opt
) )
SET(SDLNET_FOUND "NO") INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
IF(SDLNET_LIBRARY AND SDLNET_INCLUDE_DIR)
SET(SDLNET_FOUND "YES")
ENDIF(SDLNET_LIBRARY AND SDLNET_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLNET
REQUIRED_VARS SDLNET_LIBRARY SDLNET_INCLUDE_DIR)

View File

@ -114,7 +114,6 @@ FIND_LIBRARY(SDL_SOUND_LIBRARY
/opt/lib /opt/lib
) )
SET(SDL_SOUND_FOUND "NO")
IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
# CMake is giving me problems using TRY_COMPILE with the CMAKE_FLAGS # CMake is giving me problems using TRY_COMPILE with the CMAKE_FLAGS
@ -414,8 +413,9 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
ENDIF(NOT MY_RESULT) ENDIF(NOT MY_RESULT)
SET(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries") SET(SDL_SOUND_LIBRARIES "${SDL_SOUND_EXTRAS} ${SDL_SOUND_LIBRARIES_TMP}" CACHE INTERNAL "SDL_sound and dependent libraries")
SET(SDL_SOUND_FOUND "YES")
ENDIF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) ENDIF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY)
# MESSAGE("SDL_SOUND_LIBRARIES is ${SDL_SOUND_LIBRARIES}") INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL_SOUND
REQUIRED_VARS SDL_SOUND_LIBRARIES SDL_SOUND_INCLUDE_DIR)

View File

@ -68,8 +68,7 @@ FIND_LIBRARY(SDLTTF_LIBRARY
PATH_SUFFIXES lib64 lib PATH_SUFFIXES lib64 lib
) )
SET(SDLTTF_FOUND "NO") INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
IF(SDLTTF_LIBRARY AND SDLTTF_INCLUDE_DIR)
SET(SDLTTF_FOUND "YES")
ENDIF(SDLTTF_LIBRARY AND SDLTTF_INCLUDE_DIR)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDLTTF
REQUIRED_VARS SDLTTF_LIBRARY SDLTTF_INCLUDE_DIR)

View File

@ -20,7 +20,7 @@
# X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND # X11_XShm_INCLUDE_PATH, (in X11_Xext_LIB), X11_XShm_FOUND
# X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND # X11_Xshape_INCLUDE_PATH, (in X11_Xext_LIB), X11_Xshape_FOUND
# X11_xf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_xf86misc_FOUND # X11_xf86misc_INCLUDE_PATH, X11_Xxf86misc_LIB, X11_xf86misc_FOUND
# X11_xf86vmode_INCLUDE_PATH, X11_xf86vmode_FOUND # X11_xf86vmode_INCLUDE_PATH, X11_Xxf86vm_LIB X11_xf86vmode_FOUND
# X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND # X11_Xfixes_INCLUDE_PATH, X11_Xfixes_LIB, X11_Xfixes_FOUND
# X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND # X11_Xft_INCLUDE_PATH, X11_Xft_LIB, X11_Xft_FOUND
# X11_Xi_INCLUDE_PATH, X11_Xi_LIB, X11_Xi_FOUND # X11_Xi_INCLUDE_PATH, X11_Xi_LIB, X11_Xi_FOUND
@ -29,6 +29,7 @@
# X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND # X11_Xkb_INCLUDE_PATH, X11_Xkb_FOUND
# X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND # X11_Xkblib_INCLUDE_PATH, X11_Xkb_FOUND
# X11_Xkbfile_INCLUDE_PATH, X11_Xkbfile_LIB, X11_Xkbfile_FOUND # X11_Xkbfile_INCLUDE_PATH, X11_Xkbfile_LIB, X11_Xkbfile_FOUND
# X11_Xmu_INCLUDE_PATH, X11_Xmu_LIB, X11_Xmu_FOUND
# X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND # X11_Xpm_INCLUDE_PATH, X11_Xpm_LIB, X11_Xpm_FOUND
# X11_XTest_INCLUDE_PATH, X11_XTest_LIB, X11_XTest_FOUND # X11_XTest_INCLUDE_PATH, X11_XTest_LIB, X11_XTest_FOUND
# X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND # X11_Xrandr_INCLUDE_PATH, X11_Xrandr_LIB, X11_Xrandr_FOUND
@ -103,6 +104,7 @@ IF (UNIX)
FIND_PATH(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_Xkb_INCLUDE_PATH X11/extensions/XKB.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_Xkblib_INCLUDE_PATH X11/XKBlib.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_Xkbfile_INCLUDE_PATH X11/extensions/XKBfile.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_Xmu_INCLUDE_PATH X11/Xmu/Xmu.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_Xpm_INCLUDE_PATH X11/xpm.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_Xpm_INCLUDE_PATH X11/xpm.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_XTest_INCLUDE_PATH X11/extensions/XTest.h ${X11_INC_SEARCH_PATH})
FIND_PATH(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h ${X11_INC_SEARCH_PATH}) FIND_PATH(X11_XShm_INCLUDE_PATH X11/extensions/XShm.h ${X11_INC_SEARCH_PATH})
@ -134,6 +136,7 @@ IF (UNIX)
FIND_LIBRARY(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xinerama_LIB Xinerama ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xinput_LIB Xi ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xinput_LIB Xi ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xkbfile_LIB xkbfile ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xmu_LIB Xmu ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xpm_LIB Xpm ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xrandr_LIB Xrandr ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xrandr_LIB Xrandr ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xrender_LIB Xrender ${X11_LIB_SEARCH_PATH})
@ -143,6 +146,7 @@ IF (UNIX)
FIND_LIBRARY(X11_XTest_LIB Xtst ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_XTest_LIB Xtst ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xv_LIB Xv ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xv_LIB Xv ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xxf86misc_LIB Xxf86misc ${X11_LIB_SEARCH_PATH}) FIND_LIBRARY(X11_Xxf86misc_LIB Xxf86misc ${X11_LIB_SEARCH_PATH})
FIND_LIBRARY(X11_Xxf86vm_LIB Xxf86vm ${X11_LIB_SEARCH_PATH})
SET(X11_LIBRARY_DIR "") SET(X11_LIBRARY_DIR "")
IF(X11_X11_LIB) IF(X11_X11_LIB)
@ -267,10 +271,10 @@ IF (UNIX)
SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH}) SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86misc_INCLUDE_PATH})
ENDIF (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB) ENDIF (X11_xf86misc_INCLUDE_PATH AND X11_Xxf86misc_LIB)
IF (X11_xf86vmode_INCLUDE_PATH) IF (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB)
SET(X11_xf86vmode_FOUND TRUE) SET(X11_xf86vmode_FOUND TRUE)
SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH}) SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_xf86vmode_INCLUDE_PATH})
ENDIF (X11_xf86vmode_INCLUDE_PATH) ENDIF (X11_xf86vmode_INCLUDE_PATH AND X11_Xxf86vm_LIB)
IF (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB) IF (X11_Xcursor_INCLUDE_PATH AND X11_Xcursor_LIB)
SET(X11_Xcursor_FOUND TRUE) SET(X11_Xcursor_FOUND TRUE)
@ -297,6 +301,11 @@ IF (UNIX)
SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} ) SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xkbfile_INCLUDE_PATH} )
ENDIF (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH) ENDIF (X11_Xkbfile_INCLUDE_PATH AND X11_Xkbfile_LIB AND X11_Xlib_INCLUDE_PATH)
IF (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB)
SET(X11_Xmu_FOUND TRUE)
SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xmu_INCLUDE_PATH})
ENDIF (X11_Xmu_INCLUDE_PATH AND X11_Xmu_LIB)
IF (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB) IF (X11_Xinput_INCLUDE_PATH AND X11_Xinput_LIB)
SET(X11_Xinput_FOUND TRUE) SET(X11_Xinput_FOUND TRUE)
SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH}) SET(X11_INCLUDE_DIR ${X11_INCLUDE_DIR} ${X11_Xinput_INCLUDE_PATH})
@ -435,6 +444,7 @@ IF (UNIX)
X11_XRes_INCLUDE_PATH X11_XRes_INCLUDE_PATH
X11_Xxf86misc_LIB X11_Xxf86misc_LIB
X11_xf86misc_INCLUDE_PATH X11_xf86misc_INCLUDE_PATH
X11_Xxf86vm_LIB
X11_xf86vmode_INCLUDE_PATH X11_xf86vmode_INCLUDE_PATH
X11_Xi_LIB X11_Xi_LIB
X11_Xi_INCLUDE_PATH X11_Xi_INCLUDE_PATH
@ -456,6 +466,8 @@ IF (UNIX)
X11_Xkblib_INCLUDE_PATH X11_Xkblib_INCLUDE_PATH
X11_Xkbfile_INCLUDE_PATH X11_Xkbfile_INCLUDE_PATH
X11_Xkbfile_LIB X11_Xkbfile_LIB
X11_Xmu_INCLUDE_PATH
X11_Xmu_LIB
X11_Xscreensaver_INCLUDE_PATH X11_Xscreensaver_INCLUDE_PATH
X11_Xscreensaver_LIB X11_Xscreensaver_LIB
X11_Xpm_INCLUDE_PATH X11_Xpm_INCLUDE_PATH

View File

@ -173,7 +173,7 @@ macro(_test_compiler_hidden_visibility)
_gcc_version "${_gcc_version_info}") _gcc_version "${_gcc_version_info}")
endif() endif()
if(${_gcc_version} VERSION_LESS "4.2") if("${_gcc_version}" VERSION_LESS "4.2")
set(GCC_TOO_OLD TRUE) set(GCC_TOO_OLD TRUE)
message(WARNING "GCC version older than 4.2") message(WARNING "GCC version older than 4.2")
endif() endif()

View File

@ -922,12 +922,12 @@ Function .onInit
Pop $0 Pop $0
UserInfo::GetAccountType UserInfo::GetAccountType
Pop $1 Pop $1
StrCmp $1 "Admin" 0 +3 StrCmp $1 "Admin" 0 +4
SetShellVarContext all SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Admin group' ;MessageBox MB_OK 'User "$0" is in the Admin group'
StrCpy $SV_ALLUSERS "AllUsers" StrCpy $SV_ALLUSERS "AllUsers"
Goto done Goto done
StrCmp $1 "Power" 0 +3 StrCmp $1 "Power" 0 +4
SetShellVarContext all SetShellVarContext all
;MessageBox MB_OK 'User "$0" is in the Power Users group' ;MessageBox MB_OK 'User "$0" is in the Power Users group'
StrCpy $SV_ALLUSERS "AllUsers" StrCpy $SV_ALLUSERS "AllUsers"

View File

@ -393,7 +393,13 @@ MACRO(QT4_CREATE_TRANSLATION _qm_files)
FOREACH(_pro_src ${_my_sources}) FOREACH(_pro_src ${_my_sources})
SET(_pro_srcs "${_pro_srcs} \"${_pro_src}\"") SET(_pro_srcs "${_pro_srcs} \"${_pro_src}\"")
ENDFOREACH(_pro_src ${_my_sources}) ENDFOREACH(_pro_src ${_my_sources})
FILE(WRITE ${_ts_pro} "SOURCES = ${_pro_srcs}") SET(_pro_includes)
GET_DIRECTORY_PROPERTY(_inc_DIRS INCLUDE_DIRECTORIES)
FOREACH(_pro_include ${_inc_DIRS})
GET_FILENAME_COMPONENT(_abs_include "${_pro_include}" ABSOLUTE)
SET(_pro_includes "${_pro_includes} \"${_abs_include}\"")
ENDFOREACH(_pro_include ${CMAKE_CXX_INCLUDE_PATH})
FILE(WRITE ${_ts_pro} "SOURCES = ${_pro_srcs}\nINCLUDEPATH = ${_pro_includes}\n")
ENDIF(_my_sources) ENDIF(_my_sources)
ADD_CUSTOM_COMMAND(OUTPUT ${_ts_file} ADD_CUSTOM_COMMAND(OUTPUT ${_ts_file}
COMMAND ${QT_LUPDATE_EXECUTABLE} COMMAND ${QT_LUPDATE_EXECUTABLE}

View File

@ -25,6 +25,15 @@
# set(CMAKE_JAVA_TARGET_OUTPUT_NAME shibboleet.jar) # set(CMAKE_JAVA_TARGET_OUTPUT_NAME shibboleet.jar)
# add_jar(foobar foobar.java) # add_jar(foobar foobar.java)
# #
# To use a different output directory than CMAKE_CURRENT_BINARY_DIR
# you can set it with:
#
# set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/bin)
#
# To define an entry point in your jar you can set it with:
#
# set(CMAKE_JAVA_JAR_ENTRY_POINT com/examples/MyProject/Main)
#
# To add a VERSION to the target output name you can set it using # To add a VERSION to the target output name you can set it using
# CMAKE_JAVA_TARGET_VERSION. This will create a jar file with the name # CMAKE_JAVA_TARGET_VERSION. This will create a jar file with the name
# shibboleet-1.0.0.jar and will create a symlink shibboleet.jar # shibboleet-1.0.0.jar and will create a symlink shibboleet.jar
@ -112,7 +121,7 @@
# [VERSION TRUE|FALSE] # [VERSION TRUE|FALSE]
# ) # )
# #
# Create jave documentation based on files or packages. For more # Create java documentation based on files or packages. For more
# details please read the javadoc manpage. # details please read the javadoc manpage.
# #
# There are two main signatures for create_javadoc. The first # There are two main signatures for create_javadoc. The first
@ -198,10 +207,19 @@ set(_JAVA_SYMLINK_SCRIPT ${CMAKE_CURRENT_LIST_DIR}/UseJavaSymlinks.cmake)
function(add_jar _TARGET_NAME) function(add_jar _TARGET_NAME)
set(_JAVA_SOURCE_FILES ${ARGN}) set(_JAVA_SOURCE_FILES ${ARGN})
if (NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR)
set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR})
endif(NOT DEFINED CMAKE_JAVA_TARGET_OUTPUT_DIR)
if (CMAKE_JAVA_JAR_ENTRY_POINT)
set(_ENTRY_POINT_OPTION e)
set(_ENTRY_POINT_VALUE ${CMAKE_JAVA_JAR_ENTRY_POINT})
endif (CMAKE_JAVA_JAR_ENTRY_POINT)
if (LIBRARY_OUTPUT_PATH) if (LIBRARY_OUTPUT_PATH)
set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH}) set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${LIBRARY_OUTPUT_PATH})
else (LIBRARY_OUTPUT_PATH) else (LIBRARY_OUTPUT_PATH)
set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}) set(CMAKE_JAVA_LIBRARY_OUTPUT_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR})
endif (LIBRARY_OUTPUT_PATH) endif (LIBRARY_OUTPUT_PATH)
set(CMAKE_JAVA_INCLUDE_PATH set(CMAKE_JAVA_INCLUDE_PATH
@ -221,7 +239,7 @@ function(add_jar _TARGET_NAME)
set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}") set(CMAKE_JAVA_INCLUDE_PATH_FINAL "${CMAKE_JAVA_INCLUDE_PATH_FINAL}${CMAKE_JAVA_INCLUDE_FLAG_SEP}${JAVA_INCLUDE_DIR}")
endforeach(JAVA_INCLUDE_DIR) endforeach(JAVA_INCLUDE_DIR)
set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir") set(CMAKE_JAVA_CLASS_OUTPUT_PATH "${CMAKE_JAVA_TARGET_OUTPUT_DIR}${CMAKE_FILES_DIRECTORY}/${_TARGET_NAME}.dir")
set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}.jar") set(_JAVA_TARGET_OUTPUT_NAME "${_TARGET_NAME}.jar")
if (CMAKE_JAVA_TARGET_OUTPUT_NAME AND CMAKE_JAVA_TARGET_VERSION) if (CMAKE_JAVA_TARGET_OUTPUT_NAME AND CMAKE_JAVA_TARGET_VERSION)
@ -246,7 +264,7 @@ function(add_jar _TARGET_NAME)
get_filename_component(_JAVA_PATH ${_JAVA_SOURCE_FILE} PATH) get_filename_component(_JAVA_PATH ${_JAVA_SOURCE_FILE} PATH)
get_filename_component(_JAVA_FULL ${_JAVA_SOURCE_FILE} ABSOLUTE) get_filename_component(_JAVA_FULL ${_JAVA_SOURCE_FILE} ABSOLUTE)
file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${CMAKE_CURRENT_BINARY_DIR} ${_JAVA_FULL}) file(RELATIVE_PATH _JAVA_REL_BINARY_PATH ${CMAKE_JAVA_TARGET_OUTPUT_DIR} ${_JAVA_FULL})
file(RELATIVE_PATH _JAVA_REL_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${_JAVA_FULL}) file(RELATIVE_PATH _JAVA_REL_SOURCE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${_JAVA_FULL})
string(LENGTH ${_JAVA_REL_BINARY_PATH} _BIN_LEN) string(LENGTH ${_JAVA_REL_BINARY_PATH} _BIN_LEN)
string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN) string(LENGTH ${_JAVA_REL_SOURCE_PATH} _SRC_LEN)
@ -312,20 +330,22 @@ function(add_jar _TARGET_NAME)
endif (_JAVA_COMPILE_FILES) endif (_JAVA_COMPILE_FILES)
# create the jar file # create the jar file
set(_JAVA_JAR_OUTPUT_PATH
${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_NAME})
if (CMAKE_JNI_TARGET) if (CMAKE_JNI_TARGET)
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} OUTPUT ${_JAVA_JAR_OUTPUT_PATH}
COMMAND ${Java_JAR_EXECUTABLE} COMMAND ${Java_JAR_EXECUTABLE}
-cf ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} -cf${_ENTRY_POINT_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE}
${_JAVA_RESOURCE_FILES} @java_class_filelist ${_JAVA_RESOURCE_FILES} @java_class_filelist
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
-D_JAVA_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR} -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR}
-D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME} -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME}
-D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK} -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK}
-P ${_JAVA_SYMLINK_SCRIPT} -P ${_JAVA_SYMLINK_SCRIPT}
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
-D_JAVA_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR} -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR}
-D_JAVA_TARGET_OUTPUT_NAME=${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_JAR_OUTPUT_PATH}
-D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK} -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK}
-P ${_JAVA_SYMLINK_SCRIPT} -P ${_JAVA_SYMLINK_SCRIPT}
DEPENDS ${_JAVA_RESOURCE_FILES} ${_JAVA_DEPENDS} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist DEPENDS ${_JAVA_RESOURCE_FILES} ${_JAVA_DEPENDS} ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_class_filelist
@ -334,12 +354,12 @@ function(add_jar _TARGET_NAME)
) )
else () else ()
add_custom_command( add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} OUTPUT ${_JAVA_JAR_OUTPUT_PATH}
COMMAND ${Java_JAR_EXECUTABLE} COMMAND ${Java_JAR_EXECUTABLE}
-cf ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} -cf${_ENTRY_POINT_OPTION} ${_JAVA_JAR_OUTPUT_PATH} ${_ENTRY_POINT_VALUE}
${_JAVA_RESOURCE_FILES} @java_class_filelist ${_JAVA_RESOURCE_FILES} @java_class_filelist
COMMAND ${CMAKE_COMMAND} COMMAND ${CMAKE_COMMAND}
-D_JAVA_TARGET_DIR=${CMAKE_CURRENT_BINARY_DIR} -D_JAVA_TARGET_DIR=${CMAKE_JAVA_TARGET_OUTPUT_DIR}
-D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME} -D_JAVA_TARGET_OUTPUT_NAME=${_JAVA_TARGET_OUTPUT_NAME}
-D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK} -D_JAVA_TARGET_OUTPUT_LINK=${_JAVA_TARGET_OUTPUT_LINK}
-P ${_JAVA_SYMLINK_SCRIPT} -P ${_JAVA_SYMLINK_SCRIPT}
@ -350,14 +370,14 @@ function(add_jar _TARGET_NAME)
endif (CMAKE_JNI_TARGET) endif (CMAKE_JNI_TARGET)
# Add the target and make sure we have the latest resource files. # Add the target and make sure we have the latest resource files.
add_custom_target(${_TARGET_NAME} ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME}) add_custom_target(${_TARGET_NAME} ALL DEPENDS ${_JAVA_JAR_OUTPUT_PATH})
set_property( set_property(
TARGET TARGET
${_TARGET_NAME} ${_TARGET_NAME}
PROPERTY PROPERTY
INSTALL_FILES INSTALL_FILES
${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} ${_JAVA_JAR_OUTPUT_PATH}
) )
if (_JAVA_TARGET_OUTPUT_LINK) if (_JAVA_TARGET_OUTPUT_LINK)
@ -366,8 +386,8 @@ function(add_jar _TARGET_NAME)
${_TARGET_NAME} ${_TARGET_NAME}
PROPERTY PROPERTY
INSTALL_FILES INSTALL_FILES
${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} ${_JAVA_JAR_OUTPUT_PATH}
${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_LINK} ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK}
) )
if (CMAKE_JNI_TARGET) if (CMAKE_JNI_TARGET)
@ -376,7 +396,7 @@ function(add_jar _TARGET_NAME)
${_TARGET_NAME} ${_TARGET_NAME}
PROPERTY PROPERTY
JNI_SYMLINK JNI_SYMLINK
${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_LINK} ${CMAKE_JAVA_TARGET_OUTPUT_DIR}/${_JAVA_TARGET_OUTPUT_LINK}
) )
endif (CMAKE_JNI_TARGET) endif (CMAKE_JNI_TARGET)
endif (_JAVA_TARGET_OUTPUT_LINK) endif (_JAVA_TARGET_OUTPUT_LINK)
@ -386,7 +406,7 @@ function(add_jar _TARGET_NAME)
${_TARGET_NAME} ${_TARGET_NAME}
PROPERTY PROPERTY
JAR_FILE JAR_FILE
${CMAKE_CURRENT_BINARY_DIR}/${_JAVA_TARGET_OUTPUT_NAME} ${_JAVA_JAR_OUTPUT_PATH}
) )
set_property( set_property(

View File

@ -466,6 +466,8 @@ SET(CPACK_SRCS
CPack/cmCPackTarBZip2Generator.cxx CPack/cmCPackTarBZip2Generator.cxx
CPack/cmCPackTarCompressGenerator.cxx CPack/cmCPackTarCompressGenerator.cxx
CPack/cmCPackZIPGenerator.cxx CPack/cmCPackZIPGenerator.cxx
CPack/cmCPackDocumentVariables.cxx
CPack/cmCPackDocumentMacros.cxx
) )
IF(CYGWIN) IF(CYGWIN)

View File

@ -57,13 +57,20 @@ int cmCPackArchiveGenerator::addOneComponentToArchive(cmArchiveWrite& archive,
std::string dir = cmSystemTools::GetCurrentWorkingDirectory(); std::string dir = cmSystemTools::GetCurrentWorkingDirectory();
// Change to local toplevel // Change to local toplevel
cmSystemTools::ChangeDirectory(localToplevel.c_str()); cmSystemTools::ChangeDirectory(localToplevel.c_str());
std::string filePrefix;
if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY"))
{
filePrefix = this->GetOption("CPACK_PACKAGE_FILE_NAME");
filePrefix += "/";
}
std::vector<std::string>::const_iterator fileIt; std::vector<std::string>::const_iterator fileIt;
for (fileIt = component->Files.begin(); fileIt != component->Files.end(); for (fileIt = component->Files.begin(); fileIt != component->Files.end();
++fileIt ) ++fileIt )
{ {
std::string rp = filePrefix + *fileIt;
cmCPackLogger(cmCPackLog::LOG_DEBUG,"Adding file: " cmCPackLogger(cmCPackLog::LOG_DEBUG,"Adding file: "
<< (*fileIt) << std::endl); << rp << std::endl);
archive.Add(*fileIt); archive.Add(rp);
if (!archive) if (!archive)
{ {
cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: " cmCPackLogger(cmCPackLog::LOG_ERROR, "ERROR while packaging files: "

View File

@ -0,0 +1,16 @@
#include "cmCPackDocumentMacros.h"
void cmCPackDocumentMacros::GetMacrosDocumentation(
std::vector<cmDocumentationEntry>& )
{
// Commented-out example of use
//
// cmDocumentationEntry e("cpack_<macro>",
// "Brief Description"
// "which may be on several lines.",
// "Long description in pre-formatted format"
// " blah\n"
// " blah\n"
//);
//v.push_back(e);
}

View File

@ -0,0 +1,21 @@
/*============================================================================
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.
============================================================================*/
#ifndef cmCPackDocumentMacros_h
#define cmCPackDocumentMacros_h
#include "cmStandardIncludes.h"
class cmCPackDocumentMacros
{
public:
static void GetMacrosDocumentation(std::vector<cmDocumentationEntry>& v);
};
#endif

View File

@ -0,0 +1,32 @@
#include "cmCPackDocumentVariables.h"
#include "cmake.h"
void cmCPackDocumentVariables::DefineVariables(cmake* cm)
{
// Subsection: variables defined/used by cpack,
// which are common to all CPack generators
cm->DefineProperty
("CPACK_PACKAGING_INSTALL_PREFIX", cmProperty::VARIABLE,
"The prefix used in the built package.",
"Each CPack generator has a default value (like /usr)."
" This default value may"
" be overwritten from the CMakeLists.txt or the cpack command line"
" by setting an alternative value.\n"
"e.g. "
" set(CPACK_PACKAGING_INSTALL_PREFIX \"/opt\")\n"
"This is not the same purpose as CMAKE_INSTALL_PREFIX which"
" is used when installing from the build tree without building"
" a package."
"", false,
"Variables common to all CPack generators");
// Subsection: variables defined/used by cpack,
// which are specific to one CPack generator
// cm->DefineProperty
// ("CPACK_RPM_PACKAGE_NAME", cmProperty::VARIABLE,
// "RPM specific package name.",
// "If not specified, defaults to CPACK_PACKAGE_NAME."
// "", false,
// "Variables specific to a CPack generator");
}

View File

@ -0,0 +1,21 @@
/*============================================================================
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.
============================================================================*/
#ifndef cmCPackDocumentVariables_h
#define cmCPackDocumentVariables_h
class cmake;
class cmCPackDocumentVariables
{
public:
static void DefineVariables(cmake* cm);
};
#endif

View File

@ -691,6 +691,11 @@ int cmCPackGenerator::InstallProjectViaInstallCMakeProjects(
// one install directory for each component. // one install directory for each component.
tempInstallDirectory += tempInstallDirectory +=
GetComponentInstallDirNameSuffix(installComponent); GetComponentInstallDirNameSuffix(installComponent);
if (this->IsOn("CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY"))
{
tempInstallDirectory += "/";
tempInstallDirectory += this->GetOption("CPACK_PACKAGE_FILE_NAME");
}
} }
if (!setDestDir) if (!setDestDir)

View File

@ -344,9 +344,9 @@ int cmCPackNSISGenerator::InitializeInternal()
if ( cmSystemTools::IsOn(this->GetOption( if ( cmSystemTools::IsOn(this->GetOption(
"CPACK_INCLUDE_TOPLEVEL_DIRECTORY")) ) "CPACK_INCLUDE_TOPLEVEL_DIRECTORY")) )
{ {
cmCPackLogger(cmCPackLog::LOG_ERROR, cmCPackLogger(cmCPackLog::LOG_WARNING,
"NSIS Generator cannot work with CPACK_INCLUDE_TOPLEVEL_DIRECTORY. " "NSIS Generator cannot work with CPACK_INCLUDE_TOPLEVEL_DIRECTORY set. "
"This option will be ignored." "This option will be reset to 0 (for this generator only)."
<< std::endl); << std::endl);
this->SetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", 0); this->SetOption("CPACK_INCLUDE_TOPLEVEL_DIRECTORY", 0);
} }

View File

@ -14,6 +14,8 @@
// Need these for documentation support. // Need these for documentation support.
#include "cmake.h" #include "cmake.h"
#include "cmDocumentation.h" #include "cmDocumentation.h"
#include "cmCPackDocumentVariables.h"
#include "cmCPackDocumentMacros.h"
#include "cmCPackGeneratorFactory.h" #include "cmCPackGeneratorFactory.h"
#include "cmCPackGenerator.h" #include "cmCPackGenerator.h"
#include "cmake.h" #include "cmake.h"
@ -24,6 +26,7 @@
#include "cmCPackLog.h" #include "cmCPackLog.h"
#include <cmsys/CommandLineArguments.hxx> #include <cmsys/CommandLineArguments.hxx>
#include <cmsys/SystemTools.hxx>
#include <memory> // auto_ptr #include <memory> // auto_ptr
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
@ -90,6 +93,40 @@ static const char * cmDocumentationOptions[][3] =
"If vendor is not specified on cpack command line " "If vendor is not specified on cpack command line "
"(or inside CMakeLists.txt) then" "(or inside CMakeLists.txt) then"
"CPack.cmake defines it with a default value"}, "CPack.cmake defines it with a default value"},
{"--help-command cmd [file]", "Print help for a single command and exit.",
"Full documentation specific to the given command is displayed. "
"If a file is specified, the documentation is written into and the output "
"format is determined depending on the filename suffix. Supported are man "
"page, HTML, DocBook and plain text."},
{"--help-command-list [file]", "List available commands and exit.",
"The list contains all commands for which help may be obtained by using "
"the --help-command argument followed by a command name. "
"If a file is specified, the documentation is written into and the output "
"format is determined depending on the filename suffix. Supported are man "
"page, HTML, DocBook and plain text."},
{"--help-commands [file]", "Print help for all commands and exit.",
"Full documentation specific for all current command is displayed."
"If a file is specified, the documentation is written into and the output "
"format is determined depending on the filename suffix. Supported are man "
"page, HTML, DocBook and plain text."},
{"--help-variable var [file]",
"Print help for a single variable and exit.",
"Full documentation specific to the given variable is displayed."
"If a file is specified, the documentation is written into and the output "
"format is determined depending on the filename suffix. Supported are man "
"page, HTML, DocBook and plain text."},
{"--help-variable-list [file]", "List documented variables and exit.",
"The list contains all variables for which help may be obtained by using "
"the --help-variable argument followed by a variable name. If a file is "
"specified, the help is written into it."
"If a file is specified, the documentation is written into and the output "
"format is determined depending on the filename suffix. Supported are man "
"page, HTML, DocBook and plain text."},
{"--help-variables [file]", "Print help for all variables and exit.",
"Full documentation for all variables is displayed."
"If a file is specified, the documentation is written into and the output "
"format is determined depending on the filename suffix. Supported are man "
"page, HTML, DocBook and plain text."},
{0,0,0} {0,0,0}
}; };
@ -137,12 +174,15 @@ int cpackDefinitionArgument(const char* argument, const char* cValue,
return 1; return 1;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
// this is CPack. // this is CPack.
int main (int argc, char *argv[]) int main (int argc, char *argv[])
{ {
cmSystemTools::FindExecutableDirectory(argv[0]); cmSystemTools::FindExecutableDirectory(argv[0]);
cmCPackLog log; cmCPackLog log;
int nocwd = 0;
log.SetErrorPrefix("CPack Error: "); log.SetErrorPrefix("CPack Error: ");
log.SetWarningPrefix("CPack Warning: "); log.SetWarningPrefix("CPack Warning: ");
log.SetOutputPrefix("CPack: "); log.SetOutputPrefix("CPack: ");
@ -154,6 +194,7 @@ int main (int argc, char *argv[])
{ {
cmCPack_Log(&log, cmCPackLog::LOG_ERROR, cmCPack_Log(&log, cmCPackLog::LOG_ERROR,
"Current working directory cannot be established." << std::endl); "Current working directory cannot be established." << std::endl);
nocwd = 1;
} }
std::string generator; std::string generator;
@ -179,7 +220,6 @@ int main (int argc, char *argv[])
cpackConfigFile = ""; cpackConfigFile = "";
cmDocumentation doc;
cmsys::CommandLineArguments arg; cmsys::CommandLineArguments arg;
arg.Initialize(argc, argv); arg.Initialize(argc, argv);
typedef cmsys::CommandLineArguments argT; typedef cmsys::CommandLineArguments argT;
@ -252,17 +292,25 @@ int main (int argc, char *argv[])
generators.SetLogger(&log); generators.SetLogger(&log);
cmCPackGenerator* cpackGenerator = 0; cmCPackGenerator* cpackGenerator = 0;
if ( !helpFull.empty() || !helpMAN.empty() || cmDocumentation doc;
!helpHTML.empty() || helpVersion ) doc.addCPackStandardDocSections();
/* Were we invoked to display doc or to do some work ? */
if(doc.CheckOptions(argc, argv,"-G") || nocwd)
{ {
help = true; help = true;
} }
else
{
help = false;
}
// This part is used for cpack documentation lookup as well.
cminst.AddCMakePaths();
if ( parsed && !help ) if ( parsed && !help )
{ {
// find out which system cpack is running on, so it can setup the search // find out which system cpack is running on, so it can setup the search
// paths, so FIND_XXX() commands can be used in scripts // paths, so FIND_XXX() commands can be used in scripts
cminst.AddCMakePaths();
std::string systemFile = std::string systemFile =
globalMF->GetModulesFile("CMakeDetermineSystem.cmake"); globalMF->GetModulesFile("CMakeDetermineSystem.cmake");
if (!globalMF->ReadListFile(0, systemFile.c_str())) if (!globalMF->ReadListFile(0, systemFile.c_str()))
@ -465,14 +513,48 @@ int main (int argc, char *argv[])
*/ */
if ( help ) if ( help )
{ {
doc.CheckOptions(argc, argv);
// Construct and print requested documentation. // Construct and print requested documentation.
doc.SetName("cpack"); doc.SetName("cpack");
doc.SetSection("Name",cmDocumentationName); doc.SetSection("Name",cmDocumentationName);
doc.SetSection("Usage",cmDocumentationUsage); doc.SetSection("Usage",cmDocumentationUsage);
doc.SetSection("Description",cmDocumentationDescription); doc.SetSection("Description",cmDocumentationDescription);
doc.PrependSection("Options",cmDocumentationOptions); doc.PrependSection("Options",cmDocumentationOptions);
// statically (in C++ code) defined variables
cmCPackDocumentVariables::DefineVariables(&cminst);
std::vector<cmDocumentationEntry> commands;
std::string docedFile;
std::string docPath;
cmDocumentation::documentedModulesList_t docedModList;
docedFile = globalMF->GetModulesFile("CPack.cmake");
if (docedFile.length()!=0)
{
docPath = cmSystemTools::GetFilenamePath(docedFile.c_str());
doc.getDocumentedModulesListInDir(docPath,"CPack*.cmake",docedModList);
}
// parse the files for documentation.
cmDocumentation::documentedModulesList_t::iterator docedIt;
for (docedIt = docedModList.begin();
docedIt!= docedModList.end(); ++docedIt)
{
doc.GetStructuredDocFromFile(
(docedIt->first).c_str(),
commands,&cminst);
}
std::map<std::string,cmDocumentationSection *> propDocs;
cminst.GetPropertiesDocumentation(propDocs);
doc.SetSections(propDocs);
cminst.GetCommandDocumentation(commands,true,false);
// statically (in C++ code) defined macros/commands
cmCPackDocumentMacros::GetMacrosDocumentation(commands);
doc.SetSection("Commands",commands);
std::vector<cmDocumentationEntry> v; std::vector<cmDocumentationEntry> v;
cmCPackGeneratorFactory::DescriptionsMap::const_iterator generatorIt; cmCPackGeneratorFactory::DescriptionsMap::const_iterator generatorIt;
for( generatorIt = generators.GetGeneratorsList().begin(); for( generatorIt = generators.GetGeneratorsList().begin();

View File

@ -555,7 +555,7 @@ int cmCTestCoverageHandler::ProcessHandler()
covSumFile << "\t<File Name=\"" << cmXMLSafe(fileName) covSumFile << "\t<File Name=\"" << cmXMLSafe(fileName)
<< "\" FullPath=\"" << cmXMLSafe( << "\" FullPath=\"" << cmXMLSafe(
this->CTest->GetShortPathToFile(fullFileName.c_str())) this->CTest->GetShortPathToFile(fullFileName.c_str()))
<< "\" Covered=\"" << (tested > 0 ? "true":"false") << "\">\n" << "\" Covered=\"" << (tested+untested > 0 ? "true":"false") << "\">\n"
<< "\t\t<LOCTested>" << tested << "</LOCTested>\n" << "\t\t<LOCTested>" << tested << "</LOCTested>\n"
<< "\t\t<LOCUnTested>" << untested << "</LOCUnTested>\n" << "\t\t<LOCUnTested>" << untested << "</LOCUnTested>\n"
<< "\t\t<PercentCoverage>"; << "\t\t<PercentCoverage>";

View File

@ -102,6 +102,7 @@ int main(int argc, char** argv)
{ {
cmSystemTools::FindExecutableDirectory(argv[0]); cmSystemTools::FindExecutableDirectory(argv[0]);
cmDocumentation doc; cmDocumentation doc;
doc.addCMakeStandardDocSections();
if(doc.CheckOptions(argc, argv)) if(doc.CheckOptions(argc, argv))
{ {
cmake hcm; cmake hcm;

View File

@ -409,12 +409,11 @@ void cmCursesMainForm::PrintKeys(int process /* = 0 */)
char thirdLine[512]=""; char thirdLine[512]="";
if (process) if (process)
{ {
sprintf(firstLine, const char* clearLine =
" "); " ";
sprintf(secondLine, strcpy(firstLine, clearLine);
" "); strcpy(secondLine, clearLine);
sprintf(thirdLine, strcpy(thirdLine, clearLine);
" ");
} }
else else
{ {

View File

@ -10,11 +10,11 @@
# See the License for more information. # See the License for more information.
#============================================================================= #=============================================================================
PROJECT(QtDialog) PROJECT(QtDialog)
SET(QT_MIN_VERSION "4.3.0") SET(QT_MIN_VERSION "4.4.0")
FIND_PACKAGE(Qt4 REQUIRED) FIND_PACKAGE(Qt4 REQUIRED)
IF(NOT QT4_FOUND) IF(NOT QT4_FOUND)
MESSAGE(SEND_ERROR "Failed to find Qt 4.3 or greater.") MESSAGE(SEND_ERROR "Failed to find Qt 4.4 or greater.")
ELSE(NOT QT4_FOUND) ELSE(NOT QT4_FOUND)
INCLUDE(${QT_USE_FILE}) INCLUDE(${QT_USE_FILE})

View File

@ -64,6 +64,7 @@ int main(int argc, char** argv)
// check docs first so that X is not need to get docs // check docs first so that X is not need to get docs
// do docs, if args were given // do docs, if args were given
cmDocumentation doc; cmDocumentation doc;
doc.addCMakeStandardDocSections();
if(argc >1 && doc.CheckOptions(argc, argv)) if(argc >1 && doc.CheckOptions(argc, argv))
{ {
// Construct and print requested documentation. // Construct and print requested documentation.

View File

@ -554,8 +554,7 @@ void CMakeSetupDialog::doHelp()
void CMakeSetupDialog::doInterrupt() void CMakeSetupDialog::doInterrupt()
{ {
this->enterState(Interrupting); this->enterState(Interrupting);
QMetaObject::invokeMethod(this->CMakeThread->cmakeInstance(), this->CMakeThread->cmakeInstance()->interrupt();
"interrupt", Qt::QueuedConnection);
} }
void CMakeSetupDialog::doSourceBrowse() void CMakeSetupDialog::doSourceBrowse()

View File

@ -63,6 +63,8 @@ QCMake::QCMake(QObject* p)
#endif #endif
this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this); this->CMakeInstance->SetProgressCallback(QCMake::progressCallback, this);
cmSystemTools::SetInterruptCallback(QCMake::interruptCallback, this);
std::vector<std::string> generators; std::vector<std::string> generators;
this->CMakeInstance->GetRegisteredGenerators(generators); this->CMakeInstance->GetRegisteredGenerators(generators);
std::vector<std::string>::iterator iter; std::vector<std::string>::iterator iter;
@ -170,6 +172,7 @@ void QCMake::configure()
this->CMakeInstance->SetWarnUnused(this->WarnUnusedMode); this->CMakeInstance->SetWarnUnused(this->WarnUnusedMode);
this->CMakeInstance->PreLoadCMakeFiles(); this->CMakeInstance->PreLoadCMakeFiles();
InterruptFlag = 0;
cmSystemTools::ResetErrorOccuredFlag(); cmSystemTools::ResetErrorOccuredFlag();
int err = this->CMakeInstance->Configure(); int err = this->CMakeInstance->Configure();
@ -188,7 +191,9 @@ void QCMake::generate()
UINT lastErrorMode = SetErrorMode(0); UINT lastErrorMode = SetErrorMode(0);
#endif #endif
InterruptFlag = 0;
cmSystemTools::ResetErrorOccuredFlag(); cmSystemTools::ResetErrorOccuredFlag();
int err = this->CMakeInstance->Generate(); int err = this->CMakeInstance->Generate();
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
@ -337,7 +342,13 @@ QCMakePropertyList QCMake::properties() const
void QCMake::interrupt() void QCMake::interrupt()
{ {
cmSystemTools::SetFatalErrorOccured(); this->InterruptFlag.ref();
}
bool QCMake::interruptCallback(void* cd)
{
QCMake* self = reinterpret_cast<QCMake*>(cd);
return self->InterruptFlag;
} }
void QCMake::progressCallback(const char* msg, float percent, void* cd) void QCMake::progressCallback(const char* msg, float percent, void* cd)

View File

@ -23,6 +23,7 @@
#include <QList> #include <QList>
#include <QStringList> #include <QStringList>
#include <QMetaType> #include <QMetaType>
#include <QAtomicInt>
class cmake; class cmake;
@ -78,7 +79,7 @@ public slots:
void generate(); void generate();
/// set the property values /// set the property values
void setProperties(const QCMakePropertyList&); void setProperties(const QCMakePropertyList&);
/// interrupt the configure or generate process /// interrupt the configure or generate process (if connecting, make a direct connection)
void interrupt(); void interrupt();
/// delete the cache in binary directory /// delete the cache in binary directory
void deleteCache(); void deleteCache();
@ -133,6 +134,7 @@ signals:
protected: protected:
cmake* CMakeInstance; cmake* CMakeInstance;
static bool interruptCallback(void*);
static void progressCallback(const char* msg, float percent, void* cd); static void progressCallback(const char* msg, float percent, void* cd);
static void errorCallback(const char* msg, const char* title, static void errorCallback(const char* msg, const char* title,
bool&, void* cd); bool&, void* cd);
@ -145,6 +147,7 @@ protected:
QString Generator; QString Generator;
QStringList AvailableGenerators; QStringList AvailableGenerators;
QString CMakeExecutable; QString CMakeExecutable;
QAtomicInt InterruptFlag;
}; };
#endif // __QCMake_h #endif // __QCMake_h

View File

@ -38,6 +38,7 @@
#include "cmEndFunctionCommand.cxx" #include "cmEndFunctionCommand.cxx"
#include "cmEndIfCommand.cxx" #include "cmEndIfCommand.cxx"
#include "cmEndMacroCommand.cxx" #include "cmEndMacroCommand.cxx"
#include "cmEndWhileCommand.cxx"
#include "cmExecProgramCommand.cxx" #include "cmExecProgramCommand.cxx"
#include "cmExecuteProcessCommand.cxx" #include "cmExecuteProcessCommand.cxx"
#include "cmExternalMakefileProjectGenerator.cxx" #include "cmExternalMakefileProjectGenerator.cxx"
@ -91,6 +92,7 @@
#include "cmTryCompileCommand.cxx" #include "cmTryCompileCommand.cxx"
#include "cmTryRunCommand.cxx" #include "cmTryRunCommand.cxx"
#include "cmUnsetCommand.cxx" #include "cmUnsetCommand.cxx"
#include "cmWhileCommand.cxx"
void GetBootstrapCommands(std::list<cmCommand*>& commands) void GetBootstrapCommands(std::list<cmCommand*>& commands)
{ {
@ -116,6 +118,7 @@ void GetBootstrapCommands(std::list<cmCommand*>& commands)
commands.push_back(new cmEndFunctionCommand); commands.push_back(new cmEndFunctionCommand);
commands.push_back(new cmEndIfCommand); commands.push_back(new cmEndIfCommand);
commands.push_back(new cmEndMacroCommand); commands.push_back(new cmEndMacroCommand);
commands.push_back(new cmEndWhileCommand);
commands.push_back(new cmExecProgramCommand); commands.push_back(new cmExecProgramCommand);
commands.push_back(new cmExecuteProcessCommand); commands.push_back(new cmExecuteProcessCommand);
commands.push_back(new cmFileCommand); commands.push_back(new cmFileCommand);
@ -164,4 +167,5 @@ void GetBootstrapCommands(std::list<cmCommand*>& commands)
commands.push_back(new cmTryCompileCommand); commands.push_back(new cmTryCompileCommand);
commands.push_back(new cmTryRunCommand); commands.push_back(new cmTryRunCommand);
commands.push_back(new cmUnsetCommand); commands.push_back(new cmUnsetCommand);
commands.push_back(new cmWhileCommand);
} }

View File

@ -110,6 +110,17 @@ public:
return false; return false;
} }
/**
* This is used to avoid including this command
* in documentation. This is mainly used by
* cmMacroHelperCommand and cmFunctionHelperCommand
* which cannot provide appropriate documentation.
*/
virtual bool ShouldAppearInDocumentation()
{
return true;
}
/** /**
* The name of the command as specified in CMakeList.txt. * The name of the command as specified in CMakeList.txt.
*/ */

View File

@ -14,7 +14,6 @@
#include "cmAuxSourceDirectoryCommand.cxx" #include "cmAuxSourceDirectoryCommand.cxx"
#include "cmBuildNameCommand.cxx" #include "cmBuildNameCommand.cxx"
#include "cmElseIfCommand.cxx" #include "cmElseIfCommand.cxx"
#include "cmEndWhileCommand.cxx"
#include "cmExportCommand.cxx" #include "cmExportCommand.cxx"
#include "cmExportLibraryDependencies.cxx" #include "cmExportLibraryDependencies.cxx"
#include "cmFLTKWrapUICommand.cxx" #include "cmFLTKWrapUICommand.cxx"
@ -34,7 +33,6 @@
#include "cmVariableRequiresCommand.cxx" #include "cmVariableRequiresCommand.cxx"
#include "cmVariableWatchCommand.cxx" #include "cmVariableWatchCommand.cxx"
#include "cmWhileCommand.cxx"
#include "cmWriteFileCommand.cxx" #include "cmWriteFileCommand.cxx"
// This one must be last because it includes windows.h and // This one must be last because it includes windows.h and
@ -53,7 +51,6 @@ void GetPredefinedCommands(std::list<cmCommand*>&
commands.push_back(new cmAuxSourceDirectoryCommand); commands.push_back(new cmAuxSourceDirectoryCommand);
commands.push_back(new cmBuildNameCommand); commands.push_back(new cmBuildNameCommand);
commands.push_back(new cmElseIfCommand); commands.push_back(new cmElseIfCommand);
commands.push_back(new cmEndWhileCommand);
commands.push_back(new cmExportCommand); commands.push_back(new cmExportCommand);
commands.push_back(new cmExportLibraryDependenciesCommand); commands.push_back(new cmExportLibraryDependenciesCommand);
commands.push_back(new cmFLTKWrapUICommand); commands.push_back(new cmFLTKWrapUICommand);
@ -73,7 +70,6 @@ void GetPredefinedCommands(std::list<cmCommand*>&
commands.push_back(new cmUtilitySourceCommand); commands.push_back(new cmUtilitySourceCommand);
commands.push_back(new cmVariableRequiresCommand); commands.push_back(new cmVariableRequiresCommand);
commands.push_back(new cmVariableWatchCommand); commands.push_back(new cmVariableWatchCommand);
commands.push_back(new cmWhileCommand);
commands.push_back(new cmWriteFileCommand); commands.push_back(new cmWriteFileCommand);
#endif #endif
} }

View File

@ -248,6 +248,10 @@ cmComputeLinkInformation
this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator(); this->GlobalGenerator = this->LocalGenerator->GetGlobalGenerator();
this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance(); this->CMakeInstance = this->GlobalGenerator->GetCMakeInstance();
// Check whether to recognize OpenBSD-style library versioned names.
this->OpenBSD = this->Makefile->GetCMakeInstance()
->GetPropertyAsBool("FIND_LIBRARY_USE_OPENBSD_VERSIONING");
// The configuration being linked. // The configuration being linked.
this->Config = config; this->Config = config;
@ -973,7 +977,15 @@ cmComputeLinkInformation
} }
// Finish the list. // Finish the list.
libext += ")$"; libext += ")";
// Add an optional OpenBSD version component.
if(this->OpenBSD)
{
libext += "(\\.[0-9]+\\.[0-9]+)?";
}
libext += "$";
return libext; return libext;
} }

View File

@ -128,6 +128,7 @@ private:
cmsys::RegularExpression ExtractSharedLibraryName; cmsys::RegularExpression ExtractSharedLibraryName;
cmsys::RegularExpression ExtractAnyLibraryName; cmsys::RegularExpression ExtractAnyLibraryName;
std::string SharedRegexString; std::string SharedRegexString;
bool OpenBSD;
void AddLinkPrefix(const char* p); void AddLinkPrefix(const char* p);
void AddLinkExtension(const char* e, LinkType type); void AddLinkExtension(const char* e, LinkType type);
std::string CreateExtensionRegex(std::vector<std::string> const& exts); std::string CreateExtensionRegex(std::vector<std::string> const& exts);

View File

@ -26,6 +26,7 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
const char* sourceDirectory = argv[2].c_str(); const char* sourceDirectory = argv[2].c_str();
const char* projectName = 0; const char* projectName = 0;
const char* targetName = 0; const char* targetName = 0;
char targetNameBuf[64];
int extraArgs = 0; int extraArgs = 0;
// look for CMAKE_FLAGS and store them // look for CMAKE_FLAGS and store them
@ -281,16 +282,20 @@ int cmCoreTryCompile::TryCompileCode(std::vector<std::string> const& argv)
cmakeFlags.push_back(flag); cmakeFlags.push_back(flag);
} }
/* Use a random file name to avoid rapid creation and deletion
of the same executable name (some filesystems fail on that). */
sprintf(targetNameBuf, "cmTryCompileExec%u",
cmSystemTools::RandomSeed());
targetName = targetNameBuf;
/* Put the executable at a known location (for COPY_FILE). */ /* Put the executable at a known location (for COPY_FILE). */
fprintf(fout, "SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n", fprintf(fout, "SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY \"%s\")\n",
this->BinaryDirectory.c_str()); this->BinaryDirectory.c_str());
/* Create the actual executable. */ /* Create the actual executable. */
fprintf(fout, "ADD_EXECUTABLE(cmTryCompileExec \"%s\")\n",source.c_str()); fprintf(fout, "ADD_EXECUTABLE(%s \"%s\")\n", targetName, source.c_str());
fprintf(fout, fprintf(fout, "TARGET_LINK_LIBRARIES(%s ${LINK_LIBRARIES})\n",targetName);
"TARGET_LINK_LIBRARIES(cmTryCompileExec ${LINK_LIBRARIES})\n");
fclose(fout); fclose(fout);
projectName = "CMAKE_TRY_COMPILE"; projectName = "CMAKE_TRY_COMPILE";
targetName = "cmTryCompileExec";
// if the source is not in CMakeTmp // if the source is not in CMakeTmp
if(source.find("CMakeTmp") == source.npos) if(source.find("CMakeTmp") == source.npos)
{ {

View File

@ -260,12 +260,24 @@ bool cmDepends::CheckDependencies(std::istream& internalDepends,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmDepends::SetIncludePathFromLanguage(const char* lang) void cmDepends::SetIncludePathFromLanguage(const char* lang)
{ {
// Look for the new per "TARGET_" variant first:
std::string includePathVar = "CMAKE_"; std::string includePathVar = "CMAKE_";
includePathVar += lang; includePathVar += lang;
includePathVar += "_INCLUDE_PATH"; includePathVar += "_TARGET_INCLUDE_PATH";
cmMakefile* mf = this->LocalGenerator->GetMakefile(); cmMakefile* mf = this->LocalGenerator->GetMakefile();
if(const char* includePath = mf->GetDefinition(includePathVar.c_str())) if(const char* includePath = mf->GetDefinition(includePathVar.c_str()))
{ {
cmSystemTools::ExpandListArgument(includePath, this->IncludePath); cmSystemTools::ExpandListArgument(includePath, this->IncludePath);
} }
else
{
// Fallback to the old directory level variable if no per-target var:
includePathVar = "CMAKE_";
includePathVar += lang;
includePathVar += "_INCLUDE_PATH";
if(const char* includePath = mf->GetDefinition(includePathVar.c_str()))
{
cmSystemTools::ExpandListArgument(includePath, this->IncludePath);
}
}
} }

View File

@ -14,7 +14,9 @@
#include "cmSystemTools.h" #include "cmSystemTools.h"
#include "cmVersion.h" #include "cmVersion.h"
#include <cmsys/Directory.hxx> #include <cmsys/Directory.hxx>
#include <cmsys/Glob.hxx>
#include <algorithm>
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
static const char *cmDocumentationStandardOptions[][3] = static const char *cmDocumentationStandardOptions[][3] =
@ -220,55 +222,7 @@ cmDocumentation::cmDocumentation()
:CurrentFormatter(0) :CurrentFormatter(0)
{ {
this->SetForm(TextForm); this->SetForm(TextForm);
this->addCommonStandardDocSections();
cmDocumentationSection *sec;
sec = new cmDocumentationSection("Author","AUTHOR");
sec->Append(cmDocumentationEntry
(0,
"This manual page was generated by the \"--help-man\" option.",
0));
this->AllSections["Author"] = sec;
sec = new cmDocumentationSection("Copyright","COPYRIGHT");
sec->Append(cmDocumentationCopyright);
this->AllSections["Copyright"] = sec;
sec = new cmDocumentationSection("See Also","SEE ALSO");
sec->Append(cmDocumentationStandardSeeAlso);
this->AllSections["Standard See Also"] = sec;
sec = new cmDocumentationSection("Options","OPTIONS");
sec->Append(cmDocumentationStandardOptions);
this->AllSections["Options"] = sec;
sec = new cmDocumentationSection("Properties","PROPERTIES");
sec->Append(cmPropertiesDocumentationDescription);
this->AllSections["Properties Description"] = sec;
sec = new cmDocumentationSection("Generators","GENERATORS");
sec->Append(cmDocumentationGeneratorsHeader);
this->AllSections["Generators"] = sec;
sec = new cmDocumentationSection("Compatibility Commands",
"COMPATIBILITY COMMANDS");
sec->Append(cmCompatCommandsDocumentationDescription);
this->AllSections["Compatibility Commands"] = sec;
this->PropertySections.push_back("Properties of Global Scope");
this->PropertySections.push_back("Properties on Directories");
this->PropertySections.push_back("Properties on Targets");
this->PropertySections.push_back("Properties on Tests");
this->PropertySections.push_back("Properties on Source Files");
this->PropertySections.push_back("Properties on Cache Entries");
this->VariableSections.push_back("Variables that Provide Information");
this->VariableSections.push_back("Variables That Change Behavior");
this->VariableSections.push_back("Variables That Describe the System");
this->VariableSections.push_back("Variables that Control the Build");
this->VariableSections.push_back("Variables for Languages");
this->ShowGenerators = true; this->ShowGenerators = true;
} }
@ -559,6 +513,8 @@ bool cmDocumentation::CreateSingleModule(const char* fname,
{ {
if(line.size() && line[0] == '#') if(line.size() && line[0] == '#')
{ {
/* line beginnings with ## are mark-up ignore them */
if (line.size()>=2 && line[1] == '#') continue;
// blank line // blank line
if(line.size() <= 2) if(line.size() <= 2)
{ {
@ -709,6 +665,423 @@ cmDocumentation::Form cmDocumentation::GetFormFromFilename(
return cmDocumentation::TextForm; return cmDocumentation::TextForm;
} }
//----------------------------------------------------------------------------
void cmDocumentation::addCommonStandardDocSections()
{
cmDocumentationSection *sec;
sec = new cmDocumentationSection("Author","AUTHOR");
sec->Append(cmDocumentationEntry
(0,
"This manual page was generated by the \"--help-man\" option.",
0));
this->AllSections["Author"] = sec;
sec = new cmDocumentationSection("Copyright","COPYRIGHT");
sec->Append(cmDocumentationCopyright);
this->AllSections["Copyright"] = sec;
sec = new cmDocumentationSection("See Also","SEE ALSO");
sec->Append(cmDocumentationStandardSeeAlso);
this->AllSections["Standard See Also"] = sec;
sec = new cmDocumentationSection("Options","OPTIONS");
sec->Append(cmDocumentationStandardOptions);
this->AllSections["Options"] = sec;
sec = new cmDocumentationSection("Compatibility Commands",
"COMPATIBILITY COMMANDS");
sec->Append(cmCompatCommandsDocumentationDescription);
this->AllSections["Compatibility Commands"] = sec;
}
//----------------------------------------------------------------------------
void cmDocumentation::addCMakeStandardDocSections()
{
cmDocumentationSection *sec;
sec = new cmDocumentationSection("Properties","PROPERTIES");
sec->Append(cmPropertiesDocumentationDescription);
this->AllSections["Properties Description"] = sec;
sec = new cmDocumentationSection("Generators","GENERATORS");
sec->Append(cmDocumentationGeneratorsHeader);
this->AllSections["Generators"] = sec;
this->PropertySections.push_back("Properties of Global Scope");
this->PropertySections.push_back("Properties on Directories");
this->PropertySections.push_back("Properties on Targets");
this->PropertySections.push_back("Properties on Tests");
this->PropertySections.push_back("Properties on Source Files");
this->PropertySections.push_back("Properties on Cache Entries");
this->VariableSections.push_back("Variables that Provide Information");
this->VariableSections.push_back("Variables That Change Behavior");
this->VariableSections.push_back("Variables That Describe the System");
this->VariableSections.push_back("Variables that Control the Build");
this->VariableSections.push_back("Variables for Languages");
}
//----------------------------------------------------------------------------
void cmDocumentation::addCTestStandardDocSections()
{
// This is currently done for backward compatibility reason
// We may suppress some of these.
addCMakeStandardDocSections();
}
//----------------------------------------------------------------------------
void cmDocumentation::addCPackStandardDocSections()
{
cmDocumentationSection *sec;
sec = new cmDocumentationSection("Generators","GENERATORS");
sec->Append(cmDocumentationGeneratorsHeader);
this->AllSections["Generators"] = sec;
this->VariableSections.push_back(
"Variables common to all CPack generators");
}
void cmDocumentation::addAutomaticVariableSections(const std::string& section)
{
std::vector<std::string>::iterator it;
it = std::find(this->VariableSections.begin(),
this->VariableSections.end(),
section);
/* if the section does not exist then add it */
if (it==this->VariableSections.end())
{
this->VariableSections.push_back(section);
}
}
//----------------------------------------------------------------------------
int cmDocumentation::getDocumentedModulesListInDir(
std::string path,
std::string globExpr,
documentedModulesList_t& docedModuleList)
{
cmsys::Glob gl;
std::string findExpr;
std::vector<std::string> files;
std::string line;
documentedModuleSectionPair_t docPair;
int nbDocumentedModules = 0;
findExpr = path + "/" + globExpr;
if (gl.FindFiles(findExpr))
{
files = gl.GetFiles();
for (std::vector<std::string>::iterator itf=files.begin();
itf!=files.end();++itf)
{
std::ifstream fin((*itf).c_str());
// file access trouble ignore it (ignore this kind of error)
if (!fin) continue;
/* read first line in order to get doc section */
if (cmSystemTools::GetLineFromStream(fin, line))
{
/* Doc section indicates that
* this file has structured doc in it.
*/
if (line.find("##section")!=std::string::npos)
{
// ok found one more documented module
++nbDocumentedModules;
docPair.first = *itf;
// 10 is the size of '##section' + 1
docPair.second = line.substr(10,std::string::npos);
docedModuleList.push_back(docPair);
}
// No else if no section is found (undocumented module)
}
// No else cannot read first line (ignore this kind of error)
line = "";
}
}
if (nbDocumentedModules>0)
{
return 0;
}
else
{
return 1;
}
}
//----------------------------------------------------------------------------
static void trim(std::string& s)
{
std::string::size_type pos = s.find_last_not_of(' ');
if(pos != std::string::npos)
{
s.erase(pos + 1);
pos = s.find_first_not_of(' ');
if(pos != std::string::npos) s.erase(0, pos);
}
else
{
s.erase(s.begin(), s.end());
}
}
int cmDocumentation::GetStructuredDocFromFile(
const char* fname,
std::vector<cmDocumentationEntry>& commands,
cmake* cm)
{
typedef enum sdoce {
SDOC_NONE, SDOC_MODULE, SDOC_MACRO, SDOC_FUNCTION, SDOC_VARIABLE,
SDOC_SECTION,
SDOC_UNKNOWN} sdoc_t;
int nbDocItemFound = 0;
int docCtxIdx = 0;
std::vector<int> docContextStack(60);
docContextStack[docCtxIdx]=SDOC_NONE;
cmDocumentationEntry e;
std::ifstream fin(fname);
if(!fin)
{
return nbDocItemFound;
}
std::string section;
std::string name;
std::string full;
std::string brief;
std::string line;
bool newCtx = false; /* we've just entered ##<beginkey> context */
bool inBrief = false; /* we are currently parsing brief desc. */
bool inFullFirstParagraph = false; /* we are currently parsing full
desc. first paragraph */
brief = "";
full = "";
bool newParagraph = true;
while ( fin && cmSystemTools::GetLineFromStream(fin, line) )
{
if(line.size() && line[0] == '#')
{
/* handle structured doc context */
if ((line.size()>=2) && line[1]=='#')
{
/* markup word is following '##' stopping at first space
* Some markup word like 'section' may have more characters
* following but we don't handle those here.
*/
std::string mkword = line.substr(2,line.find(' ',2)-2);
if (mkword=="macro")
{
docCtxIdx++;
docContextStack[docCtxIdx]=SDOC_MACRO;
newCtx = true;
}
else if (mkword=="variable")
{
docCtxIdx++;
docContextStack[docCtxIdx]=SDOC_VARIABLE;
newCtx = true;
}
else if (mkword=="function")
{
docCtxIdx++;
docContextStack[docCtxIdx]=SDOC_FUNCTION;
newCtx = true;
}
else if (mkword=="module")
{
docCtxIdx++;
docContextStack[docCtxIdx]=SDOC_MODULE;
newCtx = true;
}
else if (mkword=="section")
{
docCtxIdx++;
docContextStack[docCtxIdx]=SDOC_SECTION;
// 10 is the size of '##section' + 1
section = line.substr(10,std::string::npos);
/* drop the rest of the line */
line = "";
newCtx = true;
}
else if (mkword.substr(0,3)=="end")
{
switch (docContextStack[docCtxIdx]) {
case SDOC_MACRO:
/* for now MACRO and FUNCTION are handled in the same way */
case SDOC_FUNCTION:
commands.push_back(cmDocumentationEntry(name.c_str(),
brief.c_str(),full.c_str()));
break;
case SDOC_VARIABLE:
this->addAutomaticVariableSections(section);
cm->DefineProperty
(name.c_str(), cmProperty::VARIABLE,
brief.c_str(),
full.c_str(),false,
section.c_str());
break;
case SDOC_MODULE:
/* not implemented */
break;
case SDOC_SECTION:
/* not implemented */
break;
default:
/* ignore other cases */
break;
}
docCtxIdx--;
newCtx = false;
++nbDocItemFound;
}
else
{
// error out unhandled context
return nbDocItemFound;
}
/* context is set go to next doc line */
continue;
}
// Now parse the text attached to the context
// The first line after the context mark-up contains::
// name - brief until. (brief is dot terminated or
// followed by a blank line)
if (newCtx)
{
// no brief (for easy variable definition)
if (line.find("-")==std::string::npos)
{
name = line.substr(1,std::string::npos);
trim(name);
brief = "";
inBrief = false;
full = "";
}
// here we have a name and brief beginning
else
{
name = line.substr(1,line.find("-")-1);
trim(name);
// we are parsing the brief context
brief = line.substr(line.find("-")+1,std::string::npos);
trim(brief);
// Brief may already be terminated on the first line
if (brief.find('.')!=std::string::npos)
{
inBrief = false;
full = brief.substr(brief.find('.')+1,std::string::npos);
trim(full);
inFullFirstParagraph = true;
brief = brief.substr(0,brief.find('.'));
}
// brief is continued on following lines
else
{
inBrief = true;
full = "";
}
}
newCtx = false;
continue;
}
// blank line
if(line.size() <= 2)
{
if (inBrief) {
inBrief = false;
full = "";
} else {
if (full.length()>0)
{
full += "\n";
}
// the first paragraph of full has ended
inFullFirstParagraph = false;
}
newParagraph = true;
}
// brief is terminated by '.'
else if (inBrief && (line.find('.')!=std::string::npos))
{
/* the brief just ended */
inBrief = false;
std::string endBrief = line.substr(1,line.find('.'));
trim(endBrief);
trim(brief);
brief += " " + endBrief;
full += line.substr(line.find('.')+1,std::string::npos);
trim(full);
inFullFirstParagraph = true;
}
// we handle full text or multi-line brief.
else
{
std::string* text;
if (inBrief)
{
text = &brief;
}
else
{
text = &full;
}
// two spaces
if(line[1] == ' ' && line[2] == ' ')
{
// there is no "full first paragraph at all."
if (line[3] == ' ')
{
inFullFirstParagraph = false;
}
if(!newParagraph && !inFullFirstParagraph)
{
*text += "\n";
newParagraph = true;
}
// Skip #, and leave space for pre-formatted
if (inFullFirstParagraph)
{
std::string temp = line.c_str()+1;
trim(temp);
*text += " " + temp;
}
else
{
*text += line.c_str()+1;
*text += "\n";
}
}
else if(line[1] == ' ')
{
if(!newParagraph)
{
*text += " ";
}
newParagraph = false;
// skip # and space
*text += line.c_str()+2;
}
else
{
if(!newParagraph)
{
*text += " ";
}
newParagraph = false;
// skip #
*text += line.c_str()+1;
}
}
}
/* next line is not the first context line */
newCtx = false;
}
return nbDocItemFound;
}
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmDocumentation::CheckOptions(int argc, const char* const* argv, bool cmDocumentation::CheckOptions(int argc, const char* const* argv,
const char* exitOpt) const char* exitOpt)

View File

@ -21,6 +21,7 @@
#include "cmDocumentationFormatterText.h" #include "cmDocumentationFormatterText.h"
#include "cmDocumentationFormatterUsage.h" #include "cmDocumentationFormatterUsage.h"
#include "cmDocumentationSection.h" #include "cmDocumentationSection.h"
#include "cmake.h"
namespace cmsys namespace cmsys
{ {
@ -34,6 +35,21 @@ public:
cmDocumentation(); cmDocumentation();
~cmDocumentation(); ~cmDocumentation();
/**
* An helper type pair for [structured] documented modules.
* The comment of those module contains structure markup
* which makes it possible to retrieve the documentation
* of variables, macros and functions defined in the module.
* - first is the filename of the module
* - second is the section of the doc the module belongs too
*/
typedef std::pair<std::string,std::string> documentedModuleSectionPair_t;
/**
* A list of documented module(s).
*/
typedef std::list<documentedModuleSectionPair_t> documentedModulesList_t;
// High-level interface for standard documents: // High-level interface for standard documents:
/** /**
@ -119,6 +135,60 @@ public:
static Form GetFormFromFilename(const std::string& filename); static Form GetFormFromFilename(const std::string& filename);
/** Add common (to all tools) documentation section(s) */
void addCommonStandardDocSections();
/** Add the CMake standard documentation section(s) */
void addCMakeStandardDocSections();
/** Add the CTest standard documentation section(s) */
void addCTestStandardDocSections();
/** Add the CPack standard documentation section(s) */
void addCPackStandardDocSections();
/** Add automatic variables sections */
void addAutomaticVariableSections(const std::string& section);
/**
* Retrieve the list of documented module located in
* path which match the globing expression globExpr.
* @param[in] path, directory where to start the search
* we will recurse into it.
* @param[in] globExpr, the globing expression used to
* match the file in path.
* @param[out] the list of obtained pairs (may be empty)
* @return 0 on success 1 on error or empty list
*/
int getDocumentedModulesListInDir(
std::string path,
std::string globExpr,
documentedModulesList_t& docModuleList);
/**
* Get the documentation of macros, functions and variable documented
* with CMake structured documentation in a CMake script.
* (in fact it may be in any file which follow the structured doc format)
* Structured documentation begin with
* ## (double sharp) in column 1 & 2 immediately followed
* by a markup. Those ## are ignored by the legacy module
* documentation parser @see CreateSingleModule.
* Current markup are ##section, ##module,
* ##macro, ##function, ##variable and ##end.
* ##end is closing either of the previous ones.
* @param[in] fname the script file name to be parsed for documentation
* @param[in,out] commands the vector of command/macros documentation
* entry found in the script file.
* @param[in,out] the cmake object instance to which variable documentation
* will be attached (using @see cmake::DefineProperty)
* @param[in] the documentation section in which the property will be
* inserted.
* @return the number of documented items (command and variable)
* found in the file.
*/
int GetStructuredDocFromFile(const char* fname,
std::vector<cmDocumentationEntry>& commands,
cmake* cm);
private: private:
void SetForm(Form f); void SetForm(Form f);
void SetDocName(const char* docname); void SetDocName(const char* docname);

View File

@ -600,16 +600,17 @@ void cmExtraCodeBlocksGenerator::AppendTarget(cmGeneratedFileStream& fout,
// the include directories for this target // the include directories for this target
std::set<std::string> uniqIncludeDirs; std::set<std::string> uniqIncludeDirs;
const std::vector<std::string>& incDirs =
target->GetMakefile()->GetIncludeDirectories(); std::vector<std::string> includes;
for(std::vector<std::string>::const_iterator dirIt=incDirs.begin(); target->GetMakefile()->GetLocalGenerator()->
dirIt != incDirs.end(); GetIncludeDirectories(includes, target);
for(std::vector<std::string>::const_iterator dirIt=includes.begin();
dirIt != includes.end();
++dirIt) ++dirIt)
{ {
uniqIncludeDirs.insert(*dirIt); uniqIncludeDirs.insert(*dirIt);
} }
std::string systemIncludeDirs = makefile->GetSafeDefinition( std::string systemIncludeDirs = makefile->GetSafeDefinition(
"CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS"); "CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS");
if (!systemIncludeDirs.empty()) if (!systemIncludeDirs.empty())

View File

@ -893,9 +893,13 @@ void cmExtraEclipseCDT4Generator::CreateCProjectFile() const
it != this->GlobalGenerator->GetLocalGenerators().end(); it != this->GlobalGenerator->GetLocalGenerators().end();
++it) ++it)
{ {
const std::vector<std::string>& includeDirs cmTargets & targets = (*it)->GetMakefile()->GetTargets();
= (*it)->GetMakefile()->GetIncludeDirectories(); for (cmTargets::iterator l = targets.begin(); l != targets.end(); ++l)
this->AppendIncludeDirectories(fout, includeDirs, emmited); {
std::vector<std::string> includeDirs;
(*it)->GetIncludeDirectories(includeDirs, &l->second);
this->AppendIncludeDirectories(fout, includeDirs, emmited);
}
} }
// now also the system include directories, in case we found them in // now also the system include directories, in case we found them in
// CMakeSystemSpecificInformation.cmake. This makes Eclipse find the // CMakeSystemSpecificInformation.cmake. This makes Eclipse find the

View File

@ -354,13 +354,23 @@ void cmFindLibraryHelper::RegexFromList(std::string& out,
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
bool cmFindLibraryHelper::HasValidSuffix(std::string const& name) bool cmFindLibraryHelper::HasValidSuffix(std::string const& name)
{ {
// Check if the given name ends in a valid library suffix.
for(std::vector<std::string>::const_iterator si = this->Suffixes.begin(); for(std::vector<std::string>::const_iterator si = this->Suffixes.begin();
si != this->Suffixes.end(); ++si) si != this->Suffixes.end(); ++si)
{ {
std::string const& suffix = *si; std::string suffix = *si;
if(name.length() > suffix.length() && if(name.length() <= suffix.length())
name.substr(name.size()-suffix.length()) == suffix) {
continue;
}
// Check if the given name ends in a valid library suffix.
if(name.substr(name.size()-suffix.length()) == suffix)
{
return true;
}
// Check if a valid library suffix is somewhere in the name,
// this may happen e.g. for versioned shared libraries: libfoo.so.2
suffix += ".";
if(name.find(suffix) != name.npos)
{ {
return true; return true;
} }

View File

@ -1226,6 +1226,15 @@ void cmFindPackageCommand::AppendSuccessInformation()
} }
this->Makefile->GetCMakeInstance()->SetProperty(versionInfoPropName.c_str(), this->Makefile->GetCMakeInstance()->SetProperty(versionInfoPropName.c_str(),
versionInfo.c_str()); versionInfo.c_str());
if (this->Required)
{
std::string requiredInfoPropName = "_CMAKE_";
requiredInfoPropName += this->Name;
requiredInfoPropName += "_TYPE";
this->Makefile->GetCMakeInstance()->SetProperty(
requiredInfoPropName.c_str(), "REQUIRED");
}
// Restore original state of "_FIND_" variables we set. // Restore original state of "_FIND_" variables we set.
this->RestoreFindDefinitions(); this->RestoreFindDefinitions();

View File

@ -22,6 +22,17 @@ public:
///! clean up any memory allocated by the function ///! clean up any memory allocated by the function
~cmFunctionHelperCommand() {}; ~cmFunctionHelperCommand() {};
/**
* This is used to avoid including this command
* in documentation. This is mainly used by
* cmMacroHelperCommand and cmFunctionHelperCommand
* which cannot provide appropriate documentation.
*/
virtual bool ShouldAppearInDocumentation()
{
return false;
}
/** /**
* This is a virtual constructor for the command. * This is a virtual constructor for the command.
*/ */

View File

@ -1067,9 +1067,9 @@ void cmGlobalGenerator::CheckLocalGenerators()
{ {
manager = this->LocalGenerators[i]->GetMakefile()->GetCacheManager(); manager = this->LocalGenerators[i]->GetMakefile()->GetCacheManager();
this->LocalGenerators[i]->ConfigureFinalPass(); this->LocalGenerators[i]->ConfigureFinalPass();
const cmTargets & targets = cmTargets & targets =
this->LocalGenerators[i]->GetMakefile()->GetTargets(); this->LocalGenerators[i]->GetMakefile()->GetTargets();
for (cmTargets::const_iterator l = targets.begin(); for (cmTargets::iterator l = targets.begin();
l != targets.end(); l++) l != targets.end(); l++)
{ {
const cmTarget::LinkLibraryVectorType& libs = const cmTarget::LinkLibraryVectorType& libs =
@ -1095,27 +1095,28 @@ void cmGlobalGenerator::CheckLocalGenerators()
notFoundMap[varName] = text; notFoundMap[varName] = text;
} }
} }
} std::vector<std::string> incs;
const std::vector<std::string>& incs = this->LocalGenerators[i]->GetIncludeDirectories(incs, &l->second);
this->LocalGenerators[i]->GetMakefile()->GetIncludeDirectories();
for( std::vector<std::string>::const_iterator incDir = incs.begin(); for( std::vector<std::string>::const_iterator incDir = incs.begin();
incDir != incs.end(); ++incDir) incDir != incs.end(); ++incDir)
{
if(incDir->size() > 9 &&
cmSystemTools::IsNOTFOUND(incDir->c_str()))
{ {
std::string varName = incDir->substr(0, incDir->size()-9); if(incDir->size() > 9 &&
cmCacheManager::CacheIterator it = cmSystemTools::IsNOTFOUND(incDir->c_str()))
manager->GetCacheIterator(varName.c_str());
if(it.GetPropertyAsBool("ADVANCED"))
{ {
varName += " (ADVANCED)"; std::string varName = incDir->substr(0, incDir->size()-9);
cmCacheManager::CacheIterator it =
manager->GetCacheIterator(varName.c_str());
if(it.GetPropertyAsBool("ADVANCED"))
{
varName += " (ADVANCED)";
}
std::string text = notFoundMap[varName];
text += "\n used as include directory in directory ";
text += this->LocalGenerators[i]
->GetMakefile()->GetCurrentDirectory();
notFoundMap[varName] = text;
} }
std::string text = notFoundMap[varName];
text += "\n used as include directory in directory ";
text += this->LocalGenerators[i]->GetMakefile()->GetCurrentDirectory();
notFoundMap[varName] = text;
} }
} }
this->CMakeInstance->UpdateProgress this->CMakeInstance->UpdateProgress

View File

@ -1811,7 +1811,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
BuildObjectListOrString dirs(this, this->XcodeVersion >= 30); BuildObjectListOrString dirs(this, this->XcodeVersion >= 30);
BuildObjectListOrString fdirs(this, this->XcodeVersion >= 30); BuildObjectListOrString fdirs(this, this->XcodeVersion >= 30);
std::vector<std::string> includes; std::vector<std::string> includes;
this->CurrentLocalGenerator->GetIncludeDirectories(includes); this->CurrentLocalGenerator->GetIncludeDirectories(includes, &target);
std::set<cmStdString> emitted; std::set<cmStdString> emitted;
emitted.insert("/System/Library/Frameworks"); emitted.insert("/System/Library/Frameworks");
for(std::vector<std::string>::iterator i = includes.begin(); for(std::vector<std::string>::iterator i = includes.begin();

View File

@ -58,13 +58,21 @@ public:
{ {
return return
" include_directories([AFTER|BEFORE] [SYSTEM] dir1 dir2 ...)\n" " include_directories([AFTER|BEFORE] [SYSTEM] dir1 dir2 ...)\n"
"Add the given directories to those searched by the compiler for " "Add the given directories to those the compiler uses to search "
"include files. By default the directories are appended onto " "for include files. "
"the current list of directories. This default behavior can be " "These directories are added to the directory property "
"changed by setting CMAKE_INCLUDE_DIRECTORIES_BEFORE to ON. " "INCLUDE_DIRECTORIES for the current CMakeLists file. "
"By using BEFORE or AFTER you can select between appending and " "They are also added to the target property INCLUDE_DIRECTORIES "
"prepending, independent from the default. " "for each target in the current CMakeLists file. "
"If the SYSTEM option is given the compiler will be told that the " "The target property values are the ones used by the generators."
"\n"
"By default the directories are appended onto the current list of "
"directories. "
"This default behavior can be changed by setting "
"CMAKE_INCLUDE_DIRECTORIES_BEFORE to ON. "
"By using AFTER or BEFORE explicitly, you can select between "
"appending and prepending, independent of the default. "
"If the SYSTEM option is given, the compiler will be told the "
"directories are meant as system include directories on some " "directories are meant as system include directories on some "
"platforms."; "platforms.";
} }

View File

@ -556,7 +556,7 @@ void cmLocalGenerator::GenerateTargetManifest()
void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname, void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
const char* lang, const char* lang,
cmSourceFile& source, cmSourceFile& source,
cmTarget& ) cmTarget& target)
{ {
std::string objectDir = cmSystemTools::GetFilenamePath(std::string(ofname)); std::string objectDir = cmSystemTools::GetFilenamePath(std::string(ofname));
objectDir = this->Convert(objectDir.c_str(),START_OUTPUT,SHELL); objectDir = this->Convert(objectDir.c_str(),START_OUTPUT,SHELL);
@ -574,7 +574,11 @@ void cmLocalGenerator::AddCustomCommandToCreateObject(const char* ofname,
std::string flags; std::string flags;
flags += this->Makefile->GetSafeDefinition(varString.c_str()); flags += this->Makefile->GetSafeDefinition(varString.c_str());
flags += " "; flags += " ";
flags += this->GetIncludeFlags(lang); {
std::vector<std::string> includes;
this->GetIncludeDirectories(includes, &target, lang);
flags += this->GetIncludeFlags(includes, lang);
}
flags += this->Makefile->GetDefineFlags(); flags += this->Makefile->GetDefineFlags();
// Construct the command lines. // Construct the command lines.
@ -1192,24 +1196,16 @@ cmLocalGenerator::ConvertToIncludeReference(std::string const& path)
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
const char* cmLocalGenerator::GetIncludeFlags(const char* lang, std::string cmLocalGenerator::GetIncludeFlags(
bool forResponseFile) const std::vector<std::string> &includes,
const char* lang, bool forResponseFile)
{ {
if(!lang) if(!lang)
{ {
return ""; return "";
} }
std::string key = lang;
key += forResponseFile? "@" : "";
if(this->LanguageToIncludeFlags.count(key))
{
return this->LanguageToIncludeFlags[key].c_str();
}
cmOStringStream includeFlags; cmOStringStream includeFlags;
std::vector<std::string> includes;
this->GetIncludeDirectories(includes, lang);
std::vector<std::string>::iterator i;
std::string flagVar = "CMAKE_INCLUDE_FLAG_"; std::string flagVar = "CMAKE_INCLUDE_FLAG_";
flagVar += lang; flagVar += lang;
@ -1251,6 +1247,7 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang,
#ifdef __APPLE__ #ifdef __APPLE__
emitted.insert("/System/Library/Frameworks"); emitted.insert("/System/Library/Frameworks");
#endif #endif
std::vector<std::string>::const_iterator i;
for(i = includes.begin(); i != includes.end(); ++i) for(i = includes.begin(); i != includes.end(); ++i)
{ {
if(this->Makefile->IsOn("APPLE") if(this->Makefile->IsOn("APPLE")
@ -1311,16 +1308,12 @@ const char* cmLocalGenerator::GetIncludeFlags(const char* lang,
{ {
flags[flags.size()-1] = ' '; flags[flags.size()-1] = ' ';
} }
this->LanguageToIncludeFlags[key] = flags; return flags;
// Use this temorary variable for the return value to work-around a
// bogus GCC 2.95 warning.
const char* ret = this->LanguageToIncludeFlags[key].c_str();
return ret;
} }
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs, void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
cmTarget* target,
const char* lang) const char* lang)
{ {
// Need to decide whether to automatically include the source and // Need to decide whether to automatically include the source and
@ -1375,8 +1368,12 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
// Store the automatic include paths. // Store the automatic include paths.
if(includeBinaryDir) if(includeBinaryDir)
{ {
dirs.push_back(this->Makefile->GetStartOutputDirectory()); if(emitted.find(
emitted.insert(this->Makefile->GetStartOutputDirectory()); this->Makefile->GetStartOutputDirectory()) == emitted.end())
{
dirs.push_back(this->Makefile->GetStartOutputDirectory());
emitted.insert(this->Makefile->GetStartOutputDirectory());
}
} }
if(includeSourceDir) if(includeSourceDir)
{ {
@ -1402,9 +1399,12 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
} }
} }
// Get the project-specified include directories. // Get the target-specific include directories.
std::vector<std::string>& includes = std::vector<std::string> includes;
this->Makefile->GetIncludeDirectories(); if(target)
{
includes = target->GetIncludeDirectories();
}
// Support putting all the in-project include directories first if // Support putting all the in-project include directories first if
// it is requested by the project. // it is requested by the project.
@ -1412,7 +1412,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
{ {
const char* topSourceDir = this->Makefile->GetHomeDirectory(); const char* topSourceDir = this->Makefile->GetHomeDirectory();
const char* topBinaryDir = this->Makefile->GetHomeOutputDirectory(); const char* topBinaryDir = this->Makefile->GetHomeOutputDirectory();
for(std::vector<std::string>::iterator i = includes.begin(); for(std::vector<std::string>::const_iterator i = includes.begin();
i != includes.end(); ++i) i != includes.end(); ++i)
{ {
// Emit this directory only if it is a subdirectory of the // Emit this directory only if it is a subdirectory of the
@ -1431,7 +1431,7 @@ void cmLocalGenerator::GetIncludeDirectories(std::vector<std::string>& dirs,
} }
// Construct the final ordered include directory list. // Construct the final ordered include directory list.
for(std::vector<std::string>::iterator i = includes.begin(); for(std::vector<std::string>::const_iterator i = includes.begin();
i != includes.end(); ++i) i != includes.end(); ++i)
{ {
if(emitted.insert(*i).second) if(emitted.insert(*i).second)

View File

@ -146,8 +146,8 @@ public:
///! Append flags to a string. ///! Append flags to a string.
virtual void AppendFlags(std::string& flags, const char* newFlags); virtual void AppendFlags(std::string& flags, const char* newFlags);
///! Get the include flags for the current makefile and language ///! Get the include flags for the current makefile and language
const char* GetIncludeFlags(const char* lang, std::string GetIncludeFlags(const std::vector<std::string> &includes,
bool forResponseFile = false); const char* lang, bool forResponseFile = false);
/** /**
* Encode a list of preprocessor definitions for the compiler * Encode a list of preprocessor definitions for the compiler
@ -195,6 +195,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,
cmTarget* target,
const char* lang = "C"); const char* lang = "C");
/** Compute the language used to compile the given source file. */ /** Compute the language used to compile the given source file. */
@ -392,7 +393,6 @@ protected:
std::vector<std::string> StartOutputDirectoryComponents; std::vector<std::string> StartOutputDirectoryComponents;
cmLocalGenerator* Parent; cmLocalGenerator* Parent;
std::vector<cmLocalGenerator*> Children; std::vector<cmLocalGenerator*> Children;
std::map<cmStdString, cmStdString> LanguageToIncludeFlags;
std::map<cmStdString, cmStdString> UniqueObjectNamesMap; std::map<cmStdString, cmStdString> UniqueObjectNamesMap;
std::string::size_type ObjectPathMax; std::string::size_type ObjectPathMax;
std::set<cmStdString> ObjectMaxPathViolations; std::set<cmStdString> ObjectMaxPathViolations;

View File

@ -452,28 +452,6 @@ void cmLocalUnixMakefileGenerator3::WriteDirectoryInformationFile()
<< "\n"; << "\n";
} }
// Store the include search path for this directory.
infoFileStream
<< "# The C and CXX include file search paths:\n";
infoFileStream
<< "SET(CMAKE_C_INCLUDE_PATH\n";
std::vector<std::string> includeDirs;
this->GetIncludeDirectories(includeDirs);
for(std::vector<std::string>::iterator i = includeDirs.begin();
i != includeDirs.end(); ++i)
{
infoFileStream
<< " \"" << this->Convert(i->c_str(),HOME_OUTPUT).c_str() << "\"\n";
}
infoFileStream
<< " )\n";
infoFileStream
<< "SET(CMAKE_CXX_INCLUDE_PATH ${CMAKE_C_INCLUDE_PATH})\n";
infoFileStream
<< "SET(CMAKE_Fortran_INCLUDE_PATH ${CMAKE_C_INCLUDE_PATH})\n";
infoFileStream
<< "SET(CMAKE_ASM_INCLUDE_PATH ${CMAKE_C_INCLUDE_PATH})\n";
// Store the include regular expressions for this directory. // Store the include regular expressions for this directory.
infoFileStream infoFileStream
<< "\n" << "\n"
@ -562,6 +540,21 @@ cmLocalUnixMakefileGenerator3
space = " "; space = " ";
} }
// Warn about paths not supported by Make tools.
std::string::size_type pos = tgt.find_first_of("=");
if(pos != std::string::npos)
{
cmOStringStream m;
m <<
"Make rule for\n"
" " << tgt << "\n"
"has '=' on left hand side. "
"The make tool may not support this.";
cmListFileBacktrace bt;
this->GlobalGenerator->GetCMakeInstance()
->IssueMessage(cmake::WARNING, m.str(), bt);
}
// Mark the rule as symbolic if requested. // Mark the rule as symbolic if requested.
if(symbolic) if(symbolic)
{ {

View File

@ -103,49 +103,6 @@ void cmLocalVisualStudio6Generator::OutputDSPFile()
} }
} }
// Setup /I and /LIBPATH options for the resulting DSP file. VS 6
// truncates long include paths so make it as short as possible if
// the length threatens this problem.
unsigned int maxIncludeLength = 3000;
bool useShortPath = false;
for(int j=0; j < 2; ++j)
{
std::vector<std::string> includes;
this->GetIncludeDirectories(includes);
std::vector<std::string>::iterator i;
for(i = includes.begin(); i != includes.end(); ++i)
{
std::string tmp =
this->ConvertToOptionallyRelativeOutputPath(i->c_str());
if(useShortPath)
{
cmSystemTools::GetShortPath(tmp.c_str(), tmp);
}
this->IncludeOptions += " /I ";
// quote if not already quoted
if (tmp[0] != '"')
{
this->IncludeOptions += "\"";
this->IncludeOptions += tmp;
this->IncludeOptions += "\"";
}
else
{
this->IncludeOptions += tmp;
}
}
if(j == 0 && this->IncludeOptions.size() > maxIncludeLength)
{
this->IncludeOptions = "";
useShortPath = true;
}
else
{
break;
}
}
// Create the DSP or set of DSP's for libraries and executables // Create the DSP or set of DSP's for libraries and executables
cmTargets &tgts = this->Makefile->GetTargets(); cmTargets &tgts = this->Makefile->GetTargets();
@ -895,6 +852,61 @@ inline std::string removeQuotes(const std::string& s)
return s; return s;
} }
std::string
cmLocalVisualStudio6Generator::GetTargetIncludeOptions(cmTarget &target)
{
std::string includeOptions;
// Setup /I and /LIBPATH options for the resulting DSP file. VS 6
// truncates long include paths so make it as short as possible if
// the length threatens this problem.
unsigned int maxIncludeLength = 3000;
bool useShortPath = false;
for(int j=0; j < 2; ++j)
{
std::vector<std::string> includes;
this->GetIncludeDirectories(includes, &target);
std::vector<std::string>::iterator i;
for(i = includes.begin(); i != includes.end(); ++i)
{
std::string tmp =
this->ConvertToOptionallyRelativeOutputPath(i->c_str());
if(useShortPath)
{
cmSystemTools::GetShortPath(tmp.c_str(), tmp);
}
includeOptions += " /I ";
// quote if not already quoted
if (tmp[0] != '"')
{
includeOptions += "\"";
includeOptions += tmp;
includeOptions += "\"";
}
else
{
includeOptions += tmp;
}
}
if(j == 0 && includeOptions.size() > maxIncludeLength)
{
includeOptions = "";
useShortPath = true;
}
else
{
break;
}
}
return includeOptions;
}
// Code in blocks surrounded by a test for this definition is needed // Code in blocks surrounded by a test for this definition is needed
// only for compatibility with user project's replacement DSP // only for compatibility with user project's replacement DSP
// templates. The CMake templates no longer use them. // templates. The CMake templates no longer use them.
@ -1132,6 +1144,9 @@ void cmLocalVisualStudio6Generator
} }
#endif #endif
// Get include options for this target.
std::string includeOptions = this->GetTargetIncludeOptions(target);
// Get extra linker options for this target type. // Get extra linker options for this target type.
std::string extraLinkOptions; std::string extraLinkOptions;
std::string extraLinkOptionsDebug; std::string extraLinkOptionsDebug;
@ -1510,7 +1525,7 @@ void cmLocalVisualStudio6Generator
optionsRelWithDebInfo.c_str()); optionsRelWithDebInfo.c_str());
cmSystemTools::ReplaceString(line, "BUILD_INCLUDES", cmSystemTools::ReplaceString(line, "BUILD_INCLUDES",
this->IncludeOptions.c_str()); includeOptions.c_str());
cmSystemTools::ReplaceString(line, "TARGET_VERSION_FLAG", cmSystemTools::ReplaceString(line, "TARGET_VERSION_FLAG",
targetVersionFlag.c_str()); targetVersionFlag.c_str());
cmSystemTools::ReplaceString(line, "TARGET_IMPLIB_FLAG_DEBUG", cmSystemTools::ReplaceString(line, "TARGET_IMPLIB_FLAG_DEBUG",

View File

@ -89,7 +89,7 @@ private:
void ComputeLinkOptions(cmTarget& target, const char* configName, void ComputeLinkOptions(cmTarget& target, const char* configName,
const std::string extraOptions, const std::string extraOptions,
std::string& options); std::string& options);
std::string IncludeOptions; std::string GetTargetIncludeOptions(cmTarget &target);
std::vector<std::string> Configurations; std::vector<std::string> Configurations;
std::string GetConfigName(std::string const& configuration) const; std::string GetConfigName(std::string const& configuration) const;

Some files were not shown because too many files have changed in this diff Show More