diff options
Diffstat (limited to 'Modules')
30 files changed, 503 insertions, 139 deletions
diff --git a/Modules/CPack.cmake b/Modules/CPack.cmake index 668a62a..7033e31 100644 --- a/Modules/CPack.cmake +++ b/Modules/CPack.cmake @@ -19,9 +19,41 @@ # described below, for more information about component-specific # installations. # -# Before including the CPack module, there are a variety of variables -# that can be set to customize the resulting installers. The most -# commonly-used variables are: +# The CPACK_GENERATOR variable has different meanings in different +# contexts. In your CMakeLists.txt file, CPACK_GENERATOR is a +# *list of generators*: when run with no other arguments, CPack +# will iterate over that list and produce one package for each +# generator. In a CPACK_PROJECT_CONFIG_FILE, though, CPACK_GENERATOR +# is a *string naming a single generator*. If you need per-cpack- +# generator logic to control *other* cpack settings, then you need +# a CPACK_PROJECT_CONFIG_FILE. +# +# The CMake source tree itself contains a CPACK_PROJECT_CONFIG_FILE. +# See the top level file CMakeCPackOptions.cmake.in for an example. +# +# If set, the CPACK_PROJECT_CONFIG_FILE is included automatically +# on a per-generator basis. It only need contain overrides. +# +# Here's how it works: +# - cpack runs +# - it includes CPackConfig.cmake +# - it iterates over the generators listed in that file's +# CPACK_GENERATOR list variable (unless told to use just a +# specific one via -G on the command line...) +# +# - foreach generator, it then +# - sets CPACK_GENERATOR to the one currently being iterated +# - includes the CPACK_PROJECT_CONFIG_FILE +# - produces the package for that generator +# +# This is the key: For each generator listed in CPACK_GENERATOR +# in CPackConfig.cmake, cpack will *reset* CPACK_GENERATOR +# internally to *the one currently being used* and then include +# the CPACK_PROJECT_CONFIG_FILE. +# +# Before including this CPack module in your CMakeLists.txt file, +# there are a variety of variables that can be set to customize +# the resulting installers. The most commonly-used variables are: # # CPACK_PACKAGE_NAME - The name of the package (or application). If # not specified, defaults to the project name. @@ -48,6 +80,11 @@ # CPACK_PACKAGE_INSTALL_DIRECTORY - Installation directory on the # target system, e.g., "CMake 2.5". # +# CPACK_PROJECT_CONFIG_FILE - File included at cpack time, once per +# generator after setting CPACK_GENERATOR to the actual generator +# being used. Allows per-generator setting of CPACK_* variables at +# cpack time. +# # CPACK_RESOURCE_FILE_LICENSE - License file for the project, which # will typically be displayed to the user (often with an explicit # "Accept" button, for graphical installers) prior to installation. diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index d936190..1a1b168 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -63,7 +63,7 @@ # Currently this module searches for the following version numbers: # 1.33, 1.33.0, 1.33.1, 1.34, 1.34.0, 1.34.1, 1.35, 1.35.0, 1.35.1, # 1.36, 1.36.0, 1.36.1, 1.37, 1.37.0, 1.38, 1.38.0, 1.39, 1.39.0, -# 1.40, 1.40.0, 1.41, 1.41.0 +# 1.40, 1.40.0, 1.41, 1.41.0, 1.42, 1.42.0, 1.43, 1.43.0, 1.44, 1.44.0 # # NOTE: If you add a new major 1.x version in Boost_ADDITIONAL_VERSIONS you should # add both 1.x and 1.x.0 as shown above. Official Boost include directories @@ -297,6 +297,7 @@ else(Boost_FIND_VERSION_EXACT) # The user has not requested an exact version. Among known # versions, find those that are acceptable to the user request. set(_Boost_KNOWN_VERSIONS ${Boost_ADDITIONAL_VERSIONS} + "1.44.0" "1.44" "1.43.0" "1.43" "1.42.0" "1.42" "1.41.0" "1.41" "1.40.0" "1.40" "1.39.0" "1.39" "1.38.0" "1.38" "1.37.0" "1.37" "1.36.1" "1.36.0" "1.36" "1.35.1" "1.35.0" "1.35" "1.34.1" "1.34.0" "1.34" "1.33.1" "1.33.0" "1.33") @@ -555,7 +556,7 @@ ELSE (_boost_IN_CACHE) # Setting some more suffixes for the library SET (Boost_LIB_PREFIX "") - if ( WIN32 AND Boost_USE_STATIC_LIBS ) + if ( WIN32 AND Boost_USE_STATIC_LIBS AND NOT CYGWIN) SET (Boost_LIB_PREFIX "lib") endif() diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 81d082a..d9b9d54 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -497,29 +497,6 @@ endif() # Always set this convenience variable set(CUDA_VERSION_STRING "${CUDA_VERSION}") -# Here we need to determine if the version we found is acceptable. We will -# assume that is unless CUDA_FIND_VERSION_EXACT or CUDA_FIND_VERSION is -# specified. The presence of either of these options checks the version -# string and signals if the version is acceptable or not. -set(_cuda_version_acceptable TRUE) -# -if(CUDA_FIND_VERSION_EXACT AND NOT CUDA_VERSION VERSION_EQUAL CUDA_FIND_VERSION) - set(_cuda_version_acceptable FALSE) -endif() -# -if(CUDA_FIND_VERSION AND CUDA_VERSION VERSION_LESS CUDA_FIND_VERSION) - set(_cuda_version_acceptable FALSE) -endif() -# -if(NOT _cuda_version_acceptable) - set(_cuda_error_message "Requested CUDA version ${CUDA_FIND_VERSION}, but found unacceptable version ${CUDA_VERSION}") - if(CUDA_FIND_REQUIRED) - message("${_cuda_error_message}") - elseif(NOT CUDA_FIND_QUIETLY) - message("${_cuda_error_message}") - endif() -endif() - # CUDA_TOOLKIT_INCLUDE find_path(CUDA_TOOLKIT_INCLUDE device_functions.h # Header included in toolkit @@ -687,12 +664,14 @@ set(CUDA_SDK_ROOT_DIR_INTERNAL "${CUDA_SDK_ROOT_DIR}" CACHE INTERNAL "This is the value of the last time CUDA_SDK_ROOT_DIR was set successfully." FORCE) include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(CUDA DEFAULT_MSG - CUDA_TOOLKIT_ROOT_DIR - CUDA_NVCC_EXECUTABLE - CUDA_INCLUDE_DIRS - CUDA_CUDART_LIBRARY - _cuda_version_acceptable +find_package_handle_standard_args(CUDA + REQUIRED_VARS + CUDA_TOOLKIT_ROOT_DIR + CUDA_NVCC_EXECUTABLE + CUDA_INCLUDE_DIRS + CUDA_CUDART_LIBRARY + VERSION_VAR + CUDA_VERSION ) diff --git a/Modules/FindFLEX.cmake b/Modules/FindFLEX.cmake index f0f4a7b..55b5639 100644 --- a/Modules/FindFLEX.cmake +++ b/Modules/FindFLEX.cmake @@ -6,6 +6,10 @@ # FLEX_VERSION - the version of flex # FLEX_LIBRARIES - The flex libraries # +# The minimum required version of flex can be specified using the +# standard syntax, e.g. FIND_PACKAGE(FLEX 2.5.13) +# +# # If flex is found on the system, the module provides the macro: # FLEX_TARGET(Name FlexInput FlexOutput [COMPILE_FLAGS <string>]) # which creates a custom command to generate the <FlexOutput> file from @@ -136,6 +140,7 @@ IF(FLEX_EXECUTABLE) ENDIF(FLEX_EXECUTABLE) INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLEX DEFAULT_MSG FLEX_EXECUTABLE) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLEX REQUIRED_VARS FLEX_EXECUTABLE + VERSION_VAR FLEX_VERSION) # FindFLEX.cmake ends here diff --git a/Modules/FindGTK2.cmake b/Modules/FindGTK2.cmake index 0769da7..3b99ae2 100644 --- a/Modules/FindGTK2.cmake +++ b/Modules/FindGTK2.cmake @@ -28,6 +28,8 @@ # # GTK2_DEBUG - Enables verbose debugging of the module # GTK2_SKIP_MARK_AS_ADVANCED - Disable marking cache variables as advanced +# GTK2_ADDITIONAL_SUFFIXES - Allows defining additional directories to +# search for include files # #================= # Example Usage: @@ -64,6 +66,15 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) +# Version 1.0 (8/12/2010) +# * Add support for detecting new pangommconfig.h header file +# (Thanks to Sune Vuorela & the Debian Project for the patch) +# * Add support for detecting fontconfig.h header +# * Call find_package(Freetype) since it's required +# * Add support for allowing users to add additional library directories +# via the GTK2_ADDITIONAL_SUFFIXES variable (kind of a future-kludge in +# case the GTK developers change versions on any of the directories in the +# future). # Version 0.8 (1/4/2010) # * Get module working under MacOSX fink by adding /sw/include, /sw/lib # to PATHS and the gobject library @@ -131,7 +142,8 @@ function(_GTK2_FIND_INCLUDE_DIR _var _hdr) endif() set(_relatives - # FIXME + # If these ever change, things will break. + ${GTK2_ADDITIONAL_SUFFIXES} glibmm-2.4 glib-2.0 atk-1.0 @@ -390,6 +402,10 @@ endif() # Find all components # +find_package(Freetype) +list(APPEND GTK2_INCLUDE_DIRS ${FREETYPE_INCLUDE_DIRS}) +list(APPEND GTK2_LIBRARIES ${FREETYPE_LIBRARIES}) + foreach(_GTK2_component ${GTK2_FIND_COMPONENTS}) if(_GTK2_component STREQUAL "gtk") _GTK2_FIND_INCLUDE_DIR(GTK2_GLIB_INCLUDE_DIR glib.h) @@ -401,16 +417,21 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS}) _GTK2_FIND_INCLUDE_DIR(GTK2_GDK_INCLUDE_DIR gdk/gdk.h) _GTK2_FIND_INCLUDE_DIR(GTK2_GDKCONFIG_INCLUDE_DIR gdkconfig.h) - _GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-x11 false true) - _GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-win32 false true) - _GTK2_FIND_INCLUDE_DIR(GTK2_GTK_INCLUDE_DIR gtk/gtk.h) - _GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-x11 false true) - _GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-win32 false true) + + if(UNIX) + _GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-x11 false true) + _GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-x11 false true) + else() + _GTK2_FIND_LIBRARY (GTK2_GDK_LIBRARY gdk-win32 false true) + _GTK2_FIND_LIBRARY (GTK2_GTK_LIBRARY gtk-win32 false true) + endif() _GTK2_FIND_INCLUDE_DIR(GTK2_CAIRO_INCLUDE_DIR cairo.h) _GTK2_FIND_LIBRARY (GTK2_CAIRO_LIBRARY cairo false false) + _GTK2_FIND_INCLUDE_DIR(GTK2_FONTCONFIG_INCLUDE_DIR fontconfig/fontconfig.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_PANGO_INCLUDE_DIR pango/pango.h) _GTK2_FIND_LIBRARY (GTK2_PANGO_LIBRARY pango false true) @@ -439,6 +460,7 @@ foreach(_GTK2_component ${GTK2_FIND_COMPONENTS}) _GTK2_FIND_LIBRARY (GTK2_CAIROMM_LIBRARY cairomm true true) _GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMM_INCLUDE_DIR pangomm.h) + _GTK2_FIND_INCLUDE_DIR(GTK2_PANGOMMCONFIG_INCLUDE_DIR pangommconfig.h) _GTK2_FIND_LIBRARY (GTK2_PANGOMM_LIBRARY pangomm true true) _GTK2_FIND_INCLUDE_DIR(GTK2_SIGC++_INCLUDE_DIR sigc++/sigc++.h) diff --git a/Modules/FindJava.cmake b/Modules/FindJava.cmake index eeb4778..1599433 100644 --- a/Modules/FindJava.cmake +++ b/Modules/FindJava.cmake @@ -13,6 +13,9 @@ # Java_VERSION_TWEAK = The tweak version of the package found (after '_') # Java_VERSION = This is set to: $major.$minor.$patch(.$tweak) # +# The minimum required version of Java can be specified using the +# standard CMake syntax, e.g. FIND_PACKAGE(Java 1.5) +# # NOTE: ${Java_VERSION} and ${Java_VERSION_STRING} are not guaranteed to be # identical. For example some java version may return: # Java_VERSION_STRING = 1.5.0_17 @@ -83,7 +86,6 @@ FIND_PROGRAM(Java_JAVA_EXECUTABLE ) IF(Java_JAVA_EXECUTABLE) - set(_java_version_acceptable TRUE) EXECUTE_PROCESS(COMMAND ${Java_JAVA_EXECUTABLE} -version RESULT_VARIABLE res OUTPUT_VARIABLE var @@ -114,7 +116,6 @@ IF(Java_JAVA_EXECUTABLE) ELSE() IF(NOT Java_FIND_QUIETLY) message(WARNING "regex not supported: ${var}. Please report") - set(_java_version_acceptable FALSE) ENDIF(NOT Java_FIND_QUIETLY) ENDIF() STRING( REGEX REPLACE "([0-9]+).*" "\\1" Java_VERSION_MAJOR "${Java_VERSION_STRING}" ) @@ -134,17 +135,6 @@ IF(Java_JAVA_EXECUTABLE) ENDIF(NOT Java_FIND_QUIETLY) ENDIF() - # check version if requested: - if( Java_FIND_VERSION ) - if("${Java_VERSION}" VERSION_LESS "${Java_FIND_VERSION}") - set(_java_version_acceptable FALSE) - endif("${Java_VERSION}" VERSION_LESS "${Java_FIND_VERSION}") - if( Java_FIND_VERSION_EXACT ) - if("${Java_VERSION}" VERSION_GREATER "${Java_FIND_VERSION}") - set(_java_version_acceptable FALSE) - endif("${Java_VERSION}" VERSION_GREATER "${Java_FIND_VERSION}") - endif( Java_FIND_VERSION_EXACT ) - endif( Java_FIND_VERSION ) ENDIF(Java_JAVA_EXECUTABLE) @@ -165,17 +155,15 @@ if(Java_FIND_COMPONENTS) foreach(component ${Java_FIND_COMPONENTS}) # User just want to execute some Java byte-compiled if(component STREQUAL "Runtime") - find_package_handle_standard_args(Java DEFAULT_MSG - Java_JAVA_EXECUTABLE - _java_version_acceptable - ) + find_package_handle_standard_args(Java + REQUIRED_VARS Java_JAVA_EXECUTABLE + VERSION_VAR Java_VERSION + ) elseif(component STREQUAL "Development") - find_package_handle_standard_args(Java DEFAULT_MSG - Java_JAVA_EXECUTABLE - Java_JAR_EXECUTABLE - Java_JAVAC_EXECUTABLE - _java_version_acceptable - ) + find_package_handle_standard_args(Java + REQUIRED_VARS Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE + VERSION_VAR Java_VERSION + ) else() message(FATAL_ERROR "Comp: ${component} is not handled") endif() @@ -183,12 +171,10 @@ if(Java_FIND_COMPONENTS) endforeach(component) else() # Check for everything - find_package_handle_standard_args(Java DEFAULT_MSG - Java_JAVA_EXECUTABLE - Java_JAR_EXECUTABLE - Java_JAVAC_EXECUTABLE - _java_version_acceptable - ) + find_package_handle_standard_args(Java + REQUIRED_VARS Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE + VERSION_VAR Java_VERSION + ) endif() diff --git a/Modules/FindPackageHandleStandardArgs.cmake b/Modules/FindPackageHandleStandardArgs.cmake index 1f6b7d0..37a55b3 100644 --- a/Modules/FindPackageHandleStandardArgs.cmake +++ b/Modules/FindPackageHandleStandardArgs.cmake @@ -214,7 +214,7 @@ FUNCTION(FIND_PACKAGE_HANDLE_STANDARD_ARGS _NAME _FIRST_ARG _VAR1) ENDIF (${_NAME}_FIND_VERSION) IF(VERSION_OK) - SET(DETAILS "${DETAILS}[v${${VERSION}}]") + SET(DETAILS "${DETAILS}[v${VERSION}]") ELSE(VERSION_OK) SET(${_NAME_UPPER}_FOUND FALSE) ENDIF(VERSION_OK) diff --git a/Modules/FindPerlLibs.cmake b/Modules/FindPerlLibs.cmake index eb4a904..d9b0e2b 100644 --- a/Modules/FindPerlLibs.cmake +++ b/Modules/FindPerlLibs.cmake @@ -8,6 +8,9 @@ # PERL_LIBRARY = path to libperl # PERL_EXECUTABLE = full path to the perl binary # +# The minimum required version of Perl can be specified using the +# standard syntax, e.g. FIND_PACKAGE(PerlLibs 6.0) +# # The following variables are also available if needed # (introduced after CMake 2.6.4) # @@ -227,8 +230,9 @@ endif (PERL_EXECUTABLE) # handle the QUIETLY and REQUIRED arguments and set PERLLIBS_FOUND to TRUE if # all listed variables are TRUE -INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(PerlLibs DEFAULT_MSG PERL_LIBRARY PERL_INCLUDE_PATH) +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(PerlLibs REQUIRED_VARS PERL_LIBRARY PERL_INCLUDE_PATH + VERSION_VAR PERL_VERSION) # Introduced after CMake 2.6.4 to bring module into compliance set(PERL_INCLUDE_DIR ${PERL_INCLUDE_PATH}) diff --git a/Modules/FindRuby.cmake b/Modules/FindRuby.cmake index 2d1a125..2e78d85 100644 --- a/Modules/FindRuby.cmake +++ b/Modules/FindRuby.cmake @@ -1,7 +1,10 @@ # - Find Ruby # This module finds if Ruby is installed and determines where the include files -# and libraries are. Ruby 1.8 and 1.9 are supported. The minimum required version -# specified in the find_package() command is honored. +# and libraries are. Ruby 1.8 and 1.9 are supported. +# +# The minimum required version of Ruby can be specified using the +# standard syntax, e.g. FIND_PACKAGE(Ruby 1.8) +# # It also determines what the name of the library is. This # code sets the following variables: # @@ -154,22 +157,6 @@ SET(_RUBY_VERSION_SHORT "${RUBY_VERSION_MAJOR}.${RUBY_VERSION_MINOR}") SET(_RUBY_VERSION_SHORT_NODOT "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}") SET(_RUBY_NODOT_VERSION "${RUBY_VERSION_MAJOR}${RUBY_VERSION_MINOR}${RUBY_VERSION_PATCH}") -# Now we know which version we found -IF(Ruby_FIND_VERSION) - IF(${RUBY_VERSION} VERSION_LESS ${Ruby_FIND_VERSION}) - # force running ruby the next time again - SET(RUBY_VERSION_MAJOR "" CACHE PATH "The Ruby major version" FORCE) - IF(Ruby_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "Ruby version ${Ruby_FIND_VERSION} required, but only version ${RUBY_VERSION} found.") - ELSE(Ruby_FIND_REQUIRED) - IF(NOT Ruby_FIND_QUIETLY) - MESSAGE(STATUS "Ruby version ${Ruby_FIND_VERSION} required, but only version ${RUBY_VERSION} found.") - ENDIF(NOT Ruby_FIND_QUIETLY) - RETURN() - ENDIF(Ruby_FIND_REQUIRED) - ENDIF(${RUBY_VERSION} VERSION_LESS ${Ruby_FIND_VERSION}) -ENDIF(Ruby_FIND_VERSION) - FIND_PATH(RUBY_INCLUDE_DIR NAMES ruby.h HINTS @@ -240,7 +227,8 @@ IF(_RUBY_DEBUG_OUTPUT) MESSAGE(STATUS "--------------------") ENDIF(_RUBY_DEBUG_OUTPUT) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby DEFAULT_MSG ${_RUBY_REQUIRED_VARS}) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Ruby REQUIRED_VARS ${_RUBY_REQUIRED_VARS} + VERSION_VAR RUBY_VERSION ) MARK_AS_ADVANCED( RUBY_EXECUTABLE diff --git a/Modules/FindSWIG.cmake b/Modules/FindSWIG.cmake index b8c3b28..68a913d 100644 --- a/Modules/FindSWIG.cmake +++ b/Modules/FindSWIG.cmake @@ -5,6 +5,9 @@ # SWIG_EXECUTABLE - the path to the swig executable # SWIG_VERSION - the version number of the swig executable # +# The minimum required version of SWIG can be specified using the +# standard syntax, e.g. FIND_PACKAGE(SWIG 1.1) +# # All information is collected from the SWIG_EXECUTABLE so the # version to be found can be changed from the command line by # means of setting SWIG_EXECUTABLE @@ -23,8 +26,6 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -SET(SWIG_FOUND FALSE) - FIND_PROGRAM(SWIG_EXECUTABLE swig) IF(SWIG_EXECUTABLE) @@ -45,7 +46,6 @@ IF(SWIG_EXECUTABLE) SET(SWIG_DIR SWIG_DIR-NOTFOUND) FIND_PATH(SWIG_DIR swig.swg PATHS ${SWIG_swiglib_output}) IF(SWIG_DIR) - SET(SWIG_FOUND 1) SET(SWIG_USE_FILE ${CMAKE_ROOT}/Modules/UseSWIG.cmake) EXECUTE_PROCESS(COMMAND ${SWIG_EXECUTABLE} -version OUTPUT_VARIABLE SWIG_version_output @@ -62,12 +62,6 @@ IF(SWIG_EXECUTABLE) ENDIF(SWIG_swiglib_result) ENDIF(SWIG_EXECUTABLE) -IF(NOT SWIG_FOUND) - IF(NOT SWIG_FIND_QUIETLY) - IF(SWIG_FIND_REQUIRED) - MESSAGE(FATAL_ERROR "SWIG was not found. Please specify Swig executable location") - ELSE(SWIG_FIND_REQUIRED) - MESSAGE(STATUS "SWIG was not found. Please specify Swig executable location") - ENDIF(SWIG_FIND_REQUIRED) - ENDIF(NOT SWIG_FIND_QUIETLY) -ENDIF(NOT SWIG_FOUND) +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(SWIG REQUIRED_VARS SWIG_EXECUTABLE SWIG_DIR + VERSION_VAR SWIG_VERSION ) diff --git a/Modules/FindSquish.cmake b/Modules/FindSquish.cmake index a9ddf27..b0b6b2f 100644 --- a/Modules/FindSquish.cmake +++ b/Modules/FindSquish.cmake @@ -4,9 +4,6 @@ # # ---- Variables and Macros # SQUISH_FOUND If false, don't try to use Squish -# SQUISH_VERSION_MAJOR The major version of Squish found -# SQUISH_VERSION_MINOR The minor version of Squish found -# SQUISH_VERSION_PATCH The patch version of Squish found # # SQUISH_INSTALL_DIR The Squish installation directory (containing bin, lib, etc) # SQUISH_SERVER_EXECUTABLE The squishserver executable diff --git a/Modules/FindSubversion.cmake b/Modules/FindSubversion.cmake index 91c2ba1..17fbeab 100644 --- a/Modules/FindSubversion.cmake +++ b/Modules/FindSubversion.cmake @@ -2,7 +2,12 @@ # The module defines the following variables: # Subversion_SVN_EXECUTABLE - path to svn command line client # Subversion_VERSION_SVN - version of svn command line client -# Subversion_FOUND - true if the command line client was found +# SUBVERSION_FOUND - true if the command line client was found +# Subversion_FOUND - same as SUBVERSION_FOUND, kept around for compatibility +# +# The minimum required version of Subversion can be specified using the +# standard syntax, e.g. FIND_PACKAGE(Subversion 1.4) +# # If the command line client executable is found the macro # Subversion_WC_INFO(<dir> <var-prefix>) # is defined to extract information of a subversion working copy at @@ -17,12 +22,12 @@ # <var-prefix>_WC_INFO - output of command `svn info <dir>' # Example usage: # FIND_PACKAGE(Subversion) -# IF(Subversion_FOUND) +# IF(SUBVERSION_FOUND) # Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Project) # MESSAGE("Current revision is ${Project_WC_REVISION}") # Subversion_WC_LOG(${PROJECT_SOURCE_DIR} Project) # MESSAGE("Last changed log is ${Project_LAST_CHANGED_LOG}") -# ENDIF(Subversion_FOUND) +# ENDIF(SUBVERSION_FOUND) #============================================================================= # Copyright 2006-2009 Kitware, Inc. @@ -38,16 +43,18 @@ # (To distribute this file outside of CMake, substitute the full # License text for the above reference.) -SET(Subversion_FOUND FALSE) -SET(Subversion_SVN_FOUND FALSE) - FIND_PROGRAM(Subversion_SVN_EXECUTABLE svn DOC "subversion command line client") MARK_AS_ADVANCED(Subversion_SVN_EXECUTABLE) IF(Subversion_SVN_EXECUTABLE) - SET(Subversion_SVN_FOUND TRUE) - SET(Subversion_FOUND TRUE) + + EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version + OUTPUT_VARIABLE Subversion_VERSION_SVN + OUTPUT_STRIP_TRAILING_WHITESPACE) + + STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*" + "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}") MACRO(Subversion_WC_INFO dir prefix) # the subversion commands should be executed with the C locale, otherwise @@ -55,11 +62,6 @@ IF(Subversion_SVN_EXECUTABLE) SET(_Subversion_SAVED_LC_ALL "$ENV{LC_ALL}") SET(ENV{LC_ALL} C) - EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} --version - WORKING_DIRECTORY ${dir} - OUTPUT_VARIABLE Subversion_VERSION_SVN - OUTPUT_STRIP_TRAILING_WHITESPACE) - EXECUTE_PROCESS(COMMAND ${Subversion_SVN_EXECUTABLE} info ${dir} OUTPUT_VARIABLE ${prefix}_WC_INFO ERROR_VARIABLE Subversion_svn_info_error @@ -70,8 +72,6 @@ IF(Subversion_SVN_EXECUTABLE) MESSAGE(SEND_ERROR "Command \"${Subversion_SVN_EXECUTABLE} info ${dir}\" failed with output:\n${Subversion_svn_info_error}") ELSE(NOT ${Subversion_svn_info_result} EQUAL 0) - STRING(REGEX REPLACE "^(.*\n)?svn, version ([.0-9]+).*" - "\\2" Subversion_VERSION_SVN "${Subversion_VERSION_SVN}") STRING(REGEX REPLACE "^(.*\n)?URL: ([^\n]+).*" "\\2" ${prefix}_WC_URL "${${prefix}_WC_INFO}") STRING(REGEX REPLACE "^(.*\n)?Revision: ([^\n]+).*" @@ -110,4 +110,9 @@ IF(Subversion_SVN_EXECUTABLE) ENDIF(Subversion_SVN_EXECUTABLE) INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(Subversion DEFAULT_MSG Subversion_SVN_EXECUTABLE) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(Subversion REQUIRED_VARS Subversion_SVN_EXECUTABLE + VERSION_VAR Subversion_VERSION_SVN ) + +# for compatibility +SET(Subversion_FOUND ${SUBVERSION_FOUND}) +SET(Subversion_SVN_FOUND ${SUBVERSION_FOUND}) diff --git a/Modules/FindZLIB.cmake b/Modules/FindZLIB.cmake index eb02ba8..ce29ca0 100644 --- a/Modules/FindZLIB.cmake +++ b/Modules/FindZLIB.cmake @@ -62,21 +62,8 @@ ENDIF() # handle the QUIETLY and REQUIRED arguments and set ZLIB_FOUND to TRUE if # all listed variables are TRUE INCLUDE(FindPackageHandleStandardArgs) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB DEFAULT_MSG ZLIB_INCLUDE_DIR ZLIB_LIBRARY) - -# handle the VERSION provided in find_package() command -if(ZLIB_FIND_VERSION) - if(ZLIB_FIND_VERSION_EXACT AND NOT ${ZLIB_VERSION_STRING} VERSION_EQUAL ${ZLIB_FIND_VERSION}) - message(FATAL_ERROR "ZLIB version found (${ZLIB_VERSION_STRING}) does not match the required one (${ZLIB_FIND_VERSION}), aborting.") - elseif(${ZLIB_VERSION_STRING} VERSION_LESS ${ZLIB_FIND_VERSION}) - if(ZLIB_FIND_REQUIRED) - message(FATAL_ERROR "ZLIB version found (${ZLIB_VERSION_STRING}) is less then the minimum required (${ZLIB_FIND_VERSION}), aborting.") - else(ZLIB_FIND_REQUIRED) - message("ZLIB version found (${ZLIB_VERSION_STRING}) is less then the minimum required (${ZLIB_FIND_VERSION}), continue without ZLIB support.") - set(ZLIB_FOUND FALSE) - endif(ZLIB_FIND_REQUIRED) - endif() -endif(ZLIB_FIND_VERSION) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZLIB REQUIRED_VARS ZLIB_INCLUDE_DIR ZLIB_LIBRARY + VERSION_VAR ZLIB_VERSION_STRING) IF(ZLIB_FOUND) SET(ZLIB_INCLUDE_DIRS ${ZLIB_INCLUDE_DIR}) diff --git a/Modules/Platform/BlueGeneP-base.cmake b/Modules/Platform/BlueGeneP-base.cmake new file mode 100644 index 0000000..2ca920f --- /dev/null +++ b/Modules/Platform/BlueGeneP-base.cmake @@ -0,0 +1,118 @@ + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov> +# +# 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.) + +# +# BlueGeneP base platform file. +# +# NOTE: Do not set your platform to "BlueGeneP-base". This file is included +# by the real platform files. Use one of these two platforms instead: +# +# BlueGeneP-dynamic For dynamically linked builds +# BlueGeneP-static For statically linked builds +# +# This platform file tries its best to adhere to the behavior of the MPI +# compiler wrappers included with the latest BG/P drivers. +# + + +# +# For BGP builds, we're cross compiling, but we don't want to re-root things +# (e.g. with CMAKE_FIND_ROOT_PATH) because users may have libraries anywhere on +# the shared filesystems, and this may lie outside the root. Instead, we set the +# system directories so that the various system BGP CNK library locations are +# searched first. This is not the clearest thing in the world, given IBM's driver +# layout, but this should cover all the standard ones. +# +set(CMAKE_SYSTEM_LIBRARY_PATH + /bgsys/drivers/ppcfloor/comm/default/lib # default comm layer (used by mpi compiler wrappers) + /bgsys/drivers/ppcfloor/comm/sys/lib # DCMF, other lower-level comm libraries + /bgsys/drivers/ppcfloor/runtime/SPI # other low-level stuff + /bgsys/drivers/ppcfloor/gnu-linux/lib # CNK python installation directory + /bgsys/drivers/ppcfloor/gnu-linux/powerpc-bgp-linux/lib # CNK Linux image -- standard runtime libs, pthread, etc. +) + +# +# This adds directories that find commands should specifically ignore for cross compiles. +# Most of these directories are the includeand lib directories for the frontend on BG/P systems. +# Not ignoring these can cause things like FindX11 to find a frontend PPC version mistakenly. +# We use this on BG instead of re-rooting because backend libraries are typically strewn about +# the filesystem, and we can't re-root ALL backend libraries to a single place. +# +set(CMAKE_SYSTEM_IGNORE_PATH + /lib /lib64 /include + /usr/lib /usr/lib64 /usr/include + /usr/local/lib /usr/local/lib64 /usr/local/include + /usr/X11/lib /usr/X11/lib64 /usr/X11/include + /usr/lib/X11 /usr/lib64/X11 /usr/include/X11 + /usr/X11R6/lib /usr/X11R6/lib64 /usr/X11R6/include + /usr/X11R7/lib /usr/X11R7/lib64 /usr/X11R7/include +) + +# +# Indicate that this is a unix-like system +# +set(UNIX 1) + +# +# Library prefixes, suffixes, extra libs. +# +set(CMAKE_LINK_LIBRARY_SUFFIX "") +set(CMAKE_STATIC_LIBRARY_PREFIX "lib") # lib +set(CMAKE_STATIC_LIBRARY_SUFFIX ".a") # .a + +set(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib +set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so +set(CMAKE_EXECUTABLE_SUFFIX "") # .exe +set(CMAKE_DL_LIBS "dl") + +# +# This macro needs to be called for dynamic library support. Unfortunately on BGP, +# We can't support both static and dynamic links in the same platform file. The +# dynamic link platform file needs to call this explicitly to set up dynamic linking. +# +macro(__BlueGeneP_set_dynamic_flags compiler_id lang) + if (${compiler_id} STREQUAL XL) + # Flags for XL compilers if we explicitly detected XL + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-qpic") # -pic + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-qmkshrobj -qnostaticlink") # -shared + set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-rpath,") # -rpath + set(BGP_${lang}_DYNAMIC_EXE_FLAGS "-qnostaticlink -qnostaticlink=libgcc") + else() + # Assume flags for GNU compilers (if the ID is GNU *or* anything else). + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "-fPIC") # -pic + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-shared") # -shared + set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-rpath,") # -rpath + set(BGP_${lang}_DYNAMIC_EXE_FLAGS "-dynamic") + endif() + + set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "") # +s, flag for exe link to use shared lib + set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") # : or empty + + set(BGP_${lang}_DEFAULT_EXE_FLAGS + "<FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") + set(CMAKE_${lang}_LINK_EXECUTABLE + "<CMAKE_${lang}_COMPILER> -Wl,-relax ${BGP_${lang}_DYNAMIC_EXE_FLAGS} ${BGP_${lang}_DEFAULT_EXE_FLAGS}") +endmacro() + +# +# This macro needs to be called for static builds. Right now it just adds -Wl,-relax +# to the link line. +# +macro(__BlueGeneP_set_static_flags compiler_id lang) + set(BGP_${lang}_DEFAULT_EXE_FLAGS + "<FLAGS> <CMAKE_${lang}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") + set(CMAKE_${lang}_LINK_EXECUTABLE + "<CMAKE_${lang}_COMPILER> -Wl,-relax ${BGP_${lang}_DEFAULT_EXE_FLAGS}") +endmacro() diff --git a/Modules/Platform/BlueGeneP-dynamic-GNU-C.cmake b/Modules/Platform/BlueGeneP-dynamic-GNU-C.cmake new file mode 100644 index 0000000..bd4696b --- /dev/null +++ b/Modules/Platform/BlueGeneP-dynamic-GNU-C.cmake @@ -0,0 +1,16 @@ + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov> +# +# 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.) + +__BlueGeneP_set_dynamic_flags(GNU C) diff --git a/Modules/Platform/BlueGeneP-dynamic-GNU-CXX.cmake b/Modules/Platform/BlueGeneP-dynamic-GNU-CXX.cmake new file mode 100644 index 0000000..9c995dc --- /dev/null +++ b/Modules/Platform/BlueGeneP-dynamic-GNU-CXX.cmake @@ -0,0 +1,16 @@ + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov> +# +# 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.) + +__BlueGeneP_set_dynamic_flags(GNU CXX) diff --git a/Modules/Platform/BlueGeneP-dynamic-GNU-Fortran.cmake b/Modules/Platform/BlueGeneP-dynamic-GNU-Fortran.cmake new file mode 100644 index 0000000..19d6be8 --- /dev/null +++ b/Modules/Platform/BlueGeneP-dynamic-GNU-Fortran.cmake @@ -0,0 +1,16 @@ + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov> +# +# 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.) + +__BlueGeneP_set_dynamic_flags(GNU Fortran) diff --git a/Modules/Platform/BlueGeneP-dynamic-XL-C.cmake b/Modules/Platform/BlueGeneP-dynamic-XL-C.cmake new file mode 100644 index 0000000..2dbbbc0 --- /dev/null +++ b/Modules/Platform/BlueGeneP-dynamic-XL-C.cmake @@ -0,0 +1,16 @@ + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov> +# +# 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.) + +__BlueGeneP_set_dynamic_flags(XL C) diff --git a/Modules/Platform/BlueGeneP-dynamic-XL-CXX.cmake b/Modules/Platform/BlueGeneP-dynamic-XL-CXX.cmake new file mode 100644 index 0000000..2bc5127 --- /dev/null +++ b/Modules/Platform/BlueGeneP-dynamic-XL-CXX.cmake @@ -0,0 +1,16 @@ + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov> +# +# 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.) + +__BlueGeneP_set_dynamic_flags(XL CXX) diff --git a/Modules/Platform/BlueGeneP-dynamic-XL-Fortran.cmake b/Modules/Platform/BlueGeneP-dynamic-XL-Fortran.cmake new file mode 100644 index 0000000..59da63d --- /dev/null +++ b/Modules/Platform/BlueGeneP-dynamic-XL-Fortran.cmake @@ -0,0 +1,16 @@ + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov> +# +# 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.) + +__BlueGeneP_set_dynamic_flags(XL Fortran) diff --git a/Modules/Platform/BlueGeneP-dynamic.cmake b/Modules/Platform/BlueGeneP-dynamic.cmake new file mode 100644 index 0000000..8f96f2f --- /dev/null +++ b/Modules/Platform/BlueGeneP-dynamic.cmake @@ -0,0 +1,19 @@ + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov> +# +# 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(Platform/BlueGeneP-base) +set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE) +set(CMAKE_FIND_LIBRARY_PREFIXES "lib") +set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a") diff --git a/Modules/Platform/BlueGeneP-static-GNU-C.cmake b/Modules/Platform/BlueGeneP-static-GNU-C.cmake new file mode 100644 index 0000000..412a7a3 --- /dev/null +++ b/Modules/Platform/BlueGeneP-static-GNU-C.cmake @@ -0,0 +1,16 @@ + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov> +# +# 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.) + +__BlueGeneP_set_static_flags(GNU C) diff --git a/Modules/Platform/BlueGeneP-static-GNU-CXX.cmake b/Modules/Platform/BlueGeneP-static-GNU-CXX.cmake new file mode 100644 index 0000000..418f0d8 --- /dev/null +++ b/Modules/Platform/BlueGeneP-static-GNU-CXX.cmake @@ -0,0 +1,16 @@ + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov> +# +# 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.) + +__BlueGeneP_set_static_flags(GNU CXX) diff --git a/Modules/Platform/BlueGeneP-static-GNU-Fortran.cmake b/Modules/Platform/BlueGeneP-static-GNU-Fortran.cmake new file mode 100644 index 0000000..119195b --- /dev/null +++ b/Modules/Platform/BlueGeneP-static-GNU-Fortran.cmake @@ -0,0 +1,16 @@ + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov> +# +# 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.) + +__BlueGeneP_set_static_flags(GNU Fortran) diff --git a/Modules/Platform/BlueGeneP-static-XL-C.cmake b/Modules/Platform/BlueGeneP-static-XL-C.cmake new file mode 100644 index 0000000..1f20959 --- /dev/null +++ b/Modules/Platform/BlueGeneP-static-XL-C.cmake @@ -0,0 +1,16 @@ + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov> +# +# 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.) + +__BlueGeneP_set_static_flags(XL C) diff --git a/Modules/Platform/BlueGeneP-static-XL-CXX.cmake b/Modules/Platform/BlueGeneP-static-XL-CXX.cmake new file mode 100644 index 0000000..f027a53 --- /dev/null +++ b/Modules/Platform/BlueGeneP-static-XL-CXX.cmake @@ -0,0 +1,16 @@ + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov> +# +# 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.) + +__BlueGeneP_set_static_flags(XL CXX) diff --git a/Modules/Platform/BlueGeneP-static-XL-Fortran.cmake b/Modules/Platform/BlueGeneP-static-XL-Fortran.cmake new file mode 100644 index 0000000..778d4bd --- /dev/null +++ b/Modules/Platform/BlueGeneP-static-XL-Fortran.cmake @@ -0,0 +1,16 @@ + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov> +# +# 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.) + +__BlueGeneP_set_static_flags(XL Fortran) diff --git a/Modules/Platform/BlueGeneP-static.cmake b/Modules/Platform/BlueGeneP-static.cmake new file mode 100644 index 0000000..c4f5f21 --- /dev/null +++ b/Modules/Platform/BlueGeneP-static.cmake @@ -0,0 +1,19 @@ + +#============================================================================= +# Copyright 2010 Kitware, Inc. +# Copyright 2010 Todd Gamblin <tgamblin@llnl.gov> +# +# 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(Platform/BlueGeneP-base) +set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS FALSE) +set(CMAKE_FIND_LIBRARY_PREFIXES "lib") +set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index b7d4431..79b2f80 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -49,6 +49,13 @@ set(CMAKE_CREATE_WIN32_EXE "-mwindows") set(CMAKE_GNULD_IMAGE_VERSION "-Wl,--major-image-version,<TARGET_VERSION_MAJOR>,--minor-image-version,<TARGET_VERSION_MINOR>") +# Check if GNU ld is too old to support @FILE syntax. +set(__WINDOWS_GNU_LD_RESPONSE 1) +execute_process(COMMAND ld -v OUTPUT_VARIABLE _help ERROR_VARIABLE _help) +if("${_help}" MATCHES "GNU ld .* 2\\.1[1-6]") + set(__WINDOWS_GNU_LD_RESPONSE 0) +endif() + macro(__windows_compiler_gnu lang) if(MSYS OR MINGW) @@ -68,7 +75,7 @@ macro(__windows_compiler_gnu lang) endif() set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "") # No -fPIC on Windows - set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS 1) + set(CMAKE_${lang}_USE_RESPONSE_FILE_FOR_OBJECTS ${__WINDOWS_GNU_LD_RESPONSE}) set(CMAKE_${lang}_RESPONSE_FILE_LINK_FLAG "-Wl,@") # Binary link rules. diff --git a/Modules/Platform/Windows-icl.cmake b/Modules/Platform/Windows-icl.cmake index c717c7c..9088cc7 100644 --- a/Modules/Platform/Windows-icl.cmake +++ b/Modules/Platform/Windows-icl.cmake @@ -6,6 +6,10 @@ IF(CMAKE_VERBOSE_MAKEFILE) ELSE(CMAKE_VERBOSE_MAKEFILE) SET(CMAKE_CL_NOLOGO "/nologo") ENDIF(CMAKE_VERBOSE_MAKEFILE) + +SET(CMAKE_C_USE_RESPONSE_FILE_FOR_OBJECTS 1) +SET(CMAKE_CXX_USE_RESPONSE_FILE_FOR_OBJECTS 1) + # create a shared C++ library SET(CMAKE_CXX_CREATE_SHARED_LIBRARY "xilink ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} /out:<TARGET> /implib:<TARGET_IMPLIB> /pdb:<TARGET_PDB> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") |