Imported Upstream version 2.8.11-rc1

ci/unstable
Modestas Vainius 12 years ago
parent 696fbbfa02
commit 009541fe8f

@ -11,113 +11,114 @@
#============================================================================= #=============================================================================
# If the cmake version includes cpack, use it # If the cmake version includes cpack, use it
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
IF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") if(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
OPTION(CMAKE_INSTALL_DEBUG_LIBRARIES option(CMAKE_INSTALL_DEBUG_LIBRARIES
"Install Microsoft runtime debug libraries with CMake." FALSE) "Install Microsoft runtime debug libraries with CMake." FALSE)
MARK_AS_ADVANCED(CMAKE_INSTALL_DEBUG_LIBRARIES) mark_as_advanced(CMAKE_INSTALL_DEBUG_LIBRARIES)
# By default, do not warn when built on machines using only VS Express: # By default, do not warn when built on machines using only VS Express:
IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS) if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON) set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
ENDIF() endif()
INCLUDE(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake) include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake") endif()
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
SET(CPACK_PACKAGE_VENDOR "Kitware") set(CPACK_PACKAGE_VENDOR "Kitware")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
SET(CPACK_PACKAGE_VERSION "${CMake_VERSION}") set(CPACK_PACKAGE_VERSION "${CMake_VERSION}")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}") set(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
# Make this explicit here, rather than accepting the CPack default value, # Make this explicit here, rather than accepting the CPack default value,
# so we can refer to it: # so we can refer to it:
SET(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}") set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
# Installers for 32- vs. 64-bit CMake: # Installers for 32- vs. 64-bit CMake:
# - Root install directory (displayed to end user at installer-run time) # - Root install directory (displayed to end user at installer-run time)
# - "NSIS package/display name" (text used in the installer GUI) # - "NSIS package/display name" (text used in the installer GUI)
# - Registry key used to store info about the installation # - Registry key used to store info about the installation
IF(CMAKE_CL_64) if(CMAKE_CL_64)
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64") set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)") set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)") set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
ELSE() else()
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES") set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}") set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}") set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
ENDIF() endif()
IF(NOT DEFINED CPACK_SYSTEM_NAME) if(NOT DEFINED CPACK_SYSTEM_NAME)
# make sure package is not Cygwin-unknown, for Cygwin just # make sure package is not Cygwin-unknown, for Cygwin just
# cygwin is good for the system name # cygwin is good for the system name
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
SET(CPACK_SYSTEM_NAME Cygwin) set(CPACK_SYSTEM_NAME Cygwin)
ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") else()
SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}) set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN") endif()
ENDIF(NOT DEFINED CPACK_SYSTEM_NAME) endif()
IF(${CPACK_SYSTEM_NAME} MATCHES Windows) if(${CPACK_SYSTEM_NAME} MATCHES Windows)
IF(CMAKE_CL_64) if(CMAKE_CL_64)
SET(CPACK_SYSTEM_NAME win64-x64) set(CPACK_SYSTEM_NAME win64-x64)
ELSE(CMAKE_CL_64) else()
SET(CPACK_SYSTEM_NAME win32-x86) set(CPACK_SYSTEM_NAME win32-x86)
ENDIF(CMAKE_CL_64) endif()
ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows) endif()
IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME) if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
# if the CPACK_PACKAGE_FILE_NAME is not defined by the cache # if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
# default to source package - system, on cygwin system is not # default to source package - system, on cygwin system is not
# needed # needed
IF(CYGWIN) if(CYGWIN)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}") set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
ELSE(CYGWIN) else()
SET(CPACK_PACKAGE_FILE_NAME set(CPACK_PACKAGE_FILE_NAME
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}") "${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
ENDIF(CYGWIN) endif()
ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME) endif()
SET(CPACK_PACKAGE_CONTACT "cmake@cmake.org") set(CPACK_PACKAGE_CONTACT "cmake@cmake.org")
IF(UNIX) if(UNIX)
SET(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest") set(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest")
SET(CPACK_SOURCE_STRIP_FILES "") set(CPACK_SOURCE_STRIP_FILES "")
SET(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake") set(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
ENDIF(UNIX) endif()
# cygwin specific packaging stuff # cygwin specific packaging stuff
IF(CYGWIN) if(CYGWIN)
# setup the cygwin package name # setup the cygwin package name
SET(CPACK_PACKAGE_NAME cmake) set(CPACK_PACKAGE_NAME cmake)
# setup the name of the package for cygwin cmake-2.4.3 # setup the name of the package for cygwin cmake-2.4.3
SET(CPACK_PACKAGE_FILE_NAME set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CMake_VERSION}") "${CPACK_PACKAGE_NAME}-${CMake_VERSION}")
# the source has the same name as the binary # the source has the same name as the binary
SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME}) set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
# Create a cygwin version number in case there are changes for cygwin # Create a cygwin version number in case there are changes for cygwin
# that are not reflected upstream in CMake # that are not reflected upstream in CMake
SET(CPACK_CYGWIN_PATCH_NUMBER 1) set(CPACK_CYGWIN_PATCH_NUMBER 1 CACHE STRING "patch number for CMake cygwin packages")
mark_as_advanced(CPACK_CYGWIN_PATCH_NUMBER)
# These files are required by the cmCPackCygwinSourceGenerator and the files # These files are required by the cmCPackCygwinSourceGenerator and the files
# put into the release tar files. # put into the release tar files.
SET(CPACK_CYGWIN_BUILD_SCRIPT set(CPACK_CYGWIN_BUILD_SCRIPT
"${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.sh") "${CMake_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}-${CPACK_CYGWIN_PATCH_NUMBER}.sh")
SET(CPACK_CYGWIN_PATCH_FILE set(CPACK_CYGWIN_PATCH_FILE
"${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.patch") "${CMake_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}-${CPACK_CYGWIN_PATCH_NUMBER}.patch")
# include the sub directory cmake file for cygwin that # include the sub directory cmake file for cygwin that
# configures some files and adds some install targets # configures some files and adds some install targets
# this file uses some of the package file name variables # this file uses some of the package file name variables
INCLUDE(Utilities/Release/Cygwin/CMakeLists.txt) include(Utilities/Release/Cygwin/CMakeLists.txt)
ENDIF(CYGWIN) endif()
# Set the options file that needs to be included inside CMakeCPackOptions.cmake # Set the options file that needs to be included inside CMakeCPackOptions.cmake
SET(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake) set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
CONFIGURE_FILE("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in" configure_file("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
"${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY) "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
SET(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake") set(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")
# include CPack model once all variables are set # include CPack model once all variables are set
INCLUDE(CPack) include(CPack)
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") endif()

@ -1,18 +1,18 @@
# This file is configured at cmake time, and loaded at cpack time. # This file is configured at cmake time, and loaded at cpack time.
# To pass variables to cpack from cmake, they must be configured # To pass variables to cpack from cmake, they must be configured
# in this file. # in this file.
if(CPACK_GENERATOR MATCHES "NSIS") if(CPACK_GENERATOR MATCHES "NSIS")
SET(CPACK_NSIS_INSTALL_ROOT "@CPACK_NSIS_INSTALL_ROOT@") set(CPACK_NSIS_INSTALL_ROOT "@CPACK_NSIS_INSTALL_ROOT@")
# set the install/unistall icon used for the installer itself # set the install/unistall icon used for the installer itself
# There is a bug in NSI that does not handle full unix paths properly. # There is a bug in NSI that does not handle full unix paths properly.
SET(CPACK_NSIS_MUI_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico") set(CPACK_NSIS_MUI_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
SET(CPACK_NSIS_MUI_UNIICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico") set(CPACK_NSIS_MUI_UNIICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
# set the package header icon for MUI # set the package header icon for MUI
SET(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp") set(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp")
# tell cpack to create links to the doc files # tell cpack to create links to the doc files
SET(CPACK_NSIS_MENU_LINKS set(CPACK_NSIS_MENU_LINKS
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-gui.html" "cmake-gui Help" "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-gui.html" "cmake-gui Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help" "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help"
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-properties.html" "doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-properties.html"
@ -24,30 +24,54 @@ if(CPACK_GENERATOR MATCHES "NSIS")
"http://www.cmake.org" "CMake Web Site" "http://www.cmake.org" "CMake Web Site"
) )
# Use the icon from cmake-gui for add-remove programs # Use the icon from cmake-gui for add-remove programs
SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe") set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe")
SET(CPACK_NSIS_PACKAGE_NAME "@CPACK_NSIS_PACKAGE_NAME@") set(CPACK_NSIS_PACKAGE_NAME "@CPACK_NSIS_PACKAGE_NAME@")
SET(CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, a cross-platform, open-source build system") set(CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, a cross-platform, open-source build system")
SET(CPACK_NSIS_HELP_LINK "http://www.cmake.org") set(CPACK_NSIS_HELP_LINK "http://www.cmake.org")
SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com") set(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com")
SET(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@) set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
SET(CPACK_NSIS_MODIFY_PATH ON) set(CPACK_NSIS_MODIFY_PATH ON)
endif(CPACK_GENERATOR MATCHES "NSIS") endif()
# include the cpack options for qt dialog if they exisit # include the cpack options for qt dialog if they exisit
# they might not if qt was not enabled for the build # they might not if qt was not enabled for the build
INCLUDE("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL) include("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL)
if(CPACK_GENERATOR MATCHES "CygwinSource") if(CPACK_GENERATOR MATCHES "CygwinSource")
# when packaging source make sure the .build directory is not included # when packaging source make sure the .build directory is not included
SET(CPACK_SOURCE_IGNORE_FILES set(CPACK_SOURCE_IGNORE_FILES
"/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$") "/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$")
endif(CPACK_GENERATOR MATCHES "CygwinSource") endif()
if("${CPACK_GENERATOR}" STREQUAL "PackageMaker") if("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
if(CMAKE_PACKAGE_QTGUI) if(CMAKE_PACKAGE_QTGUI)
set(CPACK_PACKAGE_DEFAULT_LOCATION "/Applications") set(CPACK_PACKAGE_DEFAULT_LOCATION "/Applications")
else(CMAKE_PACKAGE_QTGUI) else()
set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr") set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr")
endif(CMAKE_PACKAGE_QTGUI) endif()
endif("${CPACK_GENERATOR}" STREQUAL "PackageMaker") endif()
if("${CPACK_GENERATOR}" STREQUAL "WIX")
# Reset CPACK_PACKAGE_VERSION to deal with WiX restriction.
# But the file names still use the full CMake_VERSION value:
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-@CMake_VERSION@-${CPACK_SYSTEM_NAME}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-@CMake_VERSION@-Source")
if(NOT CPACK_WIX_SIZEOF_VOID_P)
set(CPACK_WIX_SIZEOF_VOID_P "@CMAKE_SIZEOF_VOID_P@")
endif()
set(CPACK_PACKAGE_VERSION
"@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@.@CMake_VERSION_PATCH@")
# WIX installers require at most a 4 component version number, where
# each component is an integer between 0 and 65534 inclusive
set(tweak "@CMake_VERSION_TWEAK@")
if(tweak MATCHES "^[0-9]+$")
if(tweak GREATER 0 AND tweak LESS 65535)
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION}.${tweak}")
endif()
endif()
endif()

@ -1 +1 @@
SET(GRAPHVIZ_IGNORE_TARGETS "tartest;testSystemTools;testRegistry;testProcess;testIOS;testHashSTL;testFail;testCommandLineArguments;xrtest;LIBCURL;foo") set(GRAPHVIZ_IGNORE_TARGETS "tartest;testSystemTools;testRegistry;testProcess;testIOS;testHashSTL;testFail;testCommandLineArguments;xrtest;LIBCURL;foo")

@ -9,71 +9,71 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information. # See the License for more information.
#============================================================================= #=============================================================================
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2 FATAL_ERROR) cmake_minimum_required(VERSION 2.8.2 FATAL_ERROR)
SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
PROJECT(CMake) project(CMake)
IF(CMAKE_BOOTSTRAP) if(CMAKE_BOOTSTRAP)
# Running from bootstrap script. Set local variable and remove from cache. # Running from bootstrap script. Set local variable and remove from cache.
SET(CMAKE_BOOTSTRAP 1) set(CMAKE_BOOTSTRAP 1)
UNSET(CMAKE_BOOTSTRAP CACHE) unset(CMAKE_BOOTSTRAP CACHE)
ENDIF() endif()
SET(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin) set(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)
IF("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}") if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
# Disallow architecture-specific try_run. It may not run on the host. # Disallow architecture-specific try_run. It may not run on the host.
MACRO(TRY_RUN) macro(TRY_RUN)
IF(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES) if(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
MESSAGE(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]") message(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]")
ELSE() else()
_TRY_RUN(${ARGV}) _TRY_RUN(${ARGV})
ENDIF() endif()
ENDMACRO() endmacro()
ENDIF() endif()
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
# a macro to deal with system libraries, implemented as a macro # a macro to deal with system libraries, implemented as a macro
# simply to improve readability of the main script # simply to improve readability of the main script
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES) macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
# Options have dependencies. # Options have dependencies.
INCLUDE(CMakeDependentOption) include(CMakeDependentOption)
# Optionally use system xmlrpc. We no longer build or use it by default. # Optionally use system xmlrpc. We no longer build or use it by default.
OPTION(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF) option(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF)
MARK_AS_ADVANCED(CTEST_USE_XMLRPC) mark_as_advanced(CTEST_USE_XMLRPC)
# Allow the user to enable/disable all system utility library options by # Allow the user to enable/disable all system utility library options by
# defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}. # defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}.
SET(UTILITIES BZIP2 CURL EXPAT LIBARCHIVE ZLIB) set(UTILITIES BZIP2 CURL EXPAT LIBARCHIVE ZLIB)
FOREACH(util ${UTILITIES}) foreach(util ${UTILITIES})
IF(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util} if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}
AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES) AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
SET(CMAKE_USE_SYSTEM_LIBRARY_${util} "${CMAKE_USE_SYSTEM_LIBRARIES}") set(CMAKE_USE_SYSTEM_LIBRARY_${util} "${CMAKE_USE_SYSTEM_LIBRARIES}")
ENDIF() endif()
IF(DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}) if(DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util})
IF(CMAKE_USE_SYSTEM_LIBRARY_${util}) if(CMAKE_USE_SYSTEM_LIBRARY_${util})
SET(CMAKE_USE_SYSTEM_LIBRARY_${util} ON) set(CMAKE_USE_SYSTEM_LIBRARY_${util} ON)
ELSE() else()
SET(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF) set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
ENDIF() endif()
IF(CMAKE_BOOTSTRAP) if(CMAKE_BOOTSTRAP)
UNSET(CMAKE_USE_SYSTEM_LIBRARY_${util} CACHE) unset(CMAKE_USE_SYSTEM_LIBRARY_${util} CACHE)
ENDIF() endif()
STRING(TOLOWER "${util}" lutil) string(TOLOWER "${util}" lutil)
SET(CMAKE_USE_SYSTEM_${util} "${CMAKE_USE_SYSTEM_LIBRARY_${util}}" set(CMAKE_USE_SYSTEM_${util} "${CMAKE_USE_SYSTEM_LIBRARY_${util}}"
CACHE BOOL "Use system-installed ${lutil}" FORCE) CACHE BOOL "Use system-installed ${lutil}" FORCE)
ELSE() else()
SET(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF) set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
ENDIF() endif()
ENDFOREACH(util) endforeach()
IF(CMAKE_BOOTSTRAP) if(CMAKE_BOOTSTRAP)
UNSET(CMAKE_USE_SYSTEM_LIBRARIES CACHE) unset(CMAKE_USE_SYSTEM_LIBRARIES CACHE)
ENDIF() endif()
# Optionally use system utility libraries. # Optionally use system utility libraries.
OPTION(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" "${CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE}") option(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" "${CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE}")
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl" CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl"
"${CMAKE_USE_SYSTEM_LIBRARY_CURL}" "NOT CTEST_USE_XMLRPC" ON) "${CMAKE_USE_SYSTEM_LIBRARY_CURL}" "NOT CTEST_USE_XMLRPC" ON)
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat" CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat"
@ -84,159 +84,158 @@ MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
"${CMAKE_USE_SYSTEM_LIBRARY_BZIP2}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON) "${CMAKE_USE_SYSTEM_LIBRARY_BZIP2}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
# Mention to the user what system libraries are being used. # Mention to the user what system libraries are being used.
FOREACH(util ${UTILITIES}) foreach(util ${UTILITIES})
IF(CMAKE_USE_SYSTEM_${util}) if(CMAKE_USE_SYSTEM_${util})
MESSAGE(STATUS "Using system-installed ${util}") message(STATUS "Using system-installed ${util}")
ENDIF(CMAKE_USE_SYSTEM_${util}) endif()
ENDFOREACH(util) endforeach()
# Inform utility library header wrappers whether to use system versions. # Inform utility library header wrappers whether to use system versions.
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in configure_file(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in
${CMake_BINARY_DIR}/Utilities/cmThirdParty.h ${CMake_BINARY_DIR}/Utilities/cmThirdParty.h
@ONLY) @ONLY)
ENDMACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES) endmacro()
SET(CMAKE_BUILD_ON_VISUAL_STUDIO 0) set(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
IF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW ) if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
SET(CMAKE_BUILD_ON_VISUAL_STUDIO 1) set(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
ENDIF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW ) endif()
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
# a macro to determine the generator and ctest executable to use # a macro to determine the generator and ctest executable to use
# for testing. Simply to improve readability of the main script. # for testing. Simply to improve readability of the main script.
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
MACRO(CMAKE_SETUP_TESTING) macro(CMAKE_SETUP_TESTING)
IF (NOT DART_ROOT) if (NOT DART_ROOT)
SET(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM}) set(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
ENDIF (NOT DART_ROOT) endif ()
IF(BUILD_TESTING) if(BUILD_TESTING)
SET(CMAKE_TEST_GENERATOR "" CACHE STRING set(CMAKE_TEST_GENERATOR "" CACHE STRING
"Generator used when running tests") "Generator used when running tests")
SET(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH set(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH
"Generator used when running tests") "Generator used when running tests")
IF(NOT CMAKE_TEST_GENERATOR) if(NOT CMAKE_TEST_GENERATOR)
SET(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}") set(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
SET(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}") set(CMAKE_TEST_GENERATOR_TOOLSET "${CMAKE_GENERATOR_TOOLSET}")
ELSE(NOT CMAKE_TEST_GENERATOR) set(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
SET(CMAKE_TEST_DIFFERENT_GENERATOR TRUE) else()
ENDIF(NOT CMAKE_TEST_GENERATOR) set(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
set(CMAKE_TEST_GENERATOR_TOOLSET "")
endif()
# Are we testing with the MSVC compiler? # Are we testing with the MSVC compiler?
SET(CMAKE_TEST_MSVC 0) set(CMAKE_TEST_MSVC 0)
IF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR) if(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
SET(CMAKE_TEST_MSVC 1) set(CMAKE_TEST_MSVC 1)
ELSE(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR) else()
IF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR if("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
"${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio") "${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
SET(CMAKE_TEST_MSVC 1) set(CMAKE_TEST_MSVC 1)
ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR endif()
"${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio") endif()
ENDIF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
set(CMAKE_TEST_SYSTEM_LIBRARIES 0)
SET(CMAKE_TEST_SYSTEM_LIBRARIES 0) foreach(util CURL EXPAT XMLRPC ZLIB)
FOREACH(util CURL EXPAT XMLRPC ZLIB) if(CMAKE_USE_SYSTEM_${util})
IF(CMAKE_USE_SYSTEM_${util}) set(CMAKE_TEST_SYSTEM_LIBRARIES 1)
SET(CMAKE_TEST_SYSTEM_LIBRARIES 1) endif()
ENDIF(CMAKE_USE_SYSTEM_${util}) endforeach()
ENDFOREACH(util)
# This variable is set by cmake, however to # This variable is set by cmake, however to
# test cmake we want to make sure that # test cmake we want to make sure that
# the ctest from this cmake is used for testing # the ctest from this cmake is used for testing
# and not the ctest from the cmake building and testing # and not the ctest from the cmake building and testing
# cmake. # cmake.
SET(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest") set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
SET(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake") set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
SET(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack") set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
ENDIF(BUILD_TESTING) endif()
# configure some files for testing # configure some files for testing
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in" configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/CTestScript.cmake" "${CMAKE_CURRENT_BINARY_DIR}/CTestScript.cmake"
@ONLY) @ONLY)
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage configure_file(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
${CMake_BINARY_DIR}/Tests/.NoDartCoverage) ${CMake_BINARY_DIR}/Tests/.NoDartCoverage)
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage configure_file(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
${CMake_BINARY_DIR}/Modules/.NoDartCoverage) ${CMake_BINARY_DIR}/Modules/.NoDartCoverage)
CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.cmake.in configure_file(${CMake_SOURCE_DIR}/CTestCustom.cmake.in
${CMake_BINARY_DIR}/CTestCustom.cmake @ONLY) ${CMake_BINARY_DIR}/CTestCustom.cmake @ONLY)
CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.ctest.in configure_file(${CMake_SOURCE_DIR}/CTestCustom.ctest.in
${CMake_BINARY_DIR}/CTestCustom.ctest @ONLY) ${CMake_BINARY_DIR}/CTestCustom.ctest @ONLY)
IF(BUILD_TESTING AND DART_ROOT) if(BUILD_TESTING AND DART_ROOT)
CONFIGURE_FILE(${CMake_SOURCE_DIR}/CMakeLogo.gif configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif
${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY) ${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
ENDIF(BUILD_TESTING AND DART_ROOT) endif()
MARK_AS_ADVANCED(DART_ROOT) mark_as_advanced(DART_ROOT)
MARK_AS_ADVANCED(CURL_TESTING) mark_as_advanced(CURL_TESTING)
ENDMACRO(CMAKE_SETUP_TESTING) endmacro()
# Provide a way for Visual Studio Express users to turn OFF the new FOLDER # Provide a way for Visual Studio Express users to turn OFF the new FOLDER
# organization feature. Default to ON for non-Express users. Express users must # organization feature. Default to ON for non-Express users. Express users must
# explicitly turn off this option to build CMake in the Express IDE... # explicitly turn off this option to build CMake in the Express IDE...
# #
OPTION(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON) option(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON)
MARK_AS_ADVANCED(CMAKE_USE_FOLDERS) mark_as_advanced(CMAKE_USE_FOLDERS)
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
# a macro that only sets the FOLDER target property if it's # a macro that only sets the FOLDER target property if it's
# "appropriate" # "appropriate"
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
MACRO(CMAKE_SET_TARGET_FOLDER tgt folder) macro(CMAKE_SET_TARGET_FOLDER tgt folder)
IF(CMAKE_USE_FOLDERS) if(CMAKE_USE_FOLDERS)
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Really, I just want this to be an "if(TARGET ${tgt})" ... # Really, I just want this to be an "if(TARGET ${tgt})" ...
# but I'm not sure that our min req'd., CMake 2.4.5 can handle # but I'm not sure that our min req'd., CMake 2.4.5 can handle
# that... so I'm just activating this for now, with a version # that... so I'm just activating this for now, with a version
# compare, and only for MSVC builds. # compare, and only for MSVC builds.
IF(MSVC) if(MSVC)
IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8) if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
SET_PROPERTY(TARGET "${tgt}" PROPERTY FOLDER "${folder}") set_property(TARGET "${tgt}" PROPERTY FOLDER "${folder}")
ENDIF() endif()
ENDIF() endif()
ELSE() else()
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS OFF) set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
ENDIF() endif()
ENDMACRO(CMAKE_SET_TARGET_FOLDER) endmacro()
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
# a macro to build the utilities used by CMake # a macro to build the utilities used by CMake
# Simply to improve readability of the main script. # Simply to improve readability of the main script.
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
MACRO (CMAKE_BUILD_UTILITIES) macro (CMAKE_BUILD_UTILITIES)
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Create the KWIML library for CMake. # Create the KWIML library for CMake.
SET(KWIML cmIML) set(KWIML cmIML)
SET(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities) set(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities)
ADD_SUBDIRECTORY(Utilities/KWIML) add_subdirectory(Utilities/KWIML)
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Create the kwsys library for CMake. # Create the kwsys library for CMake.
SET(KWSYS_NAMESPACE cmsys) set(KWSYS_NAMESPACE cmsys)
SET(KWSYS_USE_SystemTools 1) set(KWSYS_USE_SystemTools 1)
SET(KWSYS_USE_Directory 1) set(KWSYS_USE_Directory 1)
SET(KWSYS_USE_RegularExpression 1) set(KWSYS_USE_RegularExpression 1)
SET(KWSYS_USE_Base64 1) set(KWSYS_USE_Base64 1)
SET(KWSYS_USE_MD5 1) set(KWSYS_USE_MD5 1)
SET(KWSYS_USE_Process 1) set(KWSYS_USE_Process 1)
SET(KWSYS_USE_CommandLineArguments 1) set(KWSYS_USE_CommandLineArguments 1)
SET(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source) set(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
SET(KWSYS_INSTALL_DOC_DIR "${CMake_DOC_DEST}") set(KWSYS_INSTALL_DOC_DIR "${CMake_DOC_DEST}")
ADD_SUBDIRECTORY(Source/kwsys) add_subdirectory(Source/kwsys)
SET(kwsys_folder "Utilities/KWSys") set(kwsys_folder "Utilities/KWSys")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}") CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}_c "${kwsys_folder}") CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}_c "${kwsys_folder}")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}EncodeExecutable "${kwsys_folder}")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}ProcessFwd9x "${kwsys_folder}")
if(BUILD_TESTING) if(BUILD_TESTING)
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestDynload "${kwsys_folder}") CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestDynload "${kwsys_folder}")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestProcess "${kwsys_folder}") CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestProcess "${kwsys_folder}")
@ -249,248 +248,248 @@ MACRO (CMAKE_BUILD_UTILITIES)
# Setup third-party libraries. # Setup third-party libraries.
# Everything in the tree should be able to include files from the # Everything in the tree should be able to include files from the
# Utilities directory. # Utilities directory.
INCLUDE_DIRECTORIES( include_directories(
${CMake_BINARY_DIR}/Utilities ${CMake_BINARY_DIR}/Utilities
${CMake_SOURCE_DIR}/Utilities ${CMake_SOURCE_DIR}/Utilities
) )
# check for the use of system libraries versus builtin ones # check for the use of system libraries versus builtin ones
# (a macro defined in this file) # (a macro defined in this file)
CMAKE_HANDLE_SYSTEM_LIBRARIES() CMAKE_HANDLE_SYSTEM_LIBRARIES()
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Build zlib library for Curl, CMake, and CTest. # Build zlib library for Curl, CMake, and CTest.
SET(CMAKE_ZLIB_HEADER "cm_zlib.h") set(CMAKE_ZLIB_HEADER "cm_zlib.h")
IF(CMAKE_USE_SYSTEM_ZLIB) if(CMAKE_USE_SYSTEM_ZLIB)
FIND_PACKAGE(ZLIB) find_package(ZLIB)
IF(NOT ZLIB_FOUND) if(NOT ZLIB_FOUND)
MESSAGE(FATAL_ERROR message(FATAL_ERROR
"CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!") "CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!")
ENDIF(NOT ZLIB_FOUND) endif()
SET(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR}) set(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
SET(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) set(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
ELSE(CMAKE_USE_SYSTEM_ZLIB) else()
SET(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities) set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
SET(CMAKE_ZLIB_LIBRARIES cmzlib) set(CMAKE_ZLIB_LIBRARIES cmzlib)
ADD_SUBDIRECTORY(Utilities/cmzlib) add_subdirectory(Utilities/cmzlib)
CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
ENDIF(CMAKE_USE_SYSTEM_ZLIB) endif()
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Build Curl library for CTest. # Build Curl library for CTest.
IF(CMAKE_USE_SYSTEM_CURL) if(CMAKE_USE_SYSTEM_CURL)
FIND_PACKAGE(CURL) find_package(CURL)
IF(NOT CURL_FOUND) if(NOT CURL_FOUND)
MESSAGE(FATAL_ERROR message(FATAL_ERROR
"CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!") "CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!")
ENDIF(NOT CURL_FOUND) endif()
SET(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS}) set(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
SET(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES}) set(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
ELSE(CMAKE_USE_SYSTEM_CURL) else()
SET(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER}) set(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER})
SET(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES}) set(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
SET(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES}) set(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
OPTION(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE) option(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE)
IF(NOT CMAKE_BUILD_CURL_SHARED) if(NOT CMAKE_BUILD_CURL_SHARED)
ADD_DEFINITIONS(-DCURL_STATICLIB) add_definitions(-DCURL_STATICLIB)
ENDIF(NOT CMAKE_BUILD_CURL_SHARED) endif()
SET(CMAKE_CURL_INCLUDES) set(CMAKE_CURL_INCLUDES)
SET(CMAKE_CURL_LIBRARIES cmcurl) set(CMAKE_CURL_LIBRARIES cmcurl)
IF(CMAKE_TESTS_CDASH_SERVER) if(CMAKE_TESTS_CDASH_SERVER)
SET(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php") set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
ENDIF(CMAKE_TESTS_CDASH_SERVER) endif()
ADD_SUBDIRECTORY(Utilities/cmcurl) add_subdirectory(Utilities/cmcurl)
CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty")
CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty")
ENDIF(CMAKE_USE_SYSTEM_CURL) endif()
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Build Compress library for CTest. # Build Compress library for CTest.
SET(CMAKE_COMPRESS_INCLUDES set(CMAKE_COMPRESS_INCLUDES
"${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress") "${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress")
SET(CMAKE_COMPRESS_LIBRARIES "cmcompress") set(CMAKE_COMPRESS_LIBRARIES "cmcompress")
ADD_SUBDIRECTORY(Utilities/cmcompress) add_subdirectory(Utilities/cmcompress)
CMAKE_SET_TARGET_FOLDER(cmcompress "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(cmcompress "Utilities/3rdParty")
IF(CMAKE_USE_SYSTEM_BZIP2) if(CMAKE_USE_SYSTEM_BZIP2)
FIND_PACKAGE(BZip2) find_package(BZip2)
ELSE() else()
SET(BZIP2_INCLUDE_DIR set(BZIP2_INCLUDE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2") "${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2")
SET(BZIP2_LIBRARIES cmbzip2) set(BZIP2_LIBRARIES cmbzip2)
ADD_SUBDIRECTORY(Utilities/cmbzip2) add_subdirectory(Utilities/cmbzip2)
CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty")
ENDIF() endif()
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Build or use system libarchive for CMake and CTest. # Build or use system libarchive for CMake and CTest.
IF(CMAKE_USE_SYSTEM_LIBARCHIVE) if(CMAKE_USE_SYSTEM_LIBARCHIVE)
IF(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake) # added in 2.8.3 if(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake) # added in 2.8.3
FIND_PACKAGE(LibArchive) find_package(LibArchive)
ELSE() else()
INCLUDE(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake) include(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake)
ENDIF() endif()
IF(NOT LibArchive_FOUND) if(NOT LibArchive_FOUND)
MESSAGE(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!") message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
ENDIF() endif()
SET(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS}) set(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
SET(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES}) set(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
ELSE(CMAKE_USE_SYSTEM_LIBARCHIVE) else()
SET(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES}) set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
SET(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES}) set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
ADD_DEFINITIONS(-DLIBARCHIVE_STATIC) add_definitions(-DLIBARCHIVE_STATIC)
SET(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle") set(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle")
SET(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL") set(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL")
SET(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support") set(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support")
SET(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support") set(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support")
SET(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support") set(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support")
ADD_SUBDIRECTORY(Utilities/cmlibarchive) add_subdirectory(Utilities/cmlibarchive)
CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty")
SET(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES}) set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
ENDIF(CMAKE_USE_SYSTEM_LIBARCHIVE) endif()
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Build expat library for CMake and CTest. # Build expat library for CMake and CTest.
IF(CMAKE_USE_SYSTEM_EXPAT) if(CMAKE_USE_SYSTEM_EXPAT)
FIND_PACKAGE(EXPAT) find_package(EXPAT)
IF(NOT EXPAT_FOUND) if(NOT EXPAT_FOUND)
MESSAGE(FATAL_ERROR message(FATAL_ERROR
"CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!") "CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
ENDIF(NOT EXPAT_FOUND) endif()
SET(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS}) set(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
SET(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES}) set(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
ELSE(CMAKE_USE_SYSTEM_EXPAT) else()
SET(CMAKE_EXPAT_INCLUDES) set(CMAKE_EXPAT_INCLUDES)
SET(CMAKE_EXPAT_LIBRARIES cmexpat) set(CMAKE_EXPAT_LIBRARIES cmexpat)
ADD_SUBDIRECTORY(Utilities/cmexpat) add_subdirectory(Utilities/cmexpat)
CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty") CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
ENDIF(CMAKE_USE_SYSTEM_EXPAT) endif()
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Build XMLRPC library for CMake and CTest. # Build XMLRPC library for CMake and CTest.
IF(CTEST_USE_XMLRPC) if(CTEST_USE_XMLRPC)
FIND_PACKAGE(XMLRPC QUIET REQUIRED libwww-client) find_package(XMLRPC QUIET REQUIRED libwww-client)
IF(NOT XMLRPC_FOUND) if(NOT XMLRPC_FOUND)
MESSAGE(FATAL_ERROR message(FATAL_ERROR
"CTEST_USE_XMLRPC is ON but xmlrpc is not found!") "CTEST_USE_XMLRPC is ON but xmlrpc is not found!")
ENDIF(NOT XMLRPC_FOUND) endif()
SET(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS}) set(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
SET(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES}) set(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
ENDIF(CTEST_USE_XMLRPC) endif()
#--------------------------------------------------------------------- #---------------------------------------------------------------------
# Use curses? # Use curses?
IF (UNIX) if (UNIX)
# there is a bug in the Syllable libraries which makes linking ccmake fail, Alex # there is a bug in the Syllable libraries which makes linking ccmake fail, Alex
IF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) if(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
SET(CURSES_NEED_NCURSES TRUE) set(CURSES_NEED_NCURSES TRUE)
FIND_PACKAGE(Curses QUIET) find_package(Curses QUIET)
IF (CURSES_LIBRARY) if (CURSES_LIBRARY)
OPTION(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON) option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
ELSE (CURSES_LIBRARY) else ()
MESSAGE("Curses libraries were not found. Curses GUI for CMake will not be built.") message("Curses libraries were not found. Curses GUI for CMake will not be built.")
SET(BUILD_CursesDialog 0) set(BUILD_CursesDialog 0)
ENDIF (CURSES_LIBRARY) endif ()
ELSE(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) else()
SET(BUILD_CursesDialog 0) set(BUILD_CursesDialog 0)
ENDIF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable) endif()
ELSE (UNIX) else ()
SET(BUILD_CursesDialog 0) set(BUILD_CursesDialog 0)
ENDIF (UNIX) endif ()
IF(BUILD_CursesDialog) if(BUILD_CursesDialog)
ADD_SUBDIRECTORY(Source/CursesDialog/form) add_subdirectory(Source/CursesDialog/form)
ENDIF(BUILD_CursesDialog) endif()
ENDMACRO (CMAKE_BUILD_UTILITIES) endmacro ()
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
IF(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD") if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} execute_process(COMMAND ${CMAKE_CXX_COMPILER}
${CMAKE_CXX_COMPILER_ARG1} -dumpversion ${CMAKE_CXX_COMPILER_ARG1} -dumpversion
OUTPUT_VARIABLE _GXX_VERSION OUTPUT_VARIABLE _GXX_VERSION
) )
STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2" string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
_GXX_VERSION_SHORT ${_GXX_VERSION}) _GXX_VERSION_SHORT ${_GXX_VERSION})
IF(_GXX_VERSION_SHORT EQUAL 33) if(_GXX_VERSION_SHORT EQUAL 33)
MESSAGE(FATAL_ERROR message(FATAL_ERROR
"GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n" "GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n"
"Please use GXX 4.2 or greater to build CMake on OpenBSD\n" "Please use GXX 4.2 or greater to build CMake on OpenBSD\n"
"${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}") "${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}")
ENDIF() endif()
ENDIF() endif()
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
# The main section of the CMakeLists file # The main section of the CMakeLists file
# #
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
INCLUDE(Source/CMakeVersion.cmake) include(Source/CMakeVersion.cmake)
# Releases define a small tweak level. # Releases define a small tweak level.
IF("${CMake_VERSION_TWEAK}" VERSION_LESS 20000000) if("${CMake_VERSION_TWEAK}" VERSION_LESS 20000000)
SET(CMake_VERSION_IS_RELEASE 1) set(CMake_VERSION_IS_RELEASE 1)
SET(CMake_VERSION_SOURCE "") set(CMake_VERSION_SOURCE "")
ELSE() else()
SET(CMake_VERSION_IS_RELEASE 0) set(CMake_VERSION_IS_RELEASE 0)
INCLUDE(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake) include(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake)
ENDIF() endif()
# Compute the full version string. # Compute the full version string.
SET(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH}) set(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
IF(${CMake_VERSION_TWEAK} GREATER 0) if(${CMake_VERSION_TWEAK} GREATER 0)
SET(CMake_VERSION ${CMake_VERSION}.${CMake_VERSION_TWEAK}) set(CMake_VERSION ${CMake_VERSION}.${CMake_VERSION_TWEAK})
ENDIF() endif()
IF(CMake_VERSION_RC) if(CMake_VERSION_RC)
SET(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC}) set(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC})
ENDIF() endif()
IF(CMake_VERSION_SOURCE) if(CMake_VERSION_SOURCE)
SET(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE}) set(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE})
ENDIF() endif()
# Include the standard Dart testing module # Include the standard Dart testing module
ENABLE_TESTING() enable_testing()
INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake) include (${CMAKE_ROOT}/Modules/Dart.cmake)
# Set up test-time configuration. # Set up test-time configuration.
SET_DIRECTORY_PROPERTIES(PROPERTIES set_directory_properties(PROPERTIES
TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake") TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake")
# where to write the resulting executables and libraries # where to write the resulting executables and libraries
SET(BUILD_SHARED_LIBS OFF) set(BUILD_SHARED_LIBS OFF)
SET(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.") set(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
"Where to put the libraries for CMake") "Where to put the libraries for CMake")
# The CMake executables usually do not need any rpath to run in the build or # The CMake executables usually do not need any rpath to run in the build or
# install tree. # install tree.
SET(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.") set(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING set(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
"Install location for data (relative to prefix).") "Install location for data (relative to prefix).")
SET(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING set(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
"Install location for documentation (relative to prefix).") "Install location for documentation (relative to prefix).")
SET(CMAKE_MAN_DIR "/man" CACHE STRING set(CMAKE_MAN_DIR "/man" CACHE STRING
"Install location for man pages (relative to prefix).") "Install location for man pages (relative to prefix).")
MARK_AS_ADVANCED(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR) mark_as_advanced(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
IF(CYGWIN AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake") if(CYGWIN AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# Force doc, data and man dirs to conform to cygwin layout. # Force doc, data and man dirs to conform to cygwin layout.
SET(CMAKE_DOC_DIR "/share/doc/cmake-${CMake_VERSION}") set(CMAKE_DOC_DIR "/share/doc/cmake-${CMake_VERSION}")
SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}") set(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}")
SET(CMAKE_MAN_DIR "/share/man") set(CMAKE_MAN_DIR "/share/man")
# let the user know we just forced these values # let the user know we just forced these values
MESSAGE(STATUS "Setup for Cygwin packaging") message(STATUS "Setup for Cygwin packaging")
MESSAGE(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}") message(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}")
MESSAGE(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}") message(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}")
MESSAGE(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}") message(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}")
ENDIF() endif()
STRING(REGEX REPLACE "^/" "" CMake_DATA_DEST "${CMAKE_DATA_DIR}") string(REGEX REPLACE "^/" "" CMake_DATA_DEST "${CMAKE_DATA_DIR}")
STRING(REGEX REPLACE "^/" "" CMake_DOC_DEST "${CMAKE_DOC_DIR}") string(REGEX REPLACE "^/" "" CMake_DOC_DEST "${CMAKE_DOC_DIR}")
IF(BUILD_TESTING) if(BUILD_TESTING)
INCLUDE(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake) include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
ENDIF() endif()
# include special compile flags for some compilers # include special compile flags for some compilers
INCLUDE(CompileFlags.cmake) include(CompileFlags.cmake)
# no clue why we are testing for this here # no clue why we are testing for this here
INCLUDE(CheckSymbolExists) include(CheckSymbolExists)
CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV) CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE) CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
@ -507,91 +506,113 @@ CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
# to a cdash4simpletest database. In these cases, the CDash dashboards # to a cdash4simpletest database. In these cases, the CDash dashboards
# should be run first. # should be run first.
# #
IF("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x") if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
SET(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash") set(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash")
ENDIF("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x") endif()
# build the utilities (a macro defined in this file) # build the utilities (a macro defined in this file)
CMAKE_BUILD_UTILITIES() CMAKE_BUILD_UTILITIES()
# On NetBSD ncurses is required, since curses doesn't have the wsyncup() # On NetBSD ncurses is required, since curses doesn't have the wsyncup()
# function. ncurses is installed via pkgsrc, so the library is in /usr/pkg/lib, # function. ncurses is installed via pkgsrc, so the library is in /usr/pkg/lib,
# which isn't in the default linker search path. So without RPATH ccmake # which isn't in the default linker search path. So without RPATH ccmake
# doesn't run and the build doesn't succeed since ccmake is executed for # doesn't run and the build doesn't succeed since ccmake is executed for
# generating the documentation. # generating the documentation.
IF(BUILD_CursesDialog) if(BUILD_CursesDialog)
GET_FILENAME_COMPONENT(_CURSES_DIR "${CURSES_LIBRARY}" PATH) get_filename_component(_CURSES_DIR "${CURSES_LIBRARY}" PATH)
SET(CURSES_NEED_RPATH FALSE) set(CURSES_NEED_RPATH FALSE)
IF(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64") if(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
SET(CURSES_NEED_RPATH TRUE) set(CURSES_NEED_RPATH TRUE)
ENDIF(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64") endif()
ENDIF(BUILD_CursesDialog) endif()
IF(BUILD_QtDialog) if(BUILD_QtDialog)
IF(APPLE) if(APPLE)
SET(CMAKE_BUNDLE_NAME set(CMAKE_BUNDLE_NAME
"CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}-${CMake_VERSION_PATCH}") "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}-${CMake_VERSION_PATCH}")
SET(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}") set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
# make sure CMAKE_INSTALL_PREFIX ends in / # make sure CMAKE_INSTALL_PREFIX ends in /
STRING(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN) string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
MATH(EXPR LEN "${LEN} -1" ) math(EXPR LEN "${LEN} -1" )
STRING(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH) string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
IF(NOT "${ENDCH}" STREQUAL "/") if(NOT "${ENDCH}" STREQUAL "/")
SET(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/") set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
ENDIF(NOT "${ENDCH}" STREQUAL "/") endif()
SET(CMAKE_INSTALL_PREFIX set(CMAKE_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents") "${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents")
ENDIF(APPLE) endif()
SET(QT_NEED_RPATH FALSE) set(QT_NEED_RPATH FALSE)
IF(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64") if(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
SET(QT_NEED_RPATH TRUE) set(QT_NEED_RPATH TRUE)
ENDIF(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64") endif()
ENDIF(BUILD_QtDialog) endif()
# The same might be true on other systems for other libraries. # The same might be true on other systems for other libraries.
# Then only enable RPATH if we have are building at least with cmake 2.4, # Then only enable RPATH if we have are building at least with cmake 2.4,
# since this one has much better RPATH features than cmake 2.2. # since this one has much better RPATH features than cmake 2.2.
# The executables are then built with the RPATH for the libraries outside # The executables are then built with the RPATH for the libraries outside
# the build tree, which is both the build and the install RPATH. # the build tree, which is both the build and the install RPATH.
IF (UNIX) if (UNIX)
IF( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB if( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
SET(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
ENDIF(CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH) OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
ENDIF (UNIX) set(CMAKE_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
endif()
endif ()
# add the uninstall support # add the uninstall support
CONFIGURE_FILE( configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
@ONLY) @ONLY)
ADD_CUSTOM_TARGET(uninstall add_custom_target(uninstall
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
INCLUDE (CMakeCPack.cmake) include (CMakeCPack.cmake)
# setup some Testing support (a macro defined in this file) # setup some Testing support (a macro defined in this file)
CMAKE_SETUP_TESTING() CMAKE_SETUP_TESTING()
CONFIGURE_FILE( configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/DartLocal.conf.in" "${CMAKE_CURRENT_SOURCE_DIR}/DartLocal.conf.in"
"${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf" "${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf"
COPYONLY) COPYONLY)
OPTION(CMAKE_STRICT option(CMAKE_STRICT
"Perform strict testing to record property and variable access. Can be used to report any undefined properties or variables" OFF) "Perform strict testing to record property and variable access. Can be used to report any undefined properties or variables" OFF)
MARK_AS_ADVANCED(CMAKE_STRICT) mark_as_advanced(CMAKE_STRICT)
if(NOT CMake_VERSION_IS_RELEASE)
if("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" AND
NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS 4.2)
set(C_FLAGS_LIST -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts
-Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security
-Wmissing-format-attribute -fno-common -Wundef
)
set(CXX_FLAGS_LIST -Wnon-virtual-dtor -Wcast-align -Wchar-subscripts -Wall -W
-Wshadow -Wpointer-arith -Wformat-security -Wundef
)
foreach(FLAG_LANG C CXX)
foreach(FLAG ${${FLAG_LANG}_FLAGS_LIST})
if(NOT " ${CMAKE_${FLAG_LANG}_FLAGS} " MATCHES " ${FLAG} ")
set(CMAKE_${FLAG_LANG}_FLAGS "${CMAKE_${FLAG_LANG}_FLAGS} ${FLAG}")
endif()
endforeach()
endforeach()
unset(C_FLAGS_LIST)
unset(CXX_FLAGS_LIST)
endif()
endif()
# build the remaining subdirectories # build the remaining subdirectories
ADD_SUBDIRECTORY(Source) add_subdirectory(Source)
ADD_SUBDIRECTORY(Utilities) add_subdirectory(Utilities)
ADD_SUBDIRECTORY(Tests) add_subdirectory(Tests)
if(BUILD_TESTING) if(BUILD_TESTING)
CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests") CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests")
@ -600,14 +621,14 @@ CMAKE_SET_TARGET_FOLDER(cmw9xcom "Utilities/Win9xCompat")
CMAKE_SET_TARGET_FOLDER(documentation "Documentation") CMAKE_SET_TARGET_FOLDER(documentation "Documentation")
# add a test # add a test
ADD_TEST(SystemInformationNew "${CMAKE_CMAKE_COMMAND}" add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
--system-information -G "${CMAKE_TEST_GENERATOR}" ) --system-information -G "${CMAKE_TEST_GENERATOR}" )
# Install license file as it requires. # Install license file as it requires.
INSTALL(FILES Copyright.txt DESTINATION ${CMake_DOC_DEST}) install(FILES Copyright.txt DESTINATION ${CMake_DOC_DEST})
# Install script directories. # Install script directories.
INSTALL( install(
DIRECTORY Modules Templates DIRECTORY Modules Templates
DESTINATION "${CMake_DATA_DEST}" DESTINATION "${CMake_DATA_DEST}"
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
@ -620,7 +641,7 @@ INSTALL(
) )
# process docs related install # process docs related install
ADD_SUBDIRECTORY(Docs) add_subdirectory(Docs)
#----------------------------------------------------------------------- #-----------------------------------------------------------------------
# End of the main section of the CMakeLists file # End of the main section of the CMakeLists file
@ -631,4 +652,4 @@ ADD_SUBDIRECTORY(Docs)
# to compute the location of the "cmake" executable. We set it here # to compute the location of the "cmake" executable. We set it here
# so that those CMake versions can find it. We wait until after all # so that those CMake versions can find it. We wait until after all
# the add_subdirectory() calls to avoid affecting the subdirectories. # the add_subdirectory() calls to avoid affecting the subdirectories.
SET(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR}) set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})

@ -19,7 +19,7 @@ set(CTEST_DROP_SITE_CDASH TRUE)
set(CTEST_CDASH_VERSION "1.6") set(CTEST_CDASH_VERSION "1.6")
set(CTEST_CDASH_QUERY_VERSION TRUE) set(CTEST_CDASH_QUERY_VERSION TRUE)
# use old trigger stuff so that cmake 2.4 and below will not # use old trigger stuff so that cmake 2.4 and below will not
# get errors on trigger # get errors on trigger
SET (TRIGGER_SITE set (TRIGGER_SITE
"http://public.kitware.com/cgi-bin/Submit-CMake-TestingResults.cgi") "http://public.kitware.com/cgi-bin/Submit-CMake-TestingResults.cgi")

@ -1,8 +1,8 @@
SET(CTEST_CUSTOM_ERROR_MATCH set(CTEST_CUSTOM_ERROR_MATCH
${CTEST_CUSTOM_ERROR_MATCH} ${CTEST_CUSTOM_ERROR_MATCH}
"ERROR:") "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"
"warning LNK4221" "warning LNK4221"
@ -31,6 +31,7 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"remark: .*LOOP WAS VECTORIZED" "remark: .*LOOP WAS VECTORIZED"
"warning .980: wrong number of actual arguments to intrinsic function .std::basic_" "warning .980: wrong number of actual arguments to intrinsic function .std::basic_"
"LINK : warning LNK4089: all references to.*ADVAPI32.dll.*discarded by /OPT:REF" "LINK : warning LNK4089: all references to.*ADVAPI32.dll.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*PSAPI.DLL.*discarded by /OPT:REF"
"LINK : warning LNK4089: all references to.*USER32.dll.*discarded by /OPT:REF" "LINK : warning LNK4089: all references to.*USER32.dll.*discarded by /OPT:REF"
"Warning: library was too large for page size.*" "Warning: library was too large for page size.*"
"Warning: public.*_archive_.*in module.*archive_*clashes with prior module.*archive_.*" "Warning: public.*_archive_.*in module.*archive_*clashes with prior module.*archive_.*"
@ -56,21 +57,21 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"[0-9,]+ warnings? generated." "[0-9,]+ warnings? generated."
) )
IF(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode") if(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE set(CTEST_CUSTOM_COVERAGE_EXCLUDE
${CTEST_CUSTOM_COVERAGE_EXCLUDE} ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
"XCode" "XCode"
) )
ENDIF (NOT "@CMAKE_GENERATOR@" MATCHES "Xcode") endif ()
IF(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop") if(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE set(CTEST_CUSTOM_COVERAGE_EXCLUDE
${CTEST_CUSTOM_COVERAGE_EXCLUDE} ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
"Kdevelop" "Kdevelop"
) )
ENDIF (NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop") endif ()
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE set(CTEST_CUSTOM_COVERAGE_EXCLUDE
${CTEST_CUSTOM_COVERAGE_EXCLUDE} ${CTEST_CUSTOM_COVERAGE_EXCLUDE}
# Exclude kwsys files from coverage results. They are reported # Exclude kwsys files from coverage results. They are reported

File diff suppressed because it is too large Load Diff

@ -13,52 +13,58 @@
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# set some special flags for different compilers # set some special flags for different compilers
# #
IF(CMAKE_GENERATOR MATCHES "Visual Studio 7") if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1) set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7") endif()
IF(CMAKE_GENERATOR MATCHES "Visual Studio 6") if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1) set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6") endif()
INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake) include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
IF(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$") if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
SET(_INTEL_WINDOWS 1) set(_INTEL_WINDOWS 1)
ENDIF() endif()
# Disable deprecation warnings for standard C functions. # Disable deprecation warnings for standard C functions.
# really only needed for newer versions of VS, but should # really only needed for newer versions of VS, but should
# not hurt other versions, and this will work into the # not hurt other versions, and this will work into the
# future # future
IF(MSVC OR _INTEL_WINDOWS) if(MSVC OR _INTEL_WINDOWS)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE) add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
ELSE() else()
ENDIF() endif()
#silence duplicate symbol warnings on AIX #silence duplicate symbol warnings on AIX
IF(CMAKE_SYSTEM MATCHES "AIX.*") if(CMAKE_SYSTEM MATCHES "AIX.*")
IF(NOT CMAKE_COMPILER_IS_GNUCXX) if(NOT CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) endif()
ENDIF(CMAKE_SYSTEM MATCHES "AIX.*") endif()
IF(CMAKE_SYSTEM MATCHES "IRIX.*") if(CMAKE_SYSTEM MATCHES "IRIX.*")
IF(NOT CMAKE_COMPILER_IS_GNUCXX) if(NOT CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15")
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) endif()
ENDIF(CMAKE_SYSTEM MATCHES "IRIX.*") endif()
IF(CMAKE_SYSTEM MATCHES "OSF1-V.*") if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
IF(NOT CMAKE_COMPILER_IS_GNUCXX) if(NOT CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) endif()
ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*") endif()
# use the ansi CXX compile flag for building cmake # use the ansi CXX compile flag for building cmake
IF (CMAKE_ANSI_CXXFLAGS) if (CMAKE_ANSI_CXXFLAGS)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
ENDIF (CMAKE_ANSI_CXXFLAGS) endif ()
IF (CMAKE_ANSI_CFLAGS) if (CMAKE_ANSI_CFLAGS)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
ENDIF (CMAKE_ANSI_CFLAGS) endif ()
# avoid binutils problem with large binaries, e.g. when building CMake in debug mode
# See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50230
if (CMAKE_SYSTEM_NAME STREQUAL Linux AND CMAKE_SYSTEM_PROCESSOR STREQUAL parisc)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--unique=.text.*")
endif ()

@ -1,4 +1,4 @@
string(REGEX REPLACE "^/(.*)" "\\1" REL_CMAKE_DATA_DIR "${CMAKE_DATA_DIR}") string(REGEX REPLACE "^/(.*)" "\\1" REL_CMAKE_DATA_DIR "${CMAKE_DATA_DIR}")
install(FILES cmake-help.vim cmake-indent.vim cmake-syntax.vim DESTINATION ${REL_CMAKE_DATA_DIR}/editors/vim) install(FILES cmake-help.vim cmake-indent.vim cmake-syntax.vim DESTINATION ${REL_CMAKE_DATA_DIR}/editors/vim)
install(FILES cmake-mode.el DESTINATION ${REL_CMAKE_DATA_DIR}/editors/emacs) install(FILES cmake-mode.el DESTINATION ${REL_CMAKE_DATA_DIR}/editors/emacs)
ADD_SUBDIRECTORY (bash-completion) add_subdirectory (bash-completion)

@ -8,7 +8,7 @@ _cpack()
case "$prev" in case "$prev" in
-G) -G)
COMPREPLY=( $( compgen -W '$( cpack --help 2>/dev/null | COMPREPLY=( $( compgen -W '$( cpack --help 2>/dev/null |
grep "^ .*=\ .*" 2> /dev/null | grep -v "^ -" 2>/dev/null | grep "^ .*= .*" 2> /dev/null | grep -v "^ -" 2>/dev/null |
cut -d" " -f 3 )' -- "$cur" ) ) cut -d" " -f 3 )' -- "$cur" ) )
return return
;; ;;

@ -1,11 +1,11 @@
" ============================================================================= " =============================================================================
" "
" Program: CMake - Cross-Platform Makefile Generator " Program: CMake - Cross-Platform Makefile Generator
" Module: $RCSfile$ " Module: $RCSfile$
" Language: VIM " Language: VIM
" Date: $Date$ " Date: $Date$
" Version: $Revision$ " Version: $Revision$
" "
" ============================================================================= " =============================================================================
" Vim indent file " Vim indent file

@ -34,7 +34,7 @@
;; cmake executable variable used to run cmake --help-command ;; cmake executable variable used to run cmake --help-command
;; on commands in cmake-mode ;; on commands in cmake-mode
;; ;;
;; cmake-command-help Written by James Bigler ;; cmake-command-help Written by James Bigler
;; ;;
(defcustom cmake-mode-cmake-executable "cmake" (defcustom cmake-mode-cmake-executable "cmake"
@ -68,9 +68,9 @@ set the path with these commands:
"\\|" "[ \t\r\n]" "\\|" "[ \t\r\n]"
"\\)*")) "\\)*"))
(defconst cmake-regex-block-open (defconst cmake-regex-block-open
"^\\([iI][fF]\\|[mM][aA][cC][rR][oO]\\|[fF][oO][rR][eE][aA][cC][hH]\\|[eE][lL][sS][eE]\\|[eE][lL][sS][eE][iI][fF]\\|[wW][hH][iI][lL][eE]\\|[fF][uU][nN][cC][tT][iI][oO][nN]\\)$") "^\\(if\\|macro\\|foreach\\|else\\|elseif\\|while\\|function\\)$")
(defconst cmake-regex-block-close (defconst cmake-regex-block-close
"^[ \t]*\\([eE][nN][dD][iI][fF]\\|[eE][nN][dD][fF][oO][rR][eE][aA][cC][hH]\\|[eE][nN][dD][mM][aA][cC][rR][oO]\\|[eE][lL][sS][eE]\\|[eE][lL][sS][eE][iI][fF]\\|[eE][nN][dD][wW][hH][iI][lL][eE]\\|[eE][nN][dD][fF][uU][nN][cC][tT][iI][oO][nN]\\)[ \t]*(") "^[ \t]*\\(endif\\|endforeach\\|endmacro\\|else\\|elseif\\|endwhile\\|endfunction\\)[ \t]*(")
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
@ -126,6 +126,7 @@ set the path with these commands:
(beginning-of-line) (beginning-of-line)
(let ((point-start (point)) (let ((point-start (point))
(case-fold-search t) ;; case-insensitive
token) token)
; Search back for the last indented line. ; Search back for the last indented line.
@ -191,11 +192,11 @@ the indentation. Otherwise it retains the same position on the line"
(setq save-point (point)) (setq save-point (point))
(goto-char (point-min)) (goto-char (point-min))
(while (re-search-forward "^\\([ \t]*\\)\\(\\w+\\)\\([ \t]*(\\)" nil t) (while (re-search-forward "^\\([ \t]*\\)\\(\\w+\\)\\([ \t]*(\\)" nil t)
(replace-match (replace-match
(concat (concat
(match-string 1) (match-string 1)
(downcase (match-string 2)) (downcase (match-string 2))
(match-string 3)) (match-string 3))
t)) t))
(goto-char save-point) (goto-char save-point)
) )
@ -229,13 +230,26 @@ the indentation. Otherwise it retains the same position on the line"
;; ;;
(defvar cmake-tab-width 2) (defvar cmake-tab-width 2)
;;
;; Keymap.
;;
(defvar cmake-mode-map
(let ((map (make-sparse-keymap)))
(define-key map "\C-ch" 'cmake-help-command)
(define-key map "\C-cl" 'cmake-help-list-commands)
(define-key map "\C-cu" 'unscreamify-cmake-buffer)
map)
"Keymap used in cmake-mode buffers.")
;------------------------------------------------------------------------------ ;------------------------------------------------------------------------------
;; ;;
;; CMake mode startup function. ;; CMake mode startup function.
;; ;;
(defun cmake-mode () (defun cmake-mode ()
"Major mode for editing CMake listfiles." "Major mode for editing CMake listfiles.
\\{cmake-mode-map}"
(interactive) (interactive)
(kill-all-local-variables) (kill-all-local-variables)
(setq major-mode 'cmake-mode) (setq major-mode 'cmake-mode)
@ -262,6 +276,9 @@ the indentation. Otherwise it retains the same position on the line"
(make-local-variable 'comment-start) (make-local-variable 'comment-start)
(setq comment-start "#") (setq comment-start "#")
; Setup keymap.
(use-local-map cmake-mode-map)
; Run user hooks. ; Run user hooks.
(run-hooks 'cmake-mode-hook)) (run-hooks 'cmake-mode-hook))

@ -36,9 +36,9 @@ syn region cmakeVariableValue start=/\${/ end=/}/
\ contained oneline contains=CONTAINED,cmakeTodo \ contained oneline contains=CONTAINED,cmakeTodo
syn region cmakeEnvironment start=/\$ENV{/ end=/}/ syn region cmakeEnvironment start=/\$ENV{/ end=/}/
\ contained oneline contains=CONTAINED,cmakeTodo \ contained oneline contains=CONTAINED,cmakeTodo
syn region cmakeString start=/"/ end=/"/ syn region cmakeString start=/"/ end=/"/
\ contains=CONTAINED,cmakeTodo,cmakeOperators \ contains=CONTAINED,cmakeTodo,cmakeOperators
syn region cmakeArguments start=/(/ end=/)/ syn region cmakeArguments start=/(/ end=/)/
\ contains=ALLBUT,cmakeArguments,cmakeTodo \ contains=ALLBUT,cmakeArguments,cmakeTodo
syn keyword cmakeSystemVariables syn keyword cmakeSystemVariables
\ WIN32 UNIX APPLE CYGWIN BORLAND MINGW MSVC MSVC_IDE MSVC60 MSVC70 MSVC71 MSVC80 MSVC90 \ WIN32 UNIX APPLE CYGWIN BORLAND MINGW MSVC MSVC_IDE MSVC60 MSVC70 MSVC71 MSVC80 MSVC90
@ -49,11 +49,11 @@ syn keyword cmakeDeprecated ABSTRACT_FILES BUILD_NAME SOURCE_FILES SOURCE_FILES_
\ nextgroup=cmakeArguments \ nextgroup=cmakeArguments
" The keywords are generated as: cmake --help-command-list | tr "\n" " " " The keywords are generated as: cmake --help-command-list | tr "\n" " "
syn keyword cmakeStatement syn keyword cmakeStatement
\ ADD_CUSTOM_COMMAND ADD_CUSTOM_TARGET ADD_DEFINITIONS ADD_DEPENDENCIES ADD_EXECUTABLE ADD_LIBRARY ADD_SUBDIRECTORY ADD_TEST AUX_SOURCE_DIRECTORY BUILD_COMMAND BUILD_NAME CMAKE_MINIMUM_REQUIRED CONFIGURE_FILE CREATE_TEST_SOURCELIST ELSE ELSEIF ENABLE_LANGUAGE ENABLE_TESTING ENDFOREACH ENDFUNCTION ENDIF ENDMACRO ENDWHILE EXEC_PROGRAM EXECUTE_PROCESS EXPORT_LIBRARY_DEPENDENCIES FILE FIND_FILE FIND_LIBRARY FIND_PACKAGE FIND_PATH FIND_PROGRAM FLTK_WRAP_UI FOREACH FUNCTION GET_CMAKE_PROPERTY GET_DIRECTORY_PROPERTY GET_FILENAME_COMPONENT GET_SOURCE_FILE_PROPERTY GET_TARGET_PROPERTY GET_TEST_PROPERTY IF INCLUDE INCLUDE_DIRECTORIES INCLUDE_EXTERNAL_MSPROJECT INCLUDE_REGULAR_EXPRESSION INSTALL INSTALL_FILES INSTALL_PROGRAMS INSTALL_TARGETS LINK_DIRECTORIES LINK_LIBRARIES LIST LOAD_CACHE LOAD_COMMAND MACRO MAKE_DIRECTORY MARK_AS_ADVANCED MATH MESSAGE OPTION OUTPUT_REQUIRED_FILES PROJECT QT_WRAP_CPP QT_WRAP_UI REMOVE REMOVE_DEFINITIONS SEPARATE_ARGUMENTS SET SET_DIRECTORY_PROPERTIES SET_SOURCE_FILES_PROPERTIES SET_TARGET_PROPERTIES SET_TESTS_PROPERTIES SITE_NAME SOURCE_GROUP STRING SUBDIR_DEPENDS SUBDIRS TARGET_LINK_LIBRARIES TRY_COMPILE TRY_RUN UNSET USE_MANGLED_MESA UTILITY_SOURCE VARIABLE_REQUIRES VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WHILE WRITE_FILE \ ADD_CUSTOM_COMMAND ADD_CUSTOM_TARGET ADD_DEFINITIONS ADD_DEPENDENCIES ADD_EXECUTABLE ADD_LIBRARY ADD_SUBDIRECTORY ADD_TEST AUX_SOURCE_DIRECTORY BUILD_COMMAND BUILD_NAME CMAKE_MINIMUM_REQUIRED CONFIGURE_FILE CREATE_TEST_SOURCELIST ELSE ELSEIF ENABLE_LANGUAGE ENABLE_TESTING ENDFOREACH ENDFUNCTION ENDIF ENDMACRO ENDWHILE EXEC_PROGRAM EXECUTE_PROCESS EXPORT_LIBRARY_DEPENDENCIES FILE FIND_FILE FIND_LIBRARY FIND_PACKAGE FIND_PATH FIND_PROGRAM FLTK_WRAP_UI FOREACH FUNCTION GET_CMAKE_PROPERTY GET_DIRECTORY_PROPERTY GET_FILENAME_COMPONENT GET_SOURCE_FILE_PROPERTY GET_TARGET_PROPERTY GET_TEST_PROPERTY IF INCLUDE INCLUDE_DIRECTORIES INCLUDE_EXTERNAL_MSPROJECT INCLUDE_REGULAR_EXPRESSION INSTALL INSTALL_FILES INSTALL_PROGRAMS INSTALL_TARGETS LINK_DIRECTORIES LINK_LIBRARIES LIST LOAD_CACHE LOAD_COMMAND MACRO MAKE_DIRECTORY MARK_AS_ADVANCED MATH MESSAGE OPTION OUTPUT_REQUIRED_FILES PROJECT QT_WRAP_CPP QT_WRAP_UI REMOVE REMOVE_DEFINITIONS SEPARATE_ARGUMENTS SET SET_DIRECTORY_PROPERTIES SET_SOURCE_FILES_PROPERTIES SET_TARGET_PROPERTIES SET_TESTS_PROPERTIES SITE_NAME SOURCE_GROUP STRING SUBDIR_DEPENDS SUBDIRS TARGET_LINK_LIBRARIES TRY_COMPILE TRY_RUN UNSET USE_MANGLED_MESA UTILITY_SOURCE VARIABLE_REQUIRES VTK_MAKE_INSTANTIATOR VTK_WRAP_JAVA VTK_WRAP_PYTHON VTK_WRAP_TCL WHILE WRITE_FILE
\ nextgroup=cmakeArguments \ nextgroup=cmakeArguments
syn keyword cmakeTodo syn keyword cmakeTodo
\ TODO FIXME XXX \ TODO FIXME XXX
\ contained \ contained
" Define the default highlighting. " Define the default highlighting.

@ -5,6 +5,6 @@ extern Hello hello;
int main() int main()
{ {
hello.Print(); hello.Print();
return 0; return 0;
} }

@ -15,15 +15,15 @@
# (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.)
MACRO(ADD_FILE_DEPENDENCIES _file) macro(ADD_FILE_DEPENDENCIES _file)
GET_SOURCE_FILE_PROPERTY(_deps ${_file} OBJECT_DEPENDS) get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
IF (_deps) if (_deps)
SET(_deps ${_deps} ${ARGN}) set(_deps ${_deps} ${ARGN})
ELSE (_deps) else ()
SET(_deps ${ARGN}) set(_deps ${ARGN})
ENDIF (_deps) endif ()
SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}") set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
ENDMACRO(ADD_FILE_DEPENDENCIES) endmacro()

@ -1,7 +1,6 @@
set(AM_SOURCES @_moc_files@ ) set(AM_SOURCES @_moc_files@ )
set(AM_HEADERS @_moc_headers@ ) set(AM_HEADERS @_moc_headers@ )
set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@) set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@)
set(AM_MOC_DEFINITIONS @_moc_defs@)
set(AM_MOC_INCLUDES @_moc_incs@) set(AM_MOC_INCLUDES @_moc_incs@)
set(AM_MOC_OPTIONS @_moc_options@) set(AM_MOC_OPTIONS @_moc_options@)
set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@") set(AM_CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE "@CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE@")

@ -1,5 +1,5 @@
# This is a basic version file for the Config-mode of find_package(). # This is a basic version file for the Config-mode of find_package().
# It is used by WriteBasicConfigVersionFile.cmake as input file for configure_file() # It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file. # to create a version-file which can be installed along a config.cmake file.
# #
# The created file sets PACKAGE_VERSION_EXACT if the current version string and # The created file sets PACKAGE_VERSION_EXACT if the current version string and

@ -1,5 +1,5 @@
# This is a basic version file for the Config-mode of find_package(). # This is a basic version file for the Config-mode of find_package().
# It is used by WriteBasicConfigVersionFile.cmake as input file for configure_file() # It is used by write_basic_package_version_file() as input file for configure_file()
# to create a version-file which can be installed along a config.cmake file. # to create a version-file which can be installed along a config.cmake file.
# #
# The created file sets PACKAGE_VERSION_EXACT if the current version string and # The created file sets PACKAGE_VERSION_EXACT if the current version string and

@ -184,17 +184,17 @@ function(get_bundle_main_executable bundle result_var)
if(line_is_main_executable) if(line_is_main_executable)
string(REGEX REPLACE "^.*<string>(.*)</string>.*$" "\\1" bundle_executable "${line}") string(REGEX REPLACE "^.*<string>(.*)</string>.*$" "\\1" bundle_executable "${line}")
break() break()
endif(line_is_main_executable) endif()
if(line MATCHES "^.*<key>CFBundleExecutable</key>.*$") if(line MATCHES "^.*<key>CFBundleExecutable</key>.*$")
set(line_is_main_executable 1) set(line_is_main_executable 1)
endif(line MATCHES "^.*<key>CFBundleExecutable</key>.*$") endif()
endforeach(line) endforeach()
if(NOT "${bundle_executable}" STREQUAL "") if(NOT "${bundle_executable}" STREQUAL "")
if(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}") if(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}")
set(result "${bundle}/Contents/MacOS/${bundle_executable}") set(result "${bundle}/Contents/MacOS/${bundle_executable}")
else(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}") else()
# Ultimate goal: # Ultimate goal:
# If not in "Contents/MacOS" then scan the bundle for matching files. If # If not in "Contents/MacOS" then scan the bundle for matching files. If
@ -207,9 +207,9 @@ function(get_bundle_main_executable bundle result_var)
# for the bundle to be in Contents/MacOS, it's an error if it's not: # for the bundle to be in Contents/MacOS, it's an error if it's not:
# #
set(result "error: '${bundle}/Contents/MacOS/${bundle_executable}' does not exist") set(result "error: '${bundle}/Contents/MacOS/${bundle_executable}' does not exist")
endif(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}") endif()
endif(NOT "${bundle_executable}" STREQUAL "") endif()
else(EXISTS "${bundle}/Contents/Info.plist") else()
# #
# More inclusive technique... (This one would work on Windows and Linux # More inclusive technique... (This one would work on Windows and Linux
# too, if a developer followed the typical Mac bundle naming convention...) # too, if a developer followed the typical Mac bundle naming convention...)
@ -217,10 +217,10 @@ function(get_bundle_main_executable bundle result_var)
# If there is no Info.plist file, try to find an executable with the same # If there is no Info.plist file, try to find an executable with the same
# base name as the .app directory: # base name as the .app directory:
# #
endif(EXISTS "${bundle}/Contents/Info.plist") endif()
set(${result_var} "${result}" PARENT_SCOPE) set(${result_var} "${result}" PARENT_SCOPE)
endfunction(get_bundle_main_executable) endfunction()
function(get_dotapp_dir exe dotapp_dir_var) function(get_dotapp_dir exe dotapp_dir_var)
@ -240,9 +240,9 @@ function(get_dotapp_dir exe dotapp_dir_var)
if(sname MATCHES "\\.app$") if(sname MATCHES "\\.app$")
set(done 1) set(done 1)
set(dotapp_dir "${sdir}/${sname}") set(dotapp_dir "${sdir}/${sname}")
endif(sname MATCHES "\\.app$") endif()
endwhile(NOT ${done}) endwhile()
else(s MATCHES "^.*/.*\\.app/.*$") else()
# Otherwise use a directory containing the exe # Otherwise use a directory containing the exe
# (typical of a non-bundle executable on Mac, Windows or Linux) # (typical of a non-bundle executable on Mac, Windows or Linux)
# #
@ -250,14 +250,14 @@ function(get_dotapp_dir exe dotapp_dir_var)
if(is_executable) if(is_executable)
get_filename_component(sdir "${s}" PATH) get_filename_component(sdir "${s}" PATH)
set(dotapp_dir "${sdir}") set(dotapp_dir "${sdir}")
else(is_executable) else()
set(dotapp_dir "${s}") set(dotapp_dir "${s}")
endif(is_executable) endif()
endif(s MATCHES "^.*/.*\\.app/.*$") endif()
set(${dotapp_dir_var} "${dotapp_dir}" PARENT_SCOPE) set(${dotapp_dir_var} "${dotapp_dir}" PARENT_SCOPE)
endfunction(get_dotapp_dir) endfunction()
function(get_bundle_and_executable app bundle_var executable_var valid_var) function(get_bundle_and_executable app bundle_var executable_var valid_var)
@ -273,13 +273,13 @@ function(get_bundle_and_executable app bundle_var executable_var valid_var)
set(${executable_var} "${executable}" PARENT_SCOPE) set(${executable_var} "${executable}" PARENT_SCOPE)
set(valid 1) set(valid 1)
#message(STATUS "info: handled .app directory case...") #message(STATUS "info: handled .app directory case...")
else(EXISTS "${app}" AND EXISTS "${executable}") else()
message(STATUS "warning: *NOT* handled - .app directory case...") message(STATUS "warning: *NOT* handled - .app directory case...")
endif(EXISTS "${app}" AND EXISTS "${executable}") endif()
else(app MATCHES "\\.app$") else()
message(STATUS "warning: *NOT* handled - directory but not .app case...") message(STATUS "warning: *NOT* handled - directory but not .app case...")
endif(app MATCHES "\\.app$") endif()
else(IS_DIRECTORY "${app}") else()
# Is it an executable file? # Is it an executable file?
is_file_executable("${app}" is_executable) is_file_executable("${app}" is_executable)
if(is_executable) if(is_executable)
@ -296,21 +296,21 @@ function(get_bundle_and_executable app bundle_var executable_var valid_var)
set(valid 1) set(valid 1)
#message(STATUS "info: handled executable file in any dir case...") #message(STATUS "info: handled executable file in any dir case...")
endif() endif()
else(is_executable) else()
message(STATUS "warning: *NOT* handled - not .app dir, not executable file...") message(STATUS "warning: *NOT* handled - not .app dir, not executable file...")
endif(is_executable) endif()
endif(IS_DIRECTORY "${app}") endif()
else(EXISTS "${app}") else()
message(STATUS "warning: *NOT* handled - directory/file does not exist...") message(STATUS "warning: *NOT* handled - directory/file does not exist...")
endif(EXISTS "${app}") endif()
if(NOT valid) if(NOT valid)
set(${bundle_var} "error: not a bundle" PARENT_SCOPE) set(${bundle_var} "error: not a bundle" PARENT_SCOPE)
set(${executable_var} "error: not a bundle" PARENT_SCOPE) set(${executable_var} "error: not a bundle" PARENT_SCOPE)
endif(NOT valid) endif()
set(${valid_var} ${valid} PARENT_SCOPE) set(${valid_var} ${valid} PARENT_SCOPE)
endfunction(get_bundle_and_executable) endfunction()
function(get_bundle_all_executables bundle exes_var) function(get_bundle_all_executables bundle exes_var)
@ -321,11 +321,11 @@ function(get_bundle_all_executables bundle exes_var)
is_file_executable("${f}" is_executable) is_file_executable("${f}" is_executable)
if(is_executable) if(is_executable)
set(exes ${exes} "${f}") set(exes ${exes} "${f}")
endif(is_executable) endif()
endforeach(f) endforeach()
set(${exes_var} "${exes}" PARENT_SCOPE) set(${exes_var} "${exes}" PARENT_SCOPE)
endfunction(get_bundle_all_executables) endfunction()
function(get_item_key item key_var) function(get_item_key item key_var)
@ -335,7 +335,7 @@ function(get_item_key item key_var)
endif() endif()
string(REGEX REPLACE "\\." "_" ${key_var} "${item_name}") string(REGEX REPLACE "\\." "_" ${key_var} "${item_name}")
set(${key_var} ${${key_var}} PARENT_SCOPE) set(${key_var} ${${key_var}} PARENT_SCOPE)
endfunction(get_item_key) endfunction()
function(clear_bundle_keys keys_var) function(clear_bundle_keys keys_var)
@ -346,9 +346,9 @@ function(clear_bundle_keys keys_var)
set(${key}_EMBEDDED_ITEM PARENT_SCOPE) set(${key}_EMBEDDED_ITEM PARENT_SCOPE)
set(${key}_RESOLVED_EMBEDDED_ITEM PARENT_SCOPE) set(${key}_RESOLVED_EMBEDDED_ITEM PARENT_SCOPE)
set(${key}_COPYFLAG PARENT_SCOPE) set(${key}_COPYFLAG PARENT_SCOPE)
endforeach(key) endforeach()
set(${keys_var} PARENT_SCOPE) set(${keys_var} PARENT_SCOPE)
endfunction(clear_bundle_keys) endfunction()
function(set_bundle_key_values keys_var context item exepath dirs copyflag) function(set_bundle_key_values keys_var context item exepath dirs copyflag)
@ -369,13 +369,13 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
# For frameworks, construct the name under the embedded path from the # For frameworks, construct the name under the embedded path from the
# opening "${item_name}.framework/" to the closing "/${item_name}": # opening "${item_name}.framework/" to the closing "/${item_name}":
# #
string(REGEX REPLACE "^.*(${item_name}.framework/.*/${item_name}).*$" "${default_embedded_path}/\\1" embedded_item "${item}") string(REGEX REPLACE "^.*(${item_name}.framework/.*/?${item_name}).*$" "${default_embedded_path}/\\1" embedded_item "${item}")
else(item MATCHES "[^/]+\\.framework/") else()
# For other items, just use the same name as the original, but in the # For other items, just use the same name as the original, but in the
# embedded path: # embedded path:
# #
set(embedded_item "${default_embedded_path}/${item_name}") set(embedded_item "${default_embedded_path}/${item_name}")
endif(item MATCHES "[^/]+\\.framework/") endif()
# Replace @executable_path and resolve ".." references: # Replace @executable_path and resolve ".." references:
# #
@ -391,7 +391,7 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
# #
if(NOT copyflag) if(NOT copyflag)
set(resolved_embedded_item "${resolved_item}") set(resolved_embedded_item "${resolved_item}")
endif(NOT copyflag) endif()
set(${keys_var} ${${keys_var}} PARENT_SCOPE) set(${keys_var} ${${keys_var}} PARENT_SCOPE)
set(${key}_ITEM "${item}" PARENT_SCOPE) set(${key}_ITEM "${item}" PARENT_SCOPE)
@ -400,10 +400,10 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
set(${key}_EMBEDDED_ITEM "${embedded_item}" PARENT_SCOPE) set(${key}_EMBEDDED_ITEM "${embedded_item}" PARENT_SCOPE)
set(${key}_RESOLVED_EMBEDDED_ITEM "${resolved_embedded_item}" PARENT_SCOPE) set(${key}_RESOLVED_EMBEDDED_ITEM "${resolved_embedded_item}" PARENT_SCOPE)
set(${key}_COPYFLAG "${copyflag}" PARENT_SCOPE) set(${key}_COPYFLAG "${copyflag}" PARENT_SCOPE)
else(NOT length_before EQUAL length_after) else()
#message("warning: item key '${key}' already in the list, subsequent references assumed identical to first") #message("warning: item key '${key}' already in the list, subsequent references assumed identical to first")
endif(NOT length_before EQUAL length_after) endif()
endfunction(set_bundle_key_values) endfunction()
function(get_bundle_keys app libs dirs keys_var) function(get_bundle_keys app libs dirs keys_var)
@ -432,8 +432,8 @@ function(get_bundle_keys app libs dirs keys_var)
get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}") get_prerequisites("${lib}" prereqs 1 1 "${exepath}" "${dirs}")
foreach(pr ${prereqs}) foreach(pr ${prereqs})
set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" "${dirs}" 1) set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" "${dirs}" 1)
endforeach(pr) endforeach()
endforeach(lib) endforeach()
# For each executable found in the bundle, accumulate keys as we go. # For each executable found in the bundle, accumulate keys as we go.
# The list of keys should be complete when all prerequisites of all # The list of keys should be complete when all prerequisites of all
@ -450,8 +450,8 @@ function(get_bundle_keys app libs dirs keys_var)
get_prerequisites("${exe}" prereqs 1 1 "${exepath}" "${dirs}") get_prerequisites("${exe}" prereqs 1 1 "${exepath}" "${dirs}")
foreach(pr ${prereqs}) foreach(pr ${prereqs})
set_bundle_key_values(${keys_var} "${exe}" "${pr}" "${exepath}" "${dirs}" 1) set_bundle_key_values(${keys_var} "${exe}" "${pr}" "${exepath}" "${dirs}" 1)
endforeach(pr) endforeach()
endforeach(exe) endforeach()
# Propagate values to caller's scope: # Propagate values to caller's scope:
# #
@ -463,9 +463,9 @@ function(get_bundle_keys app libs dirs keys_var)
set(${key}_EMBEDDED_ITEM "${${key}_EMBEDDED_ITEM}" PARENT_SCOPE) set(${key}_EMBEDDED_ITEM "${${key}_EMBEDDED_ITEM}" PARENT_SCOPE)
set(${key}_RESOLVED_EMBEDDED_ITEM "${${key}_RESOLVED_EMBEDDED_ITEM}" PARENT_SCOPE) set(${key}_RESOLVED_EMBEDDED_ITEM "${${key}_RESOLVED_EMBEDDED_ITEM}" PARENT_SCOPE)
set(${key}_COPYFLAG "${${key}_COPYFLAG}" PARENT_SCOPE) set(${key}_COPYFLAG "${${key}_COPYFLAG}" PARENT_SCOPE)
endforeach(key) endforeach()
endif(valid) endif()
endfunction(get_bundle_keys) endfunction()
function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item) function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
@ -485,10 +485,10 @@ function(copy_resolved_item_into_bundle resolved_item resolved_embedded_item)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}") execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${resolved_item}" "${resolved_embedded_item}")
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
file(RPATH_REMOVE FILE "${resolved_embedded_item}") file(RPATH_REMOVE FILE "${resolved_embedded_item}")
endif(UNIX AND NOT APPLE) endif()
endif() endif()
endfunction(copy_resolved_item_into_bundle) endfunction()
function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_item) function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_item)
@ -527,10 +527,10 @@ function(copy_resolved_framework_into_bundle resolved_item resolved_embedded_ite
endif() endif()
if(UNIX AND NOT APPLE) if(UNIX AND NOT APPLE)
file(RPATH_REMOVE FILE "${resolved_embedded_item}") file(RPATH_REMOVE FILE "${resolved_embedded_item}")
endif(UNIX AND NOT APPLE) endif()
endif() endif()
endfunction(copy_resolved_framework_into_bundle) endfunction()
function(fixup_bundle_item resolved_embedded_item exepath dirs) function(fixup_bundle_item resolved_embedded_item exepath dirs)
@ -580,10 +580,10 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
if(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "") if(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "")
set(changes ${changes} "-change" "${pr}" "${${rkey}_EMBEDDED_ITEM}") set(changes ${changes} "-change" "${pr}" "${${rkey}_EMBEDDED_ITEM}")
else(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "") else()
message("warning: unexpected reference to '${pr}'") message("warning: unexpected reference to '${pr}'")
endif(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "") endif()
endforeach(pr) endforeach()
if(BU_CHMOD_BUNDLE_ITEMS) if(BU_CHMOD_BUNDLE_ITEMS)
execute_process(COMMAND chmod u+w "${resolved_embedded_item}") execute_process(COMMAND chmod u+w "${resolved_embedded_item}")
@ -595,7 +595,7 @@ function(fixup_bundle_item resolved_embedded_item exepath dirs)
execute_process(COMMAND install_name_tool execute_process(COMMAND install_name_tool
${changes} -id "${${ikey}_EMBEDDED_ITEM}" "${resolved_embedded_item}" ${changes} -id "${${ikey}_EMBEDDED_ITEM}" "${resolved_embedded_item}"
) )
endfunction(fixup_bundle_item) endfunction()
function(fixup_bundle app libs dirs) function(fixup_bundle app libs dirs)
@ -620,9 +620,9 @@ function(fixup_bundle app libs dirs)
math(EXPR i ${i}+1) math(EXPR i ${i}+1)
if(${${key}_COPYFLAG}) if(${${key}_COPYFLAG})
message(STATUS "${i}/${n}: copying '${${key}_RESOLVED_ITEM}'") message(STATUS "${i}/${n}: copying '${${key}_RESOLVED_ITEM}'")
else(${${key}_COPYFLAG}) else()
message(STATUS "${i}/${n}: *NOT* copying '${${key}_RESOLVED_ITEM}'") message(STATUS "${i}/${n}: *NOT* copying '${${key}_RESOLVED_ITEM}'")
endif(${${key}_COPYFLAG}) endif()
set(show_status 0) set(show_status 0)
if(show_status) if(show_status)
@ -634,7 +634,7 @@ function(fixup_bundle app libs dirs)
message(STATUS "resolved_embedded_item='${${key}_RESOLVED_EMBEDDED_ITEM}'") message(STATUS "resolved_embedded_item='${${key}_RESOLVED_EMBEDDED_ITEM}'")
message(STATUS "copyflag='${${key}_COPYFLAG}'") message(STATUS "copyflag='${${key}_COPYFLAG}'")
message(STATUS "") message(STATUS "")
endif(show_status) endif()
if(${${key}_COPYFLAG}) if(${${key}_COPYFLAG})
set(item "${${key}_ITEM}") set(item "${${key}_ITEM}")
@ -645,8 +645,8 @@ function(fixup_bundle app libs dirs)
copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}" copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
"${${key}_RESOLVED_EMBEDDED_ITEM}") "${${key}_RESOLVED_EMBEDDED_ITEM}")
endif() endif()
endif(${${key}_COPYFLAG}) endif()
endforeach(key) endforeach()
message(STATUS "fixup_bundle: fixing...") message(STATUS "fixup_bundle: fixing...")
foreach(key ${keys}) foreach(key ${keys})
@ -654,28 +654,28 @@ function(fixup_bundle app libs dirs)
if(APPLE) if(APPLE)
message(STATUS "${i}/${n}: fixing up '${${key}_RESOLVED_EMBEDDED_ITEM}'") message(STATUS "${i}/${n}: fixing up '${${key}_RESOLVED_EMBEDDED_ITEM}'")
fixup_bundle_item("${${key}_RESOLVED_EMBEDDED_ITEM}" "${exepath}" "${dirs}") fixup_bundle_item("${${key}_RESOLVED_EMBEDDED_ITEM}" "${exepath}" "${dirs}")
else(APPLE) else()
message(STATUS "${i}/${n}: fix-up not required on this platform '${${key}_RESOLVED_EMBEDDED_ITEM}'") message(STATUS "${i}/${n}: fix-up not required on this platform '${${key}_RESOLVED_EMBEDDED_ITEM}'")
endif(APPLE) endif()
endforeach(key) endforeach()
message(STATUS "fixup_bundle: cleaning up...") message(STATUS "fixup_bundle: cleaning up...")
clear_bundle_keys(keys) clear_bundle_keys(keys)
message(STATUS "fixup_bundle: verifying...") message(STATUS "fixup_bundle: verifying...")
verify_app("${app}") verify_app("${app}")
else(valid) else()
message(SEND_ERROR "error: fixup_bundle: not a valid bundle") message(SEND_ERROR "error: fixup_bundle: not a valid bundle")
endif(valid) endif()
message(STATUS "fixup_bundle: done") message(STATUS "fixup_bundle: done")
endfunction(fixup_bundle) endfunction()
function(copy_and_fixup_bundle src dst libs dirs) function(copy_and_fixup_bundle src dst libs dirs)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${src}" "${dst}") execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${src}" "${dst}")
fixup_bundle("${dst}" "${libs}" "${dirs}") fixup_bundle("${dst}" "${libs}" "${dirs}")
endfunction(copy_and_fixup_bundle) endfunction()
function(verify_bundle_prerequisites bundle result_var info_var) function(verify_bundle_prerequisites bundle result_var info_var)
@ -720,23 +720,23 @@ function(verify_bundle_prerequisites bundle result_var info_var)
set(external_prereqs ${external_prereqs} "${p}") set(external_prereqs ${external_prereqs} "${p}")
endif() endif()
endif() endif()
endforeach(p) endforeach()
if(external_prereqs) if(external_prereqs)
# Found non-system/somehow-unacceptable prerequisites: # Found non-system/somehow-unacceptable prerequisites:
set(result 0) set(result 0)
set(info ${info} "external prerequisites found:\nf='${f}'\nexternal_prereqs='${external_prereqs}'\n") set(info ${info} "external prerequisites found:\nf='${f}'\nexternal_prereqs='${external_prereqs}'\n")
endif(external_prereqs) endif()
endif(is_executable) endif()
endforeach(f) endforeach()
if(result) if(result)
set(info "Verified ${count} executable files in '${bundle}'") set(info "Verified ${count} executable files in '${bundle}'")
endif(result) endif()
set(${result_var} "${result}" PARENT_SCOPE) set(${result_var} "${result}" PARENT_SCOPE)
set(${info_var} "${info}" PARENT_SCOPE) set(${info_var} "${info}" PARENT_SCOPE)
endfunction(verify_bundle_prerequisites) endfunction()
function(verify_bundle_symlinks bundle result_var info_var) function(verify_bundle_symlinks bundle result_var info_var)
@ -749,7 +749,7 @@ function(verify_bundle_symlinks bundle result_var info_var)
set(${result_var} "${result}" PARENT_SCOPE) set(${result_var} "${result}" PARENT_SCOPE)
set(${info_var} "${info}" PARENT_SCOPE) set(${info_var} "${info}" PARENT_SCOPE)
endfunction(verify_bundle_symlinks) endfunction()
function(verify_app app) function(verify_app app)
@ -778,9 +778,9 @@ function(verify_app app)
message(STATUS "verified='${verified}'") message(STATUS "verified='${verified}'")
message(STATUS "info='${info}'") message(STATUS "info='${info}'")
message(STATUS "") message(STATUS "")
endif(verified) endif()
if(NOT verified) if(NOT verified)
message(FATAL_ERROR "error: verify_app failed") message(FATAL_ERROR "error: verify_app failed")
endif(NOT verified) endif()
endfunction(verify_app) endfunction()

@ -14,12 +14,12 @@
# support for AT&T syntax assemblers, e.g. GNU as # support for AT&T syntax assemblers, e.g. GNU as
SET(ASM_DIALECT "-ATT") set(ASM_DIALECT "-ATT")
# *.S files are supposed to be preprocessed, so they should not be passed to # *.S files are supposed to be preprocessed, so they should not be passed to
# assembler but should be processed by gcc # assembler but should be processed by gcc
SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;asm) set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;asm)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>") set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
INCLUDE(CMakeASMInformation) include(CMakeASMInformation)
SET(ASM_DIALECT) set(ASM_DIALECT)

@ -1,12 +1,12 @@
SET(CMAKE_ASM@ASM_DIALECT@_COMPILER "@_CMAKE_ASM_COMPILER@") set(CMAKE_ASM@ASM_DIALECT@_COMPILER "@_CMAKE_ASM_COMPILER@")
SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_ARG1 "@_CMAKE_ASM_COMPILER_ARG1@") set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ARG1 "@_CMAKE_ASM_COMPILER_ARG1@")
SET(CMAKE_AR "@CMAKE_AR@") set(CMAKE_AR "@CMAKE_AR@")
SET(CMAKE_RANLIB "@CMAKE_RANLIB@") set(CMAKE_RANLIB "@CMAKE_RANLIB@")
SET(CMAKE_LINKER "@CMAKE_LINKER@") set(CMAKE_LINKER "@CMAKE_LINKER@")
SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1) set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1)
SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_ID "@_CMAKE_ASM_COMPILER_ID@") set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ID "@_CMAKE_ASM_COMPILER_ID@")
SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_ENV_VAR "@_CMAKE_ASM_COMPILER_ENV_VAR@") set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ENV_VAR "@_CMAKE_ASM_COMPILER_ENV_VAR@")
SET(CMAKE_ASM@ASM_DIALECT@_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) set(CMAKE_ASM@ASM_DIALECT@_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
SET(CMAKE_ASM@ASM_DIALECT@_LINKER_PREFERENCE 0) set(CMAKE_ASM@ASM_DIALECT@_LINKER_PREFERENCE 0)

@ -12,76 +12,76 @@
# (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.)
IF(UNIX) if(UNIX)
SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o) set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
ELSE(UNIX) else()
SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj) set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
ENDIF(UNIX) endif()
SET(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I set(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I
SET(CMAKE_BASE_NAME) set(CMAKE_BASE_NAME)
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE) get_filename_component(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE)
IF("${CMAKE_BASE_NAME}" STREQUAL "as") if("${CMAKE_BASE_NAME}" STREQUAL "as")
SET(CMAKE_BASE_NAME gas) set(CMAKE_BASE_NAME gas)
ENDIF("${CMAKE_BASE_NAME}" STREQUAL "as") endif()
# Load compiler-specific information. # Load compiler-specific information.
SET(_INCLUDED_FILE "") set(_INCLUDED_FILE "")
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
INCLUDE(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) include(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) endif()
IF(NOT _INCLUDED_FILE) if(NOT _INCLUDED_FILE)
IF("ASM${ASM_DIALECT}" STREQUAL "ASM") if("ASM${ASM_DIALECT}" STREQUAL "ASM")
MESSAGE(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}") message(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
ENDIF("ASM${ASM_DIALECT}" STREQUAL "ASM") endif()
INCLUDE(Platform/${CMAKE_BASE_NAME} OPTIONAL) include(Platform/${CMAKE_BASE_NAME} OPTIONAL)
ENDIF(NOT _INCLUDED_FILE) endif()
IF(CMAKE_SYSTEM_PROCESSOR) if(CMAKE_SYSTEM_PROCESSOR)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
IF(NOT _INCLUDED_FILE) if(NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
ENDIF(NOT _INCLUDED_FILE) endif()
ENDIF(CMAKE_SYSTEM_PROCESSOR) endif()
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
IF(NOT _INCLUDED_FILE) if(NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
ENDIF(NOT _INCLUDED_FILE) endif()
# Set default assembler file extensions: # Set default assembler file extensions:
IF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS) if(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm) set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS) endif()
# Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends: # Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends:
SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}") set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}")
# avoid just having a space as the initial value for the cache # avoid just having a space as the initial value for the cache
IF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ") if(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT) set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
ENDIF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ") endif()
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING set (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
"Flags used by the assembler during all build types.") "Flags used by the assembler during all build types.")
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
# default build type is none # default build type is none
IF(NOT CMAKE_NO_BUILD_TYPE) if(NOT CMAKE_NO_BUILD_TYPE)
SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
"Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.") "Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.")
ENDIF(NOT CMAKE_NO_BUILD_TYPE) endif()
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING set (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
"Flags used by the assembler during debug builds.") "Flags used by the assembler during debug builds.")
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING set (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING
"Flags used by the assembler during release minsize builds.") "Flags used by the assembler during release minsize builds.")
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE_INIT}" CACHE STRING set (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE_INIT}" CACHE STRING
"Flags used by the assembler during release builds.") "Flags used by the assembler during release builds.")
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING set (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
"Flags used by the assembler during Release with Debug Info builds.") "Flags used by the assembler during Release with Debug Info builds.")
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) endif()
MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_FLAGS mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_FLAGS
CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG
CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL
CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE
@ -89,42 +89,42 @@ MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_FLAGS
) )
IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT) if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>") set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT) endif()
IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY) if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
SET(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> " "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
"<CMAKE_RANLIB> <TARGET> ") "<CMAKE_RANLIB> <TARGET> ")
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY) endif()
IF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE) if(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
SET(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
"<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE) endif()
IF(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG) if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG)
SET(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG}) set(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG})
ENDIF() endif()
IF(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP) if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP)
SET(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP}) set(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP})
ENDIF() endif()
IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG) if(NOT CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG)
SET(CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_ASM${ASM_DIALECT}_FLAG}) set(CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_ASM${ASM_DIALECT}_FLAG})
ENDIF() endif()
# to be done # to be done
IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY) if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY) set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY) endif()
IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE) if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE) set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE) endif()
SET(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1) set(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1)

@ -14,11 +14,11 @@
# support for the MS assembler, masm and masm64 # support for the MS assembler, masm and masm64
SET(ASM_DIALECT "_MASM") set(ASM_DIALECT "_MASM")
SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm) set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> /c /Fo <OBJECT> <SOURCE>") set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> /c /Fo <OBJECT> <SOURCE>")
INCLUDE(CMakeASMInformation) include(CMakeASMInformation)
SET(ASM_DIALECT) set(ASM_DIALECT)

@ -19,21 +19,21 @@ set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS nasm asm)
if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT) if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
if(WIN32) if(WIN32)
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8) if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
SET(CMAKE_ASM_NASM_OBJECT_FORMAT win64) set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
else() else()
SET(CMAKE_ASM_NASM_OBJECT_FORMAT win32) set(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
endif() endif()
elseif(APPLE) elseif(APPLE)
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8) if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho64) set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
else() else()
SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho) set(CMAKE_ASM_NASM_OBJECT_FORMAT macho)
endif() endif()
else() else()
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8) if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf64) set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
else() else()
SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf) set(CMAKE_ASM_NASM_OBJECT_FORMAT elf)
endif() endif()
endif() endif()
endif() endif()

@ -1,7 +1,23 @@
This file provides a few notes to CMake developers about how to add
support for a new language to CMake. It is also possible to place
these files in CMAKE_MODULE_PATH within an outside project to add
languages not supported by upstream CMake. However, this is not
a fully supported use case.
The implementation behind the scenes of project/enable_language,
including the compiler/platform modules, is an *internal* API that
does not make any compatibility guarantees. It is not covered in the
official reference documentation that is versioned with the source code.
Maintainers of external language support are responsible for porting
it to each version of CMake as upstream changes are made. Since
the API is internal we will not necessarily include notice of any
changes in release notes.
CMakeDetermine(LANG)Compiler.cmake -> this should find the compiler for LANG and configure CMake(LANG)Compiler.cmake.in CMakeDetermine(LANG)Compiler.cmake -> this should find the compiler for LANG and configure CMake(LANG)Compiler.cmake.in
CMake(LANG)Compiler.cmake.in -> used by CMakeDetermine(LANG)Compiler.cmake CMake(LANG)Compiler.cmake.in -> used by CMakeDetermine(LANG)Compiler.cmake
This file is used to store compiler information and is copied down into try This file is used to store compiler information and is copied down into try
compile directories so that try compiles do not need to re-determine and test the LANG compile directories so that try compiles do not need to re-determine and test the LANG
CMakeTest(LANG)Compiler.cmake -> test the compiler and set: CMakeTest(LANG)Compiler.cmake -> test the compiler and set:

@ -13,28 +13,28 @@
# License text for the above reference.) # License text for the above reference.)
# Nothing here yet # Nothing here yet
IF(CMAKE_GENERATOR MATCHES "Visual Studio 7") if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
INCLUDE(CMakeVS7BackwardCompatibility) include(CMakeVS7BackwardCompatibility)
SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1) set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7") endif()
IF(CMAKE_GENERATOR MATCHES "Visual Studio 6") if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
INCLUDE(CMakeVS6BackwardCompatibility) include(CMakeVS6BackwardCompatibility)
SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1) set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6") endif()
IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
# Old CMake versions did not support OS X universal binaries anyway, # Old CMake versions did not support OS X universal binaries anyway,
# so just get through this with at least some size for the types. # so just get through this with at least some size for the types.
LIST(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS) list(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
IF(${NUM_ARCHS} GREATER 1) if(${NUM_ARCHS} GREATER 1)
IF(NOT DEFINED CMAKE_TRY_COMPILE_OSX_ARCHITECTURES) if(NOT DEFINED CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
MESSAGE(WARNING "This module does not work with OS X universal binaries.") message(WARNING "This module does not work with OS X universal binaries.")
SET(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES 1) set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES 1)
LIST(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES) list(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
ENDIF() endif()
ENDIF() endif()
INCLUDE (CheckTypeSize) include (CheckTypeSize)
CHECK_TYPE_SIZE(int CMAKE_SIZEOF_INT) CHECK_TYPE_SIZE(int CMAKE_SIZEOF_INT)
CHECK_TYPE_SIZE(long CMAKE_SIZEOF_LONG) CHECK_TYPE_SIZE(long CMAKE_SIZEOF_LONG)
CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P) CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
@ -43,52 +43,52 @@ IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
CHECK_TYPE_SIZE(float CMAKE_SIZEOF_FLOAT) CHECK_TYPE_SIZE(float CMAKE_SIZEOF_FLOAT)
CHECK_TYPE_SIZE(double CMAKE_SIZEOF_DOUBLE) CHECK_TYPE_SIZE(double CMAKE_SIZEOF_DOUBLE)
INCLUDE (CheckIncludeFile) include (CheckIncludeFile)
CHECK_INCLUDE_FILE("limits.h" CMAKE_HAVE_LIMITS_H) CHECK_INCLUDE_FILE("limits.h" CMAKE_HAVE_LIMITS_H)
CHECK_INCLUDE_FILE("unistd.h" CMAKE_HAVE_UNISTD_H) CHECK_INCLUDE_FILE("unistd.h" CMAKE_HAVE_UNISTD_H)
CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H) CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H)
INCLUDE (CheckIncludeFiles) include (CheckIncludeFiles)
CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SYS_PRCTL_H) CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SYS_PRCTL_H)
INCLUDE (TestBigEndian) include (TestBigEndian)
TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN) TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
INCLUDE (FindX11) include (FindX11)
IF("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$") if("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
SET (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.") set (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
ELSE("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$") else()
SET (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING set (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING
"X11 extra flags.") "X11 extra flags.")
ENDIF("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$") endif()
SET (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING set (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING
"Libraries and options used in X11 programs.") "Libraries and options used in X11 programs.")
SET (CMAKE_HAS_X "${X11_FOUND}" CACHE INTERNAL "Is X11 around.") set (CMAKE_HAS_X "${X11_FOUND}" CACHE INTERNAL "Is X11 around.")
INCLUDE (FindThreads) include (FindThreads)
SET (CMAKE_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING set (CMAKE_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING
"Thread library used.") "Thread library used.")
SET (CMAKE_USE_PTHREADS "${CMAKE_USE_PTHREADS_INIT}" CACHE BOOL set (CMAKE_USE_PTHREADS "${CMAKE_USE_PTHREADS_INIT}" CACHE BOOL
"Use the pthreads library.") "Use the pthreads library.")
SET (CMAKE_USE_WIN32_THREADS "${CMAKE_USE_WIN32_THREADS_INIT}" CACHE BOOL set (CMAKE_USE_WIN32_THREADS "${CMAKE_USE_WIN32_THREADS_INIT}" CACHE BOOL
"Use the win32 thread library.") "Use the win32 thread library.")
SET (CMAKE_HP_PTHREADS ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL set (CMAKE_HP_PTHREADS ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL
"Use HP pthreads.") "Use HP pthreads.")
SET (CMAKE_USE_SPROC ${CMAKE_USE_SPROC_INIT} CACHE BOOL set (CMAKE_USE_SPROC ${CMAKE_USE_SPROC_INIT} CACHE BOOL
"Use sproc libs.") "Use sproc libs.")
IF(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES) if(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES) set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
SET(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES) set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
ENDIF() endif()
ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) endif()
MARK_AS_ADVANCED( mark_as_advanced(
CMAKE_HP_PTHREADS CMAKE_HP_PTHREADS
CMAKE_THREAD_LIBS CMAKE_THREAD_LIBS
CMAKE_USE_PTHREADS CMAKE_USE_PTHREADS

@ -1,10 +1,10 @@
# - define a bunch of backwards compatibility variables # - define a bunch of backwards compatibility variables
# CMAKE_ANSI_CXXFLAGS - flag for ansi c++ # CMAKE_ANSI_CXXFLAGS - flag for ansi c++
# CMAKE_HAS_ANSI_STRING_STREAM - has <strstream> # CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
# INCLUDE(TestForANSIStreamHeaders) # include(TestForANSIStreamHeaders)
# INCLUDE(CheckIncludeFileCXX) # include(CheckIncludeFileCXX)
# INCLUDE(TestForSTDNamespace) # include(TestForSTDNamespace)
# INCLUDE(TestForANSIForScope) # include(TestForANSIForScope)
#============================================================================= #=============================================================================
# Copyright 2002-2009 Kitware, Inc. # Copyright 2002-2009 Kitware, Inc.
@ -19,36 +19,36 @@
# (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.)
IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
# check for some ANSI flags in the CXX compiler if it is not gnu # check for some ANSI flags in the CXX compiler if it is not gnu
IF(NOT CMAKE_COMPILER_IS_GNUCXX) if(NOT CMAKE_COMPILER_IS_GNUCXX)
INCLUDE(TestCXXAcceptsFlag) include(TestCXXAcceptsFlag)
SET(CMAKE_TRY_ANSI_CXX_FLAGS "") set(CMAKE_TRY_ANSI_CXX_FLAGS "")
IF(CMAKE_SYSTEM MATCHES "IRIX.*") if(CMAKE_SYSTEM MATCHES "IRIX.*")
SET(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std") set(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std")
ENDIF(CMAKE_SYSTEM MATCHES "IRIX.*") endif()
IF(CMAKE_SYSTEM MATCHES "OSF.*") if(CMAKE_SYSTEM MATCHES "OSF.*")
SET(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname") set(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname")
ENDIF(CMAKE_SYSTEM MATCHES "OSF.*") endif()
# if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see # if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see
# if the compiler accepts it # if the compiler accepts it
IF( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+") if( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
CHECK_CXX_ACCEPTS_FLAG(${CMAKE_TRY_ANSI_CXX_FLAGS} CMAKE_CXX_ACCEPTS_FLAGS) CHECK_CXX_ACCEPTS_FLAG(${CMAKE_TRY_ANSI_CXX_FLAGS} CMAKE_CXX_ACCEPTS_FLAGS)
# if the compiler liked the flag then set CMAKE_ANSI_CXXFLAGS # if the compiler liked the flag then set CMAKE_ANSI_CXXFLAGS
# to the flag # to the flag
IF(CMAKE_CXX_ACCEPTS_FLAGS) if(CMAKE_CXX_ACCEPTS_FLAGS)
SET(CMAKE_ANSI_CXXFLAGS ${CMAKE_TRY_ANSI_CXX_FLAGS} CACHE INTERNAL set(CMAKE_ANSI_CXXFLAGS ${CMAKE_TRY_ANSI_CXX_FLAGS} CACHE INTERNAL
"What flags are required by the c++ compiler to make it ansi." ) "What flags are required by the c++ compiler to make it ansi." )
ENDIF(CMAKE_CXX_ACCEPTS_FLAGS) endif()
ENDIF( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+") endif()
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) endif()
SET(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS}) set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
INCLUDE(TestForANSIStreamHeaders) include(TestForANSIStreamHeaders)
INCLUDE(CheckIncludeFileCXX) include(CheckIncludeFileCXX)
INCLUDE(TestForSTDNamespace) include(TestForSTDNamespace)
INCLUDE(TestForANSIForScope) include(TestForANSIForScope)
INCLUDE(TestForSSTREAM) include(TestForSSTREAM)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}")
ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS) endif()

@ -12,6 +12,6 @@
# (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.)
SET (CMAKE_MAKE_PROGRAM "make" CACHE STRING set (CMAKE_MAKE_PROGRAM "make" CACHE STRING
"Program used to build from makefiles.") "Program used to build from makefiles.")
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) mark_as_advanced(CMAKE_MAKE_PROGRAM)

@ -1,53 +1,56 @@
SET(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@") set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
SET(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@") set(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
SET(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@") set(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
SET(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@") set(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
SET(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@") set(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
@SET_MSVC_C_ARCHITECTURE_ID@ @SET_MSVC_C_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@") set(CMAKE_AR "@CMAKE_AR@")
SET(CMAKE_RANLIB "@CMAKE_RANLIB@") set(CMAKE_RANLIB "@CMAKE_RANLIB@")
SET(CMAKE_LINKER "@CMAKE_LINKER@") set(CMAKE_LINKER "@CMAKE_LINKER@")
SET(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@) set(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@)
SET(CMAKE_C_COMPILER_LOADED 1) set(CMAKE_C_COMPILER_LOADED 1)
SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@) set(CMAKE_C_COMPILER_WORKS @CMAKE_C_COMPILER_WORKS@)
SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@) set(CMAKE_C_ABI_COMPILED @CMAKE_C_ABI_COMPILED@)
IF(CMAKE_COMPILER_IS_CYGWIN) set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
SET(CYGWIN 1) set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
SET(UNIX 1) if(CMAKE_COMPILER_IS_CYGWIN)
ENDIF(CMAKE_COMPILER_IS_CYGWIN) set(CYGWIN 1)
set(UNIX 1)
SET(CMAKE_C_COMPILER_ENV_VAR "CC") endif()
IF(CMAKE_COMPILER_IS_MINGW) set(CMAKE_C_COMPILER_ENV_VAR "CC")
SET(MINGW 1)
ENDIF(CMAKE_COMPILER_IS_MINGW) if(CMAKE_COMPILER_IS_MINGW)
SET(CMAKE_C_COMPILER_ID_RUN 1) set(MINGW 1)
SET(CMAKE_C_SOURCE_FILE_EXTENSIONS c) endif()
SET(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) set(CMAKE_C_COMPILER_ID_RUN 1)
SET(CMAKE_C_LINKER_PREFERENCE 10) set(CMAKE_C_SOURCE_FILE_EXTENSIONS c)
set(CMAKE_C_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_C_LINKER_PREFERENCE 10)
# Save compiler ABI information. # Save compiler ABI information.
SET(CMAKE_C_SIZEOF_DATA_PTR "@CMAKE_C_SIZEOF_DATA_PTR@") set(CMAKE_C_SIZEOF_DATA_PTR "@CMAKE_C_SIZEOF_DATA_PTR@")
SET(CMAKE_C_COMPILER_ABI "@CMAKE_C_COMPILER_ABI@") set(CMAKE_C_COMPILER_ABI "@CMAKE_C_COMPILER_ABI@")
SET(CMAKE_C_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@") set(CMAKE_C_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
IF(CMAKE_C_SIZEOF_DATA_PTR) if(CMAKE_C_SIZEOF_DATA_PTR)
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}") set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
ENDIF(CMAKE_C_SIZEOF_DATA_PTR) endif()
IF(CMAKE_C_COMPILER_ABI) if(CMAKE_C_COMPILER_ABI)
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}") set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
ENDIF(CMAKE_C_COMPILER_ABI) endif()
IF(CMAKE_C_LIBRARY_ARCHITECTURE) if(CMAKE_C_LIBRARY_ARCHITECTURE)
SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@") set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
ENDIF() endif()
SET(CMAKE_C_HAS_ISYSROOT "@CMAKE_C_HAS_ISYSROOT@") @CMAKE_C_SYSROOT_FLAG_CODE@
@CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG_CODE@ @CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
SET(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@") set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
SET(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@") set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
@SET_CMAKE_CMCLDEPS_EXECUTABLE@ @SET_CMAKE_CMCLDEPS_EXECUTABLE@
@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@ @SET_CMAKE_CL_SHOWINCLUDE_PREFIX@

@ -20,6 +20,14 @@
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif # endif
#elif defined(__PATHCC__)
# define COMPILER_ID "PathScale"
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
# if defined(__PATHCC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
# endif
#elif defined(__clang__) #elif defined(__clang__)
# define COMPILER_ID "Clang" # define COMPILER_ID "Clang"
# define COMPILER_VERSION_MAJOR DEC(__clang_major__) # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
@ -67,6 +75,10 @@
#elif defined(__DECC) #elif defined(__DECC)
# define COMPILER_ID "Compaq" # define COMPILER_ID "Compaq"
/* __DECC_VER = VVRRTPPPP */
# define COMPILER_VERSION_MAJOR DEC(__DECC_VER/10000000)
# define COMPILER_VERSION_MINOR DEC(__DECC_VER/100000 % 100)
# define COMPILER_VERSION_PATCH DEC(__DECC_VER % 10000)
#elif defined(__IBMC__) #elif defined(__IBMC__)
# if defined(__COMPILER_VER__) # if defined(__COMPILER_VER__)
@ -91,14 +103,17 @@
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif # endif
#elif defined(__PATHSCALE__)
# define COMPILER_ID "PathScale"
#elif defined(_CRAYC) #elif defined(_CRAYC)
# define COMPILER_ID "Cray" # define COMPILER_ID "Cray"
# define COMPILER_VERSION_MAJOR DEC(_RELEASE)
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
#elif defined(__TI_COMPILER_VERSION__) #elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI_DSP" # define COMPILER_ID "TI_DSP"
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
#elif defined(__TINYC__) #elif defined(__TINYC__)
# define COMPILER_ID "TinyCC" # define COMPILER_ID "TinyCC"
@ -132,9 +147,16 @@
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif # endif
/* Analog VisualDSP++ >= 4.5.6 */
#elif defined(__VISUALDSPVERSION__)
# define COMPILER_ID "ADSP"
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
/* Analog VisualDSP++ < 4.5.6 */
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
SHARC (21000) DSPs */
# define COMPILER_ID "ADSP" # define COMPILER_ID "ADSP"
/* IAR Systems compiler for embedded systems. /* IAR Systems compiler for embedded systems.
@ -147,6 +169,10 @@
http://sdcc.sourceforge.net */ http://sdcc.sourceforge.net */
#elif defined(SDCC) #elif defined(SDCC)
# define COMPILER_ID "SDCC" # define COMPILER_ID "SDCC"
/* SDCC = VRP */
# define COMPILER_VERSION_MAJOR DEC(SDCC/100)
# define COMPILER_VERSION_MINOR DEC(SDCC/10 % 10)
# define COMPILER_VERSION_PATCH DEC(SDCC % 10)
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)
# define COMPILER_ID "MIPSpro" # define COMPILER_ID "MIPSpro"

@ -20,119 +20,119 @@
# some compilers use different extensions (e.g. sdcc uses .rel) # some compilers use different extensions (e.g. sdcc uses .rel)
# so set the extension here first so it can be overridden by the compiler specific file # so set the extension here first so it can be overridden by the compiler specific file
IF(UNIX) if(UNIX)
SET(CMAKE_C_OUTPUT_EXTENSION .o) set(CMAKE_C_OUTPUT_EXTENSION .o)
ELSE(UNIX) else()
SET(CMAKE_C_OUTPUT_EXTENSION .obj) set(CMAKE_C_OUTPUT_EXTENSION .obj)
ENDIF(UNIX) endif()
SET(_INCLUDED_FILE 0) set(_INCLUDED_FILE 0)
# Load compiler-specific information. # Load compiler-specific information.
IF(CMAKE_C_COMPILER_ID) if(CMAKE_C_COMPILER_ID)
INCLUDE(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL) include(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL)
ENDIF(CMAKE_C_COMPILER_ID) endif()
SET(CMAKE_BASE_NAME) set(CMAKE_BASE_NAME)
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE) get_filename_component(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE)
IF(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_BASE_NAME gcc) set(CMAKE_BASE_NAME gcc)
ENDIF(CMAKE_COMPILER_IS_GNUCC) endif()
# load a hardware specific file, mostly useful for embedded compilers # load a hardware specific file, mostly useful for embedded compilers
IF(CMAKE_SYSTEM_PROCESSOR) if(CMAKE_SYSTEM_PROCESSOR)
IF(CMAKE_C_COMPILER_ID) if(CMAKE_C_COMPILER_ID)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
ENDIF(CMAKE_C_COMPILER_ID) endif()
IF (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
ENDIF (NOT _INCLUDED_FILE) endif ()
ENDIF(CMAKE_SYSTEM_PROCESSOR) endif()
# load the system- and compiler specific files # load the system- and compiler specific files
IF(CMAKE_C_COMPILER_ID) if(CMAKE_C_COMPILER_ID)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
ENDIF(CMAKE_C_COMPILER_ID) endif()
IF (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
ENDIF (NOT _INCLUDED_FILE) endif ()
# We specify the compiler information in the system file for some # We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file # platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info. # was first included. Include it again to get the language info.
# Remove this when all compiler info is removed from system files. # Remove this when all compiler info is removed from system files.
IF (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL) include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
ENDIF (NOT _INCLUDED_FILE) endif ()
IF(CMAKE_C_SIZEOF_DATA_PTR) if(CMAKE_C_SIZEOF_DATA_PTR)
FOREACH(f ${CMAKE_C_ABI_FILES}) foreach(f ${CMAKE_C_ABI_FILES})
INCLUDE(${f}) include(${f})
ENDFOREACH() endforeach()
UNSET(CMAKE_C_ABI_FILES) unset(CMAKE_C_ABI_FILES)
ENDIF() endif()
# This should be included before the _INIT variables are # This should be included before the _INIT variables are
# used to initialize the cache. Since the rule variables # used to initialize the cache. Since the rule variables
# have if blocks on them, users can still define them here. # have if blocks on them, users can still define them here.
# But, it should still be after the platform file so changes can # But, it should still be after the platform file so changes can
# be made to those values. # be made to those values.
IF(CMAKE_USER_MAKE_RULES_OVERRIDE) if(CMAKE_USER_MAKE_RULES_OVERRIDE)
# Save the full path of the file so try_compile can use it. # Save the full path of the file so try_compile can use it.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override) include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}") set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
ENDIF() endif()
IF(CMAKE_USER_MAKE_RULES_OVERRIDE_C) if(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
# Save the full path of the file so try_compile can use it. # Save the full path of the file so try_compile can use it.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_C} RESULT_VARIABLE _override) include(${CMAKE_USER_MAKE_RULES_OVERRIDE_C} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE_C "${_override}") set(CMAKE_USER_MAKE_RULES_OVERRIDE_C "${_override}")
ENDIF() endif()
# for most systems a module is the same as a shared library # for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just # so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables # copy the values from the LIBRARY variables
IF(NOT CMAKE_MODULE_EXISTS) if(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) set(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
ENDIF(NOT CMAKE_MODULE_EXISTS) endif()
SET(CMAKE_C_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}") set(CMAKE_C_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}")
# avoid just having a space as the initial value for the cache # avoid just having a space as the initial value for the cache
IF(CMAKE_C_FLAGS_INIT STREQUAL " ") if(CMAKE_C_FLAGS_INIT STREQUAL " ")
SET(CMAKE_C_FLAGS_INIT) set(CMAKE_C_FLAGS_INIT)
ENDIF(CMAKE_C_FLAGS_INIT STREQUAL " ") endif()
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
"Flags used by the compiler during all build types.") "Flags used by the compiler during all build types.")
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
# default build type is none # default build type is none
IF(NOT CMAKE_NO_BUILD_TYPE) if(NOT CMAKE_NO_BUILD_TYPE)
SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.") "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
ENDIF(NOT CMAKE_NO_BUILD_TYPE) endif()
SET (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
"Flags used by the compiler during debug builds.") "Flags used by the compiler during debug builds.")
SET (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING
"Flags used by the compiler during release minsize builds.") "Flags used by the compiler during release minsize builds.")
SET (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE_INIT}" CACHE STRING set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE_INIT}" CACHE STRING
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).") "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
"Flags used by the compiler during Release with Debug Info builds.") "Flags used by the compiler during Release with Debug Info builds.")
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) endif()
IF(CMAKE_C_STANDARD_LIBRARIES_INIT) if(CMAKE_C_STANDARD_LIBRARIES_INIT)
SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}" set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}"
CACHE STRING "Libraries linked by defalut with all C applications.") CACHE STRING "Libraries linked by defalut with all C applications.")
MARK_AS_ADVANCED(CMAKE_C_STANDARD_LIBRARIES) mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
ENDIF(CMAKE_C_STANDARD_LIBRARIES_INIT) endif()
INCLUDE(CMakeCommonLanguageInclude) include(CMakeCommonLanguageInclude)
# now define the following rule variables # now define the following rule variables
@ -151,69 +151,69 @@ INCLUDE(CMakeCommonLanguageInclude)
# <LINK_FLAGS> # <LINK_FLAGS>
# C compiler information # C compiler information
# <CMAKE_C_COMPILER> # <CMAKE_C_COMPILER>
# <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> # <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS>
# <CMAKE_SHARED_MODULE_CREATE_C_FLAGS> # <CMAKE_SHARED_MODULE_CREATE_C_FLAGS>
# <CMAKE_C_LINK_FLAGS> # <CMAKE_C_LINK_FLAGS>
# Static library tools # Static library tools
# <CMAKE_AR> # <CMAKE_AR>
# <CMAKE_RANLIB> # <CMAKE_RANLIB>
# create a C shared library # create a C shared library
IF(NOT CMAKE_C_CREATE_SHARED_LIBRARY) if(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
SET(CMAKE_C_CREATE_SHARED_LIBRARY set(CMAKE_C_CREATE_SHARED_LIBRARY
"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
ENDIF(NOT CMAKE_C_CREATE_SHARED_LIBRARY) endif()
# create a C shared module just copy the shared library rule # create a C shared module just copy the shared library rule
IF(NOT CMAKE_C_CREATE_SHARED_MODULE) if(NOT CMAKE_C_CREATE_SHARED_MODULE)
SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY}) set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
ENDIF(NOT CMAKE_C_CREATE_SHARED_MODULE) endif()
# Create a static archive incrementally for large object file counts. # Create a static archive incrementally for large object file counts.
# If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these. # If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these.
IF(NOT DEFINED CMAKE_C_ARCHIVE_CREATE) if(NOT DEFINED CMAKE_C_ARCHIVE_CREATE)
SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>") set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF() endif()
IF(NOT DEFINED CMAKE_C_ARCHIVE_APPEND) if(NOT DEFINED CMAKE_C_ARCHIVE_APPEND)
SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>") set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF() endif()
IF(NOT DEFINED CMAKE_C_ARCHIVE_FINISH) if(NOT DEFINED CMAKE_C_ARCHIVE_FINISH)
SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>") set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
ENDIF() endif()
# compile a C file into an object file # compile a C file into an object file
IF(NOT CMAKE_C_COMPILE_OBJECT) if(NOT CMAKE_C_COMPILE_OBJECT)
SET(CMAKE_C_COMPILE_OBJECT set(CMAKE_C_COMPILE_OBJECT
"<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>") "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
ENDIF(NOT CMAKE_C_COMPILE_OBJECT) endif()
IF(NOT CMAKE_C_LINK_EXECUTABLE) if(NOT CMAKE_C_LINK_EXECUTABLE)
SET(CMAKE_C_LINK_EXECUTABLE set(CMAKE_C_LINK_EXECUTABLE
"<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") "<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
ENDIF(NOT CMAKE_C_LINK_EXECUTABLE) endif()
IF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG) if(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG)
SET(CMAKE_EXECUTABLE_RUNTIME_C_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG}) set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG) endif()
IF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP) if(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
SET(CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP}) set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP) endif()
IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG) if(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
SET(CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG}) set(CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
ENDIF(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG) endif()
MARK_AS_ADVANCED( mark_as_advanced(
CMAKE_C_FLAGS CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_MINSIZEREL CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE CMAKE_C_FLAGS_RELEASE
CMAKE_C_FLAGS_RELWITHDEBINFO CMAKE_C_FLAGS_RELWITHDEBINFO
) )
SET(CMAKE_C_INFORMATION_LOADED 1) set(CMAKE_C_INFORMATION_LOADED 1)

@ -1,54 +1,57 @@
SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@") set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
SET(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@") set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
SET(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@") set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
SET(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@") set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
SET(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@") set(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
@SET_MSVC_CXX_ARCHITECTURE_ID@ @SET_MSVC_CXX_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@") set(CMAKE_AR "@CMAKE_AR@")
SET(CMAKE_RANLIB "@CMAKE_RANLIB@") set(CMAKE_RANLIB "@CMAKE_RANLIB@")
SET(CMAKE_LINKER "@CMAKE_LINKER@") set(CMAKE_LINKER "@CMAKE_LINKER@")
SET(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@) set(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
SET(CMAKE_CXX_COMPILER_LOADED 1) set(CMAKE_CXX_COMPILER_LOADED 1)
SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@) set(CMAKE_CXX_COMPILER_WORKS @CMAKE_CXX_COMPILER_WORKS@)
SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@) set(CMAKE_CXX_ABI_COMPILED @CMAKE_CXX_ABI_COMPILED@)
IF(CMAKE_COMPILER_IS_CYGWIN) set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
SET(CYGWIN 1) set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
SET(UNIX 1) if(CMAKE_COMPILER_IS_CYGWIN)
ENDIF(CMAKE_COMPILER_IS_CYGWIN) set(CYGWIN 1)
set(UNIX 1)
SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX") endif()
IF(CMAKE_COMPILER_IS_MINGW) set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
SET(MINGW 1)
ENDIF(CMAKE_COMPILER_IS_MINGW) if(CMAKE_COMPILER_IS_MINGW)
SET(CMAKE_CXX_COMPILER_ID_RUN 1) set(MINGW 1)
SET(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC) endif()
SET(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP) set(CMAKE_CXX_COMPILER_ID_RUN 1)
SET(CMAKE_CXX_LINKER_PREFERENCE 30) set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
SET(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1) set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
set(CMAKE_CXX_LINKER_PREFERENCE 30)
set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
# Save compiler ABI information. # Save compiler ABI information.
SET(CMAKE_CXX_SIZEOF_DATA_PTR "@CMAKE_CXX_SIZEOF_DATA_PTR@") set(CMAKE_CXX_SIZEOF_DATA_PTR "@CMAKE_CXX_SIZEOF_DATA_PTR@")
SET(CMAKE_CXX_COMPILER_ABI "@CMAKE_CXX_COMPILER_ABI@") set(CMAKE_CXX_COMPILER_ABI "@CMAKE_CXX_COMPILER_ABI@")
SET(CMAKE_CXX_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@") set(CMAKE_CXX_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
IF(CMAKE_CXX_SIZEOF_DATA_PTR) if(CMAKE_CXX_SIZEOF_DATA_PTR)
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}") set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
ENDIF(CMAKE_CXX_SIZEOF_DATA_PTR) endif()
IF(CMAKE_CXX_COMPILER_ABI) if(CMAKE_CXX_COMPILER_ABI)
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}") set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
ENDIF(CMAKE_CXX_COMPILER_ABI) endif()
IF(CMAKE_CXX_LIBRARY_ARCHITECTURE) if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@") set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
ENDIF() endif()
SET(CMAKE_CXX_HAS_ISYSROOT "@CMAKE_CXX_HAS_ISYSROOT@") @CMAKE_CXX_SYSROOT_FLAG_CODE@
@CMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG_CODE@ @CMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
SET(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@") set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
SET(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@") set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
@SET_CMAKE_CMCLDEPS_EXECUTABLE@ @SET_CMAKE_CMCLDEPS_EXECUTABLE@
@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@ @SET_CMAKE_CL_SHOWINCLUDE_PREFIX@

@ -10,6 +10,9 @@
#if defined(__COMO__) #if defined(__COMO__)
# define COMPILER_ID "Comeau" # define COMPILER_ID "Comeau"
/* __COMO_VERSION__ = VRR */
# define COMPILER_VERSION_MAJOR DEC(__COMO_VERSION__ / 100)
# define COMPILER_VERSION_MINOR DEC(__COMO_VERSION__ % 100)
#elif defined(__INTEL_COMPILER) || defined(__ICC) #elif defined(__INTEL_COMPILER) || defined(__ICC)
# define COMPILER_ID "Intel" # define COMPILER_ID "Intel"
@ -22,6 +25,14 @@
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE) # define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# endif # endif
#elif defined(__PATHCC__)
# define COMPILER_ID "PathScale"
# define COMPILER_VERSION_MAJOR DEC(__PATHCC__)
# define COMPILER_VERSION_MINOR DEC(__PATHCC_MINOR__)
# if defined(__PATHCC_PATCHLEVEL__)
# define COMPILER_VERSION_PATCH DEC(__PATHCC_PATCHLEVEL__)
# endif
#elif defined(__clang__) #elif defined(__clang__)
# define COMPILER_ID "Clang" # define COMPILER_ID "Clang"
# define COMPILER_VERSION_MAJOR DEC(__clang_major__) # define COMPILER_VERSION_MAJOR DEC(__clang_major__)
@ -69,6 +80,10 @@
#elif defined(__DECCXX) #elif defined(__DECCXX)
# define COMPILER_ID "Compaq" # define COMPILER_ID "Compaq"
/* __DECCXX_VER = VVRRTPPPP */
# define COMPILER_VERSION_MAJOR DEC(__DECCXX_VER/10000000)
# define COMPILER_VERSION_MINOR DEC(__DECCXX_VER/100000 % 100)
# define COMPILER_VERSION_PATCH DEC(__DECCXX_VER % 10000)
#elif defined(__IBMCPP__) #elif defined(__IBMCPP__)
# if defined(__COMPILER_VER__) # if defined(__COMPILER_VER__)
@ -93,14 +108,17 @@
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__) # define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif # endif
#elif defined(__PATHSCALE__)
# define COMPILER_ID "PathScale"
#elif defined(_CRAYC) #elif defined(_CRAYC)
# define COMPILER_ID "Cray" # define COMPILER_ID "Cray"
# define COMPILER_VERSION_MAJOR DEC(_RELEASE)
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
#elif defined(__TI_COMPILER_VERSION__) #elif defined(__TI_COMPILER_VERSION__)
# define COMPILER_ID "TI_DSP" # define COMPILER_ID "TI_DSP"
/* __TI_COMPILER_VERSION__ = VVVRRRPPP */
# define COMPILER_VERSION_MAJOR DEC(__TI_COMPILER_VERSION__/1000000)
# define COMPILER_VERSION_MINOR DEC(__TI_COMPILER_VERSION__/1000 % 1000)
# define COMPILER_VERSION_PATCH DEC(__TI_COMPILER_VERSION__ % 1000)
#elif defined(__SCO_VERSION__) #elif defined(__SCO_VERSION__)
# define COMPILER_ID "SCO" # define COMPILER_ID "SCO"
@ -131,9 +149,16 @@
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD) # define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# endif # endif
/* Analog VisualDSP++ >= 4.5.6 */
#elif defined(__VISUALDSPVERSION__)
# define COMPILER_ID "ADSP"
/* __VISUALDSPVERSION__ = 0xVVRRPP00 */
# define COMPILER_VERSION_MAJOR HEX(__VISUALDSPVERSION__>>24)
# define COMPILER_VERSION_MINOR HEX(__VISUALDSPVERSION__>>16 & 0xFF)
# define COMPILER_VERSION_PATCH HEX(__VISUALDSPVERSION__>>8 & 0xFF)
/* Analog VisualDSP++ < 4.5.6 */
#elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__) #elif defined(__ADSPBLACKFIN__) || defined(__ADSPTS__) || defined(__ADSP21000__)
/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
SHARC (21000) DSPs */
# define COMPILER_ID "ADSP" # define COMPILER_ID "ADSP"
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION) #elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)

@ -20,210 +20,210 @@
# some compilers use different extensions (e.g. sdcc uses .rel) # some compilers use different extensions (e.g. sdcc uses .rel)
# so set the extension here first so it can be overridden by the compiler specific file # so set the extension here first so it can be overridden by the compiler specific file
IF(UNIX) if(UNIX)
SET(CMAKE_CXX_OUTPUT_EXTENSION .o) set(CMAKE_CXX_OUTPUT_EXTENSION .o)
ELSE(UNIX) else()
SET(CMAKE_CXX_OUTPUT_EXTENSION .obj) set(CMAKE_CXX_OUTPUT_EXTENSION .obj)
ENDIF(UNIX) endif()
SET(_INCLUDED_FILE 0) set(_INCLUDED_FILE 0)
# Load compiler-specific information. # Load compiler-specific information.
IF(CMAKE_CXX_COMPILER_ID) if(CMAKE_CXX_COMPILER_ID)
INCLUDE(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL) include(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL)
ENDIF(CMAKE_CXX_COMPILER_ID) endif()
SET(CMAKE_BASE_NAME) set(CMAKE_BASE_NAME)
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE) get_filename_component(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
# since the gnu compiler has several names force g++ # since the gnu compiler has several names force g++
IF(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_BASE_NAME g++) set(CMAKE_BASE_NAME g++)
ENDIF(CMAKE_COMPILER_IS_GNUCXX) endif()
# load a hardware specific file, mostly useful for embedded compilers # load a hardware specific file, mostly useful for embedded compilers
IF(CMAKE_SYSTEM_PROCESSOR) if(CMAKE_SYSTEM_PROCESSOR)
IF(CMAKE_CXX_COMPILER_ID) if(CMAKE_CXX_COMPILER_ID)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
ENDIF(CMAKE_CXX_COMPILER_ID) endif()
IF (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
ENDIF (NOT _INCLUDED_FILE) endif ()
ENDIF(CMAKE_SYSTEM_PROCESSOR) endif()
# load the system- and compiler specific files # load the system- and compiler specific files
IF(CMAKE_CXX_COMPILER_ID) if(CMAKE_CXX_COMPILER_ID)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
ENDIF(CMAKE_CXX_COMPILER_ID) endif()
IF (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
RESULT_VARIABLE _INCLUDED_FILE) RESULT_VARIABLE _INCLUDED_FILE)
ENDIF (NOT _INCLUDED_FILE) endif ()
# We specify the compiler information in the system file for some # We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file # platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info. # was first included. Include it again to get the language info.
# Remove this when all compiler info is removed from system files. # Remove this when all compiler info is removed from system files.
IF (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL) include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
ENDIF (NOT _INCLUDED_FILE) endif ()
IF(CMAKE_CXX_SIZEOF_DATA_PTR) if(CMAKE_CXX_SIZEOF_DATA_PTR)
FOREACH(f ${CMAKE_CXX_ABI_FILES}) foreach(f ${CMAKE_CXX_ABI_FILES})
INCLUDE(${f}) include(${f})
ENDFOREACH() endforeach()
UNSET(CMAKE_CXX_ABI_FILES) unset(CMAKE_CXX_ABI_FILES)
ENDIF() endif()
# This should be included before the _INIT variables are # This should be included before the _INIT variables are
# used to initialize the cache. Since the rule variables # used to initialize the cache. Since the rule variables
# have if blocks on them, users can still define them here. # have if blocks on them, users can still define them here.
# But, it should still be after the platform file so changes can # But, it should still be after the platform file so changes can
# be made to those values. # be made to those values.
IF(CMAKE_USER_MAKE_RULES_OVERRIDE) if(CMAKE_USER_MAKE_RULES_OVERRIDE)
# Save the full path of the file so try_compile can use it. # Save the full path of the file so try_compile can use it.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override) include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}") set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
ENDIF() endif()
IF(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX) if(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
# Save the full path of the file so try_compile can use it. # Save the full path of the file so try_compile can use it.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} RESULT_VARIABLE _override) include(${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX "${_override}") set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX "${_override}")
ENDIF() endif()
# 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
IF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS) if(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS) endif()
IF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC) if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
SET(CMAKE_CXX_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC}) set(CMAKE_CXX_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC) endif()
IF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE) if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
SET(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE}) set(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE) endif()
IF(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL) if(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
SET(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL}) set(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL) endif()
IF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS) if(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) set(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
ENDIF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS) endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) endif()
IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG) if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG}) set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG) endif()
IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP) if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP}) set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP) endif()
IF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG) if(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG}) set(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
ENDIF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG) endif()
IF(NOT DEFINED CMAKE_EXE_EXPORTS_CXX_FLAG) if(NOT DEFINED CMAKE_EXE_EXPORTS_CXX_FLAG)
SET(CMAKE_EXE_EXPORTS_CXX_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG}) set(CMAKE_EXE_EXPORTS_CXX_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
ENDIF() endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG) if(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG)
SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG}) set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
ENDIF() endif()
IF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG) if(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
SET(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG}) set(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG})
ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG) endif()
IF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP) if(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
SET(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP}) set(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP})
ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP) endif()
IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG) if(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
SET(CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG}) set(CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG})
ENDIF(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG) endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH) if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH}) set(CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH) endif()
IF(NOT CMAKE_INCLUDE_FLAG_CXX) if(NOT CMAKE_INCLUDE_FLAG_CXX)
SET(CMAKE_INCLUDE_FLAG_CXX ${CMAKE_INCLUDE_FLAG_C}) set(CMAKE_INCLUDE_FLAG_CXX ${CMAKE_INCLUDE_FLAG_C})
ENDIF(NOT CMAKE_INCLUDE_FLAG_CXX) endif()
IF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX) 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()
# for most systems a module is the same as a shared library # for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just # so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables # copy the values from the LIBRARY variables
IF(NOT CMAKE_MODULE_EXISTS) if(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}) set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
ENDIF(NOT CMAKE_MODULE_EXISTS) endif()
# 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})
ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS) endif()
IF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS) if(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS}) set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
ENDIF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS) endif()
# Initialize CXX link type selection flags from C versions. # Initialize CXX link type selection flags from C versions.
FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE) foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
IF(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS) if(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS
${CMAKE_${type}_LINK_STATIC_C_FLAGS}) ${CMAKE_${type}_LINK_STATIC_C_FLAGS})
ENDIF(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS) endif()
IF(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS) if(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS
${CMAKE_${type}_LINK_DYNAMIC_C_FLAGS}) ${CMAKE_${type}_LINK_DYNAMIC_C_FLAGS})
ENDIF(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS) endif()
ENDFOREACH(type) endforeach()
# add the flags to the cache based # add the flags to the cache based
# on the initial values computed in the platform/*.cmake files # on the initial values computed in the platform/*.cmake files
# use _INIT variables so that this only happens the first time # use _INIT variables so that this only happens the first time
# and you can set these flags in the cmake cache # and you can set these flags in the cmake cache
SET(CMAKE_CXX_FLAGS_INIT "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}") set(CMAKE_CXX_FLAGS_INIT "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}")
# avoid just having a space as the initial value for the cache # avoid just having a space as the initial value for the cache
IF(CMAKE_CXX_FLAGS_INIT STREQUAL " ") if(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
SET(CMAKE_CXX_FLAGS_INIT) set(CMAKE_CXX_FLAGS_INIT)
ENDIF(CMAKE_CXX_FLAGS_INIT STREQUAL " ") endif()
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING
"Flags used by the compiler during all build types.") "Flags used by the compiler during all build types.")
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG_INIT}" CACHE STRING set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG_INIT}" CACHE STRING
"Flags used by the compiler during debug builds.") "Flags used by the compiler during debug builds.")
SET (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" CACHE STRING set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" CACHE STRING
"Flags used by the compiler during release minsize builds.") "Flags used by the compiler during release minsize builds.")
SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE_INIT}" CACHE STRING set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE_INIT}" CACHE STRING
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).") "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
"Flags used by the compiler during Release with Debug Info builds.") "Flags used by the compiler during Release with Debug Info builds.")
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) endif()
IF(CMAKE_CXX_STANDARD_LIBRARIES_INIT) if(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}" set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}"
CACHE STRING "Libraries linked by defalut with all C++ applications.") CACHE STRING "Libraries linked by defalut with all C++ applications.")
MARK_AS_ADVANCED(CMAKE_CXX_STANDARD_LIBRARIES) mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
ENDIF(CMAKE_CXX_STANDARD_LIBRARIES_INIT) endif()
INCLUDE(CMakeCommonLanguageInclude) include(CMakeCommonLanguageInclude)
# now define the following rules: # now define the following rules:
# CMAKE_CXX_CREATE_SHARED_LIBRARY # CMAKE_CXX_CREATE_SHARED_LIBRARY
@ -241,59 +241,59 @@ INCLUDE(CMakeCommonLanguageInclude)
# <LINK_FLAGS> # <LINK_FLAGS>
# CXX compiler information # CXX compiler information
# <CMAKE_CXX_COMPILER> # <CMAKE_CXX_COMPILER>
# <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> # <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS>
# <CMAKE_CXX_SHARED_MODULE_CREATE_FLAGS> # <CMAKE_CXX_SHARED_MODULE_CREATE_FLAGS>
# <CMAKE_CXX_LINK_FLAGS> # <CMAKE_CXX_LINK_FLAGS>
# Static library tools # Static library tools
# <CMAKE_AR> # <CMAKE_AR>
# <CMAKE_RANLIB> # <CMAKE_RANLIB>
# create a shared C++ library # create a shared C++ library
IF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY) if(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY set(CMAKE_CXX_CREATE_SHARED_LIBRARY
"<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
ENDIF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY) endif()
# create a c++ shared module copy the shared library rule by default # create a c++ shared module copy the shared library rule by default
IF(NOT CMAKE_CXX_CREATE_SHARED_MODULE) if(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
ENDIF(NOT CMAKE_CXX_CREATE_SHARED_MODULE) endif()
# Create a static archive incrementally for large object file counts. # Create a static archive incrementally for large object file counts.
# If CMAKE_CXX_CREATE_STATIC_LIBRARY is set it will override these. # If CMAKE_CXX_CREATE_STATIC_LIBRARY is set it will override these.
IF(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE) if(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE)
SET(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>") set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF() endif()
IF(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND) if(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND)
SET(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>") set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF() endif()
IF(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH) if(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH)
SET(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>") set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
ENDIF() endif()
# compile a C++ file into an object file # compile a C++ file into an object file
IF(NOT CMAKE_CXX_COMPILE_OBJECT) if(NOT CMAKE_CXX_COMPILE_OBJECT)
SET(CMAKE_CXX_COMPILE_OBJECT set(CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>") "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
ENDIF(NOT CMAKE_CXX_COMPILE_OBJECT) endif()
IF(NOT CMAKE_CXX_LINK_EXECUTABLE) if(NOT CMAKE_CXX_LINK_EXECUTABLE)
SET(CMAKE_CXX_LINK_EXECUTABLE set(CMAKE_CXX_LINK_EXECUTABLE
"<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") "<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
ENDIF(NOT CMAKE_CXX_LINK_EXECUTABLE) endif()
MARK_AS_ADVANCED( mark_as_advanced(
CMAKE_BUILD_TOOL CMAKE_BUILD_TOOL
CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE
CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS
CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE
CMAKE_CXX_FLAGS_RELWITHDEBINFO CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_DEBUG) CMAKE_CXX_FLAGS_DEBUG)
SET(CMAKE_CXX_INFORMATION_LOADED 1) set(CMAKE_CXX_INFORMATION_LOADED 1)

@ -20,18 +20,15 @@
# in front of each include path, so it can remove it. # in front of each include path, so it can remove it.
# #
IF(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND) if(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND)
STRING(REPLACE "cmake.exe" "cmcldeps.exe" CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND}) string(REPLACE "cmake.exe" "cmcldeps.exe" CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND})
SET(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes) set(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
FILE(WRITE ${showdir}/foo.h "\n") file(WRITE ${showdir}/foo.h "\n")
FILE(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n") file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c execute_process(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE showOut) WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE outLine)
STRING(REPLACE main.c "" showOut1 ${showOut}) string(REGEX MATCH "\n([^:]*:[^:]*:[ \t]*)" tmp "${outLine}")
STRING(REPLACE "/" "\\" header1 ${showdir}/foo.h) set(localizedPrefix "${CMAKE_MATCH_1}")
STRING(TOLOWER ${header1} header2) set(SET_CMAKE_CMCLDEPS_EXECUTABLE "set(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
STRING(REPLACE ${header2} "" showOut2 ${showOut1}) set(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "set(CMAKE_CL_SHOWINCLUDE_PREFIX \"${localizedPrefix}\")")
STRING(REPLACE "\n" "" showOut3 ${showOut2}) endif()
SET(SET_CMAKE_CMCLDEPS_EXECUTABLE "SET(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
SET(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "SET(CMAKE_CL_SHOWINCLUDE_PREFIX \"${showOut3}\")")
ENDIF()

@ -16,74 +16,74 @@
# cache values that can be initialized in the platform-compiler.cmake file # cache values that can be initialized in the platform-compiler.cmake file
# it may be included by more than one language. # it may be included by more than one language.
SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}" set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
CACHE STRING "Flags used by the linker.") CACHE STRING "Flags used by the linker.")
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
# default build type is none # default build type is none
IF(NOT CMAKE_NO_BUILD_TYPE) if(NOT CMAKE_NO_BUILD_TYPE)
SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.") "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
ENDIF(NOT CMAKE_NO_BUILD_TYPE) endif()
SET (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING set (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
"Flags used by the linker during debug builds.") "Flags used by the linker during debug builds.")
SET (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT} CACHE STRING set (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT} CACHE STRING
"Flags used by the linker during release minsize builds.") "Flags used by the linker during release minsize builds.")
SET (CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING set (CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
"Flags used by the linker during release builds.") "Flags used by the linker during release builds.")
SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
"Flags used by the linker during Release with Debug Info builds.") "Flags used by the linker during Release with Debug Info builds.")
SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING set (CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
"Flags used by the linker during debug builds.") "Flags used by the linker during debug builds.")
SET (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL ${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT} set (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL ${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT}
CACHE STRING CACHE STRING
"Flags used by the linker during release minsize builds.") "Flags used by the linker during release minsize builds.")
SET (CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} CACHE STRING set (CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
"Flags used by the linker during release builds.") "Flags used by the linker during release builds.")
SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
"Flags used by the linker during Release with Debug Info builds.") "Flags used by the linker during Release with Debug Info builds.")
SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG ${CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING set (CMAKE_MODULE_LINKER_FLAGS_DEBUG ${CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
"Flags used by the linker during debug builds.") "Flags used by the linker during debug builds.")
SET (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL ${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT} set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL ${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT}
CACHE STRING CACHE STRING
"Flags used by the linker during release minsize builds.") "Flags used by the linker during release minsize builds.")
SET (CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING set (CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
"Flags used by the linker during release builds.") "Flags used by the linker during release builds.")
SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING ${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
"Flags used by the linker during Release with Debug Info builds.") "Flags used by the linker during Release with Debug Info builds.")
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) endif()
# shared linker flags # shared linker flags
SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}" set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
CACHE STRING "Flags used by the linker during the creation of dll's.") CACHE STRING "Flags used by the linker during the creation of dll's.")
# module linker flags # module linker flags
SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}" set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
CACHE STRING "Flags used by the linker during the creation of modules.") CACHE STRING "Flags used by the linker during the creation of modules.")
SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL set(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
"What is the target build tool cmake is generating for.") "What is the target build tool cmake is generating for.")
MARK_AS_ADVANCED( mark_as_advanced(
CMAKE_BUILD_TOOL CMAKE_BUILD_TOOL
CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE
CMAKE_EXE_LINKER_FLAGS CMAKE_EXE_LINKER_FLAGS
CMAKE_EXE_LINKER_FLAGS_DEBUG CMAKE_EXE_LINKER_FLAGS_DEBUG

@ -25,27 +25,27 @@
# (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.)
MACRO(CMAKE_DEPENDENT_OPTION option doc default depends force) macro(CMAKE_DEPENDENT_OPTION option doc default depends force)
IF(${option}_ISSET MATCHES "^${option}_ISSET$") if(${option}_ISSET MATCHES "^${option}_ISSET$")
SET(${option}_AVAILABLE 1) set(${option}_AVAILABLE 1)
FOREACH(d ${depends}) foreach(d ${depends})
STRING(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}") string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
IF(${CMAKE_DEPENDENT_OPTION_DEP}) if(${CMAKE_DEPENDENT_OPTION_DEP})
ELSE(${CMAKE_DEPENDENT_OPTION_DEP}) else()
SET(${option}_AVAILABLE 0) set(${option}_AVAILABLE 0)
ENDIF(${CMAKE_DEPENDENT_OPTION_DEP}) endif()
ENDFOREACH(d) endforeach()
IF(${option}_AVAILABLE) if(${option}_AVAILABLE)
OPTION(${option} "${doc}" "${default}") option(${option} "${doc}" "${default}")
SET(${option} "${${option}}" CACHE BOOL "${doc}" FORCE) set(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
ELSE(${option}_AVAILABLE) else()
IF(${option} MATCHES "^${option}$") if(${option} MATCHES "^${option}$")
ELSE(${option} MATCHES "^${option}$") else()
SET(${option} "${${option}}" CACHE INTERNAL "${doc}") set(${option} "${${option}}" CACHE INTERNAL "${doc}")
ENDIF(${option} MATCHES "^${option}$") endif()
SET(${option} ${force}) set(${option} ${force})
ENDIF(${option}_AVAILABLE) endif()
ELSE(${option}_ISSET MATCHES "^${option}_ISSET$") else()
SET(${option} "${${option}_ISSET}") set(${option} "${${option}_ISSET}")
ENDIF(${option}_ISSET MATCHES "^${option}_ISSET$") endif()
ENDMACRO(CMAKE_DEPENDENT_OPTION) endmacro()

@ -14,7 +14,7 @@
# determine the compiler to use for ASM using AT&T syntax, e.g. GNU as # determine the compiler to use for ASM using AT&T syntax, e.g. GNU as
SET(ASM_DIALECT "-ATT") set(ASM_DIALECT "-ATT")
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ${_CMAKE_TOOLCHAIN_PREFIX}gas ${_CMAKE_TOOLCHAIN_PREFIX}as) set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ${_CMAKE_TOOLCHAIN_PREFIX}gas ${_CMAKE_TOOLCHAIN_PREFIX}as)
INCLUDE(CMakeDetermineASMCompiler) include(CMakeDetermineASMCompiler)
SET(ASM_DIALECT) set(ASM_DIALECT)

@ -14,52 +14,40 @@
# determine the compiler to use for ASM programs # determine the compiler to use for ASM programs
IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
# prefer the environment variable ASM # prefer the environment variable ASM
IF($ENV{ASM${ASM_DIALECT}} MATCHES ".+") if($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}")
ENDIF($ENV{ASM${ASM_DIALECT}} MATCHES ".+") endif()
# finally list compilers to try # finally list compilers to try
IF("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support if("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
if(NOT CMAKE_ASM_COMPILER_INIT)
IF(CMAKE_ASM_COMPILER_INIT) if(CMAKE_C_COMPILER)
SET(CMAKE_ASM_COMPILER_LIST ${CMAKE_ASM_COMPILER_INIT}) set(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "The ASM compiler")
ELSE(CMAKE_ASM_COMPILER_INIT) set(CMAKE_ASM_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
elseif(CMAKE_CXX_COMPILER)
IF(CMAKE_C_COMPILER) set(CMAKE_ASM_COMPILER "${CMAKE_CXX_COMPILER}" CACHE FILEPATH "The ASM compiler")
SET(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "The ASM compiler") set(CMAKE_ASM_COMPILER_ID "${CMAKE_CXX_COMPILER_ID}")
SET(CMAKE_ASM_COMPILER_ID "${CMAKE_C_COMPILER_ID}") else()
ELSEIF(CMAKE_CXX_COMPILER)
SET(CMAKE_ASM_COMPILER "${CMAKE_CXX_COMPILER}" CACHE FILEPATH "The ASM compiler")
SET(CMAKE_ASM_COMPILER_ID "${CMAKE_CXX_COMPILER_ID}")
ELSE(CMAKE_CXX_COMPILER)
# List all default C and CXX compilers # List all default C and CXX compilers
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}gcc ${_CMAKE_TOOLCHAIN_PREFIX}cc cl bcc xlc set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST
${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ CC aCC cl bcc xlC) ${_CMAKE_TOOLCHAIN_PREFIX}cc ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc
ENDIF(CMAKE_C_COMPILER) CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ aCC cl bcc xlC)
endif()
ENDIF(CMAKE_ASM_COMPILER_INIT) endif()
else() # some specific assembler "dialect"
if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
ELSE("ASM${ASM_DIALECT}" STREQUAL "ASM") # some specific assembler "dialect" message(FATAL_ERROR "CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT must be preset !")
endif()
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT) endif()
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST ${CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT})
ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
MESSAGE(FATAL_ERROR "CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT must be preset !")
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
ENDIF("ASM${ASM_DIALECT}" STREQUAL "ASM")
# Find the compiler. # Find the compiler.
IF (_CMAKE_USER_CXX_COMPILER_PATH OR _CMAKE_USER_C_COMPILER_PATH) _cmake_find_compiler(ASM${ASM_DIALECT})
FIND_PROGRAM(CMAKE_ASM${ASM_DIALECT}_COMPILER NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST} PATHS ${_CMAKE_USER_C_COMPILER_PATH} ${_CMAKE_USER_CXX_COMPILER_PATH} DOC "Assembler" NO_DEFAULT_PATH)
ENDIF (_CMAKE_USER_CXX_COMPILER_PATH OR _CMAKE_USER_C_COMPILER_PATH)
FIND_PROGRAM(CMAKE_ASM${ASM_DIALECT}_COMPILER NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST} PATHS ${_CMAKE_TOOLCHAIN_LOCATION} DOC "Assembler")
ELSE(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER) else()
# we only get here if CMAKE_ASM${ASM_DIALECT}_COMPILER was specified using -D or a pre-made CMakeCache.txt # we only get here if CMAKE_ASM${ASM_DIALECT}_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
@ -68,63 +56,63 @@ ELSE(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
# now try to find it with the full path # now try to find it with the full path
# if it is found, force it into the cache, # if it is found, force it into the cache,
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND" # if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
GET_FILENAME_COMPONENT(_CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH) get_filename_component(_CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
IF(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH) if(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH)
FIND_PROGRAM(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER}) find_program(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER})
MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH) mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH) if(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER ${CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH} CACHE FILEPATH "Assembler" FORCE) set(CMAKE_ASM${ASM_DIALECT}_COMPILER ${CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH} CACHE FILEPATH "Assembler" FORCE)
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH) endif()
ENDIF(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH) endif()
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER) endif()
MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_COMPILER) mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER)
IF (NOT _CMAKE_TOOLCHAIN_LOCATION) if (NOT _CMAKE_TOOLCHAIN_LOCATION)
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH) get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION) endif ()
IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
# Table of per-vendor compiler id flags with expected output. # Table of per-vendor compiler id flags with expected output.
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS GNU ) list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS GNU )
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_GNU "--version") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_GNU "--version")
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_GNU "(GNU assembler)|(GCC)|(Free Software Foundation)") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_GNU "(GNU assembler)|(GCC)|(Free Software Foundation)")
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS HP ) list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS HP )
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_HP "-V") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_HP "-V")
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_HP "HP C") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_HP "HP C")
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS Intel ) list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS Intel )
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Intel "--version") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Intel "--version")
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Intel "(ICC)") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Intel "(ICC)")
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS SunPro ) list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS SunPro )
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_SunPro "-V") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_SunPro "-V")
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_SunPro "Sun C") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_SunPro "Sun C")
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS XL ) list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS XL )
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_XL "-qversion") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_XL "-qversion")
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_XL "XL C") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_XL "XL C")
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS MSVC ) list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS MSVC )
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_MSVC "/?") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_MSVC "/?")
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_MSVC "Microsoft") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_MSVC "Microsoft")
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI_DSP ) list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI_DSP )
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI_DSP "-h") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI_DSP "-h")
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI_DSP "Texas Instruments") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI_DSP "Texas Instruments")
INCLUDE(CMakeDetermineCompilerId) include(CMakeDetermineCompilerId)
CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT}) CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})
ENDIF() endif()
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
MESSAGE(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}") message(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) else()
MESSAGE(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown") message(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) endif()
@ -135,48 +123,48 @@ ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
# NAME_WE cannot be used since then this test will fail for names lile # NAME_WE cannot be used since then this test will fail for names lile
# "arm-unknown-nto-qnx6.3.0-gas.exe", where BASENAME would be # "arm-unknown-nto-qnx6.3.0-gas.exe", where BASENAME would be
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-" # "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
IF (NOT _CMAKE_TOOLCHAIN_PREFIX) if (NOT _CMAKE_TOOLCHAIN_PREFIX)
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME) get_filename_component(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME)
IF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") if (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") endif ()
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX) endif ()
# Now try the C compiler regexp: # Now try the C compiler regexp:
IF (NOT _CMAKE_TOOLCHAIN_PREFIX) if (NOT _CMAKE_TOOLCHAIN_PREFIX)
IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") endif ()
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX) endif ()
# Finally try the CXX compiler regexp: # Finally try the CXX compiler regexp:
IF (NOT _CMAKE_TOOLCHAIN_PREFIX) if (NOT _CMAKE_TOOLCHAIN_PREFIX)
IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") endif ()
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX) endif ()
INCLUDE(CMakeFindBinUtils) include(CMakeFindBinUtils)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR "ASM${ASM_DIALECT}") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR "ASM${ASM_DIALECT}")
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER) if(CMAKE_ASM${ASM_DIALECT}_COMPILER)
MESSAGE(STATUS "Found assembler: ${CMAKE_ASM${ASM_DIALECT}_COMPILER}") message(STATUS "Found assembler: ${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER) else()
MESSAGE(STATUS "Didn't find assembler") message(STATUS "Didn't find assembler")
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER) endif()
SET(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}") set(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
SET(_CMAKE_ASM_COMPILER_ID "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}") set(_CMAKE_ASM_COMPILER_ID "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
SET(_CMAKE_ASM_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1}") set(_CMAKE_ASM_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1}")
SET(_CMAKE_ASM_COMPILER_ENV_VAR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR}") set(_CMAKE_ASM_COMPILER_ENV_VAR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR}")
# configure variables set in this file for fast reload later on # configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in configure_file(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeASM${ASM_DIALECT}Compiler.cmake IMMEDIATE @ONLY) ${CMAKE_PLATFORM_INFO_DIR}/CMakeASM${ASM_DIALECT}Compiler.cmake IMMEDIATE @ONLY)
SET(_CMAKE_ASM_COMPILER) set(_CMAKE_ASM_COMPILER)
SET(_CMAKE_ASM_COMPILER_ARG1) set(_CMAKE_ASM_COMPILER_ARG1)
SET(_CMAKE_ASM_COMPILER_ENV_VAR) set(_CMAKE_ASM_COMPILER_ENV_VAR)

@ -14,14 +14,14 @@
# Find the MS assembler (masm or masm64) # Find the MS assembler (masm or masm64)
SET(ASM_DIALECT "_MASM") set(ASM_DIALECT "_MASM")
# if we are using the 64bit cl compiler, assume we also want the 64bit assembler # if we are using the 64bit cl compiler, assume we also want the 64bit assembler
IF(CMAKE_CL_64) if(CMAKE_CL_64)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml64) set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml64)
ELSE(CMAKE_CL_64) else()
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml) set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml)
ENDIF(CMAKE_CL_64) endif()
INCLUDE(CMakeDetermineASMCompiler) include(CMakeDetermineASMCompiler)
SET(ASM_DIALECT) set(ASM_DIALECT)

@ -14,14 +14,14 @@
# Find the nasm assembler. yasm (http://www.tortall.net/projects/yasm/) is nasm compatible # Find the nasm assembler. yasm (http://www.tortall.net/projects/yasm/) is nasm compatible
SET(CMAKE_ASM_NASM_COMPILER_INIT nasm yasm) set(CMAKE_ASM_NASM_COMPILER_INIT nasm yasm)
IF(NOT CMAKE_ASM_NASM_COMPILER) if(NOT CMAKE_ASM_NASM_COMPILER)
FIND_PROGRAM(CMAKE_ASM_NASM_COMPILER nasm find_program(CMAKE_ASM_NASM_COMPILER nasm
"$ENV{ProgramFiles}/NASM") "$ENV{ProgramFiles}/NASM")
ENDIF(NOT CMAKE_ASM_NASM_COMPILER) endif()
# Load the generic DetermineASM compiler file with the DIALECT set properly: # Load the generic DetermineASM compiler file with the DIALECT set properly:
SET(ASM_DIALECT "_NASM") set(ASM_DIALECT "_NASM")
INCLUDE(CMakeDetermineASMCompiler) include(CMakeDetermineASMCompiler)
SET(ASM_DIALECT) set(ASM_DIALECT)

@ -31,114 +31,112 @@
# If not already set before, it also sets # If not already set before, it also sets
# _CMAKE_TOOLCHAIN_PREFIX # _CMAKE_TOOLCHAIN_PREFIX
IF(NOT CMAKE_C_COMPILER) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
SET(CMAKE_C_COMPILER_INIT NOTFOUND)
# Load system-specific compiler preferences for this language.
# prefer the environment variable CC include(Platform/${CMAKE_SYSTEM_NAME}-C OPTIONAL)
IF($ENV{CC} MATCHES ".+") if(NOT CMAKE_C_COMPILER_NAMES)
GET_FILENAME_COMPONENT(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT) set(CMAKE_C_COMPILER_NAMES cc)
IF(CMAKE_C_FLAGS_ENV_INIT) endif()
SET(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
ENDIF(CMAKE_C_FLAGS_ENV_INIT) if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
IF(NOT EXISTS ${CMAKE_C_COMPILER_INIT}) elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.") set(CMAKE_C_COMPILER_XCODE_TYPE sourcecode.c.c)
ENDIF(NOT EXISTS ${CMAKE_C_COMPILER_INIT}) else()
ENDIF($ENV{CC} MATCHES ".+") if(NOT CMAKE_C_COMPILER)
set(CMAKE_C_COMPILER_INIT NOTFOUND)
# next try prefer the compiler specified by the generator
IF(CMAKE_GENERATOR_CC) # prefer the environment variable CC
IF(NOT CMAKE_C_COMPILER_INIT) if($ENV{CC} MATCHES ".+")
SET(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC}) get_filename_component(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
ENDIF(NOT CMAKE_C_COMPILER_INIT) if(CMAKE_C_FLAGS_ENV_INIT)
ENDIF(CMAKE_GENERATOR_CC) set(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
endif()
# finally list compilers to try if(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
IF(CMAKE_C_COMPILER_INIT) message(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
SET(CMAKE_C_COMPILER_LIST ${CMAKE_C_COMPILER_INIT}) endif()
ELSE(CMAKE_C_COMPILER_INIT) endif()
SET(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}gcc ${_CMAKE_TOOLCHAIN_PREFIX}cc cl bcc xlc)
ENDIF(CMAKE_C_COMPILER_INIT) # next try prefer the compiler specified by the generator
if(CMAKE_GENERATOR_CC)
# Find the compiler. if(NOT CMAKE_C_COMPILER_INIT)
IF (_CMAKE_USER_CXX_COMPILER_PATH) set(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC})
FIND_PROGRAM(CMAKE_C_COMPILER NAMES ${CMAKE_C_COMPILER_LIST} PATHS ${_CMAKE_USER_CXX_COMPILER_PATH} DOC "C compiler" NO_DEFAULT_PATH) endif()
ENDIF (_CMAKE_USER_CXX_COMPILER_PATH) endif()
FIND_PROGRAM(CMAKE_C_COMPILER NAMES ${CMAKE_C_COMPILER_LIST} DOC "C compiler")
# finally list compilers to try
IF(CMAKE_C_COMPILER_INIT AND NOT CMAKE_C_COMPILER) if(NOT CMAKE_C_COMPILER_INIT)
SET(CMAKE_C_COMPILER "${CMAKE_C_COMPILER_INIT}" CACHE FILEPATH "C compiler" FORCE) set(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}cc ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc clang)
ENDIF(CMAKE_C_COMPILER_INIT AND NOT CMAKE_C_COMPILER) endif()
ELSE(NOT CMAKE_C_COMPILER)
_cmake_find_compiler(C)
# we only get here if CMAKE_C_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE else()
# if CMAKE_C_COMPILER is a list of length 2, use the first item as
# CMAKE_C_COMPILER and the 2nd one as CMAKE_C_COMPILER_ARG1 # we only get here if CMAKE_C_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
LIST(LENGTH CMAKE_C_COMPILER _CMAKE_C_COMPILER_LIST_LENGTH) # if CMAKE_C_COMPILER is a list of length 2, use the first item as
IF("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2) # CMAKE_C_COMPILER and the 2nd one as CMAKE_C_COMPILER_ARG1
LIST(GET CMAKE_C_COMPILER 1 CMAKE_C_COMPILER_ARG1)
LIST(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER) list(LENGTH CMAKE_C_COMPILER _CMAKE_C_COMPILER_LIST_LENGTH)
ENDIF("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2) if("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
list(GET CMAKE_C_COMPILER 1 CMAKE_C_COMPILER_ARG1)
# if a compiler was specified by the user but without path, list(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER)
# now try to find it with the full path endif()
# if it is found, force it into the cache,
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND" # if a compiler was specified by the user but without path,
# if the C compiler already had a path, reuse it for searching the CXX compiler # now try to find it with the full path
GET_FILENAME_COMPONENT(_CMAKE_USER_C_COMPILER_PATH "${CMAKE_C_COMPILER}" PATH) # if it is found, force it into the cache,
IF(NOT _CMAKE_USER_C_COMPILER_PATH) # if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
FIND_PROGRAM(CMAKE_C_COMPILER_WITH_PATH NAMES ${CMAKE_C_COMPILER}) # if the C compiler already had a path, reuse it for searching the CXX compiler
MARK_AS_ADVANCED(CMAKE_C_COMPILER_WITH_PATH) get_filename_component(_CMAKE_USER_C_COMPILER_PATH "${CMAKE_C_COMPILER}" PATH)
IF(CMAKE_C_COMPILER_WITH_PATH) if(NOT _CMAKE_USER_C_COMPILER_PATH)
SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE) find_program(CMAKE_C_COMPILER_WITH_PATH NAMES ${CMAKE_C_COMPILER})
ENDIF(CMAKE_C_COMPILER_WITH_PATH) mark_as_advanced(CMAKE_C_COMPILER_WITH_PATH)
ENDIF(NOT _CMAKE_USER_C_COMPILER_PATH) if(CMAKE_C_COMPILER_WITH_PATH)
ENDIF(NOT CMAKE_C_COMPILER) set(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE)
MARK_AS_ADVANCED(CMAKE_C_COMPILER) endif()
endif()
IF (NOT _CMAKE_TOOLCHAIN_LOCATION) endif()
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH) mark_as_advanced(CMAKE_C_COMPILER)
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
# Build a small source file to identify the compiler.
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
SET(CMAKE_C_COMPILER_ID_RUN 1)
SET(CMAKE_C_PLATFORM_ID "Windows")
SET(CMAKE_C_COMPILER_ID "MSVC")
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
IF(NOT CMAKE_C_COMPILER_ID_RUN)
SET(CMAKE_C_COMPILER_ID_RUN 1)
# Each entry in this list is a set of extra flags to try # Each entry in this list is a set of extra flags to try
# adding to the compile line to see if it helps produce # adding to the compile line to see if it helps produce
# a valid identification file. # a valid identification file.
SET(CMAKE_C_COMPILER_ID_TEST_FLAGS set(CMAKE_C_COMPILER_ID_TEST_FLAGS
# Try compiling to an object file only. # Try compiling to an object file only.
"-c" "-c"
# Try enabling ANSI mode on HP. # Try enabling ANSI mode on HP.
"-Aa" "-Aa"
) )
endif()
# Build a small source file to identify the compiler.
if(NOT CMAKE_C_COMPILER_ID_RUN)
set(CMAKE_C_COMPILER_ID_RUN 1)
# Try to identify the compiler. # Try to identify the compiler.
SET(CMAKE_C_COMPILER_ID) set(CMAKE_C_COMPILER_ID)
FILE(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
CMAKE_C_COMPILER_ID_PLATFORM_CONTENT) CMAKE_C_COMPILER_ID_PLATFORM_CONTENT)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
CMAKE_DETERMINE_COMPILER_ID(C CFLAGS CMakeCCompilerId.c) CMAKE_DETERMINE_COMPILER_ID(C CFLAGS CMakeCCompilerId.c)
# Set old compiler and platform id variables. # Set old compiler and platform id variables.
IF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_COMPILER_IS_GNUCC 1) set(CMAKE_COMPILER_IS_GNUCC 1)
ENDIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") endif()
IF("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW") if("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
SET(CMAKE_COMPILER_IS_MINGW 1) set(CMAKE_COMPILER_IS_MINGW 1)
ELSEIF("${CMAKE_C_PLATFORM_ID}" MATCHES "Cygwin") elseif("${CMAKE_C_PLATFORM_ID}" MATCHES "Cygwin")
SET(CMAKE_COMPILER_IS_CYGWIN 1) set(CMAKE_COMPILER_IS_CYGWIN 1)
ENDIF("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW") endif()
ENDIF(NOT CMAKE_C_COMPILER_ID_RUN) endif()
if (NOT _CMAKE_TOOLCHAIN_LOCATION)
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
endif ()
# If we have a gcc cross compiler, they have usually some prefix, like # If we have a gcc cross compiler, they have usually some prefix, like
# e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc, optionally # e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc, optionally
@ -147,33 +145,31 @@ ENDIF(NOT CMAKE_C_COMPILER_ID_RUN)
# NAME_WE cannot be used since then this test will fail for names lile # NAME_WE cannot be used since then this test will fail for names lile
# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be # "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-" # "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
IF (CMAKE_CROSSCOMPILING if (CMAKE_CROSSCOMPILING
AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU" AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
AND NOT _CMAKE_TOOLCHAIN_PREFIX) AND NOT _CMAKE_TOOLCHAIN_PREFIX)
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME) get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME)
IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") endif ()
# if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
# but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
IF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") endif ()
ENDIF (CMAKE_CROSSCOMPILING endif ()
AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
AND NOT _CMAKE_TOOLCHAIN_PREFIX) include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
include(CMakeFindBinUtils)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake) if(MSVC_C_ARCHITECTURE_ID)
INCLUDE(CMakeFindBinUtils) set(SET_MSVC_C_ARCHITECTURE_ID
IF(MSVC_C_ARCHITECTURE_ID) "set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
SET(SET_MSVC_C_ARCHITECTURE_ID endif()
"SET(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
ENDIF(MSVC_C_ARCHITECTURE_ID)
# configure variables set in this file for fast reload later on # configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in configure_file(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
"${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake" ${CMAKE_PLATFORM_INFO_DIR}/CMakeCCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0 @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
) )
SET(CMAKE_C_COMPILER_ENV_VAR "CC") set(CMAKE_C_COMPILER_ENV_VAR "CC")

@ -30,123 +30,109 @@
# If not already set before, it also sets # If not already set before, it also sets
# _CMAKE_TOOLCHAIN_PREFIX # _CMAKE_TOOLCHAIN_PREFIX
IF(NOT CMAKE_CXX_COMPILER) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
SET(CMAKE_CXX_COMPILER_INIT NOTFOUND)
# Load system-specific compiler preferences for this language.
# prefer the environment variable CXX include(Platform/${CMAKE_SYSTEM_NAME}-CXX OPTIONAL)
IF($ENV{CXX} MATCHES ".+") if(NOT CMAKE_CXX_COMPILER_NAMES)
GET_FILENAME_COMPONENT(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT) set(CMAKE_CXX_COMPILER_NAMES CC)
IF(CMAKE_CXX_FLAGS_ENV_INIT) endif()
SET(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
ENDIF(CMAKE_CXX_FLAGS_ENV_INIT) if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
IF(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT}) elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}.\n${CMAKE_CXX_COMPILER_INIT}") set(CMAKE_CXX_COMPILER_XCODE_TYPE sourcecode.cpp.cpp)
ENDIF(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT}) else()
ENDIF($ENV{CXX} MATCHES ".+") if(NOT CMAKE_CXX_COMPILER)
set(CMAKE_CXX_COMPILER_INIT NOTFOUND)
# next prefer the generator specified compiler
IF(CMAKE_GENERATOR_CXX) # prefer the environment variable CXX
IF(NOT CMAKE_CXX_COMPILER_INIT) if($ENV{CXX} MATCHES ".+")
SET(CMAKE_CXX_COMPILER_INIT ${CMAKE_GENERATOR_CXX}) get_filename_component(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT)
ENDIF(NOT CMAKE_CXX_COMPILER_INIT) if(CMAKE_CXX_FLAGS_ENV_INIT)
ENDIF(CMAKE_GENERATOR_CXX) set(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
endif()
# finally list compilers to try if(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
IF(CMAKE_CXX_COMPILER_INIT) message(FATAL_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}.\n${CMAKE_CXX_COMPILER_INIT}")
SET(CMAKE_CXX_COMPILER_LIST ${CMAKE_CXX_COMPILER_INIT}) endif()
ELSE(CMAKE_CXX_COMPILER_INIT) endif()
SET(CMAKE_CXX_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ CC aCC cl bcc xlC)
ENDIF(CMAKE_CXX_COMPILER_INIT) # next prefer the generator specified compiler
if(CMAKE_GENERATOR_CXX)
# Find the compiler. if(NOT CMAKE_CXX_COMPILER_INIT)
IF (_CMAKE_USER_C_COMPILER_PATH) set(CMAKE_CXX_COMPILER_INIT ${CMAKE_GENERATOR_CXX})
FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES ${CMAKE_CXX_COMPILER_LIST} PATHS ${_CMAKE_USER_C_COMPILER_PATH} DOC "C++ compiler" NO_DEFAULT_PATH) endif()
ENDIF (_CMAKE_USER_C_COMPILER_PATH) endif()
FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES ${CMAKE_CXX_COMPILER_LIST} DOC "C++ compiler")
# finally list compilers to try
IF(CMAKE_CXX_COMPILER_INIT AND NOT CMAKE_CXX_COMPILER) if(NOT CMAKE_CXX_COMPILER_INIT)
SET(CMAKE_CXX_COMPILER "${CMAKE_CXX_COMPILER_INIT}" CACHE FILEPATH "C++ compiler" FORCE) set(CMAKE_CXX_COMPILER_LIST CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ aCC cl bcc xlC clang++)
ENDIF(CMAKE_CXX_COMPILER_INIT AND NOT CMAKE_CXX_COMPILER) endif()
ELSE(NOT CMAKE_CXX_COMPILER)
_cmake_find_compiler(CXX)
# we only get here if CMAKE_CXX_COMPILER was specified using -D or a pre-made CMakeCache.txt else()
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
# # we only get here if CMAKE_CXX_COMPILER was specified using -D or a pre-made CMakeCache.txt
# if CMAKE_CXX_COMPILER is a list of length 2, use the first item as # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
# CMAKE_CXX_COMPILER and the 2nd one as CMAKE_CXX_COMPILER_ARG1 #
# if CMAKE_CXX_COMPILER is a list of length 2, use the first item as
LIST(LENGTH CMAKE_CXX_COMPILER _CMAKE_CXX_COMPILER_LIST_LENGTH) # CMAKE_CXX_COMPILER and the 2nd one as CMAKE_CXX_COMPILER_ARG1
IF("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
LIST(GET CMAKE_CXX_COMPILER 1 CMAKE_CXX_COMPILER_ARG1) list(LENGTH CMAKE_CXX_COMPILER _CMAKE_CXX_COMPILER_LIST_LENGTH)
LIST(GET CMAKE_CXX_COMPILER 0 CMAKE_CXX_COMPILER) if("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
ENDIF("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2) list(GET CMAKE_CXX_COMPILER 1 CMAKE_CXX_COMPILER_ARG1)
list(GET CMAKE_CXX_COMPILER 0 CMAKE_CXX_COMPILER)
# if a compiler was specified by the user but without path, endif()
# now try to find it with the full path
# if it is found, force it into the cache, # if a compiler was specified by the user but without path,
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND" # now try to find it with the full path
# if the CXX compiler already had a path, reuse it for searching the C compiler # if it is found, force it into the cache,
GET_FILENAME_COMPONENT(_CMAKE_USER_CXX_COMPILER_PATH "${CMAKE_CXX_COMPILER}" PATH) # if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
IF(NOT _CMAKE_USER_CXX_COMPILER_PATH) # if the CXX compiler already had a path, reuse it for searching the C compiler
FIND_PROGRAM(CMAKE_CXX_COMPILER_WITH_PATH NAMES ${CMAKE_CXX_COMPILER}) get_filename_component(_CMAKE_USER_CXX_COMPILER_PATH "${CMAKE_CXX_COMPILER}" PATH)
MARK_AS_ADVANCED(CMAKE_CXX_COMPILER_WITH_PATH) if(NOT _CMAKE_USER_CXX_COMPILER_PATH)
IF(CMAKE_CXX_COMPILER_WITH_PATH) find_program(CMAKE_CXX_COMPILER_WITH_PATH NAMES ${CMAKE_CXX_COMPILER})
SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE) mark_as_advanced(CMAKE_CXX_COMPILER_WITH_PATH)
ENDIF(CMAKE_CXX_COMPILER_WITH_PATH) if(CMAKE_CXX_COMPILER_WITH_PATH)
ENDIF(NOT _CMAKE_USER_CXX_COMPILER_PATH) set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE)
ENDIF(NOT CMAKE_CXX_COMPILER) endif()
MARK_AS_ADVANCED(CMAKE_CXX_COMPILER) endif()
endif()
IF (NOT _CMAKE_TOOLCHAIN_LOCATION) mark_as_advanced(CMAKE_CXX_COMPILER)
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
# This block was used before the compiler was identified by building a
# source file. Unless g++ crashes when building a small C++
# executable this should no longer be needed.
#
# The g++ that comes with BeOS 5 segfaults if you run "g++ -E"
# ("gcc -E" is fine), which throws up a system dialog box that hangs cmake
# until the user clicks "OK"...so for now, we just assume it's g++.
# IF(BEOS)
# SET(CMAKE_COMPILER_IS_GNUCXX 1)
# SET(CMAKE_COMPILER_IS_GNUCXX_RUN 1)
# ENDIF(BEOS)
# Build a small source file to identify the compiler.
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
SET(CMAKE_CXX_COMPILER_ID_RUN 1)
SET(CMAKE_CXX_PLATFORM_ID "Windows")
SET(CMAKE_CXX_COMPILER_ID "MSVC")
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
IF(NOT CMAKE_CXX_COMPILER_ID_RUN)
SET(CMAKE_CXX_COMPILER_ID_RUN 1)
# Each entry in this list is a set of extra flags to try # Each entry in this list is a set of extra flags to try
# adding to the compile line to see if it helps produce # adding to the compile line to see if it helps produce
# a valid identification file. # a valid identification file.
SET(CMAKE_CXX_COMPILER_ID_TEST_FLAGS set(CMAKE_CXX_COMPILER_ID_TEST_FLAGS
# Try compiling to an object file only. # Try compiling to an object file only.
"-c" "-c"
) )
endif()
# Build a small source file to identify the compiler.
if(NOT CMAKE_CXX_COMPILER_ID_RUN)
set(CMAKE_CXX_COMPILER_ID_RUN 1)
# Try to identify the compiler. # Try to identify the compiler.
SET(CMAKE_CXX_COMPILER_ID) set(CMAKE_CXX_COMPILER_ID)
FILE(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT) CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
CMAKE_DETERMINE_COMPILER_ID(CXX CXXFLAGS CMakeCXXCompilerId.cpp) CMAKE_DETERMINE_COMPILER_ID(CXX CXXFLAGS CMakeCXXCompilerId.cpp)
# Set old compiler and platform id variables. # Set old compiler and platform id variables.
IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_COMPILER_IS_GNUCXX 1) set(CMAKE_COMPILER_IS_GNUCXX 1)
ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") endif()
IF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW") if("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
SET(CMAKE_COMPILER_IS_MINGW 1) set(CMAKE_COMPILER_IS_MINGW 1)
ELSEIF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "Cygwin") elseif("${CMAKE_CXX_PLATFORM_ID}" MATCHES "Cygwin")
SET(CMAKE_COMPILER_IS_CYGWIN 1) set(CMAKE_COMPILER_IS_CYGWIN 1)
ENDIF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW") endif()
ENDIF(NOT CMAKE_CXX_COMPILER_ID_RUN) endif()
if (NOT _CMAKE_TOOLCHAIN_LOCATION)
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
endif ()
# if we have a g++ cross compiler, they have usually some prefix, like # if we have a g++ cross compiler, they have usually some prefix, like
# e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++ , optionally # e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++ , optionally
@ -155,34 +141,32 @@ ENDIF(NOT CMAKE_CXX_COMPILER_ID_RUN)
# NAME_WE cannot be used since then this test will fail for names lile # NAME_WE cannot be used since then this test will fail for names lile
# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be # "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-" # "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
IF (CMAKE_CROSSCOMPILING if (CMAKE_CROSSCOMPILING
AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU" AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
AND NOT _CMAKE_TOOLCHAIN_PREFIX) AND NOT _CMAKE_TOOLCHAIN_PREFIX)
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME) get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$") endif ()
# if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils # if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
# but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.) # but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
IF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1}) set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$") endif ()
ENDIF (CMAKE_CROSSCOMPILING endif ()
AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
AND NOT _CMAKE_TOOLCHAIN_PREFIX) include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
include(CMakeFindBinUtils)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake) if(MSVC_CXX_ARCHITECTURE_ID)
INCLUDE(CMakeFindBinUtils) set(SET_MSVC_CXX_ARCHITECTURE_ID
IF(MSVC_CXX_ARCHITECTURE_ID) "set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
SET(SET_MSVC_CXX_ARCHITECTURE_ID endif()
"SET(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
ENDIF(MSVC_CXX_ARCHITECTURE_ID)
# configure all variables set in this file # configure all variables set in this file
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in configure_file(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake ${CMAKE_PLATFORM_INFO_DIR}/CMakeCXXCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0 @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
) )
SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX") set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")

@ -0,0 +1,72 @@
#=============================================================================
# Copyright 2004-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(_cmake_find_compiler lang)
# Use already-enabled languages for reference.
get_property(_languages GLOBAL PROPERTY ENABLED_LANGUAGES)
list(REMOVE_ITEM _languages "${lang}")
if(CMAKE_${lang}_COMPILER_INIT)
# Search only for the specified compiler.
set(CMAKE_${lang}_COMPILER_LIST "${CMAKE_${lang}_COMPILER_INIT}")
else()
# Re-order the compiler list with preferred vendors first.
set(_${lang}_COMPILER_LIST "${CMAKE_${lang}_COMPILER_LIST}")
set(CMAKE_${lang}_COMPILER_LIST "")
# Prefer vendors of compilers from reference languages.
foreach(l ${_languages})
list(APPEND CMAKE_${lang}_COMPILER_LIST
${_${lang}_COMPILER_NAMES_${CMAKE_${l}_COMPILER_ID}})
endforeach()
# Prefer vendors based on the platform.
list(APPEND CMAKE_${lang}_COMPILER_LIST ${CMAKE_${lang}_COMPILER_NAMES})
# Append the rest of the list and remove duplicates.
list(APPEND CMAKE_${lang}_COMPILER_LIST ${_${lang}_COMPILER_LIST})
unset(_${lang}_COMPILER_LIST)
list(REMOVE_DUPLICATES CMAKE_${lang}_COMPILER_LIST)
if(CMAKE_${lang}_COMPILER_EXCLUDE)
list(REMOVE_ITEM CMAKE_${lang}_COMPILER_LIST
${CMAKE_${lang}_COMPILER_EXCLUDE})
endif()
endif()
# Look for directories containing compilers of reference languages.
set(_${lang}_COMPILER_HINTS)
foreach(l ${_languages})
if(CMAKE_${l}_COMPILER AND IS_ABSOLUTE "${CMAKE_${l}_COMPILER}")
get_filename_component(_hint "${CMAKE_${l}_COMPILER}" PATH)
if(IS_DIRECTORY "${_hint}")
list(APPEND _${lang}_COMPILER_HINTS "${_hint}")
endif()
unset(_hint)
endif()
endforeach()
# Find the compiler.
if(_${lang}_COMPILER_HINTS)
# Prefer directories containing compilers of reference languages.
list(REMOVE_DUPLICATES _${lang}_COMPILER_HINTS)
find_program(CMAKE_${lang}_COMPILER
NAMES ${CMAKE_${lang}_COMPILER_LIST}
PATHS ${_${lang}_COMPILER_HINTS}
NO_DEFAULT_PATH
DOC "${lang} compiler")
endif()
find_program(CMAKE_${lang}_COMPILER NAMES ${CMAKE_${lang}_COMPILER_LIST} DOC "${lang} compiler")
if(CMAKE_${lang}_COMPILER_INIT AND NOT CMAKE_${lang}_COMPILER)
set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER_INIT}" CACHE FILEPATH "${lang} compiler" FORCE)
endif()
unset(_${lang}_COMPILER_HINTS)
unset(_languages)
endmacro()

@ -16,19 +16,19 @@
# This is used internally by CMake and should not be included by user # This is used internally by CMake and should not be included by user
# code. # code.
INCLUDE(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake) include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src) function(CMAKE_DETERMINE_COMPILER_ABI lang src)
IF(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED) if(NOT DEFINED CMAKE_${lang}_ABI_COMPILED)
MESSAGE(STATUS "Detecting ${lang} compiler ABI info") message(STATUS "Detecting ${lang} compiler ABI info")
# Compile the ABI identification source. # Compile the ABI identification source.
SET(BIN "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDetermineCompilerABI_${lang}.bin") set(BIN "${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerABI_${lang}.bin")
SET(CMAKE_FLAGS ) set(CMAKE_FLAGS )
IF(DEFINED CMAKE_${lang}_VERBOSE_FLAG) if(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
SET(CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}") set(CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
ENDIF() endif()
TRY_COMPILE(CMAKE_DETERMINE_${lang}_ABI_COMPILED try_compile(CMAKE_${lang}_ABI_COMPILED
${CMAKE_BINARY_DIR} ${src} ${CMAKE_BINARY_DIR} ${src}
CMAKE_FLAGS "${CMAKE_FLAGS}" CMAKE_FLAGS "${CMAKE_FLAGS}"
"-DCMAKE_${lang}_STANDARD_LIBRARIES=" "-DCMAKE_${lang}_STANDARD_LIBRARIES="
@ -39,93 +39,96 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
OUTPUT_VARIABLE OUTPUT OUTPUT_VARIABLE OUTPUT
COPY_FILE "${BIN}" COPY_FILE "${BIN}"
) )
# Move result from cache to normal variable.
set(CMAKE_${lang}_ABI_COMPILED ${CMAKE_${lang}_ABI_COMPILED})
unset(CMAKE_${lang}_ABI_COMPILED CACHE)
set(CMAKE_${lang}_ABI_COMPILED ${CMAKE_${lang}_ABI_COMPILED} PARENT_SCOPE)
# Load the resulting information strings. # Load the resulting information strings.
IF(CMAKE_DETERMINE_${lang}_ABI_COMPILED) if(CMAKE_${lang}_ABI_COMPILED)
MESSAGE(STATUS "Detecting ${lang} compiler ABI info - done") message(STATUS "Detecting ${lang} compiler ABI info - done")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n") "Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n")
FILE(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[^[]*\\[") file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[^[]*\\[")
FOREACH(info ${ABI_STRINGS}) foreach(info ${ABI_STRINGS})
IF("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*") if("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
STRING(REGEX REPLACE ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*" "\\1" ABI_SIZEOF_DPTR "${info}") string(REGEX REPLACE ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*" "\\1" ABI_SIZEOF_DPTR "${info}")
ENDIF("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*") endif()
IF("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*") if("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
STRING(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}") string(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}")
ENDIF("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*") endif()
ENDFOREACH(info) endforeach()
IF(ABI_SIZEOF_DPTR) if(ABI_SIZEOF_DPTR)
SET(CMAKE_${lang}_SIZEOF_DATA_PTR "${ABI_SIZEOF_DPTR}" PARENT_SCOPE) set(CMAKE_${lang}_SIZEOF_DATA_PTR "${ABI_SIZEOF_DPTR}" PARENT_SCOPE)
ELSEIF(CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT) elseif(CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT)
SET(CMAKE_${lang}_SIZEOF_DATA_PTR "${CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT}" PARENT_SCOPE) set(CMAKE_${lang}_SIZEOF_DATA_PTR "${CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT}" PARENT_SCOPE)
ENDIF(ABI_SIZEOF_DPTR) endif()
IF(ABI_NAME) if(ABI_NAME)
SET(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
ENDIF(ABI_NAME) endif()
# Parse implicit linker information for this language, if available. # Parse implicit linker information for this language, if available.
SET(implicit_dirs "") set(implicit_dirs "")
SET(implicit_libs "") set(implicit_libs "")
SET(MULTI_ARCH FALSE) set(implicit_fwks "")
IF(DEFINED CMAKE_OSX_ARCHITECTURES) if(CMAKE_${lang}_VERBOSE_FLAG)
IF( "${CMAKE_OSX_ARCHITECTURES}" MATCHES ";" ) CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs implicit_fwks log
SET(MULTI_ARCH TRUE)
ENDIF()
ENDIF()
IF(CMAKE_${lang}_VERBOSE_FLAG
# Implicit link information cannot be used explicitly for
# multiple OS X architectures, so we skip it.
AND NOT MULTI_ARCH
# Skip this with Xcode for now.
AND NOT "${CMAKE_GENERATOR}" MATCHES Xcode)
CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs log
"${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}") "${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Parsed ${lang} implicit link information from above output:\n${log}\n\n") "Parsed ${lang} implicit link information from above output:\n${log}\n\n")
ENDIF() endif()
# for VS IDE Intel Fortran we have to figure out the # for VS IDE Intel Fortran we have to figure out the
# implicit link path for the fortran run time using # implicit link path for the fortran run time using
# a try-compile # a try-compile
IF("${lang}" MATCHES "Fortran" if("${lang}" MATCHES "Fortran"
AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio") AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
SET(_desc "Determine Intel Fortran Compiler Implicit Link Path") set(_desc "Determine Intel Fortran Compiler Implicit Link Path")
MESSAGE(STATUS "${_desc}") message(STATUS "${_desc}")
# Build a sample project which reports symbols. # Build a sample project which reports symbols.
TRY_COMPILE(IFORT_LIB_PATH_COMPILED try_compile(IFORT_LIB_PATH_COMPILED
${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath ${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath
${CMAKE_ROOT}/Modules/IntelVSImplicitPath ${CMAKE_ROOT}/Modules/IntelVSImplicitPath
IntelFortranImplicit IntelFortranImplicit
CMAKE_FLAGS CMAKE_FLAGS
"-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}" "-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}"
OUTPUT_VARIABLE _output) OUTPUT_VARIABLE _output)
FILE(WRITE file(WRITE
"${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.txt" "${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.txt"
"${_output}") "${_output}")
INCLUDE(${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.cmake OPTIONAL) include(${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.cmake OPTIONAL)
SET(_desc "Determine Intel Fortran Compiler Implicit Link Path -- done") set(_desc "Determine Intel Fortran Compiler Implicit Link Path -- done")
MESSAGE(STATUS "${_desc}") message(STATUS "${_desc}")
ENDIF() endif()
SET(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "${implicit_libs}" PARENT_SCOPE) # Implicit link libraries cannot be used explicitly for multiple
SET(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "${implicit_dirs}" PARENT_SCOPE) # OS X architectures, so we skip it.
if(DEFINED CMAKE_OSX_ARCHITECTURES)
if("${CMAKE_OSX_ARCHITECTURES}" MATCHES ";")
set(implicit_libs "")
endif()
endif()
set(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "${implicit_libs}" PARENT_SCOPE)
set(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "${implicit_dirs}" PARENT_SCOPE)
set(CMAKE_${lang}_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "${implicit_fwks}" PARENT_SCOPE)
# Detect library architecture directory name. # Detect library architecture directory name.
IF(CMAKE_LIBRARY_ARCHITECTURE_REGEX) if(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
FOREACH(dir ${implicit_dirs}) foreach(dir ${implicit_dirs})
IF("${dir}" MATCHES "/lib/${CMAKE_LIBRARY_ARCHITECTURE_REGEX}$") if("${dir}" MATCHES "/lib/${CMAKE_LIBRARY_ARCHITECTURE_REGEX}$")
GET_FILENAME_COMPONENT(arch "${dir}" NAME) get_filename_component(arch "${dir}" NAME)
SET(CMAKE_${lang}_LIBRARY_ARCHITECTURE "${arch}" PARENT_SCOPE) set(CMAKE_${lang}_LIBRARY_ARCHITECTURE "${arch}" PARENT_SCOPE)
BREAK() break()
ENDIF() endif()
ENDFOREACH() endforeach()
ENDIF() endif()
ELSE(CMAKE_DETERMINE_${lang}_ABI_COMPILED) else()
MESSAGE(STATUS "Detecting ${lang} compiler ABI info - failed") message(STATUS "Detecting ${lang} compiler ABI info - failed")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n\n") "Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n\n")
ENDIF(CMAKE_DETERMINE_${lang}_ABI_COMPILED) endif()
ENDIF(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED) endif()
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ABI) endfunction()

@ -16,116 +16,240 @@
# used internally by CMake and should not be included by user code. # used internally by CMake and should not be included by user code.
# If successful, sets CMAKE_<lang>_COMPILER_ID and CMAKE_<lang>_PLATFORM_ID # If successful, sets CMAKE_<lang>_COMPILER_ID and CMAKE_<lang>_PLATFORM_ID
FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
# Make sure the compiler arguments are clean. # Make sure the compiler arguments are clean.
STRING(STRIP "${CMAKE_${lang}_COMPILER_ARG1}" CMAKE_${lang}_COMPILER_ID_ARG1) string(STRIP "${CMAKE_${lang}_COMPILER_ARG1}" CMAKE_${lang}_COMPILER_ID_ARG1)
STRING(REGEX REPLACE " +" ";" CMAKE_${lang}_COMPILER_ID_ARG1 "${CMAKE_${lang}_COMPILER_ID_ARG1}") string(REGEX REPLACE " +" ";" CMAKE_${lang}_COMPILER_ID_ARG1 "${CMAKE_${lang}_COMPILER_ID_ARG1}")
# Make sure user-specified compiler flags are used. # Make sure user-specified compiler flags are used.
IF(CMAKE_${lang}_FLAGS) if(CMAKE_${lang}_FLAGS)
SET(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS}) set(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS})
ELSE(CMAKE_${lang}_FLAGS) else()
SET(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}}) set(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}})
ENDIF(CMAKE_${lang}_FLAGS) endif()
STRING(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}") string(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
# Compute the directory in which to run the test. # Compute the directory in which to run the test.
SET(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang}) set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_PLATFORM_INFO_DIR}/CompilerId${lang})
# Try building with no extra flags and then try each set # Try building with no extra flags and then try each set
# of helper flags. Stop when the compiler is identified. # of helper flags. Stop when the compiler is identified.
FOREACH(flags "" ${CMAKE_${lang}_COMPILER_ID_TEST_FLAGS}) foreach(flags "" ${CMAKE_${lang}_COMPILER_ID_TEST_FLAGS})
IF(NOT CMAKE_${lang}_COMPILER_ID) if(NOT CMAKE_${lang}_COMPILER_ID)
CMAKE_DETERMINE_COMPILER_ID_BUILD("${lang}" "${flags}" "${src}") CMAKE_DETERMINE_COMPILER_ID_BUILD("${lang}" "${flags}" "${src}")
FOREACH(file ${COMPILER_${lang}_PRODUCED_FILES}) foreach(file ${COMPILER_${lang}_PRODUCED_FILES})
CMAKE_DETERMINE_COMPILER_ID_CHECK("${lang}" "${CMAKE_${lang}_COMPILER_ID_DIR}/${file}" "${src}") CMAKE_DETERMINE_COMPILER_ID_CHECK("${lang}" "${CMAKE_${lang}_COMPILER_ID_DIR}/${file}" "${src}")
ENDFOREACH(file) endforeach()
ENDIF(NOT CMAKE_${lang}_COMPILER_ID) endif()
ENDFOREACH(flags) endforeach()
# If the compiler is still unknown, try to query its vendor. # If the compiler is still unknown, try to query its vendor.
IF(NOT CMAKE_${lang}_COMPILER_ID) if(NOT CMAKE_${lang}_COMPILER_ID)
CMAKE_DETERMINE_COMPILER_ID_VENDOR(${lang}) CMAKE_DETERMINE_COMPILER_ID_VENDOR(${lang})
ENDIF() endif()
# if the format is unknown after all files have been checked, put "Unknown" in the cache # if the format is unknown after all files have been checked, put "Unknown" in the cache
IF(NOT CMAKE_EXECUTABLE_FORMAT) if(NOT CMAKE_EXECUTABLE_FORMAT)
SET(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format") set(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
ENDIF(NOT CMAKE_EXECUTABLE_FORMAT) endif()
# Display the final identification result. # Display the final identification result.
IF(CMAKE_${lang}_COMPILER_ID) if(CMAKE_${lang}_COMPILER_ID)
IF(CMAKE_${lang}_COMPILER_VERSION) if(CMAKE_${lang}_COMPILER_VERSION)
SET(_version " ${CMAKE_${lang}_COMPILER_VERSION}") set(_version " ${CMAKE_${lang}_COMPILER_VERSION}")
ELSE() else()
SET(_version "") set(_version "")
ENDIF() endif()
MESSAGE(STATUS "The ${lang} compiler identification is " message(STATUS "The ${lang} compiler identification is "
"${CMAKE_${lang}_COMPILER_ID}${_version}") "${CMAKE_${lang}_COMPILER_ID}${_version}")
ELSE(CMAKE_${lang}_COMPILER_ID) else()
MESSAGE(STATUS "The ${lang} compiler identification is unknown") message(STATUS "The ${lang} compiler identification is unknown")
ENDIF(CMAKE_${lang}_COMPILER_ID) endif()
SET(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE) # Check if compiler id detection gave us the compiler tool.
SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE) if(NOT CMAKE_${lang}_COMPILER)
SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" if(CMAKE_${lang}_COMPILER_ID_TOOL)
set(CMAKE_${lang}_COMPILER "${CMAKE_${lang}_COMPILER_ID_TOOL}" PARENT_SCOPE)
else()
set(CMAKE_${lang}_COMPILER "CMAKE_${lang}_COMPILER-NOTFOUND" PARENT_SCOPE)
endif()
endif()
set(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE) PARENT_SCOPE)
SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID) endfunction()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Function to write the compiler id source file. # Function to write the compiler id source file.
FUNCTION(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src) function(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src)
FILE(READ ${CMAKE_ROOT}/Modules/${src}.in ID_CONTENT_IN) file(READ ${CMAKE_ROOT}/Modules/${src}.in ID_CONTENT_IN)
STRING(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY) string(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY)
FILE(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}") file(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}")
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_WRITE) endfunction()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Function to build the compiler id source file and look for output # Function to build the compiler id source file and look for output
# files. # files.
FUNCTION(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src) function(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
# Create a clean working directory. # Create a clean working directory.
FILE(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR}) file(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
FILE(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}) file(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
CMAKE_DETERMINE_COMPILER_ID_WRITE("${lang}" "${src}") CMAKE_DETERMINE_COMPILER_ID_WRITE("${lang}" "${src}")
# Construct a description of this test case. # Construct a description of this test case.
SET(COMPILER_DESCRIPTION set(COMPILER_DESCRIPTION
"Compiler: ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_ARG1} "Compiler: ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_ARG1}
Build flags: ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST} Build flags: ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
Id flags: ${testflags} Id flags: ${testflags}
") ")
# Compile the compiler identification source. # Compile the compiler identification source.
IF(COMMAND EXECUTE_PROCESS) if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([0-9]+)")
EXECUTE_PROCESS( set(vs_version ${CMAKE_MATCH_1})
COMMAND ${CMAKE_${lang}_COMPILER} set(id_arch ${CMAKE_VS_PLATFORM_NAME})
${CMAKE_${lang}_COMPILER_ID_ARG1} set(id_lang "${lang}")
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST} set(id_cl cl.exe)
${testflags} if(NOT id_arch)
"${src}" set(id_arch Win32)
endif()
if(NOT "${vs_version}" VERSION_LESS 10)
set(v 10)
set(ext vcxproj)
elseif(NOT "${vs_version}" VERSION_LESS 7)
set(id_version ${vs_version}.00)
set(v 7)
set(ext vcproj)
else()
set(v 6)
set(ext dsp)
endif()
if("${id_arch}" STREQUAL "x64")
set(id_machine_10 MachineX64)
elseif("${id_arch}" STREQUAL "Itanium")
set(id_machine_10 MachineIA64)
set(id_arch ia64)
else()
set(id_machine_6 x86)
set(id_machine_10 MachineX86)
endif()
if(CMAKE_VS_PLATFORM_TOOLSET)
set(id_toolset "<PlatformToolset>${CMAKE_VS_PLATFORM_TOOLSET}</PlatformToolset>")
else()
set(id_toolset "")
endif()
if(CMAKE_VS_WINCE_VERSION)
set(id_entrypoint "mainACRTStartup")
set(id_subsystem 9)
else()
set(id_subsystem 1)
endif()
if("${CMAKE_MAKE_PROGRAM}" MATCHES "[Mm][Ss][Bb][Uu][Ii][Ll][Dd]")
set(build /p:Configuration=Debug /p:Platform=@id_arch@ /p:VisualStudioVersion=${vs_version}.0)
elseif("${CMAKE_MAKE_PROGRAM}" MATCHES "[Mm][Ss][Dd][Ee][Vv]")
set(build /make)
else()
set(build /build Debug)
endif()
set(id_dir ${CMAKE_${lang}_COMPILER_ID_DIR})
get_filename_component(id_src "${src}" NAME)
configure_file(${CMAKE_ROOT}/Modules/CompilerId/VS-${v}.${ext}.in
${id_dir}/CompilerId${lang}.${ext} @ONLY IMMEDIATE)
execute_process(
COMMAND ${CMAKE_MAKE_PROGRAM} CompilerId${lang}.${ext} ${build}
WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR} WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
) )
ELSE(COMMAND EXECUTE_PROCESS) # Match the compiler location line printed out.
EXEC_PROGRAM( if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "CMAKE_${lang}_COMPILER=([^%\r\n]+)[\r\n]")
${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_DIR} set(_comp "${CMAKE_MATCH_1}")
ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1} if(EXISTS "${_comp}")
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST} file(TO_CMAKE_PATH "${_comp}" _comp)
${testflags} set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE)
\"${src}\" endif()
endif()
elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
set(id_lang "${lang}")
set(id_type ${CMAKE_${lang}_COMPILER_XCODE_TYPE})
set(id_dir ${CMAKE_${lang}_COMPILER_ID_DIR})
get_filename_component(id_src "${src}" NAME)
if(CMAKE_XCODE_PLATFORM_TOOLSET)
set(id_toolset "GCC_VERSION = ${CMAKE_XCODE_PLATFORM_TOOLSET};")
else()
set(id_toolset "")
endif()
if(NOT ${XCODE_VERSION} VERSION_LESS 3)
set(v 3)
set(ext xcodeproj)
elseif(NOT ${XCODE_VERSION} VERSION_LESS 2)
set(v 2)
set(ext xcodeproj)
else()
set(v 1)
set(ext xcode)
endif()
configure_file(${CMAKE_ROOT}/Modules/CompilerId/Xcode-${v}.pbxproj.in
${id_dir}/CompilerId${lang}.${ext}/project.pbxproj @ONLY IMMEDIATE)
unset(_ENV_MACOSX_DEPLOYMENT_TARGET)
if(DEFINED ENV{MACOSX_DEPLOYMENT_TARGET})
set(_ENV_MACOSX_DEPLOYMENT_TARGET "$ENV{MACOSX_DEPLOYMENT_TARGET}")
set(ENV{MACOSX_DEPLOYMENT_TARGET} "")
endif()
execute_process(COMMAND xcodebuild
WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
) )
ENDIF(COMMAND EXECUTE_PROCESS) if(DEFINED _ENV_MACOSX_DEPLOYMENT_TARGET)
set(ENV{MACOSX_DEPLOYMENT_TARGET} "${_ENV_MACOSX_DEPLOYMENT_TARGET}")
endif()
# Match the link line from xcodebuild output of the form
# Ld ...
# ...
# /path/to/cc ...CompilerId${lang}/...
# to extract the compiler front-end for the language.
if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "\nLd[^\n]*(\n[ \t]+[^\n]*)*\n[ \t]+([^ \t\r\n]+)[^\r\n]*-o[^\r\n]*CompilerId${lang}/\\./CompilerId${lang}[ \t\n\\\"]")
set(_comp "${CMAKE_MATCH_2}")
if(EXISTS "${_comp}")
set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE)
endif()
endif()
else()
if(COMMAND EXECUTE_PROCESS)
execute_process(
COMMAND ${CMAKE_${lang}_COMPILER}
${CMAKE_${lang}_COMPILER_ID_ARG1}
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
${testflags}
"${src}"
WORKING_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}
OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
)
else()
exec_program(
${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_DIR}
ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1}
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
${testflags}
\"${src}\"
OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT
)
endif()
endif()
# Check the result of compilation. # Check the result of compilation.
IF(CMAKE_${lang}_COMPILER_ID_RESULT) if(CMAKE_${lang}_COMPILER_ID_RESULT)
# Compilation failed. # Compilation failed.
SET(MSG set(MSG
"Compiling the ${lang} compiler identification source file \"${src}\" failed. "Compiling the ${lang} compiler identification source file \"${src}\" failed.
${COMPILER_DESCRIPTION} ${COMPILER_DESCRIPTION}
The output was: The output was:
@ -133,16 +257,16 @@ ${CMAKE_${lang}_COMPILER_ID_RESULT}
${CMAKE_${lang}_COMPILER_ID_OUTPUT} ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
") ")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}") file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}")
#IF(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL) #if(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
# MESSAGE(FATAL_ERROR "${MSG}") # message(FATAL_ERROR "${MSG}")
#ENDIF(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL) #endif()
# No output files should be inspected. # No output files should be inspected.
SET(COMPILER_${lang}_PRODUCED_FILES) set(COMPILER_${lang}_PRODUCED_FILES)
ELSE(CMAKE_${lang}_COMPILER_ID_RESULT) else()
# Compilation succeeded. # Compilation succeeded.
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Compiling the ${lang} compiler identification source file \"${src}\" succeeded. "Compiling the ${lang} compiler identification source file \"${src}\" succeeded.
${COMPILER_DESCRIPTION} ${COMPILER_DESCRIPTION}
The output was: The output was:
@ -153,120 +277,124 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
# Find the executable produced by the compiler, try all files in the # Find the executable produced by the compiler, try all files in the
# binary dir. # binary dir.
FILE(GLOB COMPILER_${lang}_PRODUCED_FILES file(GLOB files
RELATIVE ${CMAKE_${lang}_COMPILER_ID_DIR} RELATIVE ${CMAKE_${lang}_COMPILER_ID_DIR}
${CMAKE_${lang}_COMPILER_ID_DIR}/*) ${CMAKE_${lang}_COMPILER_ID_DIR}/*)
LIST(REMOVE_ITEM COMPILER_${lang}_PRODUCED_FILES "${src}") list(REMOVE_ITEM files "${src}")
FOREACH(file ${COMPILER_${lang}_PRODUCED_FILES}) set(COMPILER_${lang}_PRODUCED_FILES "")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log foreach(file ${files})
"Compilation of the ${lang} compiler identification source \"" if(NOT IS_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}/${file})
"${src}\" produced \"${file}\"\n\n") list(APPEND COMPILER_${lang}_PRODUCED_FILES ${file})
ENDFOREACH(file) file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Compilation of the ${lang} compiler identification source \""
IF(NOT COMPILER_${lang}_PRODUCED_FILES) "${src}\" produced \"${file}\"\n\n")
endif()
endforeach()
if(NOT COMPILER_${lang}_PRODUCED_FILES)
# No executable was found. # No executable was found.
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Compilation of the ${lang} compiler identification source \"" "Compilation of the ${lang} compiler identification source \""
"${src}\" did not produce an executable in \"" "${src}\" did not produce an executable in \""
"${CMAKE_${lang}_COMPILER_ID_DIR}\".\n\n") "${CMAKE_${lang}_COMPILER_ID_DIR}\".\n\n")
ENDIF(NOT COMPILER_${lang}_PRODUCED_FILES) endif()
ENDIF(CMAKE_${lang}_COMPILER_ID_RESULT) endif()
# Return the files produced by the compilation. # Return the files produced by the compilation.
SET(COMPILER_${lang}_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE) set(COMPILER_${lang}_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src) endfunction()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Function to extract the compiler id from an executable. # Function to extract the compiler id from an executable.
FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file) function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
# Look for a compiler id if not yet known. # Look for a compiler id if not yet known.
IF(NOT CMAKE_${lang}_COMPILER_ID) if(NOT CMAKE_${lang}_COMPILER_ID)
# Read the compiler identification string from the executable file. # Read the compiler identification string from the executable file.
SET(COMPILER_ID) set(COMPILER_ID)
SET(COMPILER_VERSION) set(COMPILER_VERSION)
SET(PLATFORM_ID) set(PLATFORM_ID)
FILE(STRINGS ${file} file(STRINGS ${file}
CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 4 REGEX "INFO:") CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 4 REGEX "INFO:")
SET(HAVE_COMPILER_TWICE 0) set(HAVE_COMPILER_TWICE 0)
FOREACH(info ${CMAKE_${lang}_COMPILER_ID_STRINGS}) foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
IF("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*") if("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
IF(COMPILER_ID) if(COMPILER_ID)
SET(COMPILER_ID_TWICE 1) set(COMPILER_ID_TWICE 1)
ENDIF(COMPILER_ID) endif()
STRING(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1" string(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1"
COMPILER_ID "${info}") COMPILER_ID "${info}")
ENDIF("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*") endif()
IF("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*") if("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
STRING(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1" string(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1"
PLATFORM_ID "${info}") PLATFORM_ID "${info}")
ENDIF("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*") endif()
IF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*") if("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
STRING(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1" string(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
ARCHITECTURE_ID "${info}") ARCHITECTURE_ID "${info}")
ENDIF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*") endif()
IF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*") if("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
STRING(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}") string(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}")
STRING(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}") string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}")
STRING(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}") string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
ENDIF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*") endif()
ENDFOREACH(info) endforeach()
# Check if a valid compiler and platform were found. # Check if a valid compiler and platform were found.
IF(COMPILER_ID AND NOT COMPILER_ID_TWICE) if(COMPILER_ID AND NOT COMPILER_ID_TWICE)
SET(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}") set(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}")
SET(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}") set(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}")
SET(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}") set(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
SET(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}") set(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}")
ENDIF(COMPILER_ID AND NOT COMPILER_ID_TWICE) endif()
# Check the compiler identification string. # Check the compiler identification string.
IF(CMAKE_${lang}_COMPILER_ID) if(CMAKE_${lang}_COMPILER_ID)
# The compiler identification was found. # The compiler identification was found.
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"The ${lang} compiler identification is ${CMAKE_${lang}_COMPILER_ID}, found in \"" "The ${lang} compiler identification is ${CMAKE_${lang}_COMPILER_ID}, found in \""
"${file}\"\n\n") "${file}\"\n\n")
ELSE(CMAKE_${lang}_COMPILER_ID) else()
# The compiler identification could not be found. # The compiler identification could not be found.
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"The ${lang} compiler identification could not be found in \"" "The ${lang} compiler identification could not be found in \""
"${file}\"\n\n") "${file}\"\n\n")
ENDIF(CMAKE_${lang}_COMPILER_ID) endif()
ENDIF(NOT CMAKE_${lang}_COMPILER_ID) endif()
# try to figure out the executable format: ELF, COFF, Mach-O # try to figure out the executable format: ELF, COFF, Mach-O
IF(NOT CMAKE_EXECUTABLE_FORMAT) if(NOT CMAKE_EXECUTABLE_FORMAT)
FILE(READ ${file} CMAKE_EXECUTABLE_MAGIC LIMIT 4 HEX) file(READ ${file} CMAKE_EXECUTABLE_MAGIC LIMIT 4 HEX)
# ELF files start with 0x7f"ELF" # ELF files start with 0x7f"ELF"
IF("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46") if("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
SET(CMAKE_EXECUTABLE_FORMAT "ELF" CACHE INTERNAL "Executable file format") set(CMAKE_EXECUTABLE_FORMAT "ELF" CACHE INTERNAL "Executable file format")
ENDIF("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46") endif()
# # COFF (.exe) files start with "MZ" # # COFF (.exe) files start with "MZ"
# IF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....") # if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
# SET(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format") # set(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format")
# ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....") # endif()
# #
# # Mach-O files start with CAFEBABE or FEEDFACE, according to http://radio.weblogs.com/0100490/2003/01/28.html # # Mach-O files start with CAFEBABE or FEEDFACE, according to http://radio.weblogs.com/0100490/2003/01/28.html
# IF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe") # if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
# SET(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format") # set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
# ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe") # endif()
# IF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface") # if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
# SET(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format") # set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
# ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface") # endif()
ENDIF(NOT CMAKE_EXECUTABLE_FORMAT) endif()
IF(NOT DEFINED CMAKE_EXECUTABLE_FORMAT) if(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)
SET(CMAKE_EXECUTABLE_FORMAT) set(CMAKE_EXECUTABLE_FORMAT)
ENDIF() endif()
# Return the information extracted. # Return the information extracted.
SET(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE) set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}" set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE) PARENT_SCOPE)
SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
SET(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE) set(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang) endfunction()
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
# Function to query the compiler vendor. # Function to query the compiler vendor.
@ -276,22 +404,22 @@ ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
# set(CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor} "Some Vendor Output") # set(CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor} "Some Vendor Output")
# We try running the compiler with the flag for each vendor and # We try running the compiler with the flag for each vendor and
# matching its regular expression in the output. # matching its regular expression in the output.
FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang) function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
IF(NOT CMAKE_${lang}_COMPILER_ID_DIR) if(NOT CMAKE_${lang}_COMPILER_ID_DIR)
# We get here when this function is called not from within CMAKE_DETERMINE_COMPILER_ID() # We get here when this function is called not from within CMAKE_DETERMINE_COMPILER_ID()
# This is done e.g. for detecting the compiler ID for assemblers. # This is done e.g. for detecting the compiler ID for assemblers.
# Compute the directory in which to run the test and Create a clean working directory. # Compute the directory in which to run the test and Create a clean working directory.
SET(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang}) set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_PLATFORM_INFO_DIR}/CompilerId${lang})
FILE(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR}) file(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
FILE(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}) file(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
ENDIF(NOT CMAKE_${lang}_COMPILER_ID_DIR) endif()
FOREACH(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS}) foreach(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS})
SET(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}}) set(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}})
SET(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}}) set(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}})
EXECUTE_PROCESS( execute_process(
COMMAND ${CMAKE_${lang}_COMPILER} COMMAND ${CMAKE_${lang}_COMPILER}
${CMAKE_${lang}_COMPILER_ID_ARG1} ${CMAKE_${lang}_COMPILER_ID_ARG1}
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST} ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
@ -302,22 +430,22 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
TIMEOUT 10 TIMEOUT 10
) )
IF("${output}" MATCHES "${regex}") if("${output}" MATCHES "${regex}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" " "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
"matched \"${regex}\":\n${output}") "matched \"${regex}\":\n${output}")
SET(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE) set(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE)
BREAK() break()
ELSE() else()
IF("${result}" MATCHES "timeout") if("${result}" MATCHES "timeout")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" " "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
"terminated after 10 s due to timeout.") "terminated after 10 s due to timeout.")
ELSE() else()
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" " "Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
"did not match \"${regex}\":\n${output}") "did not match \"${regex}\":\n${output}")
ENDIF() endif()
ENDIF() endif()
ENDFOREACH() endforeach()
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR) endfunction()

@ -15,214 +15,215 @@
# determine the compiler to use for Fortran programs # determine the compiler to use for Fortran programs
# NOTE, a generator may set CMAKE_Fortran_COMPILER before # NOTE, a generator may set CMAKE_Fortran_COMPILER before
# loading this file to force a compiler. # loading this file to force a compiler.
# use environment variable FC first if defined by user, next use # use environment variable FC first if defined by user, next use
# the cmake variable CMAKE_GENERATOR_FC which can be defined by a generator # the cmake variable CMAKE_GENERATOR_FC which can be defined by a generator
# as a default compiler # as a default compiler
IF(NOT CMAKE_Fortran_COMPILER) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
# prefer the environment variable CC include(Platform/${CMAKE_SYSTEM_NAME}-Fortran OPTIONAL)
IF($ENV{FC} MATCHES ".+") if(NOT CMAKE_Fortran_COMPILER_NAMES)
GET_FILENAME_COMPONENT(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT) set(CMAKE_Fortran_COMPILER_NAMES f95)
IF(CMAKE_Fortran_FLAGS_ENV_INIT) endif()
SET(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler")
ENDIF(CMAKE_Fortran_FLAGS_ENV_INIT) if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
IF(EXISTS ${CMAKE_Fortran_COMPILER_INIT}) set(CMAKE_Fortran_COMPILER_ID_RUN 1)
ELSE(EXISTS ${CMAKE_Fortran_COMPILER_INIT}) set(CMAKE_Fortran_PLATFORM_ID "Windows")
MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.") set(CMAKE_Fortran_COMPILER_ID "Intel")
ENDIF(EXISTS ${CMAKE_Fortran_COMPILER_INIT}) set(CMAKE_Fortran_COMPILER "${CMAKE_GENERATOR_FC}")
ENDIF($ENV{FC} MATCHES ".+") elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
set(CMAKE_Fortran_COMPILER_XCODE_TYPE sourcecode.fortran.f90)
# next try prefer the compiler specified by the generator else()
IF(CMAKE_GENERATOR_FC) if(NOT CMAKE_Fortran_COMPILER)
IF(NOT CMAKE_Fortran_COMPILER_INIT) # prefer the environment variable CC
SET(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC}) if($ENV{FC} MATCHES ".+")
ENDIF(NOT CMAKE_Fortran_COMPILER_INIT) get_filename_component(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
ENDIF(CMAKE_GENERATOR_FC) if(CMAKE_Fortran_FLAGS_ENV_INIT)
set(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler")
# finally list compilers to try endif()
IF(CMAKE_Fortran_COMPILER_INIT) if(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
SET(CMAKE_Fortran_COMPILER_LIST ${CMAKE_Fortran_COMPILER_INIT}) else()
ELSE(CMAKE_Fortran_COMPILER_INIT) message(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.")
# Known compilers: endif()
# f77/f90/f95: generic compiler names endif()
# g77: GNU Fortran 77 compiler
# gfortran: putative GNU Fortran 95+ compiler (in progress) # next try prefer the compiler specified by the generator
# fort77: native F77 compiler under HP-UX (and some older Crays) if(CMAKE_GENERATOR_FC)
# frt: Fujitsu F77 compiler if(NOT CMAKE_Fortran_COMPILER_INIT)
# pathf90/pathf95/pathf2003: PathScale Fortran compiler set(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
# pgf77/pgf90/pgf95/pgfortran: Portland Group F77/F90/F95 compilers endif()
# xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers endif()
# lf95: Lahey-Fujitsu F95 compiler
# fl32: Microsoft Fortran 77 "PowerStation" compiler # finally list compilers to try
# af77: Apogee F77 compiler for Intergraph hardware running CLIX if(NOT CMAKE_Fortran_COMPILER_INIT)
# epcf90: "Edinburgh Portable Compiler" F90 # Known compilers:
# fort: Compaq (now HP) Fortran 90/95 compiler for Tru64 and Linux/Alpha # f77/f90/f95: generic compiler names
# ifc: Intel Fortran 95 compiler for Linux/x86 # g77: GNU Fortran 77 compiler
# efc: Intel Fortran 95 compiler for IA64 # gfortran: putative GNU Fortran 95+ compiler (in progress)
# # fort77: native F77 compiler under HP-UX (and some older Crays)
# The order is 95 or newer compilers first, then 90, # frt: Fujitsu F77 compiler
# then 77 or older compilers, gnu is always last in the group, # pathf90/pathf95/pathf2003: PathScale Fortran compiler
# so if you paid for a compiler it is picked by default. # pgf77/pgf90/pgf95/pgfortran: Portland Group F77/F90/F95 compilers
SET(CMAKE_Fortran_COMPILER_LIST # xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers
ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 pgfortran lf95 xlf95 # lf95: Lahey-Fujitsu F95 compiler
fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77 # fl32: Microsoft Fortran 77 "PowerStation" compiler
frt pgf77 xlf fl32 af77 g77 f77 # af77: Apogee F77 compiler for Intergraph hardware running CLIX
) # epcf90: "Edinburgh Portable Compiler" F90
# fort: Compaq (now HP) Fortran 90/95 compiler for Tru64 and Linux/Alpha
# Vendor-specific compiler names. # ifc: Intel Fortran 95 compiler for Linux/x86
SET(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77) # efc: Intel Fortran 95 compiler for IA64
SET(_Fortran_COMPILER_NAMES_Intel ifort ifc efc) #
SET(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77) # The order is 95 or newer compilers first, then 90,
SET(_Fortran_COMPILER_NAMES_PGI pgf95 pgfortran pgf90 pgf77) # then 77 or older compilers, gnu is always last in the group,
SET(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90) # so if you paid for a compiler it is picked by default.
SET(_Fortran_COMPILER_NAMES_XL xlf) set(CMAKE_Fortran_COMPILER_LIST
SET(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf) ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 pgfortran lf95 xlf95
fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77
# Prefer vendors matching the C and C++ compilers. frt pgf77 xlf fl32 af77 g77 f77
SET(CMAKE_Fortran_COMPILER_LIST )
${_Fortran_COMPILER_NAMES_${CMAKE_C_COMPILER_ID}}
${_Fortran_COMPILER_NAMES_${CMAKE_CXX_COMPILER_ID}} # Vendor-specific compiler names.
${CMAKE_Fortran_COMPILER_LIST}) set(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77)
LIST(REMOVE_DUPLICATES CMAKE_Fortran_COMPILER_LIST) set(_Fortran_COMPILER_NAMES_Intel ifort ifc efc)
ENDIF(CMAKE_Fortran_COMPILER_INIT) set(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77)
set(_Fortran_COMPILER_NAMES_PGI pgf95 pgfortran pgf90 pgf77)
# Look for directories containing the C and C++ compilers. set(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90)
SET(_Fortran_COMPILER_HINTS) set(_Fortran_COMPILER_NAMES_XL xlf)
FOREACH(lang C CXX) set(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf)
IF(CMAKE_${lang}_COMPILER AND IS_ABSOLUTE "${CMAKE_${lang}_COMPILER}") endif()
GET_FILENAME_COMPONENT(_hint "${CMAKE_${lang}_COMPILER}" PATH)
IF(IS_DIRECTORY "${_hint}") _cmake_find_compiler(Fortran)
LIST(APPEND _Fortran_COMPILER_HINTS "${_hint}")
ENDIF() else()
SET(_hint) # we only get here if CMAKE_Fortran_COMPILER was specified using -D or a pre-made CMakeCache.txt
ENDIF() # (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
ENDFOREACH() # if CMAKE_Fortran_COMPILER is a list of length 2, use the first item as
# CMAKE_Fortran_COMPILER and the 2nd one as CMAKE_Fortran_COMPILER_ARG1
# Find the compiler.
IF(_Fortran_COMPILER_HINTS) list(LENGTH CMAKE_Fortran_COMPILER _CMAKE_Fortran_COMPILER_LIST_LENGTH)
# Prefer directories containing C and C++ compilers. if("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
LIST(REMOVE_DUPLICATES _Fortran_COMPILER_HINTS) list(GET CMAKE_Fortran_COMPILER 1 CMAKE_Fortran_COMPILER_ARG1)
FIND_PROGRAM(CMAKE_Fortran_COMPILER list(GET CMAKE_Fortran_COMPILER 0 CMAKE_Fortran_COMPILER)
NAMES ${CMAKE_Fortran_COMPILER_LIST} endif()
PATHS ${_Fortran_COMPILER_HINTS}
NO_DEFAULT_PATH # if a compiler was specified by the user but without path,
DOC "Fortran compiler") # now try to find it with the full path
ENDIF() # if it is found, force it into the cache,
FIND_PROGRAM(CMAKE_Fortran_COMPILER NAMES ${CMAKE_Fortran_COMPILER_LIST} DOC "Fortran compiler") # if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
IF(CMAKE_Fortran_COMPILER_INIT AND NOT CMAKE_Fortran_COMPILER) # if the C compiler already had a path, reuse it for searching the CXX compiler
SET(CMAKE_Fortran_COMPILER "${CMAKE_Fortran_COMPILER_INIT}" CACHE FILEPATH "Fortran compiler" FORCE) get_filename_component(_CMAKE_USER_Fortran_COMPILER_PATH "${CMAKE_Fortran_COMPILER}" PATH)
ENDIF(CMAKE_Fortran_COMPILER_INIT AND NOT CMAKE_Fortran_COMPILER) if(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
ELSE(NOT CMAKE_Fortran_COMPILER) find_program(CMAKE_Fortran_COMPILER_WITH_PATH NAMES ${CMAKE_Fortran_COMPILER})
# we only get here if CMAKE_Fortran_COMPILER was specified using -D or a pre-made CMakeCache.txt mark_as_advanced(CMAKE_Fortran_COMPILER_WITH_PATH)
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE if(CMAKE_Fortran_COMPILER_WITH_PATH)
# if CMAKE_Fortran_COMPILER is a list of length 2, use the first item as set(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_WITH_PATH}
# CMAKE_Fortran_COMPILER and the 2nd one as CMAKE_Fortran_COMPILER_ARG1 CACHE STRING "Fortran compiler" FORCE)
endif()
LIST(LENGTH CMAKE_Fortran_COMPILER _CMAKE_Fortran_COMPILER_LIST_LENGTH) endif()
IF("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2) endif()
LIST(GET CMAKE_Fortran_COMPILER 1 CMAKE_Fortran_COMPILER_ARG1) mark_as_advanced(CMAKE_Fortran_COMPILER)
LIST(GET CMAKE_Fortran_COMPILER 0 CMAKE_Fortran_COMPILER)
ENDIF("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
# if a compiler was specified by the user but without path,
# now try to find it with the full path
# if it is found, force it into the cache,
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
# if the C compiler already had a path, reuse it for searching the CXX compiler
GET_FILENAME_COMPONENT(_CMAKE_USER_Fortran_COMPILER_PATH "${CMAKE_Fortran_COMPILER}" PATH)
IF(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
FIND_PROGRAM(CMAKE_Fortran_COMPILER_WITH_PATH NAMES ${CMAKE_Fortran_COMPILER})
MARK_AS_ADVANCED(CMAKE_Fortran_COMPILER_WITH_PATH)
IF(CMAKE_Fortran_COMPILER_WITH_PATH)
SET(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_WITH_PATH}
CACHE STRING "Fortran compiler" FORCE)
ENDIF(CMAKE_Fortran_COMPILER_WITH_PATH)
ENDIF(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
ENDIF(NOT CMAKE_Fortran_COMPILER)
MARK_AS_ADVANCED(CMAKE_Fortran_COMPILER)
# Build a small source file to identify the compiler.
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
SET(CMAKE_Fortran_COMPILER_ID_RUN 1)
SET(CMAKE_Fortran_PLATFORM_ID "Windows")
SET(CMAKE_Fortran_COMPILER_ID "Intel")
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
IF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
SET(CMAKE_Fortran_COMPILER_ID_RUN 1)
# Each entry in this list is a set of extra flags to try # Each entry in this list is a set of extra flags to try
# adding to the compile line to see if it helps produce # adding to the compile line to see if it helps produce
# a valid identification executable. # a valid identification executable.
SET(CMAKE_Fortran_COMPILER_ID_TEST_FLAGS set(CMAKE_Fortran_COMPILER_ID_TEST_FLAGS
# Try compiling to an object file only. # Try compiling to an object file only.
"-c" "-c"
# Intel on windows does not preprocess by default. # Intel on windows does not preprocess by default.
"-fpp" "-fpp"
) )
endif()
# Build a small source file to identify the compiler.
if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
set(CMAKE_Fortran_COMPILER_ID_RUN 1)
# Table of per-vendor compiler id flags with expected output. # Table of per-vendor compiler id flags with expected output.
LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS Compaq) list(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS Compaq)
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_Compaq "-what") set(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_Compaq "-what")
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_Compaq "Compaq Visual Fortran") set(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_Compaq "Compaq Visual Fortran")
LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS NAG) # Numerical Algorithms Group list(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS NAG) # Numerical Algorithms Group
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_NAG "-V") set(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_NAG "-V")
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_NAG "NAG Fortran Compiler") set(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_NAG "NAG Fortran Compiler")
# Try to identify the compiler. # Try to identify the compiler.
SET(CMAKE_Fortran_COMPILER_ID) set(CMAKE_Fortran_COMPILER_ID)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
CMAKE_DETERMINE_COMPILER_ID(Fortran FFLAGS CMakeFortranCompilerId.F) CMAKE_DETERMINE_COMPILER_ID(Fortran FFLAGS CMakeFortranCompilerId.F)
# Fall back to old is-GNU test. # Fall back to old is-GNU test.
IF(NOT CMAKE_Fortran_COMPILER_ID) if(NOT CMAKE_Fortran_COMPILER_ID)
EXEC_PROGRAM(${CMAKE_Fortran_COMPILER} exec_program(${CMAKE_Fortran_COMPILER}
ARGS ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\"" ARGS ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\""
OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN) OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN)
IF(NOT CMAKE_COMPILER_RETURN) if(NOT CMAKE_COMPILER_RETURN)
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" ) if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
SET(CMAKE_Fortran_COMPILER_ID "GNU") set(CMAKE_Fortran_COMPILER_ID "GNU")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler is GNU succeeded with " "Determining if the Fortran compiler is GNU succeeded with "
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n") "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
ELSE("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" ) else()
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler is GNU failed with " "Determining if the Fortran compiler is GNU failed with "
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n") "the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" ) endif()
IF(NOT CMAKE_Fortran_PLATFORM_ID) if(NOT CMAKE_Fortran_PLATFORM_ID)
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" ) if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
SET(CMAKE_Fortran_PLATFORM_ID "MinGW") set(CMAKE_Fortran_PLATFORM_ID "MinGW")
ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" ) endif()
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" ) if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
SET(CMAKE_Fortran_PLATFORM_ID "Cygwin") set(CMAKE_Fortran_PLATFORM_ID "Cygwin")
ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" ) endif()
ENDIF(NOT CMAKE_Fortran_PLATFORM_ID) endif()
ENDIF(NOT CMAKE_COMPILER_RETURN) endif()
ENDIF(NOT CMAKE_Fortran_COMPILER_ID) endif()
# Set old compiler and platform id variables. # Set old compiler and platform id variables.
IF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_COMPILER_IS_GNUG77 1) set(CMAKE_COMPILER_IS_GNUG77 1)
ENDIF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") endif()
IF("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW") if("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
SET(CMAKE_COMPILER_IS_MINGW 1) set(CMAKE_COMPILER_IS_MINGW 1)
ELSEIF("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin") elseif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin")
SET(CMAKE_COMPILER_IS_CYGWIN 1) set(CMAKE_COMPILER_IS_CYGWIN 1)
ENDIF("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW") endif()
ENDIF(NOT CMAKE_Fortran_COMPILER_ID_RUN) endif()
INCLUDE(CMakeFindBinUtils) if (NOT _CMAKE_TOOLCHAIN_LOCATION)
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_Fortran_COMPILER}" PATH)
IF(MSVC_Fortran_ARCHITECTURE_ID) endif ()
SET(SET_MSVC_Fortran_ARCHITECTURE_ID
"SET(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})") # if we have a fortran cross compiler, they have usually some prefix, like
ENDIF() # e.g. powerpc-linux-gfortran, arm-elf-gfortran or i586-mingw32msvc-gfortran , optionally
# with a 3-component version number at the end (e.g. arm-eabi-gcc-4.5.2).
# The other tools of the toolchain usually have the same prefix
# NAME_WE cannot be used since then this test will fail for names lile
# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
if (CMAKE_CROSSCOMPILING
AND "${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU"
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
get_filename_component(COMPILER_BASENAME "${CMAKE_Fortran_COMPILER}" NAME)
if (COMPILER_BASENAME MATCHES "^(.+-)g?fortran(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif ()
# if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
# but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif ()
endif ()
include(CMakeFindBinUtils)
if(MSVC_Fortran_ARCHITECTURE_ID)
set(SET_MSVC_Fortran_ARCHITECTURE_ID
"set(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})")
endif()
# configure variables set in this file for fast reload later on # configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in configure_file(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake ${CMAKE_PLATFORM_INFO_DIR}/CMakeFortranCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0 @ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
) )
SET(CMAKE_Fortran_COMPILER_ENV_VAR "FC") set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")

@ -16,33 +16,33 @@
# NOTE, a generator may set CMAKE_Java_COMPILER before # NOTE, a generator may set CMAKE_Java_COMPILER before
# loading this file to force a compiler. # loading this file to force a compiler.
IF(NOT CMAKE_Java_COMPILER) if(NOT CMAKE_Java_COMPILER)
# prefer the environment variable CC # prefer the environment variable CC
IF($ENV{JAVA_COMPILER} MATCHES ".+") if($ENV{JAVA_COMPILER} MATCHES ".+")
GET_FILENAME_COMPONENT(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT) get_filename_component(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
IF(CMAKE_Java_FLAGS_ENV_INIT) if(CMAKE_Java_FLAGS_ENV_INIT)
SET(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler") set(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler")
ENDIF(CMAKE_Java_FLAGS_ENV_INIT) endif()
IF(NOT EXISTS ${CMAKE_Java_COMPILER_INIT}) if(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.") message(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.")
ENDIF(NOT EXISTS ${CMAKE_Java_COMPILER_INIT}) endif()
ENDIF($ENV{JAVA_COMPILER} MATCHES ".+") endif()
IF($ENV{JAVA_RUNTIME} MATCHES ".+") if($ENV{JAVA_RUNTIME} MATCHES ".+")
GET_FILENAME_COMPONENT(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT) get_filename_component(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
IF(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT}) if(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.") message(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
ENDIF(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT}) endif()
ENDIF($ENV{JAVA_RUNTIME} MATCHES ".+") endif()
IF($ENV{JAVA_ARCHIVE} MATCHES ".+") if($ENV{JAVA_ARCHIVE} MATCHES ".+")
GET_FILENAME_COMPONENT(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT) get_filename_component(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
IF(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT}) if(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.") message(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")
ENDIF(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT}) endif()
ENDIF($ENV{JAVA_ARCHIVE} MATCHES ".+") endif()
SET(Java_BIN_PATH set(Java_BIN_PATH
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/bin"
@ -63,40 +63,42 @@ IF(NOT CMAKE_Java_COMPILER)
/usr/java/j2sdk1.4.2_09/bin /usr/java/j2sdk1.4.2_09/bin
/usr/lib/j2sdk1.5-sun/bin /usr/lib/j2sdk1.5-sun/bin
/opt/sun-jdk-1.5.0.04/bin /opt/sun-jdk-1.5.0.04/bin
/usr/local/jdk-1.7.0/bin
/usr/local/jdk-1.6.0/bin
) )
# if no compiler has been specified yet, then look for one # if no compiler has been specified yet, then look for one
IF(CMAKE_Java_COMPILER_INIT) if(CMAKE_Java_COMPILER_INIT)
SET(CMAKE_Java_COMPILER ${CMAKE_Java_COMPILER_INIT} CACHE PATH "Java Compiler") set(CMAKE_Java_COMPILER ${CMAKE_Java_COMPILER_INIT} CACHE PATH "Java Compiler")
ELSE(CMAKE_Java_COMPILER_INIT) else()
FIND_PROGRAM(CMAKE_Java_COMPILER find_program(CMAKE_Java_COMPILER
NAMES javac NAMES javac
PATHS ${Java_BIN_PATH} PATHS ${Java_BIN_PATH}
) )
ENDIF(CMAKE_Java_COMPILER_INIT) endif()
# if no runtime has been specified yet, then look for one # if no runtime has been specified yet, then look for one
IF(CMAKE_Java_RUNTIME_INIT) if(CMAKE_Java_RUNTIME_INIT)
SET(CMAKE_Java_RUNTIME ${CMAKE_Java_RUNTIME_INIT} CACHE PATH "Java Compiler") set(CMAKE_Java_RUNTIME ${CMAKE_Java_RUNTIME_INIT} CACHE PATH "Java Compiler")
ELSE(CMAKE_Java_RUNTIME_INIT) else()
FIND_PROGRAM(CMAKE_Java_RUNTIME find_program(CMAKE_Java_RUNTIME
NAMES java NAMES java
PATHS ${Java_BIN_PATH} PATHS ${Java_BIN_PATH}
) )
ENDIF(CMAKE_Java_RUNTIME_INIT) endif()
# if no archive has been specified yet, then look for one # if no archive has been specified yet, then look for one
IF(CMAKE_Java_ARCHIVE_INIT) if(CMAKE_Java_ARCHIVE_INIT)
SET(CMAKE_Java_ARCHIVE ${CMAKE_Java_ARCHIVE_INIT} CACHE PATH "Java Compiler") set(CMAKE_Java_ARCHIVE ${CMAKE_Java_ARCHIVE_INIT} CACHE PATH "Java Compiler")
ELSE(CMAKE_Java_ARCHIVE_INIT) else()
FIND_PROGRAM(CMAKE_Java_ARCHIVE find_program(CMAKE_Java_ARCHIVE
NAMES jar NAMES jar
PATHS ${Java_BIN_PATH} PATHS ${Java_BIN_PATH}
) )
ENDIF(CMAKE_Java_ARCHIVE_INIT) endif()
ENDIF(NOT CMAKE_Java_COMPILER) endif()
MARK_AS_ADVANCED(CMAKE_Java_COMPILER) mark_as_advanced(CMAKE_Java_COMPILER)
# configure variables set in this file for fast reload later on # configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in configure_file(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeJavaCompiler.cmake IMMEDIATE @ONLY) ${CMAKE_PLATFORM_INFO_DIR}/CMakeJavaCompiler.cmake IMMEDIATE @ONLY)
SET(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER") set(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")

@ -15,53 +15,53 @@
# determine the compiler to use for C programs # determine the compiler to use for C programs
# NOTE, a generator may set CMAKE_C_COMPILER before # NOTE, a generator may set CMAKE_C_COMPILER before
# loading this file to force a compiler. # loading this file to force a compiler.
# use environment variable CCC first if defined by user, next use # use environment variable CCC first if defined by user, next use
# the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator # the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
# as a default compiler # as a default compiler
IF(NOT CMAKE_RC_COMPILER) if(NOT CMAKE_RC_COMPILER)
# prefer the environment variable CC # prefer the environment variable CC
IF($ENV{RC} MATCHES ".+") if($ENV{RC} MATCHES ".+")
GET_FILENAME_COMPONENT(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT) get_filename_component(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT)
IF(CMAKE_RC_FLAGS_ENV_INIT) if(CMAKE_RC_FLAGS_ENV_INIT)
SET(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler") set(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler")
ENDIF(CMAKE_RC_FLAGS_ENV_INIT) endif()
IF(EXISTS ${CMAKE_RC_COMPILER_INIT}) if(EXISTS ${CMAKE_RC_COMPILER_INIT})
ELSE(EXISTS ${CMAKE_RC_COMPILER_INIT}) else()
MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.") message(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.")
ENDIF(EXISTS ${CMAKE_RC_COMPILER_INIT}) endif()
ENDIF($ENV{RC} MATCHES ".+") endif()
# next try prefer the compiler specified by the generator # next try prefer the compiler specified by the generator
IF(CMAKE_GENERATOR_RC) if(CMAKE_GENERATOR_RC)
IF(NOT CMAKE_RC_COMPILER_INIT) if(NOT CMAKE_RC_COMPILER_INIT)
SET(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC}) set(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC})
ENDIF(NOT CMAKE_RC_COMPILER_INIT) endif()
ENDIF(CMAKE_GENERATOR_RC) endif()
# finally list compilers to try # finally list compilers to try
IF(CMAKE_RC_COMPILER_INIT) if(CMAKE_RC_COMPILER_INIT)
SET(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT}) set(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
ELSE(CMAKE_RC_COMPILER_INIT) else()
SET(CMAKE_RC_COMPILER_LIST rc) set(CMAKE_RC_COMPILER_LIST rc)
ENDIF(CMAKE_RC_COMPILER_INIT) endif()
# Find the compiler. # Find the compiler.
FIND_PROGRAM(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "RC compiler") find_program(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "RC compiler")
IF(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER) if(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
SET(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE) set(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE)
ENDIF(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER) endif()
ENDIF(NOT CMAKE_RC_COMPILER) endif()
MARK_AS_ADVANCED(CMAKE_RC_COMPILER) mark_as_advanced(CMAKE_RC_COMPILER)
GET_FILENAME_COMPONENT(_CMAKE_RC_COMPILER_NAME_WE ${CMAKE_RC_COMPILER} NAME_WE) get_filename_component(_CMAKE_RC_COMPILER_NAME_WE ${CMAKE_RC_COMPILER} NAME_WE)
IF(_CMAKE_RC_COMPILER_NAME_WE STREQUAL "windres") if(_CMAKE_RC_COMPILER_NAME_WE STREQUAL "windres")
SET(CMAKE_RC_OUTPUT_EXTENSION .obj) set(CMAKE_RC_OUTPUT_EXTENSION .obj)
ELSE() else()
SET(CMAKE_RC_OUTPUT_EXTENSION .res) set(CMAKE_RC_OUTPUT_EXTENSION .res)
ENDIF() endif()
# configure variables set in this file for fast reload later on # configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in configure_file(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeRCCompiler.cmake IMMEDIATE) ${CMAKE_PLATFORM_INFO_DIR}/CMakeRCCompiler.cmake IMMEDIATE)
SET(CMAKE_RC_COMPILER_ENV_VAR "RC") set(CMAKE_RC_COMPILER_ENV_VAR "RC")

@ -19,158 +19,168 @@
# #
# Expected uname -s output: # Expected uname -s output:
# #
# AIX AIX # AIX AIX
# BSD/OS BSD/OS # BSD/OS BSD/OS
# FreeBSD FreeBSD # FreeBSD FreeBSD
# HP-UX HP-UX # HP-UX HP-UX
# IRIX IRIX # IRIX IRIX
# Linux Linux # Linux Linux
# GNU/kFreeBSD GNU/kFreeBSD # GNU/kFreeBSD GNU/kFreeBSD
# NetBSD NetBSD # NetBSD NetBSD
# OpenBSD OpenBSD # OpenBSD OpenBSD
# OFS/1 (Digital Unix) OSF1 # OFS/1 (Digital Unix) OSF1
# SCO OpenServer 5 SCO_SV # SCO OpenServer 5 SCO_SV
# SCO UnixWare 7 UnixWare # SCO UnixWare 7 UnixWare
# SCO UnixWare (pre release 7) UNIX_SV # SCO UnixWare (pre release 7) UNIX_SV
# SCO XENIX Xenix # SCO XENIX Xenix
# Solaris SunOS # Solaris SunOS
# SunOS SunOS # SunOS SunOS
# Tru64 Tru64 # Tru64 Tru64
# Ultrix ULTRIX # Ultrix ULTRIX
# cygwin CYGWIN_NT-5.1 # cygwin CYGWIN_NT-5.1
# MacOSX Darwin # MacOSX Darwin
# find out on which system cmake runs # find out on which system cmake runs
IF(CMAKE_HOST_UNIX) if(CMAKE_HOST_UNIX)
FIND_PROGRAM(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin ) find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
IF(CMAKE_UNAME) if(CMAKE_UNAME)
EXEC_PROGRAM(uname ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_NAME) exec_program(uname ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_NAME)
EXEC_PROGRAM(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION) exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*") if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*")
EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val) RETURN_VALUE val)
ELSEIF(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD") elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD")
EXEC_PROGRAM(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR exec_program(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val) RETURN_VALUE val)
ELSE() else()
EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR exec_program(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val) RETURN_VALUE val)
IF("${val}" GREATER 0) if("${val}" GREATER 0)
EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val) RETURN_VALUE val)
ENDIF("${val}" GREATER 0) endif()
ENDIF() endif()
# check the return of the last uname -m or -p # check the return of the last uname -m or -p
IF("${val}" GREATER 0) if("${val}" GREATER 0)
SET(CMAKE_HOST_SYSTEM_PROCESSOR "unknown") set(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")
ENDIF("${val}" GREATER 0) endif()
SET(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command") set(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command")
# processor may have double quote in the name, and that needs to be removed # processor may have double quote in the name, and that needs to be removed
STRING(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}") string(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
STRING(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}") string(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
ENDIF(CMAKE_UNAME) endif()
ELSE(CMAKE_HOST_UNIX) else()
IF(CMAKE_HOST_WIN32) if(CMAKE_HOST_WIN32)
SET (CMAKE_HOST_SYSTEM_NAME "Windows") set (CMAKE_HOST_SYSTEM_NAME "Windows")
SET (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}") if (DEFINED ENV{PROCESSOR_ARCHITEW6432})
ENDIF(CMAKE_HOST_WIN32) set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITEW6432}")
ENDIF(CMAKE_HOST_UNIX) else()
set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
endif()
endif()
endif()
# if a toolchain file is used, the user wants to cross compile. # if a toolchain file is used, the user wants to cross compile.
# in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_* # in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_*
# variables around so they can be used in CMakeLists.txt. # variables around so they can be used in CMakeLists.txt.
# In all other cases, the host and target platform are the same. # In all other cases, the host and target platform are the same.
IF(CMAKE_TOOLCHAIN_FILE) if(CMAKE_TOOLCHAIN_FILE)
# at first try to load it as path relative to the directory from which cmake has been run # at first try to load it as path relative to the directory from which cmake has been run
INCLUDE("${CMAKE_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE) include("${CMAKE_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
IF(NOT _INCLUDED_TOOLCHAIN_FILE) if(NOT _INCLUDED_TOOLCHAIN_FILE)
# if the file isn't found there, check the default locations # if the file isn't found there, check the default locations
INCLUDE("${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE) include("${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
ENDIF(NOT _INCLUDED_TOOLCHAIN_FILE) endif()
IF(_INCLUDED_TOOLCHAIN_FILE) if(_INCLUDED_TOOLCHAIN_FILE)
SET(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE) set(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE)
ELSE(_INCLUDED_TOOLCHAIN_FILE) else()
MESSAGE(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}") message(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
SET(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE) set(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE)
ENDIF(_INCLUDED_TOOLCHAIN_FILE) endif()
ENDIF(CMAKE_TOOLCHAIN_FILE) endif()
# if CMAKE_SYSTEM_NAME is here already set, either it comes from a toolchain file # if CMAKE_SYSTEM_NAME is here already set, either it comes from a toolchain file
# or it was set via -DCMAKE_SYSTEM_NAME=... # or it was set via -DCMAKE_SYSTEM_NAME=...
# if that's the case, assume we are crosscompiling # if that's the case, assume we are crosscompiling
IF(CMAKE_SYSTEM_NAME) if(CMAKE_SYSTEM_NAME)
IF(NOT DEFINED CMAKE_CROSSCOMPILING) if(NOT DEFINED CMAKE_CROSSCOMPILING)
SET(CMAKE_CROSSCOMPILING TRUE) set(CMAKE_CROSSCOMPILING TRUE)
ENDIF(NOT DEFINED CMAKE_CROSSCOMPILING) endif()
SET(PRESET_CMAKE_SYSTEM_NAME TRUE) set(PRESET_CMAKE_SYSTEM_NAME TRUE)
ELSE(CMAKE_SYSTEM_NAME) elseif(CMAKE_VS_WINCE_VERSION)
SET(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}") set(CMAKE_SYSTEM_NAME "WindowsCE")
SET(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}") set(CMAKE_SYSTEM_VERSION "${CMAKE_VS_WINCE_VERSION}")
SET(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}") set(CMAKE_SYSTEM_PROCESSOR "${MSVC_C_ARCHITECTURE_ID}")
SET(CMAKE_CROSSCOMPILING FALSE) set(CMAKE_CROSSCOMPILING TRUE)
SET(PRESET_CMAKE_SYSTEM_NAME FALSE) set(PRESET_CMAKE_SYSTEM_NAME TRUE)
ENDIF(CMAKE_SYSTEM_NAME) else()
set(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
MACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX) set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
IF(NOT ${_PREFIX}_NAME) set(CMAKE_CROSSCOMPILING FALSE)
SET(${_PREFIX}_NAME "UnknownOS") set(PRESET_CMAKE_SYSTEM_NAME FALSE)
ENDIF(NOT ${_PREFIX}_NAME) endif()
macro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
if(NOT ${_PREFIX}_NAME)
set(${_PREFIX}_NAME "UnknownOS")
endif()
# fix for BSD/OS , remove the / # fix for BSD/OS , remove the /
IF(${_PREFIX}_NAME MATCHES BSD.OS) if(${_PREFIX}_NAME MATCHES BSD.OS)
SET(${_PREFIX}_NAME BSDOS) set(${_PREFIX}_NAME BSDOS)
ENDIF(${_PREFIX}_NAME MATCHES BSD.OS) endif()
# fix for GNU/kFreeBSD, remove the GNU/ # fix for GNU/kFreeBSD, remove the GNU/
IF(${_PREFIX}_NAME MATCHES kFreeBSD) if(${_PREFIX}_NAME MATCHES kFreeBSD)
SET(${_PREFIX}_NAME kFreeBSD) set(${_PREFIX}_NAME kFreeBSD)
ENDIF(${_PREFIX}_NAME MATCHES kFreeBSD) endif()
# fix for CYGWIN which has windows version in it # fix for CYGWIN which has windows version in it
IF(${_PREFIX}_NAME MATCHES CYGWIN) if(${_PREFIX}_NAME MATCHES CYGWIN)
SET(${_PREFIX}_NAME CYGWIN) set(${_PREFIX}_NAME CYGWIN)
ENDIF(${_PREFIX}_NAME MATCHES CYGWIN) endif()
# set CMAKE_SYSTEM to the CMAKE_SYSTEM_NAME # set CMAKE_SYSTEM to the CMAKE_SYSTEM_NAME
SET(${_PREFIX} ${${_PREFIX}_NAME}) set(${_PREFIX} ${${_PREFIX}_NAME})
# if there is a CMAKE_SYSTEM_VERSION then add a -${CMAKE_SYSTEM_VERSION} # if there is a CMAKE_SYSTEM_VERSION then add a -${CMAKE_SYSTEM_VERSION}
IF(${_PREFIX}_VERSION) if(${_PREFIX}_VERSION)
SET(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION}) set(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION})
ENDIF(${_PREFIX}_VERSION) endif()
ENDMACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX) endmacro()
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM) ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM)
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM) ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM)
# this file is also executed from cpack, then we don't need to generate these files # this file is also executed from cpack, then we don't need to generate these files
# in this case there is no CMAKE_BINARY_DIR # in this case there is no CMAKE_BINARY_DIR
IF(CMAKE_BINARY_DIR) if(CMAKE_BINARY_DIR)
# write entry to the log file # write entry to the log file
IF(PRESET_CMAKE_SYSTEM_NAME) if(PRESET_CMAKE_SYSTEM_NAME)
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n") "The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n") "The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n")
ELSE(PRESET_CMAKE_SYSTEM_NAME) else()
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n") "The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
ENDIF(PRESET_CMAKE_SYSTEM_NAME) endif()
# if a toolchain file is used, it needs to be included in the configured file, # if a toolchain file is used, it needs to be included in the configured file,
# so settings done there are also available if they don't go in the cache and in TRY_COMPILE() # so settings done there are also available if they don't go in the cache and in try_compile()
SET(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED) set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED)
IF(DEFINED CMAKE_TOOLCHAIN_FILE) if(DEFINED CMAKE_TOOLCHAIN_FILE)
SET(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED "INCLUDE(\"${CMAKE_TOOLCHAIN_FILE}\")") set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED "include(\"${CMAKE_TOOLCHAIN_FILE}\")")
ENDIF(DEFINED CMAKE_TOOLCHAIN_FILE) endif()
# configure variables set in this file for fast reload, the template file is defined at the top of this file # configure variables set in this file for fast reload, the template file is defined at the top of this file
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in configure_file(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake ${CMAKE_PLATFORM_INFO_DIR}/CMakeSystem.cmake
IMMEDIATE @ONLY) IMMEDIATE @ONLY)
ENDIF(CMAKE_BINARY_DIR) endif()

@ -9,6 +9,7 @@
# vc90sp1 # vc90sp1
# vc100 # vc100
# vc100sp1 # vc100sp1
# vc110
# #
# Usage: # Usage:
# =========================== # ===========================
@ -54,6 +55,8 @@ function(_DetermineVSServicePackFromCompiler _OUT_VAR _cl_version)
set(_version "vc100") set(_version "vc100")
elseif(${_cl_version} VERSION_EQUAL "16.00.40219.01") elseif(${_cl_version} VERSION_EQUAL "16.00.40219.01")
set(_version "vc100sp1") set(_version "vc100sp1")
elseif(${_cl_version} VERSION_EQUAL "17.00.50727.1")
set(_version "vc110")
else() else()
set(_version "") set(_version "")
endif() endif()

@ -10,7 +10,7 @@
# the first configuration from ${CMAKE_CONFIGURATION_TYPES} if set, otherwise # the first configuration from ${CMAKE_CONFIGURATION_TYPES} if set, otherwise
# ${CMAKE_BUILD_TYPE}. # ${CMAKE_BUILD_TYPE}.
# This macro is used by all Check*.cmake files which use # This macro is used by all Check*.cmake files which use
# TRY_COMPILE() or TRY_RUN() and support CMAKE_REQUIRED_LIBRARIES , so that # try_compile() or try_run() and support CMAKE_REQUIRED_LIBRARIES , so that
# these checks support imported targets in CMAKE_REQUIRED_LIBRARIES: # these checks support imported targets in CMAKE_REQUIRED_LIBRARIES:
# cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} # cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
# CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" ) # CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
@ -30,7 +30,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.)
include(CMakeParseArguments) include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake)
function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT ) function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
@ -76,16 +76,16 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
# guard against infinite loop: abort after 100 iterations ( 100 is arbitrary chosen) # guard against infinite loop: abort after 100 iterations ( 100 is arbitrary chosen)
if ("${_CCSR_LOOP_COUNTER}" LESS 100) if ("${_CCSR_LOOP_COUNTER}" LESS 100)
set(_CHECK_FOR_IMPORTED_TARGETS TRUE) set(_CHECK_FOR_IMPORTED_TARGETS TRUE)
# else ("${_CCSR_LOOP_COUNTER}" LESS 1) # else ()
# message(STATUS "********* aborting loop, counter : ${_CCSR_LOOP_COUNTER}") # message(STATUS "********* aborting loop, counter : ${_CCSR_LOOP_COUNTER}")
endif ("${_CCSR_LOOP_COUNTER}" LESS 100) endif ()
# if one of the imported configurations equals ${CMAKE_TRY_COMPILE_CONFIGURATION}, # if one of the imported configurations equals ${CMAKE_TRY_COMPILE_CONFIGURATION},
# use it, otherwise simply use the first one: # use it, otherwise simply use the first one:
list(FIND _importedConfigs "${CEIT_CONFIGURATION}" _configIndexToUse) list(FIND _importedConfigs "${CEIT_CONFIGURATION}" _configIndexToUse)
if("${_configIndexToUse}" EQUAL -1) if("${_configIndexToUse}" EQUAL -1)
set(_configIndexToUse 0) set(_configIndexToUse 0)
endif("${_configIndexToUse}" EQUAL -1) endif()
list(GET _importedConfigs ${_configIndexToUse} _importedConfigToUse) list(GET _importedConfigs ${_configIndexToUse} _importedConfigToUse)
get_target_property(_importedLocation "${_CURRENT_LIB}" IMPORTED_LOCATION_${_importedConfigToUse}) get_target_property(_importedLocation "${_CURRENT_LIB}" IMPORTED_LOCATION_${_importedConfigToUse})
@ -98,18 +98,18 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
# message(STATUS "Appending link interface lib ${_currentLinkInterfaceLib}") # message(STATUS "Appending link interface lib ${_currentLinkInterfaceLib}")
if(_currentLinkInterfaceLib) if(_currentLinkInterfaceLib)
list(APPEND _CCSR_NEW_REQ_LIBS "${_currentLinkInterfaceLib}" ) list(APPEND _CCSR_NEW_REQ_LIBS "${_currentLinkInterfaceLib}" )
endif(_currentLinkInterfaceLib) endif()
endforeach(_currentLinkInterfaceLib "${_linkInterfaceLibs}") endforeach()
endif(_linkInterfaceLibs) endif()
else(_importedConfigs) else()
# "Normal" libraries are just used as they are. # "Normal" libraries are just used as they are.
list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" ) list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
# message(STATUS "Appending lib directly: ${_CURRENT_LIB}") # message(STATUS "Appending lib directly: ${_CURRENT_LIB}")
endif(_importedConfigs) endif()
endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS}) endforeach()
set(_CCSR_REQ_LIBS ${_CCSR_NEW_REQ_LIBS} ) set(_CCSR_REQ_LIBS ${_CCSR_NEW_REQ_LIBS} )
endwhile(_CHECK_FOR_IMPORTED_TARGETS) endwhile()
# Finally we iterate once more over all libraries. This loop only removes # Finally we iterate once more over all libraries. This loop only removes
# all remaining imported target names (there shouldn't be any left anyway). # all remaining imported target names (there shouldn't be any left anyway).
@ -119,10 +119,10 @@ function(CMAKE_EXPAND_IMPORTED_TARGETS _RESULT )
if (NOT _importedConfigs) if (NOT _importedConfigs)
list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" ) list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
# message(STATUS "final: appending ${_CURRENT_LIB}") # message(STATUS "final: appending ${_CURRENT_LIB}")
else (NOT _importedConfigs) else ()
# message(STATUS "final: skipping ${_CURRENT_LIB}") # message(STATUS "final: skipping ${_CURRENT_LIB}")
endif (NOT _importedConfigs) endif ()
endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS}) endforeach()
# message(STATUS "setting -${_RESULT}- to -${_CCSR_NEW_REQ_LIBS}-") # message(STATUS "setting -${_RESULT}- to -${_CCSR_NEW_REQ_LIBS}-")
set(${_RESULT} "${_CCSR_NEW_REQ_LIBS}" PARENT_SCOPE) set(${_RESULT} "${_CCSR_NEW_REQ_LIBS}" PARENT_SCOPE)

@ -13,24 +13,24 @@
# License text for the above reference.) # License text for the above reference.)
# This module is purposely no longer documented. It does nothing useful. # This module is purposely no longer documented. It does nothing useful.
IF(NOT "${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS 2.7) if(NOT "${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS 2.7)
MESSAGE(FATAL_ERROR message(FATAL_ERROR
"The functionality of this module has been dropped as of CMake 2.8. " "The functionality of this module has been dropped as of CMake 2.8. "
"It was deemed harmful (confusing users by changing their compiler). " "It was deemed harmful (confusing users by changing their compiler). "
"Please remove calls to the CMAKE_EXPORT_BUILD_SETTINGS macro and " "Please remove calls to the CMAKE_EXPORT_BUILD_SETTINGS macro and "
"stop including this module. " "stop including this module. "
"If this project generates any files for use by external projects, " "If this project generates any files for use by external projects, "
"remove any use of the CMakeImportBuildSettings module from them.") "remove any use of the CMakeImportBuildSettings module from them.")
ENDIF() endif()
# This macro used to store build settings of a project in a file to be # This macro used to store build settings of a project in a file to be
# loaded by another project using CMAKE_IMPORT_BUILD_SETTINGS. Now it # loaded by another project using CMAKE_IMPORT_BUILD_SETTINGS. Now it
# creates a file that refuses to load (with comment explaining why). # creates a file that refuses to load (with comment explaining why).
MACRO(CMAKE_EXPORT_BUILD_SETTINGS SETTINGS_FILE) macro(CMAKE_EXPORT_BUILD_SETTINGS SETTINGS_FILE)
IF(${SETTINGS_FILE} MATCHES ".+") if(${SETTINGS_FILE} MATCHES ".+")
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in configure_file(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in
${SETTINGS_FILE} @ONLY IMMEDIATE) ${SETTINGS_FILE} @ONLY IMMEDIATE)
ELSE(${SETTINGS_FILE} MATCHES ".+") else()
MESSAGE(SEND_ERROR "CMAKE_EXPORT_BUILD_SETTINGS called with no argument.") message(SEND_ERROR "CMAKE_EXPORT_BUILD_SETTINGS called with no argument.")
ENDIF(${SETTINGS_FILE} MATCHES ".+") endif()
ENDMACRO(CMAKE_EXPORT_BUILD_SETTINGS) endmacro()

@ -18,39 +18,42 @@
# so that they can find the headers at runtime and parsing etc. works better # so that they can find the headers at runtime and parsing etc. works better
# This is done here by actually running gcc with the options so it prints its # This is done here by actually running gcc with the options so it prints its
# system include directories, which are parsed then and stored in the cache. # system include directories, which are parsed then and stored in the cache.
MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines) macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines)
SET(${_resultIncludeDirs}) set(${_resultIncludeDirs})
SET(_gccOutput) set(_gccOutput)
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" ) file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
IF (${_lang} STREQUAL "c++") if (${_lang} STREQUAL "c++")
SET(_compilerExecutable "${CMAKE_CXX_COMPILER}") set(_compilerExecutable "${CMAKE_CXX_COMPILER}")
SET(_arg1 "${CMAKE_CXX_COMPILER_ARG1}") set(_arg1 "${CMAKE_CXX_COMPILER_ARG1}")
ELSE () else ()
SET(_compilerExecutable "${CMAKE_C_COMPILER}") set(_compilerExecutable "${CMAKE_C_COMPILER}")
SET(_arg1 "${CMAKE_C_COMPILER_ARG1}") set(_arg1 "${CMAKE_C_COMPILER_ARG1}")
ENDIF () endif ()
EXECUTE_PROCESS(COMMAND ${_compilerExecutable} ${_arg1} -v -E -x ${_lang} -dD dummy execute_process(COMMAND ${_compilerExecutable} ${_arg1} -v -E -x ${_lang} -dD dummy
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
ERROR_VARIABLE _gccOutput ERROR_VARIABLE _gccOutput
OUTPUT_VARIABLE _gccStdout ) OUTPUT_VARIABLE _gccStdout )
FILE(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy") file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
# First find the system include dirs: # First find the system include dirs:
IF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+ *\n) *End of (search) list" ) if( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+ *\n) *End of (search) list" )
# split the output into lines and then remove leading and trailing spaces from each of them: # split the output into lines and then remove leading and trailing spaces from each of them:
STRING(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}") string(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
FOREACH(nextLine ${_includeLines}) foreach(nextLine ${_includeLines})
STRING(STRIP "${nextLine}" _includePath) # on OSX, gcc says things like this: "/System/Library/Frameworks (framework directory)", strip the last part
LIST(APPEND ${_resultIncludeDirs} "${_includePath}") string(REGEX REPLACE "\\(framework directory\\)" "" nextLineNoFramework "${nextLine}")
ENDFOREACH(nextLine) # strip spaces at the beginning and the end
string(STRIP "${nextLineNoFramework}" _includePath)
list(APPEND ${_resultIncludeDirs} "${_includePath}")
endforeach()
ENDIF() endif()
# now find the builtin macros: # now find the builtin macros:
STRING(REGEX MATCHALL "#define[^\n]+\n" _defineLines "${_gccStdout}") string(REGEX MATCHALL "#define[^\n]+\n" _defineLines "${_gccStdout}")
# A few example lines which the regexp below has to match properly: # A few example lines which the regexp below has to match properly:
# #define MAX(a,b) ((a) > (b) ? (a) : (b)) # #define MAX(a,b) ((a) > (b) ? (a) : (b))
# #define __fastcall __attribute__((__fastcall__)) # #define __fastcall __attribute__((__fastcall__))
@ -59,51 +62,51 @@ MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
# #define __UINTMAX_TYPE__ long long unsigned int # #define __UINTMAX_TYPE__ long long unsigned int
# #define __i386__ 1 # #define __i386__ 1
FOREACH(nextLine ${_defineLines}) foreach(nextLine ${_defineLines})
STRING(REGEX MATCH "^#define +([A-Za-z_][A-Za-z0-9_]*)(\\([^\\)]+\\))? +(.+) *$" _dummy "${nextLine}") string(REGEX MATCH "^#define +([A-Za-z_][A-Za-z0-9_]*)(\\([^\\)]+\\))? +(.+) *$" _dummy "${nextLine}")
SET(_name "${CMAKE_MATCH_1}${CMAKE_MATCH_2}") set(_name "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
STRING(STRIP "${CMAKE_MATCH_3}" _value) string(STRIP "${CMAKE_MATCH_3}" _value)
#MESSAGE(STATUS "m1: -${CMAKE_MATCH_1}- m2: -${CMAKE_MATCH_2}- m3: -${CMAKE_MATCH_3}-") #message(STATUS "m1: -${CMAKE_MATCH_1}- m2: -${CMAKE_MATCH_2}- m3: -${CMAKE_MATCH_3}-")
LIST(APPEND ${_resultDefines} "${_name}") list(APPEND ${_resultDefines} "${_name}")
IF(_value) if(_value)
LIST(APPEND ${_resultDefines} "${_value}") list(APPEND ${_resultDefines} "${_value}")
ELSE() else()
LIST(APPEND ${_resultDefines} " ") list(APPEND ${_resultDefines} " ")
ENDIF() endif()
ENDFOREACH(nextLine) endforeach()
ENDMACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang) endmacro()
# Save the current LC_ALL, LC_MESSAGES, and LANG environment variables and set them # Save the current LC_ALL, LC_MESSAGES, and LANG environment variables and set them
# to "C" that way GCC's "search starts here" text is in English and we can grok it. # to "C" that way GCC's "search starts here" text is in English and we can grok it.
SET(_orig_lc_all $ENV{LC_ALL}) set(_orig_lc_all $ENV{LC_ALL})
SET(_orig_lc_messages $ENV{LC_MESSAGES}) set(_orig_lc_messages $ENV{LC_MESSAGES})
SET(_orig_lang $ENV{LANG}) set(_orig_lang $ENV{LANG})
SET(ENV{LC_ALL} C) set(ENV{LC_ALL} C)
SET(ENV{LC_MESSAGES} C) set(ENV{LC_MESSAGES} C)
SET(ENV{LANG} C) set(ENV{LANG} C)
# Now check for C, works for gcc and Intel compiler at least # Now check for C, works for gcc and Intel compiler at least
IF (NOT CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS) if (NOT CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS)
IF ("${CMAKE_C_COMPILER_ID}" MATCHES GNU OR "${CMAKE_C_COMPILER_ID}" MATCHES Intel) if ("${CMAKE_C_COMPILER_ID}" MATCHES GNU OR "${CMAKE_C_COMPILER_ID}" MATCHES Intel OR "${CMAKE_C_COMPILER_ID}" MATCHES Clang)
_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c _dirs _defines) _DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c _dirs _defines)
SET(CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "C compiler system include directories") set(CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "C compiler system include directories")
SET(CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "C compiler system defined macros") set(CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "C compiler system defined macros")
ENDIF () endif ()
ENDIF () endif ()
# And now the same for C++ # And now the same for C++
IF (NOT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS) if (NOT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS)
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Intel) if ("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Intel OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Clang)
_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c++ _dirs _defines) _DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c++ _dirs _defines)
SET(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "CXX compiler system include directories") set(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "CXX compiler system include directories")
SET(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "CXX compiler system defined macros") set(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "CXX compiler system defined macros")
ENDIF () endif ()
ENDIF () endif ()
# Restore original LC_ALL, LC_MESSAGES, and LANG # Restore original LC_ALL, LC_MESSAGES, and LANG
SET(ENV{LC_ALL} ${_orig_lc_all}) set(ENV{LC_ALL} ${_orig_lc_all})
SET(ENV{LC_MESSAGES} ${_orig_lc_messages}) set(ENV{LC_MESSAGES} ${_orig_lc_messages})
SET(ENV{LANG} ${_orig_lang}) set(ENV{LANG} ${_orig_lang})

@ -1,13 +1,13 @@
# search for additional tools required for C/C++ (and other languages ?) # search for additional tools required for C/C++ (and other languages ?)
# #
# If the internal cmake variable _CMAKE_TOOLCHAIN_PREFIX is set, this is used # If the internal cmake variable _CMAKE_TOOLCHAIN_PREFIX is set, this is used
# as prefix for the tools (e.g. arm-elf-gcc etc.) # as prefix for the tools (e.g. arm-elf-gcc etc.)
# If the cmake variable _CMAKE_TOOLCHAIN_LOCATION is set, the compiler is # If the cmake variable _CMAKE_TOOLCHAIN_LOCATION is set, the compiler is
# searched only there. The other tools are at first searched there, then # searched only there. The other tools are at first searched there, then
# also in the default locations. # also in the default locations.
# #
# Sets the following variables: # Sets the following variables:
# CMAKE_AR # CMAKE_AR
# CMAKE_RANLIB # CMAKE_RANLIB
# CMAKE_LINKER # CMAKE_LINKER
@ -30,46 +30,42 @@
# License text for the above reference.) # License text for the above reference.)
# if it's the MS C/CXX compiler, search for link # if it's the MS C/CXX compiler, search for link
IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC" OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio") OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
FIND_PROGRAM(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
MARK_AS_ADVANCED(CMAKE_LINKER) mark_as_advanced(CMAKE_LINKER)
# in all other cases search for ar, ranlib, etc. # in all other cases search for ar, ranlib, etc.
ELSE("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" else()
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
FIND_PROGRAM(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
FIND_PROGRAM(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
IF(NOT CMAKE_RANLIB) if(NOT CMAKE_RANLIB)
SET(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib") set(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib")
ENDIF(NOT CMAKE_RANLIB) endif()
FIND_PROGRAM(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
FIND_PROGRAM(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
FIND_PROGRAM(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
FIND_PROGRAM(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
FIND_PROGRAM(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
MARK_AS_ADVANCED(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY) mark_as_advanced(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY)
ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC" endif()
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
# on Apple there really should be install_name_tool # on Apple there really should be install_name_tool
IF(APPLE) if(APPLE)
FIND_PROGRAM(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION}) find_program(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
IF(NOT CMAKE_INSTALL_NAME_TOOL) if(NOT CMAKE_INSTALL_NAME_TOOL)
MESSAGE(FATAL_ERROR "Could not find install_name_tool, please check your installation.") message(FATAL_ERROR "Could not find install_name_tool, please check your installation.")
ENDIF(NOT CMAKE_INSTALL_NAME_TOOL) endif()
MARK_AS_ADVANCED(CMAKE_INSTALL_NAME_TOOL) mark_as_advanced(CMAKE_INSTALL_NAME_TOOL)
ENDIF(APPLE) endif()

@ -15,11 +15,11 @@
# This file is included in CMakeSystemSpecificInformation.cmake if # This file is included in CMakeSystemSpecificInformation.cmake if
# the CodeBlocks extra generator has been selected. # the CodeBlocks extra generator has been selected.
FIND_PROGRAM(CMAKE_CODEBLOCKS_EXECUTABLE NAMES codeblocks DOC "The CodeBlocks executable") find_program(CMAKE_CODEBLOCKS_EXECUTABLE NAMES codeblocks DOC "The CodeBlocks executable")
IF(CMAKE_CODEBLOCKS_EXECUTABLE) if(CMAKE_CODEBLOCKS_EXECUTABLE)
SET(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_CODEBLOCKS_EXECUTABLE} <PROJECT_FILE>" ) set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_CODEBLOCKS_EXECUTABLE} <PROJECT_FILE>" )
ENDIF(CMAKE_CODEBLOCKS_EXECUTABLE) endif()
# Determine builtin macros and include dirs: # Determine builtin macros and include dirs:
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)

@ -15,65 +15,73 @@
# This file is included in CMakeSystemSpecificInformation.cmake if # This file is included in CMakeSystemSpecificInformation.cmake if
# the Eclipse CDT4 extra generator has been selected. # the Eclipse CDT4 extra generator has been selected.
FIND_PROGRAM(CMAKE_ECLIPSE_EXECUTABLE NAMES eclipse DOC "The Eclipse executable") find_program(CMAKE_ECLIPSE_EXECUTABLE NAMES eclipse DOC "The Eclipse executable")
FUNCTION(_FIND_ECLIPSE_VERSION) function(_FIND_ECLIPSE_VERSION)
# This code is in a function so the variables used here have only local scope # This code is in a function so the variables used here have only local scope
IF(CMAKE_ECLIPSE_EXECUTABLE) if(CMAKE_ECLIPSE_EXECUTABLE)
# use REALPATH to resolve symlinks (http://public.kitware.com/Bug/view.php?id=13036) # use REALPATH to resolve symlinks (http://public.kitware.com/Bug/view.php?id=13036)
GET_FILENAME_COMPONENT(_REALPATH_CMAKE_ECLIPSE_EXECUTABLE "${CMAKE_ECLIPSE_EXECUTABLE}" REALPATH) get_filename_component(_REALPATH_CMAKE_ECLIPSE_EXECUTABLE "${CMAKE_ECLIPSE_EXECUTABLE}" REALPATH)
GET_FILENAME_COMPONENT(_ECLIPSE_DIR "${_REALPATH_CMAKE_ECLIPSE_EXECUTABLE}" PATH) get_filename_component(_ECLIPSE_DIR "${_REALPATH_CMAKE_ECLIPSE_EXECUTABLE}" PATH)
FILE(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/features/org.eclipse.platform*") file(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/features/org.eclipse.platform*")
IF("${_ECLIPSE_FEATURE_DIR}" MATCHES ".+org.eclipse.platform_([0-9]+\\.[0-9]+).+") if(APPLE AND NOT _ECLIPSE_FEATURE_DIR)
SET(_ECLIPSE_VERSION ${CMAKE_MATCH_1}) file(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/../../../features/org.eclipse.platform*")
ENDIF() endif()
ENDIF() if("${_ECLIPSE_FEATURE_DIR}" MATCHES ".+org.eclipse.platform_([0-9]+\\.[0-9]+).+")
set(_ECLIPSE_VERSION ${CMAKE_MATCH_1})
endif()
endif()
# Set up a map with the names of the Eclipse releases: # Set up a map with the names of the Eclipse releases:
SET(_ECLIPSE_VERSION_NAME_ "Unknown" ) set(_ECLIPSE_VERSION_NAME_ "Unknown" )
SET(_ECLIPSE_VERSION_NAME_3.2 "Callisto" ) set(_ECLIPSE_VERSION_NAME_3.2 "Callisto" )
SET(_ECLIPSE_VERSION_NAME_3.3 "Europa" ) set(_ECLIPSE_VERSION_NAME_3.3 "Europa" )
SET(_ECLIPSE_VERSION_NAME_3.4 "Ganymede" ) set(_ECLIPSE_VERSION_NAME_3.4 "Ganymede" )
SET(_ECLIPSE_VERSION_NAME_3.5 "Galileo" ) set(_ECLIPSE_VERSION_NAME_3.5 "Galileo" )
SET(_ECLIPSE_VERSION_NAME_3.6 "Helios" ) set(_ECLIPSE_VERSION_NAME_3.6 "Helios" )
SET(_ECLIPSE_VERSION_NAME_3.7 "Indigo" ) set(_ECLIPSE_VERSION_NAME_3.7 "Indigo" )
set(_ECLIPSE_VERSION_NAME_4.2 "Juno" )
IF(_ECLIPSE_VERSION) if(_ECLIPSE_VERSION)
MESSAGE(STATUS "Found Eclipse version ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})") message(STATUS "Found Eclipse version ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})")
ELSE() else()
SET(_ECLIPSE_VERSION "3.6" ) set(_ECLIPSE_VERSION "3.6" )
MESSAGE(STATUS "Could not determine Eclipse version, assuming at least ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}}). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.") message(STATUS "Could not determine Eclipse version, assuming at least ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}}). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.")
ENDIF() endif()
SET(CMAKE_ECLIPSE_VERSION "${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})" CACHE STRING "The version of Eclipse. If Eclipse has not been found, 3.6 (Helios) is assumed.") set(CMAKE_ECLIPSE_VERSION "${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})" CACHE STRING "The version of Eclipse. If Eclipse has not been found, 3.6 (Helios) is assumed.")
SET_PROPERTY(CACHE CMAKE_ECLIPSE_VERSION PROPERTY STRINGS "3.2 (${_ECLIPSE_VERSION_NAME_3.2})" set_property(CACHE CMAKE_ECLIPSE_VERSION PROPERTY STRINGS "3.2 (${_ECLIPSE_VERSION_NAME_3.2})"
"3.3 (${_ECLIPSE_VERSION_NAME_3.3})" "3.3 (${_ECLIPSE_VERSION_NAME_3.3})"
"3.4 (${_ECLIPSE_VERSION_NAME_3.4})" "3.4 (${_ECLIPSE_VERSION_NAME_3.4})"
"3.5 (${_ECLIPSE_VERSION_NAME_3.5})" "3.5 (${_ECLIPSE_VERSION_NAME_3.5})"
"3.6 (${_ECLIPSE_VERSION_NAME_3.6})" "3.6 (${_ECLIPSE_VERSION_NAME_3.6})"
"3.7 (${_ECLIPSE_VERSION_NAME_3.7})") "3.7 (${_ECLIPSE_VERSION_NAME_3.7})"
ENDFUNCTION() "4.2 (${_ECLIPSE_VERSION_NAME_4.2})"
)
endfunction()
_FIND_ECLIPSE_VERSION() _FIND_ECLIPSE_VERSION()
# Try to find out how many CPUs we have and set the -j argument for make accordingly # Try to find out how many CPUs we have and set the -j argument for make accordingly
SET(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "") set(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "")
INCLUDE(ProcessorCount) include(ProcessorCount)
PROCESSORCOUNT(_CMAKE_ECLIPSE_PROCESSOR_COUNT) PROCESSORCOUNT(_CMAKE_ECLIPSE_PROCESSOR_COUNT)
# Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name # Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name
# (we may also get here in the future e.g. for ninja) # (we may also get here in the future e.g. for ninja)
IF("${_CMAKE_ECLIPSE_PROCESSOR_COUNT}" GREATER 1 AND UNIX AND "${CMAKE_MAKE_PROGRAM}" MATCHES make) if("${_CMAKE_ECLIPSE_PROCESSOR_COUNT}" GREATER 1 AND UNIX AND "${CMAKE_MAKE_PROGRAM}" MATCHES make)
SET(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "-j${_CMAKE_ECLIPSE_PROCESSOR_COUNT}") set(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "-j${_CMAKE_ECLIPSE_PROCESSOR_COUNT}")
ENDIF() endif()
# This variable is used by the Eclipse generator and appended to the make invocation commands. # This variable is used by the Eclipse generator and appended to the make invocation commands.
SET(CMAKE_ECLIPSE_MAKE_ARGUMENTS "${_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS}" CACHE STRING "Additional command line arguments when Eclipse invokes make. Enter e.g. -j<some_number> to get parallel builds") set(CMAKE_ECLIPSE_MAKE_ARGUMENTS "${_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS}" CACHE STRING "Additional command line arguments when Eclipse invokes make. Enter e.g. -j<some_number> to get parallel builds")
set(CMAKE_ECLIPSE_GENERATE_LINKED_RESOURCES TRUE CACHE BOOL "If disabled, CMake will not generate linked resource to the subprojects and to the source files within targets")
# This variable is used by the Eclipse generator in out-of-source builds only. # This variable is used by the Eclipse generator in out-of-source builds only.
SET(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT FALSE CACHE BOOL "If enabled, CMake will generate a source project for Eclipse in CMAKE_SOURCE_DIR") set(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT FALSE CACHE BOOL "If enabled, CMake will generate a source project for Eclipse in CMAKE_SOURCE_DIR")
MARK_AS_ADVANCED(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT) mark_as_advanced(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT)
# Determine builtin macros and include dirs: # Determine builtin macros and include dirs:
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake) include(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)

@ -13,20 +13,20 @@
# (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.)
IF(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED) if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
SET(CMAKE_FIND_FRAMEWORKS_INCLUDED 1) set(CMAKE_FIND_FRAMEWORKS_INCLUDED 1)
MACRO(CMAKE_FIND_FRAMEWORKS fwk) macro(CMAKE_FIND_FRAMEWORKS fwk)
SET(${fwk}_FRAMEWORKS) set(${fwk}_FRAMEWORKS)
IF(APPLE) if(APPLE)
FOREACH(dir foreach(dir
~/Library/Frameworks/${fwk}.framework ~/Library/Frameworks/${fwk}.framework
/Library/Frameworks/${fwk}.framework /Library/Frameworks/${fwk}.framework
/System/Library/Frameworks/${fwk}.framework /System/Library/Frameworks/${fwk}.framework
/Network/Library/Frameworks/${fwk}.framework) /Network/Library/Frameworks/${fwk}.framework)
IF(EXISTS ${dir}) if(EXISTS ${dir})
SET(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir}) set(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
ENDIF(EXISTS ${dir}) endif()
ENDFOREACH(dir) endforeach()
ENDIF(APPLE) endif()
ENDMACRO(CMAKE_FIND_FRAMEWORKS) endmacro()
ENDIF(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED) endif()

@ -15,9 +15,9 @@
# This file is included in CMakeSystemSpecificInformation.cmake if # This file is included in CMakeSystemSpecificInformation.cmake if
# the KDevelop3 extra generator has been selected. # the KDevelop3 extra generator has been selected.
FIND_PROGRAM(CMAKE_KDEVELOP3_EXECUTABLE NAMES kdevelop DOC "The KDevelop3 executable") find_program(CMAKE_KDEVELOP3_EXECUTABLE NAMES kdevelop DOC "The KDevelop3 executable")
IF(CMAKE_KDEVELOP3_EXECUTABLE) if(CMAKE_KDEVELOP3_EXECUTABLE)
SET(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} <PROJECT_FILE>" ) set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} <PROJECT_FILE>" )
ENDIF(CMAKE_KDEVELOP3_EXECUTABLE) endif()

@ -47,12 +47,14 @@ macro(ENABLE_LANGUAGE)
# But in --find-package mode, we don't want (and can't) enable any language. # But in --find-package mode, we don't want (and can't) enable any language.
endmacro() endmacro()
set(CMAKE_PLATFORM_INFO_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
include(CMakeDetermineSystem) include(CMakeDetermineSystem)
# short-cut some tests on Darwin, see Darwin-GNU.cmake: # short-cut some tests on Darwin, see Darwin-GNU.cmake:
if("${CMAKE_SYSTEM_NAME}" MATCHES Darwin AND "${COMPILER_ID}" MATCHES GNU) if("${CMAKE_SYSTEM_NAME}" MATCHES Darwin AND "${COMPILER_ID}" MATCHES GNU)
set(${CMAKE_${LANGUAGE}_HAS_ISYSROOT} 0 ) set(CMAKE_${LANGUAGE}_SYSROOT_FLAG "")
set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "") set(CMAKE_${LANGUAGE}_OSX_DEPLOYMENT_TARGET_FLAG "")
endif() endif()
# Also load the system specific file, which sets up e.g. the search paths. # Also load the system specific file, which sets up e.g. the search paths.
@ -179,7 +181,7 @@ if(${NAME}_FOUND OR ${UPPERCASE_NAME}_FOUND)
set_compile_flags_var(${NAME}) set_compile_flags_var(${NAME})
elseif("${MODE}" STREQUAL "LINK") elseif("${MODE}" STREQUAL "LINK")
set_link_flags_var(${NAME}) set_link_flags_var(${NAME})
else("${MODE}" STREQUAL "LINK") else()
message(FATAL_ERROR "Invalid mode argument ${MODE} given.") message(FATAL_ERROR "Invalid mode argument ${MODE} given.")
endif() endif()

@ -12,6 +12,6 @@
# (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.)
SET (CMAKE_MAKE_PROGRAM "wmake" CACHE STRING set (CMAKE_MAKE_PROGRAM "wmake" CACHE STRING
"Program used to build from makefiles.") "Program used to build from makefiles.")
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) mark_as_advanced(CMAKE_MAKE_PROGRAM)

@ -12,9 +12,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.)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM find_program(CMAKE_MAKE_PROGRAM
NAMES xcodebuild NAMES xcodebuild
PATHS PATHS
/usr/bin /usr/bin
) )
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) mark_as_advanced(CMAKE_MAKE_PROGRAM)

@ -24,8 +24,8 @@
# information tests. # information tests.
# #
# So a simple toolchain file could look like this: # So a simple toolchain file could look like this:
# INCLUDE (CMakeForceCompiler) # include (CMakeForceCompiler)
# SET(CMAKE_SYSTEM_NAME Generic) # set(CMAKE_SYSTEM_NAME Generic)
# CMAKE_FORCE_C_COMPILER (chc12 MetrowerksHicross) # CMAKE_FORCE_C_COMPILER (chc12 MetrowerksHicross)
# CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross) # CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross)
@ -42,41 +42,38 @@
# (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.)
MACRO(CMAKE_FORCE_C_COMPILER compiler id) macro(CMAKE_FORCE_C_COMPILER compiler id)
SET(CMAKE_C_COMPILER "${compiler}") set(CMAKE_C_COMPILER "${compiler}")
SET(CMAKE_C_COMPILER_ID_RUN TRUE) set(CMAKE_C_COMPILER_ID_RUN TRUE)
SET(CMAKE_C_COMPILER_ID ${id}) set(CMAKE_C_COMPILER_ID ${id})
SET(CMAKE_C_COMPILER_WORKS TRUE) set(CMAKE_C_COMPILER_FORCED TRUE)
SET(CMAKE_C_COMPILER_FORCED TRUE)
# Set old compiler id variables. # Set old compiler id variables.
IF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_COMPILER_IS_GNUCC 1) set(CMAKE_COMPILER_IS_GNUCC 1)
ENDIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU") endif()
ENDMACRO(CMAKE_FORCE_C_COMPILER) endmacro()
MACRO(CMAKE_FORCE_CXX_COMPILER compiler id) macro(CMAKE_FORCE_CXX_COMPILER compiler id)
SET(CMAKE_CXX_COMPILER "${compiler}") set(CMAKE_CXX_COMPILER "${compiler}")
SET(CMAKE_CXX_COMPILER_ID_RUN TRUE) set(CMAKE_CXX_COMPILER_ID_RUN TRUE)
SET(CMAKE_CXX_COMPILER_ID ${id}) set(CMAKE_CXX_COMPILER_ID ${id})
SET(CMAKE_CXX_COMPILER_WORKS TRUE) set(CMAKE_CXX_COMPILER_FORCED TRUE)
SET(CMAKE_CXX_COMPILER_FORCED TRUE)
# Set old compiler id variables. # Set old compiler id variables.
IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_COMPILER_IS_GNUCXX 1) set(CMAKE_COMPILER_IS_GNUCXX 1)
ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") endif()
ENDMACRO(CMAKE_FORCE_CXX_COMPILER) endmacro()
MACRO(CMAKE_FORCE_Fortran_COMPILER compiler id) macro(CMAKE_FORCE_Fortran_COMPILER compiler id)
SET(CMAKE_Fortran_COMPILER "${compiler}") set(CMAKE_Fortran_COMPILER "${compiler}")
SET(CMAKE_Fortran_COMPILER_ID_RUN TRUE) set(CMAKE_Fortran_COMPILER_ID_RUN TRUE)
SET(CMAKE_Fortran_COMPILER_ID ${id}) set(CMAKE_Fortran_COMPILER_ID ${id})
SET(CMAKE_Fortran_COMPILER_WORKS TRUE) set(CMAKE_Fortran_COMPILER_FORCED TRUE)
SET(CMAKE_Fortran_COMPILER_FORCED TRUE)
# Set old compiler id variables. # Set old compiler id variables.
IF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_COMPILER_IS_GNUG77 1) set(CMAKE_COMPILER_IS_GNUG77 1)
ENDIF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU") endif()
ENDMACRO(CMAKE_FORCE_Fortran_COMPILER) endmacro()

@ -1,52 +1,55 @@
SET(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@") set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@")
SET(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@") set(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@")
SET(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@") set(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
SET(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@") set(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
@SET_MSVC_Fortran_ARCHITECTURE_ID@ @SET_MSVC_Fortran_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@") set(CMAKE_AR "@CMAKE_AR@")
SET(CMAKE_RANLIB "@CMAKE_RANLIB@") set(CMAKE_RANLIB "@CMAKE_RANLIB@")
SET(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@) set(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@)
SET(CMAKE_Fortran_COMPILER_LOADED 1) set(CMAKE_Fortran_COMPILER_LOADED 1)
SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@) set(CMAKE_Fortran_COMPILER_WORKS @CMAKE_Fortran_COMPILER_WORKS@)
SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@) set(CMAKE_Fortran_ABI_COMPILED @CMAKE_Fortran_ABI_COMPILED@)
IF(CMAKE_COMPILER_IS_CYGWIN) set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
SET(CYGWIN 1) set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
SET(UNIX 1) if(CMAKE_COMPILER_IS_CYGWIN)
ENDIF(CMAKE_COMPILER_IS_CYGWIN) set(CYGWIN 1)
set(UNIX 1)
SET(CMAKE_Fortran_COMPILER_ENV_VAR "FC") endif()
SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 @CMAKE_Fortran_COMPILER_SUPPORTS_F90@) set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
IF(CMAKE_COMPILER_IS_MINGW) set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 @CMAKE_Fortran_COMPILER_SUPPORTS_F90@)
SET(MINGW 1)
ENDIF(CMAKE_COMPILER_IS_MINGW) if(CMAKE_COMPILER_IS_MINGW)
SET(CMAKE_Fortran_COMPILER_ID_RUN 1) set(MINGW 1)
SET(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;f77;F77;f90;F90;for;For;FOR;f95;F95) endif()
SET(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC) set(CMAKE_Fortran_COMPILER_ID_RUN 1)
SET(CMAKE_Fortran_LINKER_PREFERENCE 20) set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;f77;F77;f90;F90;for;For;FOR;f95;F95)
IF(UNIX) set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
SET(CMAKE_Fortran_OUTPUT_EXTENSION .o) set(CMAKE_Fortran_LINKER_PREFERENCE 20)
ELSE(UNIX) if(UNIX)
SET(CMAKE_Fortran_OUTPUT_EXTENSION .obj) set(CMAKE_Fortran_OUTPUT_EXTENSION .o)
ENDIF(UNIX) else()
set(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
endif()
# Save compiler ABI information. # Save compiler ABI information.
SET(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@") set(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
SET(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@") set(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@")
SET(CMAKE_Fortran_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@") set(CMAKE_Fortran_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
IF(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P) if(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P)
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}") set(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
ENDIF() endif()
IF(CMAKE_Fortran_COMPILER_ABI) if(CMAKE_Fortran_COMPILER_ABI)
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}") set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
ENDIF(CMAKE_Fortran_COMPILER_ABI) endif()
IF(CMAKE_Fortran_LIBRARY_ARCHITECTURE) if(CMAKE_Fortran_LIBRARY_ARCHITECTURE)
SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@") set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
ENDIF() endif()
SET(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "@CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES@") set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "@CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES@")
SET(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES@") set(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES@")
set(CMAKE_Fortran_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")

@ -74,12 +74,8 @@
PRINT *, 'INFO:platform[IRIX]' PRINT *, 'INFO:platform[IRIX]'
#elif defined(__hpux) || defined(__hpux__) #elif defined(__hpux) || defined(__hpux__)
PRINT *, 'INFO:platform[HP-UX]' PRINT *, 'INFO:platform[HP-UX]'
#elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU) #elif defined(__HAIKU__)
PRINT *, 'INFO:platform[Haiku]' PRINT *, 'INFO:platform[Haiku]'
# if 0
! Haiku also defines __BEOS__ so we must
! put it prior to the check for __BEOS__
# endif
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
PRINT *, 'INFO:platform[BeOS]' PRINT *, 'INFO:platform[BeOS]'
#elif defined(__QNX__) || defined(__QNXNTO__) #elif defined(__QNX__) || defined(__QNXNTO__)

@ -16,163 +16,163 @@
# It also loads the available platform file for the system-compiler # It also loads the available platform file for the system-compiler
# if it exists. # if it exists.
SET(_INCLUDED_FILE 0) set(_INCLUDED_FILE 0)
# Load compiler-specific information. # Load compiler-specific information.
IF(CMAKE_Fortran_COMPILER_ID) if(CMAKE_Fortran_COMPILER_ID)
INCLUDE(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL) include(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL)
ENDIF(CMAKE_Fortran_COMPILER_ID) endif()
SET(CMAKE_BASE_NAME) set(CMAKE_BASE_NAME)
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE) get_filename_component(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE)
# since the gnu compiler has several names force g++ # since the gnu compiler has several names force g++
IF(CMAKE_COMPILER_IS_GNUG77) if(CMAKE_COMPILER_IS_GNUG77)
SET(CMAKE_BASE_NAME g77) set(CMAKE_BASE_NAME g77)
ENDIF(CMAKE_COMPILER_IS_GNUG77) endif()
IF(CMAKE_Fortran_COMPILER_ID) if(CMAKE_Fortran_COMPILER_ID)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
ENDIF(CMAKE_Fortran_COMPILER_ID) endif()
IF (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
RESULT_VARIABLE _INCLUDED_FILE) RESULT_VARIABLE _INCLUDED_FILE)
ENDIF (NOT _INCLUDED_FILE) endif ()
# We specify the compiler information in the system file for some # We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file # platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info. # was first included. Include it again to get the language info.
# Remove this when all compiler info is removed from system files. # Remove this when all compiler info is removed from system files.
IF (NOT _INCLUDED_FILE) if (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL) include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
ENDIF (NOT _INCLUDED_FILE) endif ()
IF(CMAKE_Fortran_SIZEOF_DATA_PTR) if(CMAKE_Fortran_SIZEOF_DATA_PTR)
FOREACH(f ${CMAKE_Fortran_ABI_FILES}) foreach(f ${CMAKE_Fortran_ABI_FILES})
INCLUDE(${f}) include(${f})
ENDFOREACH() endforeach()
UNSET(CMAKE_Fortran_ABI_FILES) unset(CMAKE_Fortran_ABI_FILES)
ENDIF() endif()
# This should be included before the _INIT variables are # This should be included before the _INIT variables are
# used to initialize the cache. Since the rule variables # used to initialize the cache. Since the rule variables
# have if blocks on them, users can still define them here. # have if blocks on them, users can still define them here.
# But, it should still be after the platform file so changes can # But, it should still be after the platform file so changes can
# be made to those values. # be made to those values.
IF(CMAKE_USER_MAKE_RULES_OVERRIDE) if(CMAKE_USER_MAKE_RULES_OVERRIDE)
# Save the full path of the file so try_compile can use it. # Save the full path of the file so try_compile can use it.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override) include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}") set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
ENDIF() endif()
IF(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran) if(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran)
# Save the full path of the file so try_compile can use it. # Save the full path of the file so try_compile can use it.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran} RESULT_VARIABLE _override) include(${CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran "${_override}") set(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran "${_override}")
ENDIF() endif()
# Fortran needs cmake to do a requires step during its build process to # Fortran needs cmake to do a requires step during its build process to
# catch any modules # catch any modules
SET(CMAKE_NEEDS_REQUIRES_STEP_Fortran_FLAG 1) set(CMAKE_NEEDS_REQUIRES_STEP_Fortran_FLAG 1)
IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC) if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
SET(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC}) set(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC) endif()
IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE) if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
SET(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE}) set(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE) endif()
IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL) if(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
SET(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL}) set(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL) endif()
# Create a set of shared library variable specific to Fortran # Create a set of shared library variable specific to Fortran
# 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
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS) if(NOT DEFINED CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
ENDIF() endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_Fortran_FLAGS) if(NOT DEFINED CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
ENDIF() endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS) if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}) set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
ENDIF() endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG) if(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG}) set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
ENDIF() endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP) if(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP)
SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP}) set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
ENDIF() endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG) if(NOT DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG}) set(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
ENDIF() endif()
IF(NOT DEFINED CMAKE_EXE_EXPORTS_Fortran_FLAG) if(NOT DEFINED CMAKE_EXE_EXPORTS_Fortran_FLAG)
SET(CMAKE_EXE_EXPORTS_Fortran_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG}) set(CMAKE_EXE_EXPORTS_Fortran_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
ENDIF() endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG) 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 # for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just # so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables # copy the values from the LIBRARY variables
IF(NOT CMAKE_MODULE_EXISTS) if(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS}) set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS}) set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
ENDIF(NOT CMAKE_MODULE_EXISTS) endif()
# 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})
ENDIF() endif()
IF(NOT DEFINED CMAKE_SHARED_MODULE_Fortran_FLAGS) if(NOT DEFINED CMAKE_SHARED_MODULE_Fortran_FLAGS)
SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS}) set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
ENDIF() endif()
IF(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG) if(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG}) set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG})
ENDIF() endif()
IF(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP) if(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP}) set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP})
ENDIF() endif()
IF(NOT DEFINED CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG) if(NOT DEFINED CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
SET(CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG}) set(CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG})
ENDIF() endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH) if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH}) set(CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH) endif()
IF(NOT CMAKE_INCLUDE_FLAG_Fortran) if(NOT CMAKE_INCLUDE_FLAG_Fortran)
SET(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C}) set(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C})
ENDIF(NOT CMAKE_INCLUDE_FLAG_Fortran) endif()
IF(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran) if(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
SET(CMAKE_INCLUDE_FLAG_SEP_Fortran ${CMAKE_INCLUDE_FLAG_SEP_C}) set(CMAKE_INCLUDE_FLAG_SEP_Fortran ${CMAKE_INCLUDE_FLAG_SEP_C})
ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran) endif()
SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.") set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
SET(CMAKE_Fortran_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}") set(CMAKE_Fortran_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}")
# avoid just having a space as the initial value for the cache # avoid just having a space as the initial value for the cache
IF(CMAKE_Fortran_FLAGS_INIT STREQUAL " ") if(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
SET(CMAKE_Fortran_FLAGS_INIT) set(CMAKE_Fortran_FLAGS_INIT)
ENDIF(CMAKE_Fortran_FLAGS_INIT STREQUAL " ") endif()
SET (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING
"Flags for Fortran compiler.") "Flags for Fortran compiler.")
INCLUDE(CMakeCommonLanguageInclude) include(CMakeCommonLanguageInclude)
# now define the following rule variables # now define the following rule variables
# CMAKE_Fortran_CREATE_SHARED_LIBRARY # CMAKE_Fortran_CREATE_SHARED_LIBRARY
@ -181,60 +181,60 @@ INCLUDE(CMakeCommonLanguageInclude)
# CMAKE_Fortran_LINK_EXECUTABLE # CMAKE_Fortran_LINK_EXECUTABLE
# create a Fortran shared library # create a Fortran shared library
IF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY) if(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
"<CMAKE_Fortran_COMPILER> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") "<CMAKE_Fortran_COMPILER> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY) endif()
# create a Fortran shared module just copy the shared library rule # create a Fortran shared module just copy the shared library rule
IF(NOT CMAKE_Fortran_CREATE_SHARED_MODULE) if(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
SET(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY}) set(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_MODULE) endif()
# Create a static archive incrementally for large object file counts. # Create a static archive incrementally for large object file counts.
# If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these. # If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these.
IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_CREATE) if(NOT DEFINED CMAKE_Fortran_ARCHIVE_CREATE)
SET(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>") set(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF() endif()
IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND) if(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND)
SET(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>") set(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF() endif()
IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH) if(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH)
SET(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>") set(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
ENDIF() endif()
# compile a Fortran file into an object file # compile a Fortran file into an object file
# (put -o after -c to workaround bug in at least one mpif77 wrapper) # (put -o after -c to workaround bug in at least one mpif77 wrapper)
IF(NOT CMAKE_Fortran_COMPILE_OBJECT) if(NOT CMAKE_Fortran_COMPILE_OBJECT)
SET(CMAKE_Fortran_COMPILE_OBJECT set(CMAKE_Fortran_COMPILE_OBJECT
"<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -c <SOURCE> -o <OBJECT>") "<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -c <SOURCE> -o <OBJECT>")
ENDIF(NOT CMAKE_Fortran_COMPILE_OBJECT) endif()
# link a fortran program # link a fortran program
IF(NOT CMAKE_Fortran_LINK_EXECUTABLE) if(NOT CMAKE_Fortran_LINK_EXECUTABLE)
SET(CMAKE_Fortran_LINK_EXECUTABLE set(CMAKE_Fortran_LINK_EXECUTABLE
"<CMAKE_Fortran_COMPILER> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") "<CMAKE_Fortran_COMPILER> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
ENDIF(NOT CMAKE_Fortran_LINK_EXECUTABLE) endif()
IF(CMAKE_Fortran_STANDARD_LIBRARIES_INIT) if(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
SET(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}" set(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}"
CACHE STRING "Libraries linked by defalut with all Fortran applications.") CACHE STRING "Libraries linked by defalut with all Fortran applications.")
MARK_AS_ADVANCED(CMAKE_Fortran_STANDARD_LIBRARIES) mark_as_advanced(CMAKE_Fortran_STANDARD_LIBRARIES)
ENDIF(CMAKE_Fortran_STANDARD_LIBRARIES_INIT) endif()
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
SET (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG_INIT}" CACHE STRING set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG_INIT}" CACHE STRING
"Flags used by the compiler during debug builds.") "Flags used by the compiler during debug builds.")
SET (CMAKE_Fortran_FLAGS_MINSIZEREL "${CMAKE_Fortran_FLAGS_MINSIZEREL_INIT}" CACHE STRING set (CMAKE_Fortran_FLAGS_MINSIZEREL "${CMAKE_Fortran_FLAGS_MINSIZEREL_INIT}" CACHE STRING
"Flags used by the compiler during release minsize builds.") "Flags used by the compiler during release minsize builds.")
SET (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE_INIT}" CACHE STRING set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE_INIT}" CACHE STRING
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).") "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING set (CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
"Flags used by the compiler during Release with Debug Info builds.") "Flags used by the compiler during Release with Debug Info builds.")
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) endif()
MARK_AS_ADVANCED( mark_as_advanced(
CMAKE_Fortran_FLAGS CMAKE_Fortran_FLAGS
CMAKE_Fortran_FLAGS_DEBUG CMAKE_Fortran_FLAGS_DEBUG
CMAKE_Fortran_FLAGS_MINSIZEREL CMAKE_Fortran_FLAGS_MINSIZEREL
@ -242,4 +242,4 @@ CMAKE_Fortran_FLAGS_RELEASE
CMAKE_Fortran_FLAGS_RELWITHDEBINFO) CMAKE_Fortran_FLAGS_RELWITHDEBINFO)
# set this variable so we can avoid loading this more than once. # set this variable so we can avoid loading this more than once.
SET(CMAKE_Fortran_INFORMATION_LOADED 1) set(CMAKE_Fortran_INFORMATION_LOADED 1)

@ -12,60 +12,60 @@
# (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.)
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic set(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") # -rpath set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") # -rpath
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
SET(CMAKE_INCLUDE_FLAG_C "-I") # -I set(CMAKE_INCLUDE_FLAG_C "-I") # -I
SET(CMAKE_INCLUDE_FLAG_C_SEP "") # , or empty set(CMAKE_INCLUDE_FLAG_C_SEP "") # , or empty
SET(CMAKE_LIBRARY_PATH_FLAG "-L") set(CMAKE_LIBRARY_PATH_FLAG "-L")
SET(CMAKE_LIBRARY_PATH_TERMINATOR "") # for the Digital Mars D compiler the link paths have to be terminated with a "/" set(CMAKE_LIBRARY_PATH_TERMINATOR "") # for the Digital Mars D compiler the link paths have to be terminated with a "/"
SET(CMAKE_LINK_LIBRARY_FLAG "-l") set(CMAKE_LINK_LIBRARY_FLAG "-l")
SET(CMAKE_LINK_LIBRARY_SUFFIX "") set(CMAKE_LINK_LIBRARY_SUFFIX "")
SET(CMAKE_STATIC_LIBRARY_PREFIX "lib") set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a") set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib set(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
SET(CMAKE_EXECUTABLE_SUFFIX "") # .exe set(CMAKE_EXECUTABLE_SUFFIX "") # .exe
SET(CMAKE_DL_LIBS "dl") set(CMAKE_DL_LIBS "dl")
SET(CMAKE_FIND_LIBRARY_PREFIXES "lib") set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a") set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
# basically all general purpose OSs support shared libs # basically all general purpose OSs support shared libs
SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE) set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL set (CMAKE_SKIP_RPATH "NO" CACHE BOOL
"If set, runtime paths are not added when using shared libraries.") "If set, runtime paths are not added when using shared libraries.")
SET (CMAKE_SKIP_INSTALL_RPATH "NO" CACHE BOOL set (CMAKE_SKIP_INSTALL_RPATH "NO" CACHE BOOL
"If set, runtime paths are not added when installing shared libraries, but are added when building.") "If set, runtime paths are not added when installing shared libraries, but are added when building.")
SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.") set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
IF(CMAKE_GENERATOR MATCHES "Makefiles") if(CMAKE_GENERATOR MATCHES "Makefiles")
SET(CMAKE_COLOR_MAKEFILE ON CACHE BOOL set(CMAKE_COLOR_MAKEFILE ON CACHE BOOL
"Enable/Disable color output during build." "Enable/Disable color output during build."
) )
MARK_AS_ADVANCED(CMAKE_COLOR_MAKEFILE) mark_as_advanced(CMAKE_COLOR_MAKEFILE)
IF(DEFINED CMAKE_RULE_MESSAGES) if(DEFINED CMAKE_RULE_MESSAGES)
SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES}) set_property(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
ENDIF(DEFINED CMAKE_RULE_MESSAGES) endif()
IF(CMAKE_GENERATOR MATCHES "Unix Makefiles") if(CMAKE_GENERATOR MATCHES "Unix Makefiles")
SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
"Enable/Disable output of compile commands during generation." "Enable/Disable output of compile commands during generation."
) )
MARK_AS_ADVANCED(CMAKE_EXPORT_COMPILE_COMMANDS) mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
ENDIF(CMAKE_GENERATOR MATCHES "Unix Makefiles") endif()
ENDIF(CMAKE_GENERATOR MATCHES "Makefiles") endif()
IF(CMAKE_GENERATOR MATCHES "Ninja") if(CMAKE_GENERATOR MATCHES "Ninja")
SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
"Enable/Disable output of compile commands during generation." "Enable/Disable output of compile commands during generation."
) )
MARK_AS_ADVANCED(CMAKE_EXPORT_COMPILE_COMMANDS) mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
ENDIF(CMAKE_GENERATOR MATCHES "Ninja") endif()
# GetDefaultWindowsPrefixBase # GetDefaultWindowsPrefixBase
# #
@ -160,27 +160,27 @@ endfunction()
# was initialized by the block below. This is useful for user # was initialized by the block below. This is useful for user
# projects to change the default prefix while still allowing the # projects to change the default prefix while still allowing the
# command line to override it. # command line to override it.
IF(NOT DEFINED CMAKE_INSTALL_PREFIX) if(NOT DEFINED CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1) set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX) endif()
# Choose a default install prefix for this platform. # Choose a default install prefix for this platform.
IF(CMAKE_HOST_UNIX) if(CMAKE_HOST_UNIX)
SET(CMAKE_INSTALL_PREFIX "/usr/local" set(CMAKE_INSTALL_PREFIX "/usr/local"
CACHE PATH "Install path prefix, prepended onto install directories.") CACHE PATH "Install path prefix, prepended onto install directories.")
ELSE(CMAKE_HOST_UNIX) else()
GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES) GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
SET(CMAKE_INSTALL_PREFIX set(CMAKE_INSTALL_PREFIX
"${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}" "${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
CACHE PATH "Install path prefix, prepended onto install directories.") CACHE PATH "Install path prefix, prepended onto install directories.")
SET(CMAKE_GENERIC_PROGRAM_FILES) set(CMAKE_GENERIC_PROGRAM_FILES)
ENDIF(CMAKE_HOST_UNIX) endif()
# Set a variable which will be used as component name in install() commands # Set a variable which will be used as component name in install() commands
# where no COMPONENT has been given: # where no COMPONENT has been given:
SET(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "Unspecified") set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "Unspecified")
MARK_AS_ADVANCED( mark_as_advanced(
CMAKE_SKIP_RPATH CMAKE_SKIP_RPATH
CMAKE_SKIP_INSTALL_RPATH CMAKE_SKIP_INSTALL_RPATH
CMAKE_VERBOSE_MAKEFILE CMAKE_VERBOSE_MAKEFILE

@ -16,9 +16,9 @@
# This macro used to load build settings from another project that # This macro used to load build settings from another project that
# stored settings using the CMAKE_EXPORT_BUILD_SETTINGS macro. # stored settings using the CMAKE_EXPORT_BUILD_SETTINGS macro.
MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE) macro(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
IF(${SETTINGS_FILE} MATCHES ".+") if(${SETTINGS_FILE} MATCHES ".+")
ELSE(${SETTINGS_FILE} MATCHES ".+") else()
MESSAGE(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.") message(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.")
ENDIF(${SETTINGS_FILE} MATCHES ".+") endif()
ENDMACRO(CMAKE_IMPORT_BUILD_SETTINGS) endmacro()

@ -13,6 +13,6 @@
# License text for the above reference.) # License text for the above reference.)
SET (CMAKE_MAKE_PROGRAM "jom" CACHE STRING set (CMAKE_MAKE_PROGRAM "jom" CACHE STRING
"Program used to build from makefiles.") "Program used to build from makefiles.")
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) mark_as_advanced(CMAKE_MAKE_PROGRAM)

@ -1,13 +1,13 @@
SET(CMAKE_Java_COMPILER "@CMAKE_Java_COMPILER@") set(CMAKE_Java_COMPILER "@CMAKE_Java_COMPILER@")
SET(CMAKE_Java_COMPILER_ARG1 "@CMAKE_Java_COMPILER_ARG1@") set(CMAKE_Java_COMPILER_ARG1 "@CMAKE_Java_COMPILER_ARG1@")
SET(CMAKE_Java_RUNTIME "@CMAKE_Java_RUNTIME@") set(CMAKE_Java_RUNTIME "@CMAKE_Java_RUNTIME@")
SET(CMAKE_Java_ARCHIVE "@CMAKE_Java_ARCHIVE@") set(CMAKE_Java_ARCHIVE "@CMAKE_Java_ARCHIVE@")
SET(CMAKE_Java_COMPILER_LOADED 1) set(CMAKE_Java_COMPILER_LOADED 1)
SET(CMAKE_Java_SOURCE_FILE_EXTENSIONS java) set(CMAKE_Java_SOURCE_FILE_EXTENSIONS java)
SET(CMAKE_Java_LINKER_PREFERENCE 40) set(CMAKE_Java_LINKER_PREFERENCE 40)
SET(CMAKE_Java_OUTPUT_EXTENSION .class) set(CMAKE_Java_OUTPUT_EXTENSION .class)
SET(CMAKE_Java_OUTPUT_EXTENSION_REPLACE 1) set(CMAKE_Java_OUTPUT_EXTENSION_REPLACE 1)
SET(CMAKE_STATIC_LIBRARY_PREFIX_Java "") set(CMAKE_STATIC_LIBRARY_PREFIX_Java "")
SET(CMAKE_STATIC_LIBRARY_SUFFIX_Java ".jar") set(CMAKE_STATIC_LIBRARY_SUFFIX_Java ".jar")
SET(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER") set(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")

@ -13,47 +13,47 @@
# License text for the above reference.) # License text for the above reference.)
# This should be included before the _INIT variables are # This should be included before the _INIT variables are
# used to initialize the cache. Since the rule variables # used to initialize the cache. Since the rule variables
# have if blocks on them, users can still define them here. # have if blocks on them, users can still define them here.
# But, it should still be after the platform file so changes can # But, it should still be after the platform file so changes can
# be made to those values. # be made to those values.
IF(CMAKE_USER_MAKE_RULES_OVERRIDE) if(CMAKE_USER_MAKE_RULES_OVERRIDE)
# Save the full path of the file so try_compile can use it. # Save the full path of the file so try_compile can use it.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override) include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}") set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
ENDIF() endif()
IF(CMAKE_USER_MAKE_RULES_OVERRIDE_Java) if(CMAKE_USER_MAKE_RULES_OVERRIDE_Java)
# Save the full path of the file so try_compile can use it. # Save the full path of the file so try_compile can use it.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Java} RESULT_VARIABLE _override) include(${CMAKE_USER_MAKE_RULES_OVERRIDE_Java} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE_Java "${_override}") set(CMAKE_USER_MAKE_RULES_OVERRIDE_Java "${_override}")
ENDIF() endif()
# this is a place holder if java needed flags for javac they would go here. # this is a place holder if java needed flags for javac they would go here.
IF(NOT CMAKE_Java_CREATE_STATIC_LIBRARY) if(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
# IF(WIN32) # if(WIN32)
# SET(class_files_mask "*.class") # set(class_files_mask "*.class")
# ELSE(WIN32) # else()
SET(class_files_mask ".") set(class_files_mask ".")
# ENDIF(WIN32) # endif()
SET(CMAKE_Java_CREATE_STATIC_LIBRARY set(CMAKE_Java_CREATE_STATIC_LIBRARY
"<CMAKE_Java_ARCHIVE> -cf <TARGET> -C <OBJECT_DIR> ${class_files_mask}") "<CMAKE_Java_ARCHIVE> -cf <TARGET> -C <OBJECT_DIR> ${class_files_mask}")
# "${class_files_mask}" should really be "<OBJECTS>" but compling a *.java # "${class_files_mask}" should really be "<OBJECTS>" but compling a *.java
# file can create more than one *.class file... # file can create more than one *.class file...
ENDIF(NOT CMAKE_Java_CREATE_STATIC_LIBRARY) endif()
# compile a Java file into an object file # compile a Java file into an object file
IF(NOT CMAKE_Java_COMPILE_OBJECT) if(NOT CMAKE_Java_COMPILE_OBJECT)
SET(CMAKE_Java_COMPILE_OBJECT set(CMAKE_Java_COMPILE_OBJECT
"<CMAKE_Java_COMPILER> <FLAGS> <SOURCE> -d <OBJECT_DIR>") "<CMAKE_Java_COMPILER> <FLAGS> <SOURCE> -d <OBJECT_DIR>")
ENDIF(NOT CMAKE_Java_COMPILE_OBJECT) endif()
# set java include flag option and the separator for multiple include paths # set java include flag option and the separator for multiple include paths
SET(CMAKE_INCLUDE_FLAG_Java "-classpath ") set(CMAKE_INCLUDE_FLAG_Java "-classpath ")
IF(WIN32 AND NOT CYGWIN) if(WIN32 AND NOT CYGWIN)
SET(CMAKE_INCLUDE_FLAG_SEP_Java ";") set(CMAKE_INCLUDE_FLAG_SEP_Java ";")
ELSE(WIN32 AND NOT CYGWIN) else()
SET(CMAKE_INCLUDE_FLAG_SEP_Java ":") set(CMAKE_INCLUDE_FLAG_SEP_Java ":")
ENDIF(WIN32 AND NOT CYGWIN) endif()

@ -12,9 +12,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.)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM make find_program(CMAKE_MAKE_PROGRAM make
PATHS PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS-1.0_is1;Inno Setup: App Path]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS-1.0_is1;Inno Setup: App Path]/bin"
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
c:/msys/1.0/bin /msys/1.0/bin) c:/msys/1.0/bin /msys/1.0/bin)
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) mark_as_advanced(CMAKE_MAKE_PROGRAM)

@ -12,13 +12,13 @@
# (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_PROGRAM(CMAKE_MAKE_PROGRAM mingw32-make.exe PATHS find_program(CMAKE_MAKE_PROGRAM mingw32-make.exe PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin" "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
c:/MinGW/bin /MinGW/bin) c:/MinGW/bin /MinGW/bin)
FIND_PROGRAM(CMAKE_SH sh.exe ) find_program(CMAKE_SH sh.exe )
IF(CMAKE_SH) if(CMAKE_SH)
MESSAGE(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n") message(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n")
SET(CMAKE_MAKE_PROGRAM NOTFOUND) set(CMAKE_MAKE_PROGRAM NOTFOUND)
ENDIF(CMAKE_SH) endif()
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM CMAKE_SH) mark_as_advanced(CMAKE_MAKE_PROGRAM CMAKE_SH)

@ -13,6 +13,6 @@
# License text for the above reference.) # License text for the above reference.)
SET (CMAKE_MAKE_PROGRAM "nmake" CACHE STRING set (CMAKE_MAKE_PROGRAM "nmake" CACHE STRING
"Program used to build from makefiles.") "Program used to build from makefiles.")
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) mark_as_advanced(CMAKE_MAKE_PROGRAM)

@ -12,6 +12,6 @@
# (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_PROGRAM(CMAKE_MAKE_PROGRAM ninja find_program(CMAKE_MAKE_PROGRAM ninja
DOC "Program used to build from build.ninja files.") DOC "Program used to build from build.ninja files.")
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) mark_as_advanced(CMAKE_MAKE_PROGRAM)

@ -6,9 +6,11 @@
# [NO_CHECK_REQUIRED_COMPONENTS_MACRO]) # [NO_CHECK_REQUIRED_COMPONENTS_MACRO])
# #
# CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the plain # CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the plain
# CONFIGURE_FILE() command when creating the <Name>Config.cmake or <Name>-config.cmake # configure_file() command when creating the <Name>Config.cmake or <Name>-config.cmake
# file for installing a project or library. It helps making the resulting package # file for installing a project or library. It helps making the resulting package
# relocatable by avoiding hardcoded paths in the installed Config.cmake file. # relocatable by avoiding hardcoded paths in the installed Config.cmake file.
# <Name>Config.cmake files installed under UNIX into /lib(64) or /usr/lib(64) are
# considered system packages and are not relocatable.
# #
# In a FooConfig.cmake file there may be code like this to make the # In a FooConfig.cmake file there may be code like this to make the
# install destinations know to the using project: # install destinations know to the using project:
@ -31,12 +33,12 @@
# Usage: # Usage:
# 1. write a FooConfig.cmake.in file as you are used to # 1. write a FooConfig.cmake.in file as you are used to
# 2. insert a line containing only the string "@PACKAGE_INIT@" # 2. insert a line containing only the string "@PACKAGE_INIT@"
# 3. instead of SET(FOO_DIR "@SOME_INSTALL_DIR@"), use SET(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@") # 3. instead of set(FOO_DIR "@SOME_INSTALL_DIR@"), use set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")
# (this must be after the @PACKAGE_INIT@ line) # (this must be after the @PACKAGE_INIT@ line)
# 4. instead of using the normal CONFIGURE_FILE(), use CONFIGURE_PACKAGE_CONFIG_FILE() # 4. instead of using the normal configure_file(), use CONFIGURE_PACKAGE_CONFIG_FILE()
# #
# The <input> and <output> arguments are the input and output file, the same way # The <input> and <output> arguments are the input and output file, the same way
# as in CONFIGURE_FILE(). # as in configure_file().
# #
# The <path> given to INSTALL_DESTINATION must be the destination where the FooConfig.cmake # The <path> given to INSTALL_DESTINATION must be the destination where the FooConfig.cmake
# file will be installed to. This can either be a relative or absolute path, both work. # file will be installed to. This can either be a relative or absolute path, both work.
@ -77,7 +79,7 @@
# WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) ) # WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) )
# #
# Writes a file for use as <package>ConfigVersion.cmake file to <filename>. # Writes a file for use as <package>ConfigVersion.cmake file to <filename>.
# See the documentation of FIND_PACKAGE() for details on this. # See the documentation of find_package() for details on this.
# filename is the output filename, it should be in the build tree. # filename is the output filename, it should be in the build tree.
# major.minor.patch is the version number of the project to be installed # major.minor.patch is the version number of the project to be installed
# The COMPATIBILITY mode AnyNewerVersion means that the installed package version # The COMPATIBILITY mode AnyNewerVersion means that the installed package version
@ -173,23 +175,44 @@ function(CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile)
else() else()
set(absInstallDir "${CMAKE_INSTALL_PREFIX}/${CCF_INSTALL_DESTINATION}") set(absInstallDir "${CMAKE_INSTALL_PREFIX}/${CCF_INSTALL_DESTINATION}")
endif() endif()
# with the /usr-move, /lib(64) is a symlink to /usr/lib on Fedora, ArchLinux, Mageira and others.
# If we are installed to such a location, force using absolute paths.
set(forceAbsolutePaths FALSE)
if("${absInstallDir}" MATCHES "^(/usr)?/lib(64)?/.+")
set(forceAbsolutePaths TRUE)
endif()
file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${absInstallDir}" "${CMAKE_INSTALL_PREFIX}" ) file(RELATIVE_PATH PACKAGE_RELATIVE_PATH "${absInstallDir}" "${CMAKE_INSTALL_PREFIX}" )
foreach(var ${CCF_PATH_VARS}) foreach(var ${CCF_PATH_VARS})
if(NOT DEFINED ${var}) if(NOT DEFINED ${var})
message(FATAL_ERROR "Variable ${var} does not exist") message(FATAL_ERROR "Variable ${var} does not exist")
else() else()
if(IS_ABSOLUTE "${${var}}") if(forceAbsolutePaths)
string(REPLACE "${CMAKE_INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}" if(IS_ABSOLUTE "${${var}}")
PACKAGE_${var} "${${var}}") set(PACKAGE_${var} "${${var}}")
else()
set(PACKAGE_${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
endif()
else() else()
set(PACKAGE_${var} "\${PACKAGE_PREFIX_DIR}/${${var}}") if(IS_ABSOLUTE "${${var}}")
string(REPLACE "${CMAKE_INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}"
PACKAGE_${var} "${${var}}")
else()
set(PACKAGE_${var} "\${PACKAGE_PREFIX_DIR}/${${var}}")
endif()
endif() endif()
endif() endif()
endforeach() endforeach()
get_filename_component(inputFileName "${_inputFile}" NAME)
set(PACKAGE_INIT " set(PACKAGE_INIT "
####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### ####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
####### Any changes to this file will be overwritten by the next CMake run ####
####### The input file was ${inputFileName} ########
get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/${PACKAGE_RELATIVE_PATH}\" ABSOLUTE) get_filename_component(PACKAGE_PREFIX_DIR \"\${CMAKE_CURRENT_LIST_DIR}/${PACKAGE_RELATIVE_PATH}\" ABSOLUTE)
") ")
@ -214,7 +237,7 @@ macro(check_required_components _NAME)
set(\${_NAME}_FOUND FALSE) set(\${_NAME}_FOUND FALSE)
endif() endif()
endif() endif()
endforeach(comp) endforeach()
endmacro() endmacro()
") ")
endif() endif()

@ -84,11 +84,11 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
# first set all result variables to empty/FALSE # first set all result variables to empty/FALSE
foreach(arg_name ${_singleArgNames} ${_multiArgNames}) foreach(arg_name ${_singleArgNames} ${_multiArgNames})
set(${prefix}_${arg_name}) set(${prefix}_${arg_name})
endforeach(arg_name) endforeach()
foreach(option ${_optionNames}) foreach(option ${_optionNames})
set(${prefix}_${option} FALSE) set(${prefix}_${option} FALSE)
endforeach(option) endforeach()
set(${prefix}_UNPARSED_ARGUMENTS) set(${prefix}_UNPARSED_ARGUMENTS)
@ -109,9 +109,9 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
elseif("${insideValues}" STREQUAL "MULTI") elseif("${insideValues}" STREQUAL "MULTI")
list(APPEND ${prefix}_${currentArgName} ${currentArg}) list(APPEND ${prefix}_${currentArgName} ${currentArg})
endif() endif()
else(insideValues) else()
list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg}) list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
endif(insideValues) endif()
else() else()
if(NOT ${optionIndex} EQUAL -1) if(NOT ${optionIndex} EQUAL -1)
set(${prefix}_${currentArg} TRUE) set(${prefix}_${currentArg} TRUE)
@ -127,12 +127,12 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
endif() endif()
endif() endif()
endforeach(currentArg) endforeach()
# propagate the result variables to the caller: # propagate the result variables to the caller:
foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames}) foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE) set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
endforeach(arg_name) endforeach()
set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE) set(${prefix}_UNPARSED_ARGUMENTS ${${prefix}_UNPARSED_ARGUMENTS} PARENT_SCOPE)
endfunction(CMAKE_PARSE_ARGUMENTS _options _singleArgs _multiArgs) endfunction()

@ -16,9 +16,10 @@
# This is used internally by CMake and should not be included by user # This is used internally by CMake and should not be included by user
# code. # code.
function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var obj_regex) function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var fwk_var log_var obj_regex)
set(implicit_libs_tmp "") set(implicit_libs_tmp "")
set(implicit_dirs_tmp) set(implicit_dirs_tmp)
set(implicit_fwks_tmp)
set(log "") set(log "")
# Parse implicit linker arguments. # Parse implicit linker arguments.
@ -36,6 +37,16 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var obj_regex)
set(cmd) set(cmd)
if("${line}" MATCHES "${linker_regex}" AND if("${line}" MATCHES "${linker_regex}" AND
NOT "${line}" MATCHES "${linker_exclude_regex}") NOT "${line}" MATCHES "${linker_exclude_regex}")
if(XCODE)
# Xcode unconditionally adds a path under the project build tree and
# on older versions it is not reported with proper quotes. Remove it.
string(REGEX REPLACE "([][+.*()^])" "\\\\\\1" _dir_regex "${CMAKE_BINARY_DIR}")
string(REGEX REPLACE " -[FL]${_dir_regex}/([^ ]| [^-])+( |$)" " " xline "${line}")
if(NOT "x${xline}" STREQUAL "x${line}")
set(log "${log} reduced line: [${line}]\n to: [${xline}]\n")
set(line "${xline}")
endif()
endif()
if(UNIX) if(UNIX)
separate_arguments(args UNIX_COMMAND "${line}") separate_arguments(args UNIX_COMMAND "${line}")
else() else()
@ -97,32 +108,62 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var obj_regex)
endif() endif()
endforeach() endforeach()
# Look for library search paths reported by linker.
if("${output_lines}" MATCHES ";Library search paths:((;\t[^;]+)+)")
string(REPLACE ";\t" ";" implicit_dirs_match "${CMAKE_MATCH_1}")
set(log "${log} Library search paths: [${implicit_dirs_match}]\n")
list(APPEND implicit_dirs_tmp ${implicit_dirs_match})
endif()
if("${output_lines}" MATCHES ";Framework search paths:((;\t[^;]+)+)")
string(REPLACE ";\t" ";" implicit_fwks_match "${CMAKE_MATCH_1}")
set(log "${log} Framework search paths: [${implicit_fwks_match}]\n")
list(APPEND implicit_fwks_tmp ${implicit_fwks_match})
endif()
# Cleanup list of libraries and flags. # Cleanup list of libraries and flags.
# We remove items that are not language-specific. # We remove items that are not language-specific.
set(implicit_libs "") set(implicit_libs "")
foreach(lib IN LISTS implicit_libs_tmp) foreach(lib IN LISTS implicit_libs_tmp)
if("${lib}" MATCHES "^(crt.*\\.o|gcc.*|System.*)$") if("${lib}" MATCHES "^(crt.*\\.o|gcc.*|System.*)$")
set(log "${log} remove lib [${lib}]\n") set(log "${log} remove lib [${lib}]\n")
elseif(IS_ABSOLUTE "${lib}")
get_filename_component(abs "${lib}" ABSOLUTE)
if(NOT "x${lib}" STREQUAL "x${abs}")
set(log "${log} collapse lib [${lib}] ==> [${abs}]\n")
endif()
list(APPEND implicit_libs "${abs}")
else() else()
list(APPEND implicit_libs "${lib}") list(APPEND implicit_libs "${lib}")
endif() endif()
endforeach() endforeach()
# Cleanup list of directories. # Cleanup list of library and framework directories.
set(implicit_dirs "") set(desc_dirs "library")
foreach(d IN LISTS implicit_dirs_tmp) set(desc_fwks "framework")
get_filename_component(dir "${d}" ABSOLUTE) foreach(t dirs fwks)
list(APPEND implicit_dirs "${dir}") set(implicit_${t} "")
set(log "${log} collapse dir [${d}] ==> [${dir}]\n") foreach(d IN LISTS implicit_${t}_tmp)
get_filename_component(dir "${d}" ABSOLUTE)
string(FIND "${dir}" "${CMAKE_FILES_DIRECTORY}/" pos)
if(NOT pos LESS 0)
set(msg ", skipping non-system directory")
else()
set(msg "")
list(APPEND implicit_${t} "${dir}")
endif()
set(log "${log} collapse ${desc_${t}} dir [${d}] ==> [${dir}]${msg}\n")
endforeach()
list(REMOVE_DUPLICATES implicit_${t})
endforeach() endforeach()
list(REMOVE_DUPLICATES implicit_dirs)
# Log results. # Log results.
set(log "${log} implicit libs: [${implicit_libs}]\n") set(log "${log} implicit libs: [${implicit_libs}]\n")
set(log "${log} implicit dirs: [${implicit_dirs}]\n") set(log "${log} implicit dirs: [${implicit_dirs}]\n")
set(log "${log} implicit fwks: [${implicit_fwks}]\n")
# Return results. # Return results.
set(${lib_var} "${implicit_libs}" PARENT_SCOPE) set(${lib_var} "${implicit_libs}" PARENT_SCOPE)
set(${dir_var} "${implicit_dirs}" PARENT_SCOPE) set(${dir_var} "${implicit_dirs}" PARENT_SCOPE)
set(${fwk_var} "${implicit_fwks}" PARENT_SCOPE)
set(${log_var} "${log}" PARENT_SCOPE) set(${log_var} "${log}" PARENT_SCOPE)
endfunction() endfunction()

@ -35,11 +35,8 @@
#elif defined(__hpux) || defined(__hpux__) #elif defined(__hpux) || defined(__hpux__)
# define PLATFORM_ID "HP-UX" # define PLATFORM_ID "HP-UX"
#elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU) #elif defined(__HAIKU__)
# define PLATFORM_ID "Haiku" # define PLATFORM_ID "Haiku"
/* Haiku also defines __BEOS__ so we must
put it prior to the check for __BEOS__
*/
#elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS) #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
# define PLATFORM_ID "BeOS" # define PLATFORM_ID "BeOS"
@ -92,7 +89,7 @@
# define ARCHITECTURE_ID "IA64" # define ARCHITECTURE_ID "IA64"
# elif defined(_M_X64) || defined(_M_AMD64) # elif defined(_M_X64) || defined(_M_AMD64)
# define ARCHITECTURE_ID "x64" # define ARCHITECTURE_ID "x64"
# elif defined(_M_IX86) # elif defined(_M_IX86)
# define ARCHITECTURE_ID "X86" # define ARCHITECTURE_ID "X86"
@ -100,6 +97,12 @@
# elif defined(_M_ARM) # elif defined(_M_ARM)
# define ARCHITECTURE_ID "ARM" # define ARCHITECTURE_ID "ARM"
# elif defined(_M_MIPS)
# define ARCHITECTURE_ID "MIPS"
# elif defined(_M_SH)
# define ARCHITECTURE_ID "SHx"
# else /* unknown architecture */ # else /* unknown architecture */
# define ARCHITECTURE_ID "" # define ARCHITECTURE_ID ""
# endif # endif

@ -16,31 +16,31 @@
# (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.)
MESSAGE("CMAKE_SYSTEM is ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}") message("CMAKE_SYSTEM is ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}")
MESSAGE("CMAKE_SYSTEM file is ${CMAKE_SYSTEM_INFO_FILE}") message("CMAKE_SYSTEM file is ${CMAKE_SYSTEM_INFO_FILE}")
MESSAGE("CMAKE_C_COMPILER is ${CMAKE_C_COMPILER}") message("CMAKE_C_COMPILER is ${CMAKE_C_COMPILER}")
MESSAGE("CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}") message("CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}")
MESSAGE("CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}") message("CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
MESSAGE("CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}") message("CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
MESSAGE("CMAKE_DL_LIBS is ${CMAKE_DL_LIBS}") message("CMAKE_DL_LIBS is ${CMAKE_DL_LIBS}")
MESSAGE("CMAKE_SHARED_LIBRARY_PREFIX is ${CMAKE_SHARED_LIBRARY_PREFIX}") message("CMAKE_SHARED_LIBRARY_PREFIX is ${CMAKE_SHARED_LIBRARY_PREFIX}")
MESSAGE("CMAKE_SHARED_LIBRARY_SUFFIX is ${CMAKE_SHARED_LIBRARY_SUFFIX}") message("CMAKE_SHARED_LIBRARY_SUFFIX is ${CMAKE_SHARED_LIBRARY_SUFFIX}")
MESSAGE("CMAKE_COMPILER_IS_GNUCC = ${CMAKE_COMPILER_IS_GNUCC}") message("CMAKE_COMPILER_IS_GNUCC = ${CMAKE_COMPILER_IS_GNUCC}")
MESSAGE("CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}") message("CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}")
MESSAGE("CMAKE_CXX_CREATE_SHARED_LIBRARY is ${CMAKE_CXX_CREATE_SHARED_LIBRARY}") message("CMAKE_CXX_CREATE_SHARED_LIBRARY is ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
MESSAGE("CMAKE_CXX_CREATE_SHARED_MODULE is ${CMAKE_CXX_CREATE_SHARED_MODULE}") message("CMAKE_CXX_CREATE_SHARED_MODULE is ${CMAKE_CXX_CREATE_SHARED_MODULE}")
MESSAGE("CMAKE_CXX_CREATE_STATIC_LIBRARY is ${CMAKE_CXX_CREATE_STATIC_LIBRARY}") message("CMAKE_CXX_CREATE_STATIC_LIBRARY is ${CMAKE_CXX_CREATE_STATIC_LIBRARY}")
MESSAGE("CMAKE_CXX_COMPILE_OBJECT is ${CMAKE_CXX_COMPILE_OBJECT}") message("CMAKE_CXX_COMPILE_OBJECT is ${CMAKE_CXX_COMPILE_OBJECT}")
MESSAGE("CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_CXX_LINK_EXECUTABLE}") message("CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_CXX_LINK_EXECUTABLE}")
MESSAGE("CMAKE_C_CREATE_SHARED_LIBRARY is ${CMAKE_C_CREATE_SHARED_LIBRARY}") message("CMAKE_C_CREATE_SHARED_LIBRARY is ${CMAKE_C_CREATE_SHARED_LIBRARY}")
MESSAGE("CMAKE_C_CREATE_SHARED_MODULE is ${CMAKE_C_CREATE_SHARED_MODULE}") message("CMAKE_C_CREATE_SHARED_MODULE is ${CMAKE_C_CREATE_SHARED_MODULE}")
MESSAGE("CMAKE_C_CREATE_STATIC_LIBRARY is ${CMAKE_C_CREATE_STATIC_LIBRARY}") message("CMAKE_C_CREATE_STATIC_LIBRARY is ${CMAKE_C_CREATE_STATIC_LIBRARY}")
MESSAGE("CMAKE_C_COMPILE_OBJECT is ${CMAKE_C_COMPILE_OBJECT}") message("CMAKE_C_COMPILE_OBJECT is ${CMAKE_C_COMPILE_OBJECT}")
MESSAGE("CMAKE_C_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE}") message("CMAKE_C_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE}")
MESSAGE("CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE}") message("CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE}")
MESSAGE("CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE}") message("CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE}")

@ -31,31 +31,31 @@
# License text for the above reference.) # License text for the above reference.)
MACRO(CMAKE_PUSH_CHECK_STATE) macro(CMAKE_PUSH_CHECK_STATE)
IF(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER) if(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER)
SET(_CMAKE_PUSH_CHECK_STATE_COUNTER 0) set(_CMAKE_PUSH_CHECK_STATE_COUNTER 0)
ENDIF() endif()
MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1") math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1")
SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES}) set(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES})
SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS}) set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES}) set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS}) set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
ENDMACRO(CMAKE_PUSH_CHECK_STATE) endmacro()
MACRO(CMAKE_POP_CHECK_STATE) macro(CMAKE_POP_CHECK_STATE)
# don't pop more than we pushed # don't pop more than we pushed
IF("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0") if("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0")
SET(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) set(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
SET(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) set(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
SET(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
SET(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}}) set(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1") math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
ENDIF() endif()
ENDMACRO(CMAKE_POP_CHECK_STATE) endmacro()

@ -1,6 +1,6 @@
SET(CMAKE_RC_COMPILER "@CMAKE_RC_COMPILER@") set(CMAKE_RC_COMPILER "@CMAKE_RC_COMPILER@")
SET(CMAKE_RC_COMPILER_ARG1 "@CMAKE_RC_COMPILER_ARG1@") set(CMAKE_RC_COMPILER_ARG1 "@CMAKE_RC_COMPILER_ARG1@")
SET(CMAKE_RC_COMPILER_LOADED 1) set(CMAKE_RC_COMPILER_LOADED 1)
SET(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc) set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc)
SET(CMAKE_RC_OUTPUT_EXTENSION @CMAKE_RC_OUTPUT_EXTENSION@) set(CMAKE_RC_OUTPUT_EXTENSION @CMAKE_RC_OUTPUT_EXTENSION@)
SET(CMAKE_RC_COMPILER_ENV_VAR "RC") set(CMAKE_RC_COMPILER_ENV_VAR "RC")

@ -18,36 +18,36 @@
# if it exists. # if it exists.
# make sure we don't use CMAKE_BASE_NAME from somewhere else # make sure we don't use CMAKE_BASE_NAME from somewhere else
SET(CMAKE_BASE_NAME) set(CMAKE_BASE_NAME)
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE) get_filename_component(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE)
IF("${CMAKE_BASE_NAME}" MATCHES "windres") if("${CMAKE_BASE_NAME}" MATCHES "windres")
SET(CMAKE_BASE_NAME "windres") set(CMAKE_BASE_NAME "windres")
ENDIF() endif()
SET(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE set(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL) include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
SET (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING set (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING
"Flags for Fortran compiler.") "Flags for Fortran compiler.")
# These are the only types of flags that should be passed to the rc # These are the only types of flags that should be passed to the rc
# command, if COMPILE_FLAGS is used on a target this will be used # command, if COMPILE_FLAGS is used on a target this will be used
# to filter out any other flags # to filter out any other flags
SET(CMAKE_RC_FLAG_REGEX "^[-/](D|I)") set(CMAKE_RC_FLAG_REGEX "^[-/](D|I)")
# now define the following rule variables # now define the following rule variables
# CMAKE_RC_COMPILE_OBJECT # CMAKE_RC_COMPILE_OBJECT
SET(CMAKE_INCLUDE_FLAG_RC "-I") set(CMAKE_INCLUDE_FLAG_RC "-I")
# compile a Resource file into an object file # compile a Resource file into an object file
IF(NOT CMAKE_RC_COMPILE_OBJECT) if(NOT CMAKE_RC_COMPILE_OBJECT)
SET(CMAKE_RC_COMPILE_OBJECT set(CMAKE_RC_COMPILE_OBJECT
"<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> /fo<OBJECT> <SOURCE>") "<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> /fo<OBJECT> <SOURCE>")
ENDIF(NOT CMAKE_RC_COMPILE_OBJECT) endif()
MARK_AS_ADVANCED( mark_as_advanced(
CMAKE_RC_FLAGS CMAKE_RC_FLAGS
) )
# set this variable so we can avoid loading this more than once. # set this variable so we can avoid loading this more than once.
SET(CMAKE_RC_INFORMATION_LOADED 1) set(CMAKE_RC_INFORMATION_LOADED 1)

@ -1,15 +1,15 @@
@INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED@ @INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED@
SET(CMAKE_SYSTEM "@CMAKE_SYSTEM@") set(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@") set(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
SET(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@") set(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@")
SET(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@") set(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@") set(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
SET(CMAKE_HOST_SYSTEM_NAME "@CMAKE_HOST_SYSTEM_NAME@") set(CMAKE_HOST_SYSTEM_NAME "@CMAKE_HOST_SYSTEM_NAME@")
SET(CMAKE_HOST_SYSTEM_VERSION "@CMAKE_HOST_SYSTEM_VERSION@") set(CMAKE_HOST_SYSTEM_VERSION "@CMAKE_HOST_SYSTEM_VERSION@")
SET(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@") set(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
SET(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@") set(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
SET(CMAKE_SYSTEM_LOADED 1) set(CMAKE_SYSTEM_LOADED 1)

@ -21,49 +21,49 @@
# But they are reset here and set again in the platform files for the target # But they are reset here and set again in the platform files for the target
# platform, so they can be used for testing the target platform instead # platform, so they can be used for testing the target platform instead
# of testing the host platform. # of testing the host platform.
SET(APPLE ) set(APPLE )
SET(UNIX ) set(UNIX )
SET(CYGWIN ) set(CYGWIN )
SET(WIN32 ) set(WIN32 )
# include Generic system information # include Generic system information
INCLUDE(CMakeGenericSystem) include(CMakeGenericSystem)
# 2. now include SystemName.cmake file to set the system specific information # 2. now include SystemName.cmake file to set the system specific information
SET(CMAKE_SYSTEM_INFO_FILE Platform/${CMAKE_SYSTEM_NAME}) set(CMAKE_SYSTEM_INFO_FILE Platform/${CMAKE_SYSTEM_NAME})
INCLUDE(${CMAKE_SYSTEM_INFO_FILE} OPTIONAL RESULT_VARIABLE _INCLUDED_SYSTEM_INFO_FILE) include(${CMAKE_SYSTEM_INFO_FILE} OPTIONAL RESULT_VARIABLE _INCLUDED_SYSTEM_INFO_FILE)
IF(NOT _INCLUDED_SYSTEM_INFO_FILE) if(NOT _INCLUDED_SYSTEM_INFO_FILE)
MESSAGE("System is unknown to cmake, create:\n${CMAKE_SYSTEM_INFO_FILE}" message("System is unknown to cmake, create:\n${CMAKE_SYSTEM_INFO_FILE}"
" to use this system, please send your config file to " " to use this system, please send your config file to "
"cmake@www.cmake.org so it can be added to cmake") "cmake@www.cmake.org so it can be added to cmake")
IF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt) if(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/CMakeCache.txt configure_file(${CMAKE_BINARY_DIR}/CMakeCache.txt
${CMAKE_BINARY_DIR}/CopyOfCMakeCache.txt COPYONLY) ${CMAKE_BINARY_DIR}/CopyOfCMakeCache.txt COPYONLY)
MESSAGE("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. " message("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. "
"Please send that file to cmake@www.cmake.org.") "Please send that file to cmake@www.cmake.org.")
ENDIF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt) endif()
ENDIF(NOT _INCLUDED_SYSTEM_INFO_FILE) endif()
# optionally include a file which can do extra-generator specific things, e.g. # optionally include a file which can do extra-generator specific things, e.g.
# CMakeFindEclipseCDT4.cmake asks gcc for the system include dirs for the Eclipse CDT4 generator # CMakeFindEclipseCDT4.cmake asks gcc for the system include dirs for the Eclipse CDT4 generator
IF(CMAKE_EXTRA_GENERATOR) if(CMAKE_EXTRA_GENERATOR)
STRING(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} ) string(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} )
INCLUDE("CMakeFind${_CMAKE_EXTRA_GENERATOR_NO_SPACES}" OPTIONAL) include("CMakeFind${_CMAKE_EXTRA_GENERATOR_NO_SPACES}" OPTIONAL)
ENDIF(CMAKE_EXTRA_GENERATOR) endif()
# for most systems a module is the same as a shared library # for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just # so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables # copy the values from the LIBRARY variables
# this has to be done after the system information has been loaded # this has to be done after the system information has been loaded
IF(NOT CMAKE_MODULE_EXISTS) if(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}") set(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
SET(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}") set(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
ENDIF(NOT CMAKE_MODULE_EXISTS) endif()
SET(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1) set(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1)

@ -18,6 +18,6 @@
# because otherwise there would have to be a separate assembler source file # because otherwise there would have to be a separate assembler source file
# for each assembler on every architecture. # for each assembler on every architecture.
SET(ASM_DIALECT "-ATT") set(ASM_DIALECT "-ATT")
INCLUDE(CMakeTestASMCompiler) include(CMakeTestASMCompiler)
SET(ASM_DIALECT) set(ASM_DIALECT)

@ -19,17 +19,17 @@
# for each assembler on every architecture. # for each assembler on every architecture.
SET(_ASM_COMPILER_WORKS 0) set(_ASM_COMPILER_WORKS 0)
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER) if(CMAKE_ASM${ASM_DIALECT}_COMPILER)
SET(_ASM_COMPILER_WORKS 1) set(_ASM_COMPILER_WORKS 1)
ENDIF() endif()
# when using generic "ASM" support, we must have detected the compiler ID, fail otherwise: # when using generic "ASM" support, we must have detected the compiler ID, fail otherwise:
IF("ASM${ASM_DIALECT}" STREQUAL "ASM") if("ASM${ASM_DIALECT}" STREQUAL "ASM")
IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID) if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
SET(_ASM_COMPILER_WORKS 0) set(_ASM_COMPILER_WORKS 0)
ENDIF() endif()
ENDIF() endif()
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_WORKS ${_ASM_COMPILER_WORKS} CACHE INTERNAL "") set(CMAKE_ASM${ASM_DIALECT}_COMPILER_WORKS ${_ASM_COMPILER_WORKS} CACHE INTERNAL "")

@ -18,6 +18,6 @@
# because otherwise there would have to be a separate assembler source file # because otherwise there would have to be a separate assembler source file
# for each assembler on every architecture. # for each assembler on every architecture.
SET(ASM_DIALECT "_MASM") set(ASM_DIALECT "_MASM")
INCLUDE(CMakeTestASMCompiler) include(CMakeTestASMCompiler)
SET(ASM_DIALECT) set(ASM_DIALECT)

@ -18,6 +18,6 @@
# because otherwise there would have to be a separate assembler source file # because otherwise there would have to be a separate assembler source file
# for each assembler on every architecture. # for each assembler on every architecture.
SET(ASM_DIALECT "_NASM") set(ASM_DIALECT "_NASM")
INCLUDE(CMakeTestASMCompiler) include(CMakeTestASMCompiler)
SET(ASM_DIALECT) set(ASM_DIALECT)

@ -1,6 +1,6 @@
#============================================================================= #=============================================================================
# Copyright 2003-2009 Kitware, Inc. # Copyright 2003-2012 Kitware, Inc.
# #
# 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.
@ -12,16 +12,27 @@
# (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(CMakeTestCompilerCommon) if(CMAKE_C_COMPILER_FORCED)
# The compiler configuration was forced by the user.
# Assume the user has configured all compiler information.
set(CMAKE_C_COMPILER_WORKS TRUE)
return()
endif()
include(CMakeTestCompilerCommon)
# Remove any cached result from an older CMake version.
# We now store this in CMakeCCompiler.cmake.
unset(CMAKE_C_COMPILER_WORKS CACHE)
# This file is used by EnableLanguage in cmGlobalGenerator to # This file is used by EnableLanguage in cmGlobalGenerator to
# determine that that selected C compiler can actually compile # determine that that selected C compiler can actually compile
# and link the most basic of programs. If not, a fatal error # and link the most basic of programs. If not, a fatal error
# is set and cmake stops processing commands and will not generate # is set and cmake stops processing commands and will not generate
# any makefiles or projects. # any makefiles or projects.
IF(NOT CMAKE_C_COMPILER_WORKS) if(NOT CMAKE_C_COMPILER_WORKS)
PrintTestCompilerStatus("C" "") PrintTestCompilerStatus("C" "")
FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
"#ifdef __cplusplus\n" "#ifdef __cplusplus\n"
"# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n" "# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n"
"#endif\n" "#endif\n"
@ -33,55 +44,50 @@ IF(NOT CMAKE_C_COMPILER_WORKS)
"int main(int argc, char* argv[])\n" "int main(int argc, char* argv[])\n"
"#endif\n" "#endif\n"
"{ (void)argv; return argc-1;}\n") "{ (void)argv; return argc-1;}\n")
TRY_COMPILE(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR} try_compile(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT) OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT)
SET(C_TEST_WAS_RUN 1) # Move result from cache to normal variable.
ENDIF(NOT CMAKE_C_COMPILER_WORKS) set(CMAKE_C_COMPILER_WORKS ${CMAKE_C_COMPILER_WORKS})
unset(CMAKE_C_COMPILER_WORKS CACHE)
set(C_TEST_WAS_RUN 1)
endif()
IF(NOT CMAKE_C_COMPILER_WORKS) if(NOT CMAKE_C_COMPILER_WORKS)
PrintTestCompilerStatus("C" " -- broken") PrintTestCompilerStatus("C" " -- broken")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the C compiler works failed with " "Determining if the C compiler works failed with "
"the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n") "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
# if the compiler is broken make sure to remove the platform file message(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
# since Windows-cl configures both c/cxx files both need to be removed
# when c or c++ fails
FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
MESSAGE(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
"is not able to compile a simple test program.\nIt fails " "is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${__CMAKE_C_COMPILER_OUTPUT}\n\n" "with the following output:\n ${__CMAKE_C_COMPILER_OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.") "CMake will not be able to correctly generate this project.")
ELSE(NOT CMAKE_C_COMPILER_WORKS) else()
IF(C_TEST_WAS_RUN) if(C_TEST_WAS_RUN)
PrintTestCompilerStatus("C" " -- works") PrintTestCompilerStatus("C" " -- works")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the C compiler works passed with " "Determining if the C compiler works passed with "
"the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n") "the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
ENDIF(C_TEST_WAS_RUN) endif()
SET(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
# Try to identify the ABI and configure it into CMakeCCompiler.cmake
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
CMAKE_DETERMINE_COMPILER_ABI(C ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c)
# Re-configure to save learned information.
configure_file(
${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
${CMAKE_PLATFORM_INFO_DIR}/CMakeCCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
)
include(${CMAKE_PLATFORM_INFO_DIR}/CMakeCCompiler.cmake)
IF(CMAKE_C_COMPILER_FORCED) if(CMAKE_C_SIZEOF_DATA_PTR)
# The compiler configuration was forced by the user. foreach(f ${CMAKE_C_ABI_FILES})
# Assume the user has configured all compiler information. include(${f})
ELSE(CMAKE_C_COMPILER_FORCED) endforeach()
# Try to identify the ABI and configure it into CMakeCCompiler.cmake unset(CMAKE_C_ABI_FILES)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) endif()
CMAKE_DETERMINE_COMPILER_ABI(C ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c) endif()
CONFIGURE_FILE(
${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
)
INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake)
ENDIF(CMAKE_C_COMPILER_FORCED)
IF(CMAKE_C_SIZEOF_DATA_PTR)
FOREACH(f ${CMAKE_C_ABI_FILES})
INCLUDE(${f})
ENDFOREACH()
UNSET(CMAKE_C_ABI_FILES)
ENDIF()
ENDIF(NOT CMAKE_C_COMPILER_WORKS)
UNSET(__CMAKE_C_COMPILER_OUTPUT) unset(__CMAKE_C_COMPILER_OUTPUT)

@ -1,6 +1,6 @@
#============================================================================= #=============================================================================
# Copyright 2003-2009 Kitware, Inc. # Copyright 2003-2012 Kitware, Inc.
# #
# 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.
@ -12,69 +12,75 @@
# (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(CMakeTestCompilerCommon) if(CMAKE_CXX_COMPILER_FORCED)
# The compiler configuration was forced by the user.
# Assume the user has configured all compiler information.
set(CMAKE_CXX_COMPILER_WORKS TRUE)
return()
endif()
include(CMakeTestCompilerCommon)
# Remove any cached result from an older CMake version.
# We now store this in CMakeCXXCompiler.cmake.
unset(CMAKE_CXX_COMPILER_WORKS CACHE)
# This file is used by EnableLanguage in cmGlobalGenerator to # This file is used by EnableLanguage in cmGlobalGenerator to
# determine that that selected C++ compiler can actually compile # determine that that selected C++ compiler can actually compile
# and link the most basic of programs. If not, a fatal error # and link the most basic of programs. If not, a fatal error
# is set and cmake stops processing commands and will not generate # is set and cmake stops processing commands and will not generate
# any makefiles or projects. # any makefiles or projects.
IF(NOT CMAKE_CXX_COMPILER_WORKS) if(NOT CMAKE_CXX_COMPILER_WORKS)
PrintTestCompilerStatus("CXX" "") PrintTestCompilerStatus("CXX" "")
FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
"#ifndef __cplusplus\n" "#ifndef __cplusplus\n"
"# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n" "# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n"
"#endif\n" "#endif\n"
"int main(){return 0;}\n") "int main(){return 0;}\n")
TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR} try_compile(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT) OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT)
SET(CXX_TEST_WAS_RUN 1) # Move result from cache to normal variable.
ENDIF(NOT CMAKE_CXX_COMPILER_WORKS) set(CMAKE_CXX_COMPILER_WORKS ${CMAKE_CXX_COMPILER_WORKS})
unset(CMAKE_CXX_COMPILER_WORKS CACHE)
set(CXX_TEST_WAS_RUN 1)
endif()
IF(NOT CMAKE_CXX_COMPILER_WORKS) if(NOT CMAKE_CXX_COMPILER_WORKS)
PrintTestCompilerStatus("CXX" " -- broken") PrintTestCompilerStatus("CXX" " -- broken")
# if the compiler is broken make sure to remove the platform file file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
# since Windows-cl configures both c/cxx files both need to be removed
# when c or c++ fails
FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the CXX compiler works failed with " "Determining if the CXX compiler works failed with "
"the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n") "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
MESSAGE(FATAL_ERROR "The C++ compiler \"${CMAKE_CXX_COMPILER}\" " message(FATAL_ERROR "The C++ compiler \"${CMAKE_CXX_COMPILER}\" "
"is not able to compile a simple test program.\nIt fails " "is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${__CMAKE_CXX_COMPILER_OUTPUT}\n\n" "with the following output:\n ${__CMAKE_CXX_COMPILER_OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.") "CMake will not be able to correctly generate this project.")
ELSE(NOT CMAKE_CXX_COMPILER_WORKS) else()
IF(CXX_TEST_WAS_RUN) if(CXX_TEST_WAS_RUN)
PrintTestCompilerStatus("CXX" " -- works") PrintTestCompilerStatus("CXX" " -- works")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the CXX compiler works passed with " "Determining if the CXX compiler works passed with "
"the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n") "the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
ENDIF(CXX_TEST_WAS_RUN) endif()
SET(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")
# Try to identify the ABI and configure it into CMakeCXXCompiler.cmake
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
CMAKE_DETERMINE_COMPILER_ABI(CXX ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp)
# Re-configure to save learned information.
configure_file(
${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
${CMAKE_PLATFORM_INFO_DIR}/CMakeCXXCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
)
include(${CMAKE_PLATFORM_INFO_DIR}/CMakeCXXCompiler.cmake)
IF(CMAKE_CXX_COMPILER_FORCED) if(CMAKE_CXX_SIZEOF_DATA_PTR)
# The compiler configuration was forced by the user. foreach(f ${CMAKE_CXX_ABI_FILES})
# Assume the user has configured all compiler information. include(${f})
ELSE(CMAKE_CXX_COMPILER_FORCED) endforeach()
# Try to identify the ABI and configure it into CMakeCXXCompiler.cmake unset(CMAKE_CXX_ABI_FILES)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake) endif()
CMAKE_DETERMINE_COMPILER_ABI(CXX ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp) endif()
CONFIGURE_FILE(
${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
)
INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake)
ENDIF(CMAKE_CXX_COMPILER_FORCED)
IF(CMAKE_CXX_SIZEOF_DATA_PTR)
FOREACH(f ${CMAKE_CXX_ABI_FILES})
INCLUDE(${f})
ENDFOREACH()
UNSET(CMAKE_CXX_ABI_FILES)
ENDIF()
ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
UNSET(__CMAKE_CXX_COMPILER_OUTPUT) unset(__CMAKE_CXX_COMPILER_OUTPUT)

@ -13,9 +13,9 @@
# License text for the above reference.) # License text for the above reference.)
function(PrintTestCompilerStatus LANG MSG) function(PrintTestCompilerStatus LANG MSG)
IF(CMAKE_GENERATOR MATCHES Make) if(CMAKE_GENERATOR MATCHES Make)
MESSAGE(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}") message(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
ELSE() else()
MESSAGE(STATUS "Check for working ${LANG} compiler using: ${CMAKE_GENERATOR}${MSG}") message(STATUS "Check for working ${LANG} compiler using: ${CMAKE_GENERATOR}${MSG}")
ENDIF() endif()
endfunction() endfunction()

@ -1,3 +0,0 @@
#include<iostream>
int main(){return 0;}

@ -1,6 +1,6 @@
#============================================================================= #=============================================================================
# Copyright 2004-2009 Kitware, Inc. # Copyright 2004-2012 Kitware, Inc.
# #
# 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.
@ -12,90 +12,100 @@
# (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(CMakeTestCompilerCommon) if(CMAKE_Fortran_COMPILER_FORCED)
# The compiler configuration was forced by the user.
# Assume the user has configured all compiler information.
set(CMAKE_Fortran_COMPILER_WORKS TRUE)
return()
endif()
include(CMakeTestCompilerCommon)
# Remove any cached result from an older CMake version.
# We now store this in CMakeFortranCompiler.cmake.
unset(CMAKE_Fortran_COMPILER_WORKS CACHE)
# This file is used by EnableLanguage in cmGlobalGenerator to # This file is used by EnableLanguage in cmGlobalGenerator to
# determine that that selected Fortran compiler can actually compile # determine that that selected Fortran compiler can actually compile
# and link the most basic of programs. If not, a fatal error # and link the most basic of programs. If not, a fatal error
# is set and cmake stops processing commands and will not generate # is set and cmake stops processing commands and will not generate
# any makefiles or projects. # any makefiles or projects.
IF(NOT CMAKE_Fortran_COMPILER_WORKS) if(NOT CMAKE_Fortran_COMPILER_WORKS)
PrintTestCompilerStatus("Fortran" "") PrintTestCompilerStatus("Fortran" "")
FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f " file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "
PROGRAM TESTFortran PROGRAM TESTFortran
PRINT *, 'Hello' PRINT *, 'Hello'
END END
") ")
TRY_COMPILE(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR} try_compile(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
SET(FORTRAN_TEST_WAS_RUN 1) # Move result from cache to normal variable.
ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS) set(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_Fortran_COMPILER_WORKS})
unset(CMAKE_Fortran_COMPILER_WORKS CACHE)
set(FORTRAN_TEST_WAS_RUN 1)
endif()
IF(NOT CMAKE_Fortran_COMPILER_WORKS) if(NOT CMAKE_Fortran_COMPILER_WORKS)
PrintTestCompilerStatus("Fortran" " -- broken") PrintTestCompilerStatus("Fortran" " -- broken")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the Fortran compiler works failed with " "Determining if the Fortran compiler works failed with "
"the following output:\n${OUTPUT}\n\n") "the following output:\n${OUTPUT}\n\n")
MESSAGE(FATAL_ERROR "The Fortran compiler \"${CMAKE_Fortran_COMPILER}\" " message(FATAL_ERROR "The Fortran compiler \"${CMAKE_Fortran_COMPILER}\" "
"is not able to compile a simple test program.\nIt fails " "is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${OUTPUT}\n\n" "with the following output:\n ${OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.") "CMake will not be able to correctly generate this project.")
ELSE(NOT CMAKE_Fortran_COMPILER_WORKS) else()
IF(FORTRAN_TEST_WAS_RUN) if(FORTRAN_TEST_WAS_RUN)
PrintTestCompilerStatus("Fortran" " -- works") PrintTestCompilerStatus("Fortran" " -- works")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler works passed with " "Determining if the Fortran compiler works passed with "
"the following output:\n${OUTPUT}\n\n") "the following output:\n${OUTPUT}\n\n")
ENDIF(FORTRAN_TEST_WAS_RUN) endif()
SET(CMAKE_Fortran_COMPILER_WORKS 1 CACHE INTERNAL "")
IF(CMAKE_Fortran_COMPILER_FORCED) # Try to identify the ABI and configure it into CMakeFortranCompiler.cmake
# The compiler configuration was forced by the user. include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
# Assume the user has configured all compiler information. CMAKE_DETERMINE_COMPILER_ABI(Fortran ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F)
ELSE(CMAKE_Fortran_COMPILER_FORCED)
# Try to identify the ABI and configure it into CMakeFortranCompiler.cmake
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
CMAKE_DETERMINE_COMPILER_ABI(Fortran ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F)
# Test for Fortran 90 support by using an f90-specific construct. # Test for Fortran 90 support by using an f90-specific construct.
IF(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90) if(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90") message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90")
FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 " file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 "
PROGRAM TESTFortran90 PROGRAM TESTFortran90
stop = 1 ; do while ( stop .eq. 0 ) ; end do stop = 1 ; do while ( stop .eq. 0 ) ; end do
END PROGRAM TESTFortran90 END PROGRAM TESTFortran90
") ")
TRY_COMPILE(CMAKE_Fortran_COMPILER_SUPPORTS_F90 ${CMAKE_BINARY_DIR} try_compile(CMAKE_Fortran_COMPILER_SUPPORTS_F90 ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90
OUTPUT_VARIABLE OUTPUT) OUTPUT_VARIABLE OUTPUT)
IF(CMAKE_Fortran_COMPILER_SUPPORTS_F90) if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- yes") message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- yes")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler supports Fortran 90 passed with " "Determining if the Fortran compiler supports Fortran 90 passed with "
"the following output:\n${OUTPUT}\n\n") "the following output:\n${OUTPUT}\n\n")
SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1) set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
ELSE(CMAKE_Fortran_COMPILER_SUPPORTS_F90) else()
MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- no") message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- no")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the Fortran compiler supports Fortran 90 failed with " "Determining if the Fortran compiler supports Fortran 90 failed with "
"the following output:\n${OUTPUT}\n\n") "the following output:\n${OUTPUT}\n\n")
SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0) set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0)
ENDIF(CMAKE_Fortran_COMPILER_SUPPORTS_F90) endif()
UNSET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE) unset(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE)
ENDIF(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90) endif()
# Re-configure to save learned information.
configure_file(
${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
${CMAKE_PLATFORM_INFO_DIR}/CMakeFortranCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
)
include(${CMAKE_PLATFORM_INFO_DIR}/CMakeFortranCompiler.cmake)
CONFIGURE_FILE( if(CMAKE_Fortran_SIZEOF_DATA_PTR)
${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in foreach(f ${CMAKE_Fortran_ABI_FILES})
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake include(${f})
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0 endforeach()
) unset(CMAKE_Fortran_ABI_FILES)
INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake) endif()
ENDIF(CMAKE_Fortran_COMPILER_FORCED) endif()
IF(CMAKE_Fortran_SIZEOF_DATA_PTR)
FOREACH(f ${CMAKE_Fortran_ABI_FILES})
INCLUDE(${f})
ENDFOREACH()
UNSET(CMAKE_Fortran_ABI_FILES)
ENDIF()
ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS)

@ -17,4 +17,4 @@
# and link the most basic of programs. If not, a fatal error # and link the most basic of programs. If not, a fatal error
# is set and cmake stops processing commands and will not generate # is set and cmake stops processing commands and will not generate
# any makefiles or projects. # any makefiles or projects.
SET(CMAKE_Java_COMPILER_WORKS 1 CACHE INTERNAL "") set(CMAKE_Java_COMPILER_WORKS 1 CACHE INTERNAL "")

@ -1,2 +0,0 @@
VERSION=_MSC_VER

@ -20,4 +20,4 @@
# For now there is no way to do a try compile on just a .rc file # For now there is no way to do a try compile on just a .rc file
# so just do nothing in here. # so just do nothing in here.
SET(CMAKE_RC_COMPILER_WORKS 1 CACHE INTERNAL "") set(CMAKE_RC_COMPILER_WORKS 1 CACHE INTERNAL "")

@ -12,5 +12,5 @@
# (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_PROGRAM(CMAKE_MAKE_PROGRAM NAMES gmake make smake) find_program(CMAKE_MAKE_PROGRAM NAMES gmake make smake)
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) mark_as_advanced(CMAKE_MAKE_PROGRAM)

@ -15,7 +15,7 @@
# Look for devenv as a build program. We need to use this to support # Look for devenv as a build program. We need to use this to support
# Intel Fortran integration into VS. MSBuild can not be used for that case # Intel Fortran integration into VS. MSBuild can not be used for that case
# since Intel Fortran uses the older devenv file format. # since Intel Fortran uses the older devenv file format.
FIND_PROGRAM(CMAKE_MAKE_PROGRAM find_program(CMAKE_MAKE_PROGRAM
NAMES devenv NAMES devenv
HINTS HINTS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory]
@ -39,16 +39,16 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
# causes the compiler checks and try-compile stuff to fail. MSbuild # causes the compiler checks and try-compile stuff to fail. MSbuild
# is a better choice for this. However, VCExpress does not support # is a better choice for this. However, VCExpress does not support
# cross compiling needed for Win CE. # cross compiling needed for Win CE.
IF(NOT CMAKE_CROSSCOMPILING) if(NOT CMAKE_CROSSCOMPILING)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM find_program(CMAKE_MAKE_PROGRAM
NAMES MSBuild NAMES MSBuild
HINTS HINTS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir]
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/" "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
"c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/" "c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0;CLR Version]/") "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0;CLR Version]/")
ENDIF() endif()
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) mark_as_advanced(CMAKE_MAKE_PROGRAM)
SET(MSVC10 1) set(MSVC10 1)
SET(MSVC_VERSION 1600) set(MSVC_VERSION 1600)

@ -15,7 +15,7 @@
# Look for devenv as a build program. We need to use this to support # Look for devenv as a build program. We need to use this to support
# Intel Fortran integration into VS. MSBuild can not be used for that case # Intel Fortran integration into VS. MSBuild can not be used for that case
# since Intel Fortran uses the older devenv file format. # since Intel Fortran uses the older devenv file format.
FIND_PROGRAM(CMAKE_MAKE_PROGRAM find_program(CMAKE_MAKE_PROGRAM
NAMES devenv NAMES devenv
HINTS HINTS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;EnvironmentDirectory] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;EnvironmentDirectory]
@ -34,21 +34,20 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
# if devenv is not found, then use MSBuild. # if devenv is not found, then use MSBuild.
# it is expected that if devenv is not found, then we are # it is expected that if devenv is not found, then we are
# dealing with Visual Studio Express. VCExpress has random # dealing with Visual Studio Express.
# failures when being run as a command line build tool which if(NOT CMAKE_CROSSCOMPILING)
# causes the compiler checks and try-compile stuff to fail. MSbuild set(_FDIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkDir32]")
# is a better choice for this. However, VCExpress does not support set(_FVER "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkVer32]")
# cross compiling needed for Win CE. find_program(CMAKE_MAKE_PROGRAM
IF(NOT CMAKE_CROSSCOMPILING)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
NAMES MSBuild NAMES MSBuild
HINTS HINTS
${_FDIR}/${_FVER}
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir]
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/" "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/"
"c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/" "c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/"
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0;CLR Version]/") "$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0;CLR Version]/")
ENDIF() endif()
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM) mark_as_advanced(CMAKE_MAKE_PROGRAM)
SET(MSVC11 1) set(MSVC11 1)
SET(MSVC_VERSION 1700) set(MSVC_VERSION 1700)

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

Loading…
Cancel
Save