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(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
IF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
OPTION(CMAKE_INSTALL_DEBUG_LIBRARIES
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
if(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
option(CMAKE_INSTALL_DEBUG_LIBRARIES
"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:
IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
ENDIF()
if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
endif()
INCLUDE(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
endif()
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
SET(CPACK_PACKAGE_VENDOR "Kitware")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${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_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
set(CPACK_PACKAGE_VENDOR "Kitware")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${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_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
set(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
# Make this explicit here, rather than accepting the CPack default value,
# 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:
# - Root install directory (displayed to end user at installer-run time)
# - "NSIS package/display name" (text used in the installer GUI)
# - Registry key used to store info about the installation
IF(CMAKE_CL_64)
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
ELSE()
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
ENDIF()
if(CMAKE_CL_64)
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
else()
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
endif()
IF(NOT DEFINED CPACK_SYSTEM_NAME)
if(NOT DEFINED CPACK_SYSTEM_NAME)
# make sure package is not Cygwin-unknown, for Cygwin just
# cygwin is good for the system name
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
SET(CPACK_SYSTEM_NAME Cygwin)
ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
ENDIF(NOT DEFINED CPACK_SYSTEM_NAME)
IF(${CPACK_SYSTEM_NAME} MATCHES Windows)
IF(CMAKE_CL_64)
SET(CPACK_SYSTEM_NAME win64-x64)
ELSE(CMAKE_CL_64)
SET(CPACK_SYSTEM_NAME win32-x86)
ENDIF(CMAKE_CL_64)
ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
set(CPACK_SYSTEM_NAME Cygwin)
else()
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
endif()
endif()
if(${CPACK_SYSTEM_NAME} MATCHES Windows)
if(CMAKE_CL_64)
set(CPACK_SYSTEM_NAME win64-x64)
else()
set(CPACK_SYSTEM_NAME win32-x86)
endif()
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
# default to source package - system, on cygwin system is not
# needed
IF(CYGWIN)
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
ELSE(CYGWIN)
SET(CPACK_PACKAGE_FILE_NAME
if(CYGWIN)
set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
else()
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
ENDIF(CYGWIN)
ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
endif()
endif()
SET(CPACK_PACKAGE_CONTACT "cmake@cmake.org")
set(CPACK_PACKAGE_CONTACT "cmake@cmake.org")
IF(UNIX)
SET(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest")
SET(CPACK_SOURCE_STRIP_FILES "")
SET(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
ENDIF(UNIX)
if(UNIX)
set(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest")
set(CPACK_SOURCE_STRIP_FILES "")
set(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
endif()
# cygwin specific packaging stuff
IF(CYGWIN)
if(CYGWIN)
# 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
SET(CPACK_PACKAGE_FILE_NAME
set(CPACK_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CMake_VERSION}")
# 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
# 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
# put into the release tar files.
SET(CPACK_CYGWIN_BUILD_SCRIPT
"${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.sh")
SET(CPACK_CYGWIN_PATCH_FILE
"${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.patch")
set(CPACK_CYGWIN_BUILD_SCRIPT
"${CMake_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}-${CPACK_CYGWIN_PATCH_NUMBER}.sh")
set(CPACK_CYGWIN_PATCH_FILE
"${CMake_BINARY_DIR}/${CPACK_PACKAGE_FILE_NAME}-${CPACK_CYGWIN_PATCH_NUMBER}.patch")
# include the sub directory cmake file for cygwin that
# configures some files and adds some install targets
# this file uses some of the package file name variables
INCLUDE(Utilities/Release/Cygwin/CMakeLists.txt)
ENDIF(CYGWIN)
include(Utilities/Release/Cygwin/CMakeLists.txt)
endif()
# 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)
CONFIGURE_FILE("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
configure_file("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
"${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)
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
include(CPack)
endif()

@ -3,16 +3,16 @@
# in this file.
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
# 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_UNIICON "@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 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
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.html" "CMake Help"
"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"
)
# 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_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_URL_INFO_ABOUT "http://www.kitware.com")
SET(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
SET(CPACK_NSIS_MODIFY_PATH ON)
endif(CPACK_GENERATOR MATCHES "NSIS")
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_HELP_LINK "http://www.cmake.org")
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com")
set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
set(CPACK_NSIS_MODIFY_PATH ON)
endif()
# include the cpack options for qt dialog if they exisit
# 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")
# 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$" "\\.#" "/#" "~$")
endif(CPACK_GENERATOR MATCHES "CygwinSource")
endif()
if("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
if(CMAKE_PACKAGE_QTGUI)
set(CPACK_PACKAGE_DEFAULT_LOCATION "/Applications")
else(CMAKE_PACKAGE_QTGUI)
else()
set(CPACK_PACKAGE_DEFAULT_LOCATION "/usr")
endif(CMAKE_PACKAGE_QTGUI)
endif("${CPACK_GENERATOR}" STREQUAL "PackageMaker")
endif()
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.
# See the License for more information.
#=============================================================================
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2 FATAL_ERROR)
SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
PROJECT(CMake)
cmake_minimum_required(VERSION 2.8.2 FATAL_ERROR)
set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
project(CMake)
IF(CMAKE_BOOTSTRAP)
if(CMAKE_BOOTSTRAP)
# Running from bootstrap script. Set local variable and remove from cache.
SET(CMAKE_BOOTSTRAP 1)
UNSET(CMAKE_BOOTSTRAP CACHE)
ENDIF()
set(CMAKE_BOOTSTRAP 1)
unset(CMAKE_BOOTSTRAP CACHE)
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.
MACRO(TRY_RUN)
IF(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
MESSAGE(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]")
ELSE()
macro(TRY_RUN)
if(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
message(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]")
else()
_TRY_RUN(${ARGV})
ENDIF()
ENDMACRO()
ENDIF()
endif()
endmacro()
endif()
#-----------------------------------------------------------------------
# a macro to deal with system libraries, implemented as a macro
# simply to improve readability of the main script
#-----------------------------------------------------------------------
MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
# Options have dependencies.
INCLUDE(CMakeDependentOption)
include(CMakeDependentOption)
# Optionally use system xmlrpc. We no longer build or use it by default.
OPTION(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF)
MARK_AS_ADVANCED(CTEST_USE_XMLRPC)
option(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF)
mark_as_advanced(CTEST_USE_XMLRPC)
# Allow the user to enable/disable all system utility library options by
# defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}.
SET(UTILITIES BZIP2 CURL EXPAT LIBARCHIVE ZLIB)
FOREACH(util ${UTILITIES})
IF(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}
set(UTILITIES BZIP2 CURL EXPAT LIBARCHIVE ZLIB)
foreach(util ${UTILITIES})
if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}
AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
SET(CMAKE_USE_SYSTEM_LIBRARY_${util} "${CMAKE_USE_SYSTEM_LIBRARIES}")
ENDIF()
IF(DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util})
IF(CMAKE_USE_SYSTEM_LIBRARY_${util})
SET(CMAKE_USE_SYSTEM_LIBRARY_${util} ON)
ELSE()
SET(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
ENDIF()
IF(CMAKE_BOOTSTRAP)
UNSET(CMAKE_USE_SYSTEM_LIBRARY_${util} CACHE)
ENDIF()
STRING(TOLOWER "${util}" lutil)
SET(CMAKE_USE_SYSTEM_${util} "${CMAKE_USE_SYSTEM_LIBRARY_${util}}"
set(CMAKE_USE_SYSTEM_LIBRARY_${util} "${CMAKE_USE_SYSTEM_LIBRARIES}")
endif()
if(DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util})
if(CMAKE_USE_SYSTEM_LIBRARY_${util})
set(CMAKE_USE_SYSTEM_LIBRARY_${util} ON)
else()
set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
endif()
if(CMAKE_BOOTSTRAP)
unset(CMAKE_USE_SYSTEM_LIBRARY_${util} CACHE)
endif()
string(TOLOWER "${util}" lutil)
set(CMAKE_USE_SYSTEM_${util} "${CMAKE_USE_SYSTEM_LIBRARY_${util}}"
CACHE BOOL "Use system-installed ${lutil}" FORCE)
ELSE()
SET(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
ENDIF()
ENDFOREACH(util)
IF(CMAKE_BOOTSTRAP)
UNSET(CMAKE_USE_SYSTEM_LIBRARIES CACHE)
ENDIF()
else()
set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
endif()
endforeach()
if(CMAKE_BOOTSTRAP)
unset(CMAKE_USE_SYSTEM_LIBRARIES CACHE)
endif()
# 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_USE_SYSTEM_LIBRARY_CURL}" "NOT CTEST_USE_XMLRPC" ON)
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)
# Mention to the user what system libraries are being used.
FOREACH(util ${UTILITIES})
IF(CMAKE_USE_SYSTEM_${util})
MESSAGE(STATUS "Using system-installed ${util}")
ENDIF(CMAKE_USE_SYSTEM_${util})
ENDFOREACH(util)
foreach(util ${UTILITIES})
if(CMAKE_USE_SYSTEM_${util})
message(STATUS "Using system-installed ${util}")
endif()
endforeach()
# 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
@ONLY)
ENDMACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
endmacro()
SET(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
IF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
SET(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
ENDIF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
set(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
set(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
endif()
#-----------------------------------------------------------------------
# a macro to determine the generator and ctest executable to use
# for testing. Simply to improve readability of the main script.
#-----------------------------------------------------------------------
MACRO(CMAKE_SETUP_TESTING)
IF (NOT DART_ROOT)
SET(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
ENDIF (NOT DART_ROOT)
macro(CMAKE_SETUP_TESTING)
if (NOT DART_ROOT)
set(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
endif ()
IF(BUILD_TESTING)
SET(CMAKE_TEST_GENERATOR "" CACHE STRING
if(BUILD_TESTING)
set(CMAKE_TEST_GENERATOR "" CACHE STRING
"Generator used when running tests")
SET(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH
set(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH
"Generator used when running tests")
IF(NOT CMAKE_TEST_GENERATOR)
SET(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
SET(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
ELSE(NOT CMAKE_TEST_GENERATOR)
SET(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
ENDIF(NOT CMAKE_TEST_GENERATOR)
if(NOT CMAKE_TEST_GENERATOR)
set(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
set(CMAKE_TEST_GENERATOR_TOOLSET "${CMAKE_GENERATOR_TOOLSET}")
set(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
else()
set(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
set(CMAKE_TEST_GENERATOR_TOOLSET "")
endif()
# Are we testing with the MSVC compiler?
SET(CMAKE_TEST_MSVC 0)
IF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
SET(CMAKE_TEST_MSVC 1)
ELSE(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
IF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
set(CMAKE_TEST_MSVC 0)
if(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
set(CMAKE_TEST_MSVC 1)
else()
if("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
"${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
SET(CMAKE_TEST_MSVC 1)
ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
"${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
ENDIF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
SET(CMAKE_TEST_SYSTEM_LIBRARIES 0)
FOREACH(util CURL EXPAT XMLRPC ZLIB)
IF(CMAKE_USE_SYSTEM_${util})
SET(CMAKE_TEST_SYSTEM_LIBRARIES 1)
ENDIF(CMAKE_USE_SYSTEM_${util})
ENDFOREACH(util)
set(CMAKE_TEST_MSVC 1)
endif()
endif()
set(CMAKE_TEST_SYSTEM_LIBRARIES 0)
foreach(util CURL EXPAT XMLRPC ZLIB)
if(CMAKE_USE_SYSTEM_${util})
set(CMAKE_TEST_SYSTEM_LIBRARIES 1)
endif()
endforeach()
# This variable is set by cmake, however to
# test cmake we want to make sure that
# the ctest from this cmake is used for testing
# and not the ctest from the cmake building and testing
# cmake.
SET(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
SET(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
SET(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
ENDIF(BUILD_TESTING)
set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
endif()
# 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"
@ONLY)
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
configure_file(${CMake_SOURCE_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)
CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.cmake.in
configure_file(${CMake_SOURCE_DIR}/CTestCustom.cmake.in
${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)
IF(BUILD_TESTING AND DART_ROOT)
CONFIGURE_FILE(${CMake_SOURCE_DIR}/CMakeLogo.gif
if(BUILD_TESTING AND DART_ROOT)
configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif
${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
ENDIF(BUILD_TESTING AND DART_ROOT)
MARK_AS_ADVANCED(DART_ROOT)
MARK_AS_ADVANCED(CURL_TESTING)
ENDMACRO(CMAKE_SETUP_TESTING)
endif()
mark_as_advanced(DART_ROOT)
mark_as_advanced(CURL_TESTING)
endmacro()
# Provide a way for Visual Studio Express users to turn OFF the new FOLDER
# organization feature. Default to ON for non-Express users. Express users must
# explicitly turn off this option to build CMake in the Express IDE...
#
OPTION(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON)
MARK_AS_ADVANCED(CMAKE_USE_FOLDERS)
option(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON)
mark_as_advanced(CMAKE_USE_FOLDERS)
#-----------------------------------------------------------------------
# a macro that only sets the FOLDER target property if it's
# "appropriate"
#-----------------------------------------------------------------------
MACRO(CMAKE_SET_TARGET_FOLDER tgt folder)
IF(CMAKE_USE_FOLDERS)
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
macro(CMAKE_SET_TARGET_FOLDER tgt folder)
if(CMAKE_USE_FOLDERS)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Really, I just want this to be an "if(TARGET ${tgt})" ...
# but I'm not sure that our min req'd., CMake 2.4.5 can handle
# that... so I'm just activating this for now, with a version
# compare, and only for MSVC builds.
IF(MSVC)
IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
SET_PROPERTY(TARGET "${tgt}" PROPERTY FOLDER "${folder}")
ENDIF()
ENDIF()
ELSE()
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS OFF)
ENDIF()
ENDMACRO(CMAKE_SET_TARGET_FOLDER)
if(MSVC)
if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
set_property(TARGET "${tgt}" PROPERTY FOLDER "${folder}")
endif()
endif()
else()
set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
endif()
endmacro()
#-----------------------------------------------------------------------
# a macro to build the utilities used by CMake
# Simply to improve readability of the main script.
#-----------------------------------------------------------------------
MACRO (CMAKE_BUILD_UTILITIES)
macro (CMAKE_BUILD_UTILITIES)
#---------------------------------------------------------------------
# Create the KWIML library for CMake.
SET(KWIML cmIML)
SET(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities)
ADD_SUBDIRECTORY(Utilities/KWIML)
set(KWIML cmIML)
set(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities)
add_subdirectory(Utilities/KWIML)
#---------------------------------------------------------------------
# Create the kwsys library for CMake.
SET(KWSYS_NAMESPACE cmsys)
SET(KWSYS_USE_SystemTools 1)
SET(KWSYS_USE_Directory 1)
SET(KWSYS_USE_RegularExpression 1)
SET(KWSYS_USE_Base64 1)
SET(KWSYS_USE_MD5 1)
SET(KWSYS_USE_Process 1)
SET(KWSYS_USE_CommandLineArguments 1)
SET(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
SET(KWSYS_INSTALL_DOC_DIR "${CMake_DOC_DEST}")
ADD_SUBDIRECTORY(Source/kwsys)
SET(kwsys_folder "Utilities/KWSys")
set(KWSYS_NAMESPACE cmsys)
set(KWSYS_USE_SystemTools 1)
set(KWSYS_USE_Directory 1)
set(KWSYS_USE_RegularExpression 1)
set(KWSYS_USE_Base64 1)
set(KWSYS_USE_MD5 1)
set(KWSYS_USE_Process 1)
set(KWSYS_USE_CommandLineArguments 1)
set(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
set(KWSYS_INSTALL_DOC_DIR "${CMake_DOC_DEST}")
add_subdirectory(Source/kwsys)
set(kwsys_folder "Utilities/KWSys")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${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)
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestDynload "${kwsys_folder}")
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}TestProcess "${kwsys_folder}")
@ -249,7 +248,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
# Setup third-party libraries.
# Everything in the tree should be able to include files from the
# Utilities directory.
INCLUDE_DIRECTORIES(
include_directories(
${CMake_BINARY_DIR}/Utilities
${CMake_SOURCE_DIR}/Utilities
)
@ -260,237 +259,237 @@ MACRO (CMAKE_BUILD_UTILITIES)
#---------------------------------------------------------------------
# Build zlib library for Curl, CMake, and CTest.
SET(CMAKE_ZLIB_HEADER "cm_zlib.h")
IF(CMAKE_USE_SYSTEM_ZLIB)
FIND_PACKAGE(ZLIB)
IF(NOT ZLIB_FOUND)
MESSAGE(FATAL_ERROR
set(CMAKE_ZLIB_HEADER "cm_zlib.h")
if(CMAKE_USE_SYSTEM_ZLIB)
find_package(ZLIB)
if(NOT ZLIB_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!")
ENDIF(NOT ZLIB_FOUND)
SET(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
SET(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
ELSE(CMAKE_USE_SYSTEM_ZLIB)
SET(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
SET(CMAKE_ZLIB_LIBRARIES cmzlib)
ADD_SUBDIRECTORY(Utilities/cmzlib)
endif()
set(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
set(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
else()
set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
set(CMAKE_ZLIB_LIBRARIES cmzlib)
add_subdirectory(Utilities/cmzlib)
CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
ENDIF(CMAKE_USE_SYSTEM_ZLIB)
endif()
#---------------------------------------------------------------------
# Build Curl library for CTest.
IF(CMAKE_USE_SYSTEM_CURL)
FIND_PACKAGE(CURL)
IF(NOT CURL_FOUND)
MESSAGE(FATAL_ERROR
if(CMAKE_USE_SYSTEM_CURL)
find_package(CURL)
if(NOT CURL_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!")
ENDIF(NOT CURL_FOUND)
SET(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
SET(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
ELSE(CMAKE_USE_SYSTEM_CURL)
SET(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER})
SET(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
SET(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
OPTION(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE)
IF(NOT CMAKE_BUILD_CURL_SHARED)
ADD_DEFINITIONS(-DCURL_STATICLIB)
ENDIF(NOT CMAKE_BUILD_CURL_SHARED)
SET(CMAKE_CURL_INCLUDES)
SET(CMAKE_CURL_LIBRARIES cmcurl)
IF(CMAKE_TESTS_CDASH_SERVER)
SET(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
ENDIF(CMAKE_TESTS_CDASH_SERVER)
ADD_SUBDIRECTORY(Utilities/cmcurl)
endif()
set(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
set(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
else()
set(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER})
set(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
set(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
option(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE)
if(NOT CMAKE_BUILD_CURL_SHARED)
add_definitions(-DCURL_STATICLIB)
endif()
set(CMAKE_CURL_INCLUDES)
set(CMAKE_CURL_LIBRARIES cmcurl)
if(CMAKE_TESTS_CDASH_SERVER)
set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
endif()
add_subdirectory(Utilities/cmcurl)
CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty")
CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty")
ENDIF(CMAKE_USE_SYSTEM_CURL)
endif()
#---------------------------------------------------------------------
# Build Compress library for CTest.
SET(CMAKE_COMPRESS_INCLUDES
set(CMAKE_COMPRESS_INCLUDES
"${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress")
SET(CMAKE_COMPRESS_LIBRARIES "cmcompress")
ADD_SUBDIRECTORY(Utilities/cmcompress)
set(CMAKE_COMPRESS_LIBRARIES "cmcompress")
add_subdirectory(Utilities/cmcompress)
CMAKE_SET_TARGET_FOLDER(cmcompress "Utilities/3rdParty")
IF(CMAKE_USE_SYSTEM_BZIP2)
FIND_PACKAGE(BZip2)
ELSE()
SET(BZIP2_INCLUDE_DIR
if(CMAKE_USE_SYSTEM_BZIP2)
find_package(BZip2)
else()
set(BZIP2_INCLUDE_DIR
"${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2")
SET(BZIP2_LIBRARIES cmbzip2)
ADD_SUBDIRECTORY(Utilities/cmbzip2)
set(BZIP2_LIBRARIES cmbzip2)
add_subdirectory(Utilities/cmbzip2)
CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty")
ENDIF()
endif()
#---------------------------------------------------------------------
# Build or use system libarchive for CMake and CTest.
IF(CMAKE_USE_SYSTEM_LIBARCHIVE)
IF(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake) # added in 2.8.3
FIND_PACKAGE(LibArchive)
ELSE()
INCLUDE(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake)
ENDIF()
IF(NOT LibArchive_FOUND)
MESSAGE(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
ENDIF()
SET(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
SET(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
ELSE(CMAKE_USE_SYSTEM_LIBARCHIVE)
SET(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
SET(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
ADD_DEFINITIONS(-DLIBARCHIVE_STATIC)
SET(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle")
SET(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL")
SET(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support")
SET(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support")
SET(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support")
ADD_SUBDIRECTORY(Utilities/cmlibarchive)
if(CMAKE_USE_SYSTEM_LIBARCHIVE)
if(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake) # added in 2.8.3
find_package(LibArchive)
else()
include(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake)
endif()
if(NOT LibArchive_FOUND)
message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
endif()
set(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
set(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
else()
set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
add_definitions(-DLIBARCHIVE_STATIC)
set(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle")
set(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL")
set(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support")
set(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support")
set(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support")
add_subdirectory(Utilities/cmlibarchive)
CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty")
SET(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
ENDIF(CMAKE_USE_SYSTEM_LIBARCHIVE)
set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
endif()
#---------------------------------------------------------------------
# Build expat library for CMake and CTest.
IF(CMAKE_USE_SYSTEM_EXPAT)
FIND_PACKAGE(EXPAT)
IF(NOT EXPAT_FOUND)
MESSAGE(FATAL_ERROR
if(CMAKE_USE_SYSTEM_EXPAT)
find_package(EXPAT)
if(NOT EXPAT_FOUND)
message(FATAL_ERROR
"CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
ENDIF(NOT EXPAT_FOUND)
SET(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
SET(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
ELSE(CMAKE_USE_SYSTEM_EXPAT)
SET(CMAKE_EXPAT_INCLUDES)
SET(CMAKE_EXPAT_LIBRARIES cmexpat)
ADD_SUBDIRECTORY(Utilities/cmexpat)
endif()
set(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
set(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
else()
set(CMAKE_EXPAT_INCLUDES)
set(CMAKE_EXPAT_LIBRARIES cmexpat)
add_subdirectory(Utilities/cmexpat)
CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
ENDIF(CMAKE_USE_SYSTEM_EXPAT)
endif()
#---------------------------------------------------------------------
# Build XMLRPC library for CMake and CTest.
IF(CTEST_USE_XMLRPC)
FIND_PACKAGE(XMLRPC QUIET REQUIRED libwww-client)
IF(NOT XMLRPC_FOUND)
MESSAGE(FATAL_ERROR
if(CTEST_USE_XMLRPC)
find_package(XMLRPC QUIET REQUIRED libwww-client)
if(NOT XMLRPC_FOUND)
message(FATAL_ERROR
"CTEST_USE_XMLRPC is ON but xmlrpc is not found!")
ENDIF(NOT XMLRPC_FOUND)
SET(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
SET(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
ENDIF(CTEST_USE_XMLRPC)
endif()
set(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
set(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
endif()
#---------------------------------------------------------------------
# Use curses?
IF (UNIX)
if (UNIX)
# there is a bug in the Syllable libraries which makes linking ccmake fail, Alex
IF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
SET(CURSES_NEED_NCURSES TRUE)
FIND_PACKAGE(Curses QUIET)
IF (CURSES_LIBRARY)
OPTION(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
ELSE (CURSES_LIBRARY)
MESSAGE("Curses libraries were not found. Curses GUI for CMake will not be built.")
SET(BUILD_CursesDialog 0)
ENDIF (CURSES_LIBRARY)
ELSE(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
SET(BUILD_CursesDialog 0)
ENDIF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
ELSE (UNIX)
SET(BUILD_CursesDialog 0)
ENDIF (UNIX)
IF(BUILD_CursesDialog)
ADD_SUBDIRECTORY(Source/CursesDialog/form)
ENDIF(BUILD_CursesDialog)
ENDMACRO (CMAKE_BUILD_UTILITIES)
if(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
set(CURSES_NEED_NCURSES TRUE)
find_package(Curses QUIET)
if (CURSES_LIBRARY)
option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
else ()
message("Curses libraries were not found. Curses GUI for CMake will not be built.")
set(BUILD_CursesDialog 0)
endif ()
else()
set(BUILD_CursesDialog 0)
endif()
else ()
set(BUILD_CursesDialog 0)
endif ()
if(BUILD_CursesDialog)
add_subdirectory(Source/CursesDialog/form)
endif()
endmacro ()
#-----------------------------------------------------------------------
IF(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER}
if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
execute_process(COMMAND ${CMAKE_CXX_COMPILER}
${CMAKE_CXX_COMPILER_ARG1} -dumpversion
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})
IF(_GXX_VERSION_SHORT EQUAL 33)
MESSAGE(FATAL_ERROR
if(_GXX_VERSION_SHORT EQUAL 33)
message(FATAL_ERROR
"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"
"${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}")
ENDIF()
ENDIF()
endif()
endif()
#-----------------------------------------------------------------------
# The main section of the CMakeLists file
#
#-----------------------------------------------------------------------
INCLUDE(Source/CMakeVersion.cmake)
include(Source/CMakeVersion.cmake)
# Releases define a small tweak level.
IF("${CMake_VERSION_TWEAK}" VERSION_LESS 20000000)
SET(CMake_VERSION_IS_RELEASE 1)
SET(CMake_VERSION_SOURCE "")
ELSE()
SET(CMake_VERSION_IS_RELEASE 0)
INCLUDE(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake)
ENDIF()
if("${CMake_VERSION_TWEAK}" VERSION_LESS 20000000)
set(CMake_VERSION_IS_RELEASE 1)
set(CMake_VERSION_SOURCE "")
else()
set(CMake_VERSION_IS_RELEASE 0)
include(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake)
endif()
# Compute the full version string.
SET(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
IF(${CMake_VERSION_TWEAK} GREATER 0)
SET(CMake_VERSION ${CMake_VERSION}.${CMake_VERSION_TWEAK})
ENDIF()
IF(CMake_VERSION_RC)
SET(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC})
ENDIF()
IF(CMake_VERSION_SOURCE)
SET(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE})
ENDIF()
set(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
if(${CMake_VERSION_TWEAK} GREATER 0)
set(CMake_VERSION ${CMake_VERSION}.${CMake_VERSION_TWEAK})
endif()
if(CMake_VERSION_RC)
set(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC})
endif()
if(CMake_VERSION_SOURCE)
set(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE})
endif()
# Include the standard Dart testing module
ENABLE_TESTING()
INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
enable_testing()
include (${CMAKE_ROOT}/Modules/Dart.cmake)
# Set up test-time configuration.
SET_DIRECTORY_PROPERTIES(PROPERTIES
set_directory_properties(PROPERTIES
TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake")
# where to write the resulting executables and libraries
SET(BUILD_SHARED_LIBS OFF)
SET(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
set(BUILD_SHARED_LIBS OFF)
set(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
"Where to put the libraries for CMake")
# The CMake executables usually do not need any rpath to run in the build or
# 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).")
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).")
SET(CMAKE_MAN_DIR "/man" CACHE STRING
set(CMAKE_MAN_DIR "/man" CACHE STRING
"Install location for man pages (relative to prefix).")
MARK_AS_ADVANCED(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
IF(CYGWIN AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
mark_as_advanced(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
if(CYGWIN AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
# Force doc, data and man dirs to conform to cygwin layout.
SET(CMAKE_DOC_DIR "/share/doc/cmake-${CMake_VERSION}")
SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}")
SET(CMAKE_MAN_DIR "/share/man")
set(CMAKE_DOC_DIR "/share/doc/cmake-${CMake_VERSION}")
set(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}")
set(CMAKE_MAN_DIR "/share/man")
# let the user know we just forced these values
MESSAGE(STATUS "Setup for Cygwin packaging")
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_MAN_DIR = ${CMAKE_MAN_DIR}")
ENDIF()
STRING(REGEX REPLACE "^/" "" CMake_DATA_DEST "${CMAKE_DATA_DIR}")
STRING(REGEX REPLACE "^/" "" CMake_DOC_DEST "${CMAKE_DOC_DIR}")
IF(BUILD_TESTING)
INCLUDE(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
ENDIF()
message(STATUS "Setup for Cygwin packaging")
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_MAN_DIR = ${CMAKE_MAN_DIR}")
endif()
string(REGEX REPLACE "^/" "" CMake_DATA_DEST "${CMAKE_DATA_DIR}")
string(REGEX REPLACE "^/" "" CMake_DOC_DEST "${CMAKE_DOC_DIR}")
if(BUILD_TESTING)
include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
endif()
# include special compile flags for some compilers
INCLUDE(CompileFlags.cmake)
include(CompileFlags.cmake)
# no clue why we are testing for this here
INCLUDE(CheckSymbolExists)
include(CheckSymbolExists)
CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
@ -507,9 +506,9 @@ CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
# to a cdash4simpletest database. In these cases, the CDash dashboards
# should be run first.
#
IF("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
SET(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash")
ENDIF("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")
endif()
# build the utilities (a macro defined in this file)
CMAKE_BUILD_UTILITIES()
@ -519,35 +518,35 @@ CMAKE_BUILD_UTILITIES()
# 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
# generating the documentation.
IF(BUILD_CursesDialog)
GET_FILENAME_COMPONENT(_CURSES_DIR "${CURSES_LIBRARY}" PATH)
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")
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(BUILD_CursesDialog)
IF(BUILD_QtDialog)
IF(APPLE)
SET(CMAKE_BUNDLE_NAME
if(BUILD_CursesDialog)
get_filename_component(_CURSES_DIR "${CURSES_LIBRARY}" PATH)
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")
set(CURSES_NEED_RPATH TRUE)
endif()
endif()
if(BUILD_QtDialog)
if(APPLE)
set(CMAKE_BUNDLE_NAME
"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 /
STRING(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
MATH(EXPR LEN "${LEN} -1" )
STRING(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
IF(NOT "${ENDCH}" STREQUAL "/")
SET(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
ENDIF(NOT "${ENDCH}" STREQUAL "/")
SET(CMAKE_INSTALL_PREFIX
string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
math(EXPR LEN "${LEN} -1" )
string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
if(NOT "${ENDCH}" STREQUAL "/")
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
endif()
set(CMAKE_INSTALL_PREFIX
"${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents")
ENDIF(APPLE)
endif()
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")
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(BUILD_QtDialog)
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")
set(QT_NEED_RPATH TRUE)
endif()
endif()
# The same might be true on other systems for other libraries.
@ -555,43 +554,65 @@ ENDIF(BUILD_QtDialog)
# 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 build tree, which is both the build and the install RPATH.
IF (UNIX)
IF( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
if (UNIX)
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)
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
CONFIGURE_FILE(
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
@ONLY)
ADD_CUSTOM_TARGET(uninstall
add_custom_target(uninstall
"${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)
CMAKE_SETUP_TESTING()
CONFIGURE_FILE(
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/DartLocal.conf.in"
"${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf"
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)
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
ADD_SUBDIRECTORY(Source)
ADD_SUBDIRECTORY(Utilities)
ADD_SUBDIRECTORY(Tests)
add_subdirectory(Source)
add_subdirectory(Utilities)
add_subdirectory(Tests)
if(BUILD_TESTING)
CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests")
@ -600,14 +621,14 @@ CMAKE_SET_TARGET_FOLDER(cmw9xcom "Utilities/Win9xCompat")
CMAKE_SET_TARGET_FOLDER(documentation "Documentation")
# add a test
ADD_TEST(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
--system-information -G "${CMAKE_TEST_GENERATOR}" )
# 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(
install(
DIRECTORY Modules Templates
DESTINATION "${CMake_DATA_DEST}"
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
@ -620,7 +641,7 @@ INSTALL(
)
# process docs related install
ADD_SUBDIRECTORY(Docs)
add_subdirectory(Docs)
#-----------------------------------------------------------------------
# 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
# so that those CMake versions can find it. We wait until after all
# the add_subdirectory() calls to avoid affecting the subdirectories.
SET(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})

@ -21,5 +21,5 @@ set(CTEST_CDASH_QUERY_VERSION TRUE)
# use old trigger stuff so that cmake 2.4 and below will not
# get errors on trigger
SET (TRIGGER_SITE
set (TRIGGER_SITE
"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}
"ERROR:")
SET(CTEST_CUSTOM_WARNING_EXCEPTION
set(CTEST_CUSTOM_WARNING_EXCEPTION
${CTEST_CUSTOM_WARNING_EXCEPTION}
"xtree.[0-9]+. : warning C4702: unreachable code"
"warning LNK4221"
@ -31,6 +31,7 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"remark: .*LOOP WAS VECTORIZED"
"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.*PSAPI.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: public.*_archive_.*in module.*archive_*clashes with prior module.*archive_.*"
@ -56,21 +57,21 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
"[0-9,]+ warnings? generated."
)
IF(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
if(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
set(CTEST_CUSTOM_COVERAGE_EXCLUDE
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
"XCode"
)
ENDIF (NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
endif ()
IF(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
if(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
set(CTEST_CUSTOM_COVERAGE_EXCLUDE
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
"Kdevelop"
)
ENDIF (NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
endif ()
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
set(CTEST_CUSTOM_COVERAGE_EXCLUDE
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
# 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
#
IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
endif()
include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
IF(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
SET(_INTEL_WINDOWS 1)
ENDIF()
if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
set(_INTEL_WINDOWS 1)
endif()
# Disable deprecation warnings for standard C functions.
# really only needed for newer versions of VS, but should
# not hurt other versions, and this will work into the
# future
IF(MSVC OR _INTEL_WINDOWS)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
ELSE()
ENDIF()
if(MSVC OR _INTEL_WINDOWS)
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
else()
endif()
#silence duplicate symbol warnings on AIX
IF(CMAKE_SYSTEM MATCHES "AIX.*")
IF(NOT CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_SYSTEM MATCHES "AIX.*")
if(CMAKE_SYSTEM MATCHES "AIX.*")
if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
endif()
endif()
IF(CMAKE_SYSTEM MATCHES "IRIX.*")
IF(NOT CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15")
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_SYSTEM MATCHES "IRIX.*")
if(CMAKE_SYSTEM MATCHES "IRIX.*")
if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15")
endif()
endif()
IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
IF(NOT CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
if(NOT CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
endif()
endif()
# use the ansi CXX compile flag for building cmake
IF (CMAKE_ANSI_CXXFLAGS)
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
ENDIF (CMAKE_ANSI_CXXFLAGS)
if (CMAKE_ANSI_CXXFLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
endif ()
IF (CMAKE_ANSI_CFLAGS)
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
ENDIF (CMAKE_ANSI_CFLAGS)
if (CMAKE_ANSI_CFLAGS)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${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}")
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)
ADD_SUBDIRECTORY (bash-completion)
add_subdirectory (bash-completion)

@ -8,7 +8,7 @@ _cpack()
case "$prev" in
-G)
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" ) )
return
;;

@ -68,9 +68,9 @@ set the path with these commands:
"\\|" "[ \t\r\n]"
"\\)*"))
(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
"^[ \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)
(let ((point-start (point))
(case-fold-search t) ;; case-insensitive
token)
; Search back for the last indented line.
@ -229,13 +230,26 @@ the indentation. Otherwise it retains the same position on the line"
;;
(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.
;;
(defun cmake-mode ()
"Major mode for editing CMake listfiles."
"Major mode for editing CMake listfiles.
\\{cmake-mode-map}"
(interactive)
(kill-all-local-variables)
(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)
(setq comment-start "#")
; Setup keymap.
(use-local-map cmake-mode-map)
; Run user hooks.
(run-hooks 'cmake-mode-hook))

@ -15,15 +15,15 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(ADD_FILE_DEPENDENCIES _file)
macro(ADD_FILE_DEPENDENCIES _file)
GET_SOURCE_FILE_PROPERTY(_deps ${_file} OBJECT_DEPENDS)
IF (_deps)
SET(_deps ${_deps} ${ARGN})
ELSE (_deps)
SET(_deps ${ARGN})
ENDIF (_deps)
get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
if (_deps)
set(_deps ${_deps} ${ARGN})
else ()
set(_deps ${ARGN})
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_HEADERS @_moc_headers@ )
set(AM_MOC_COMPILE_DEFINITIONS @_moc_compile_defs@)
set(AM_MOC_DEFINITIONS @_moc_defs@)
set(AM_MOC_INCLUDES @_moc_incs@)
set(AM_MOC_OPTIONS @_moc_options@)
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().
# 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.
#
# 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().
# 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.
#
# 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)
string(REGEX REPLACE "^.*<string>(.*)</string>.*$" "\\1" bundle_executable "${line}")
break()
endif(line_is_main_executable)
endif()
if(line MATCHES "^.*<key>CFBundleExecutable</key>.*$")
set(line_is_main_executable 1)
endif(line MATCHES "^.*<key>CFBundleExecutable</key>.*$")
endforeach(line)
endif()
endforeach()
if(NOT "${bundle_executable}" STREQUAL "")
if(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}")
set(result "${bundle}/Contents/MacOS/${bundle_executable}")
else(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}")
else()
# Ultimate goal:
# 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:
#
set(result "error: '${bundle}/Contents/MacOS/${bundle_executable}' does not exist")
endif(EXISTS "${bundle}/Contents/MacOS/${bundle_executable}")
endif(NOT "${bundle_executable}" STREQUAL "")
else(EXISTS "${bundle}/Contents/Info.plist")
endif()
endif()
else()
#
# More inclusive technique... (This one would work on Windows and Linux
# 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
# base name as the .app directory:
#
endif(EXISTS "${bundle}/Contents/Info.plist")
endif()
set(${result_var} "${result}" PARENT_SCOPE)
endfunction(get_bundle_main_executable)
endfunction()
function(get_dotapp_dir exe dotapp_dir_var)
@ -240,9 +240,9 @@ function(get_dotapp_dir exe dotapp_dir_var)
if(sname MATCHES "\\.app$")
set(done 1)
set(dotapp_dir "${sdir}/${sname}")
endif(sname MATCHES "\\.app$")
endwhile(NOT ${done})
else(s MATCHES "^.*/.*\\.app/.*$")
endif()
endwhile()
else()
# Otherwise use a directory containing the exe
# (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)
get_filename_component(sdir "${s}" PATH)
set(dotapp_dir "${sdir}")
else(is_executable)
else()
set(dotapp_dir "${s}")
endif(is_executable)
endif(s MATCHES "^.*/.*\\.app/.*$")
endif()
endif()
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)
@ -273,13 +273,13 @@ function(get_bundle_and_executable app bundle_var executable_var valid_var)
set(${executable_var} "${executable}" PARENT_SCOPE)
set(valid 1)
#message(STATUS "info: handled .app directory case...")
else(EXISTS "${app}" AND EXISTS "${executable}")
else()
message(STATUS "warning: *NOT* handled - .app directory case...")
endif(EXISTS "${app}" AND EXISTS "${executable}")
else(app MATCHES "\\.app$")
endif()
else()
message(STATUS "warning: *NOT* handled - directory but not .app case...")
endif(app MATCHES "\\.app$")
else(IS_DIRECTORY "${app}")
endif()
else()
# Is it an executable file?
is_file_executable("${app}" is_executable)
if(is_executable)
@ -296,21 +296,21 @@ function(get_bundle_and_executable app bundle_var executable_var valid_var)
set(valid 1)
#message(STATUS "info: handled executable file in any dir case...")
endif()
else(is_executable)
else()
message(STATUS "warning: *NOT* handled - not .app dir, not executable file...")
endif(is_executable)
endif(IS_DIRECTORY "${app}")
else(EXISTS "${app}")
endif()
endif()
else()
message(STATUS "warning: *NOT* handled - directory/file does not exist...")
endif(EXISTS "${app}")
endif()
if(NOT valid)
set(${bundle_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)
endfunction(get_bundle_and_executable)
endfunction()
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)
if(is_executable)
set(exes ${exes} "${f}")
endif(is_executable)
endforeach(f)
endif()
endforeach()
set(${exes_var} "${exes}" PARENT_SCOPE)
endfunction(get_bundle_all_executables)
endfunction()
function(get_item_key item key_var)
@ -335,7 +335,7 @@ function(get_item_key item key_var)
endif()
string(REGEX REPLACE "\\." "_" ${key_var} "${item_name}")
set(${key_var} ${${key_var}} PARENT_SCOPE)
endfunction(get_item_key)
endfunction()
function(clear_bundle_keys keys_var)
@ -346,9 +346,9 @@ function(clear_bundle_keys keys_var)
set(${key}_EMBEDDED_ITEM PARENT_SCOPE)
set(${key}_RESOLVED_EMBEDDED_ITEM PARENT_SCOPE)
set(${key}_COPYFLAG PARENT_SCOPE)
endforeach(key)
endforeach()
set(${keys_var} PARENT_SCOPE)
endfunction(clear_bundle_keys)
endfunction()
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
# opening "${item_name}.framework/" to the closing "/${item_name}":
#
string(REGEX REPLACE "^.*(${item_name}.framework/.*/${item_name}).*$" "${default_embedded_path}/\\1" embedded_item "${item}")
else(item MATCHES "[^/]+\\.framework/")
string(REGEX REPLACE "^.*(${item_name}.framework/.*/?${item_name}).*$" "${default_embedded_path}/\\1" embedded_item "${item}")
else()
# For other items, just use the same name as the original, but in the
# embedded path:
#
set(embedded_item "${default_embedded_path}/${item_name}")
endif(item MATCHES "[^/]+\\.framework/")
endif()
# 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)
set(resolved_embedded_item "${resolved_item}")
endif(NOT copyflag)
endif()
set(${keys_var} ${${keys_var}} 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}_RESOLVED_EMBEDDED_ITEM "${resolved_embedded_item}" 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")
endif(NOT length_before EQUAL length_after)
endfunction(set_bundle_key_values)
endif()
endfunction()
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}")
foreach(pr ${prereqs})
set_bundle_key_values(${keys_var} "${lib}" "${pr}" "${exepath}" "${dirs}" 1)
endforeach(pr)
endforeach(lib)
endforeach()
endforeach()
# For each executable found in the bundle, accumulate keys as we go.
# 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}")
foreach(pr ${prereqs})
set_bundle_key_values(${keys_var} "${exe}" "${pr}" "${exepath}" "${dirs}" 1)
endforeach(pr)
endforeach(exe)
endforeach()
endforeach()
# 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}_RESOLVED_EMBEDDED_ITEM "${${key}_RESOLVED_EMBEDDED_ITEM}" PARENT_SCOPE)
set(${key}_COPYFLAG "${${key}_COPYFLAG}" PARENT_SCOPE)
endforeach(key)
endif(valid)
endfunction(get_bundle_keys)
endforeach()
endif()
endfunction()
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}")
if(UNIX AND NOT APPLE)
file(RPATH_REMOVE FILE "${resolved_embedded_item}")
endif(UNIX AND NOT APPLE)
endif()
endif()
endfunction(copy_resolved_item_into_bundle)
endfunction()
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()
if(UNIX AND NOT APPLE)
file(RPATH_REMOVE FILE "${resolved_embedded_item}")
endif(UNIX AND NOT APPLE)
endif()
endif()
endfunction(copy_resolved_framework_into_bundle)
endfunction()
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 "")
set(changes ${changes} "-change" "${pr}" "${${rkey}_EMBEDDED_ITEM}")
else(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "")
else()
message("warning: unexpected reference to '${pr}'")
endif(NOT "${${rkey}_EMBEDDED_ITEM}" STREQUAL "")
endforeach(pr)
endif()
endforeach()
if(BU_CHMOD_BUNDLE_ITEMS)
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
${changes} -id "${${ikey}_EMBEDDED_ITEM}" "${resolved_embedded_item}"
)
endfunction(fixup_bundle_item)
endfunction()
function(fixup_bundle app libs dirs)
@ -620,9 +620,9 @@ function(fixup_bundle app libs dirs)
math(EXPR i ${i}+1)
if(${${key}_COPYFLAG})
message(STATUS "${i}/${n}: copying '${${key}_RESOLVED_ITEM}'")
else(${${key}_COPYFLAG})
else()
message(STATUS "${i}/${n}: *NOT* copying '${${key}_RESOLVED_ITEM}'")
endif(${${key}_COPYFLAG})
endif()
set(show_status 0)
if(show_status)
@ -634,7 +634,7 @@ function(fixup_bundle app libs dirs)
message(STATUS "resolved_embedded_item='${${key}_RESOLVED_EMBEDDED_ITEM}'")
message(STATUS "copyflag='${${key}_COPYFLAG}'")
message(STATUS "")
endif(show_status)
endif()
if(${${key}_COPYFLAG})
set(item "${${key}_ITEM}")
@ -645,8 +645,8 @@ function(fixup_bundle app libs dirs)
copy_resolved_item_into_bundle("${${key}_RESOLVED_ITEM}"
"${${key}_RESOLVED_EMBEDDED_ITEM}")
endif()
endif(${${key}_COPYFLAG})
endforeach(key)
endif()
endforeach()
message(STATUS "fixup_bundle: fixing...")
foreach(key ${keys})
@ -654,28 +654,28 @@ function(fixup_bundle app libs dirs)
if(APPLE)
message(STATUS "${i}/${n}: fixing up '${${key}_RESOLVED_EMBEDDED_ITEM}'")
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}'")
endif(APPLE)
endforeach(key)
endif()
endforeach()
message(STATUS "fixup_bundle: cleaning up...")
clear_bundle_keys(keys)
message(STATUS "fixup_bundle: verifying...")
verify_app("${app}")
else(valid)
else()
message(SEND_ERROR "error: fixup_bundle: not a valid bundle")
endif(valid)
endif()
message(STATUS "fixup_bundle: done")
endfunction(fixup_bundle)
endfunction()
function(copy_and_fixup_bundle src dst libs dirs)
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_directory "${src}" "${dst}")
fixup_bundle("${dst}" "${libs}" "${dirs}")
endfunction(copy_and_fixup_bundle)
endfunction()
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}")
endif()
endif()
endforeach(p)
endforeach()
if(external_prereqs)
# Found non-system/somehow-unacceptable prerequisites:
set(result 0)
set(info ${info} "external prerequisites found:\nf='${f}'\nexternal_prereqs='${external_prereqs}'\n")
endif(external_prereqs)
endif(is_executable)
endforeach(f)
endif()
endif()
endforeach()
if(result)
set(info "Verified ${count} executable files in '${bundle}'")
endif(result)
endif()
set(${result_var} "${result}" PARENT_SCOPE)
set(${info_var} "${info}" PARENT_SCOPE)
endfunction(verify_bundle_prerequisites)
endfunction()
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(${info_var} "${info}" PARENT_SCOPE)
endfunction(verify_bundle_symlinks)
endfunction()
function(verify_app app)
@ -778,9 +778,9 @@ function(verify_app app)
message(STATUS "verified='${verified}'")
message(STATUS "info='${info}'")
message(STATUS "")
endif(verified)
endif()
if(NOT verified)
message(FATAL_ERROR "error: verify_app failed")
endif(NOT verified)
endfunction(verify_app)
endif()
endfunction()

@ -14,12 +14,12 @@
# 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
# 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)
SET(ASM_DIALECT)
include(CMakeASMInformation)
set(ASM_DIALECT)

@ -1,12 +1,12 @@
SET(CMAKE_ASM@ASM_DIALECT@_COMPILER "@_CMAKE_ASM_COMPILER@")
SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_ARG1 "@_CMAKE_ASM_COMPILER_ARG1@")
SET(CMAKE_AR "@CMAKE_AR@")
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
SET(CMAKE_LINKER "@CMAKE_LINKER@")
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_ENV_VAR "@_CMAKE_ASM_COMPILER_ENV_VAR@")
set(CMAKE_ASM@ASM_DIALECT@_COMPILER "@_CMAKE_ASM_COMPILER@")
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ARG1 "@_CMAKE_ASM_COMPILER_ARG1@")
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
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_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@_LINKER_PREFERENCE 0)
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)

@ -12,76 +12,76 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF(UNIX)
SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
ELSE(UNIX)
SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
if(UNIX)
set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
else()
set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
endif()
SET(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I
SET(CMAKE_BASE_NAME)
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE)
set(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I
set(CMAKE_BASE_NAME)
get_filename_component(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE)
IF("${CMAKE_BASE_NAME}" STREQUAL "as")
SET(CMAKE_BASE_NAME gas)
ENDIF("${CMAKE_BASE_NAME}" STREQUAL "as")
if("${CMAKE_BASE_NAME}" STREQUAL "as")
set(CMAKE_BASE_NAME gas)
endif()
# Load compiler-specific information.
SET(_INCLUDED_FILE "")
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
INCLUDE(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
IF(NOT _INCLUDED_FILE)
IF("ASM${ASM_DIALECT}" STREQUAL "ASM")
MESSAGE(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
ENDIF("ASM${ASM_DIALECT}" STREQUAL "ASM")
INCLUDE(Platform/${CMAKE_BASE_NAME} OPTIONAL)
ENDIF(NOT _INCLUDED_FILE)
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)
IF(NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
ENDIF(NOT _INCLUDED_FILE)
ENDIF(CMAKE_SYSTEM_PROCESSOR)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
IF(NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
ENDIF(NOT _INCLUDED_FILE)
set(_INCLUDED_FILE "")
if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
include(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif()
if(NOT _INCLUDED_FILE)
if("ASM${ASM_DIALECT}" STREQUAL "ASM")
message(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
endif()
include(Platform/${CMAKE_BASE_NAME} OPTIONAL)
endif()
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)
if(NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
endif()
endif()
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
if(NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
endif()
# Set default assembler file extensions:
IF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
ENDIF(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)
endif()
# 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
IF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
ENDIF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
if(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
endif()
set (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
"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
IF(NOT CMAKE_NO_BUILD_TYPE)
SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
if(NOT CMAKE_NO_BUILD_TYPE)
set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
"Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.")
ENDIF(NOT CMAKE_NO_BUILD_TYPE)
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
endif()
set (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
"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.")
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.")
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.")
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_MINSIZEREL
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)
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)
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>")
endif()
IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
SET(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
"<CMAKE_RANLIB> <TARGET> ")
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
endif()
IF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
SET(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
if(NOT 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>")
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
endif()
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})
ENDIF()
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})
endif()
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})
ENDIF()
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})
endif()
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})
ENDIF()
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})
endif()
# to be done
IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
ENDIF(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)
endif()
IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
ENDIF(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)
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
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)
SET(ASM_DIALECT)
include(CMakeASMInformation)
set(ASM_DIALECT)

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

@ -1,3 +1,19 @@
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
CMake(LANG)Compiler.cmake.in -> used by CMakeDetermine(LANG)Compiler.cmake

@ -13,28 +13,28 @@
# License text for the above reference.)
# Nothing here yet
IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
INCLUDE(CMakeVS7BackwardCompatibility)
SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
INCLUDE(CMakeVS6BackwardCompatibility)
SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
include(CMakeVS7BackwardCompatibility)
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
endif()
if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
include(CMakeVS6BackwardCompatibility)
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
endif()
if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
# Old CMake versions did not support OS X universal binaries anyway,
# so just get through this with at least some size for the types.
LIST(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
IF(${NUM_ARCHS} GREATER 1)
IF(NOT DEFINED CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
MESSAGE(WARNING "This module does not work with OS X universal binaries.")
SET(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES 1)
LIST(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
ENDIF()
ENDIF()
INCLUDE (CheckTypeSize)
list(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
if(${NUM_ARCHS} GREATER 1)
if(NOT DEFINED CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
message(WARNING "This module does not work with OS X universal binaries.")
set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES 1)
list(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
endif()
endif()
include (CheckTypeSize)
CHECK_TYPE_SIZE(int CMAKE_SIZEOF_INT)
CHECK_TYPE_SIZE(long CMAKE_SIZEOF_LONG)
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(double CMAKE_SIZEOF_DOUBLE)
INCLUDE (CheckIncludeFile)
include (CheckIncludeFile)
CHECK_INCLUDE_FILE("limits.h" CMAKE_HAVE_LIMITS_H)
CHECK_INCLUDE_FILE("unistd.h" CMAKE_HAVE_UNISTD_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)
INCLUDE (TestBigEndian)
include (TestBigEndian)
TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
INCLUDE (FindX11)
include (FindX11)
IF("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
SET (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
ELSE("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
SET (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING
if("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
set (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
else()
set (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING
"X11 extra flags.")
ENDIF("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
SET (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING
endif()
set (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING
"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.")
SET (CMAKE_USE_PTHREADS "${CMAKE_USE_PTHREADS_INIT}" CACHE BOOL
set (CMAKE_USE_PTHREADS "${CMAKE_USE_PTHREADS_INIT}" CACHE BOOL
"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.")
SET (CMAKE_HP_PTHREADS ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL
set (CMAKE_HP_PTHREADS ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL
"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.")
IF(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
SET(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
ENDIF()
ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
if(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
endif()
endif()
MARK_AS_ADVANCED(
mark_as_advanced(
CMAKE_HP_PTHREADS
CMAKE_THREAD_LIBS
CMAKE_USE_PTHREADS

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

@ -12,6 +12,6 @@
# (To distribute this file outside of CMake, substitute the full
# 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.")
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_ARG1 "@CMAKE_C_COMPILER_ARG1@")
SET(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
SET(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
SET(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
set(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
set(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
set(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
set(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
@SET_MSVC_C_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@")
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
SET(CMAKE_LINKER "@CMAKE_LINKER@")
SET(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@)
SET(CMAKE_C_COMPILER_LOADED 1)
SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
IF(CMAKE_COMPILER_IS_CYGWIN)
SET(CYGWIN 1)
SET(UNIX 1)
ENDIF(CMAKE_COMPILER_IS_CYGWIN)
SET(CMAKE_C_COMPILER_ENV_VAR "CC")
IF(CMAKE_COMPILER_IS_MINGW)
SET(MINGW 1)
ENDIF(CMAKE_COMPILER_IS_MINGW)
SET(CMAKE_C_COMPILER_ID_RUN 1)
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)
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
set(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@)
set(CMAKE_C_COMPILER_LOADED 1)
set(CMAKE_C_COMPILER_WORKS @CMAKE_C_COMPILER_WORKS@)
set(CMAKE_C_ABI_COMPILED @CMAKE_C_ABI_COMPILED@)
set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
if(CMAKE_COMPILER_IS_CYGWIN)
set(CYGWIN 1)
set(UNIX 1)
endif()
set(CMAKE_C_COMPILER_ENV_VAR "CC")
if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1)
endif()
set(CMAKE_C_COMPILER_ID_RUN 1)
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.
SET(CMAKE_C_SIZEOF_DATA_PTR "@CMAKE_C_SIZEOF_DATA_PTR@")
SET(CMAKE_C_COMPILER_ABI "@CMAKE_C_COMPILER_ABI@")
SET(CMAKE_C_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
set(CMAKE_C_SIZEOF_DATA_PTR "@CMAKE_C_SIZEOF_DATA_PTR@")
set(CMAKE_C_COMPILER_ABI "@CMAKE_C_COMPILER_ABI@")
set(CMAKE_C_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
IF(CMAKE_C_SIZEOF_DATA_PTR)
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
ENDIF(CMAKE_C_SIZEOF_DATA_PTR)
if(CMAKE_C_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
endif()
IF(CMAKE_C_COMPILER_ABI)
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
ENDIF(CMAKE_C_COMPILER_ABI)
if(CMAKE_C_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
endif()
IF(CMAKE_C_LIBRARY_ARCHITECTURE)
SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
ENDIF()
if(CMAKE_C_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
endif()
SET(CMAKE_C_HAS_ISYSROOT "@CMAKE_C_HAS_ISYSROOT@")
@CMAKE_C_SYSROOT_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_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
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_FRAMEWORK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
@SET_CMAKE_CMCLDEPS_EXECUTABLE@
@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@

@ -20,6 +20,14 @@
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# 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__)
# define COMPILER_ID "Clang"
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
@ -67,6 +75,10 @@
#elif defined(__DECC)
# 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__)
# if defined(__COMPILER_VER__)
@ -91,14 +103,17 @@
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
#elif defined(__PATHSCALE__)
# define COMPILER_ID "PathScale"
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"
# define COMPILER_VERSION_MAJOR DEC(_RELEASE)
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
#elif defined(__TI_COMPILER_VERSION__)
# 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__)
# define COMPILER_ID "TinyCC"
@ -132,9 +147,16 @@
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# 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__)
/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
SHARC (21000) DSPs */
# define COMPILER_ID "ADSP"
/* IAR Systems compiler for embedded systems.
@ -147,6 +169,10 @@
http://sdcc.sourceforge.net */
#elif defined(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)
# define COMPILER_ID "MIPSpro"

@ -20,60 +20,60 @@
# 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
IF(UNIX)
SET(CMAKE_C_OUTPUT_EXTENSION .o)
ELSE(UNIX)
SET(CMAKE_C_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
if(UNIX)
set(CMAKE_C_OUTPUT_EXTENSION .o)
else()
set(CMAKE_C_OUTPUT_EXTENSION .obj)
endif()
SET(_INCLUDED_FILE 0)
set(_INCLUDED_FILE 0)
# Load compiler-specific information.
IF(CMAKE_C_COMPILER_ID)
INCLUDE(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL)
ENDIF(CMAKE_C_COMPILER_ID)
if(CMAKE_C_COMPILER_ID)
include(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL)
endif()
SET(CMAKE_BASE_NAME)
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE)
IF(CMAKE_COMPILER_IS_GNUCC)
SET(CMAKE_BASE_NAME gcc)
ENDIF(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_BASE_NAME)
get_filename_component(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE)
if(CMAKE_COMPILER_IS_GNUCC)
set(CMAKE_BASE_NAME gcc)
endif()
# load a hardware specific file, mostly useful for embedded compilers
IF(CMAKE_SYSTEM_PROCESSOR)
IF(CMAKE_C_COMPILER_ID)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
ENDIF(CMAKE_C_COMPILER_ID)
IF (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
ENDIF (NOT _INCLUDED_FILE)
ENDIF(CMAKE_SYSTEM_PROCESSOR)
if(CMAKE_SYSTEM_PROCESSOR)
if(CMAKE_C_COMPILER_ID)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif()
if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
endif ()
endif()
# load the system- and compiler specific files
IF(CMAKE_C_COMPILER_ID)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
if(CMAKE_C_COMPILER_ID)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
ENDIF(CMAKE_C_COMPILER_ID)
IF (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
endif()
if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
ENDIF (NOT _INCLUDED_FILE)
endif ()
# We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info.
# Remove this when all compiler info is removed from system files.
IF (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
ENDIF (NOT _INCLUDED_FILE)
if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
endif ()
IF(CMAKE_C_SIZEOF_DATA_PTR)
FOREACH(f ${CMAKE_C_ABI_FILES})
INCLUDE(${f})
ENDFOREACH()
UNSET(CMAKE_C_ABI_FILES)
ENDIF()
if(CMAKE_C_SIZEOF_DATA_PTR)
foreach(f ${CMAKE_C_ABI_FILES})
include(${f})
endforeach()
unset(CMAKE_C_ABI_FILES)
endif()
# This should be included before the _INIT variables are
# used to initialize the cache. Since the rule variables
@ -81,58 +81,58 @@ ENDIF()
# But, it should still be after the platform file so changes can
# 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.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
ENDIF()
include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
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.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_C} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE_C "${_override}")
ENDIF()
include(${CMAKE_USER_MAKE_RULES_OVERRIDE_C} RESULT_VARIABLE _override)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_C "${_override}")
endif()
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
IF(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
ENDIF(NOT CMAKE_MODULE_EXISTS)
if(NOT CMAKE_MODULE_EXISTS)
set(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
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
IF(CMAKE_C_FLAGS_INIT STREQUAL " ")
SET(CMAKE_C_FLAGS_INIT)
ENDIF(CMAKE_C_FLAGS_INIT STREQUAL " ")
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
if(CMAKE_C_FLAGS_INIT STREQUAL " ")
set(CMAKE_C_FLAGS_INIT)
endif()
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
"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
IF(NOT CMAKE_NO_BUILD_TYPE)
SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
if(NOT CMAKE_NO_BUILD_TYPE)
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.")
ENDIF(NOT CMAKE_NO_BUILD_TYPE)
SET (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
endif()
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
"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.")
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).")
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.")
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
endif()
IF(CMAKE_C_STANDARD_LIBRARIES_INIT)
SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}"
if(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.")
MARK_AS_ADVANCED(CMAKE_C_STANDARD_LIBRARIES)
ENDIF(CMAKE_C_STANDARD_LIBRARIES_INIT)
mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
endif()
INCLUDE(CMakeCommonLanguageInclude)
include(CMakeCommonLanguageInclude)
# now define the following rule variables
@ -162,58 +162,58 @@ INCLUDE(CMakeCommonLanguageInclude)
# create a C shared library
IF(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
SET(CMAKE_C_CREATE_SHARED_LIBRARY
if(NOT 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>")
ENDIF(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
endif()
# create a C shared module just copy the shared library rule
IF(NOT CMAKE_C_CREATE_SHARED_MODULE)
SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
ENDIF(NOT CMAKE_C_CREATE_SHARED_MODULE)
if(NOT CMAKE_C_CREATE_SHARED_MODULE)
set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
endif()
# Create a static archive incrementally for large object file counts.
# If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these.
IF(NOT DEFINED CMAKE_C_ARCHIVE_CREATE)
SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF()
IF(NOT DEFINED CMAKE_C_ARCHIVE_APPEND)
SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF()
IF(NOT DEFINED CMAKE_C_ARCHIVE_FINISH)
SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
ENDIF()
if(NOT DEFINED CMAKE_C_ARCHIVE_CREATE)
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_C_ARCHIVE_APPEND)
set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_C_ARCHIVE_FINISH)
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
endif()
# compile a C file into an object file
IF(NOT CMAKE_C_COMPILE_OBJECT)
SET(CMAKE_C_COMPILE_OBJECT
if(NOT CMAKE_C_COMPILE_OBJECT)
set(CMAKE_C_COMPILE_OBJECT
"<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
ENDIF(NOT CMAKE_C_COMPILE_OBJECT)
endif()
IF(NOT CMAKE_C_LINK_EXECUTABLE)
SET(CMAKE_C_LINK_EXECUTABLE
if(NOT CMAKE_C_LINK_EXECUTABLE)
set(CMAKE_C_LINK_EXECUTABLE
"<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)
SET(CMAKE_EXECUTABLE_RUNTIME_C_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
ENDIF(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})
endif()
IF(NOT CMAKE_EXECUTABLE_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)
if(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
endif()
IF(NOT CMAKE_EXECUTABLE_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)
if(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
set(CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
endif()
MARK_AS_ADVANCED(
mark_as_advanced(
CMAKE_C_FLAGS
CMAKE_C_FLAGS_DEBUG
CMAKE_C_FLAGS_MINSIZEREL
CMAKE_C_FLAGS_RELEASE
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_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
SET(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
SET(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
SET(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
set(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
@SET_MSVC_CXX_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@")
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
SET(CMAKE_LINKER "@CMAKE_LINKER@")
SET(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
SET(CMAKE_CXX_COMPILER_LOADED 1)
SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
IF(CMAKE_COMPILER_IS_CYGWIN)
SET(CYGWIN 1)
SET(UNIX 1)
ENDIF(CMAKE_COMPILER_IS_CYGWIN)
SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
IF(CMAKE_COMPILER_IS_MINGW)
SET(MINGW 1)
ENDIF(CMAKE_COMPILER_IS_MINGW)
SET(CMAKE_CXX_COMPILER_ID_RUN 1)
SET(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
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)
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_LINKER "@CMAKE_LINKER@")
set(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
set(CMAKE_CXX_COMPILER_LOADED 1)
set(CMAKE_CXX_COMPILER_WORKS @CMAKE_CXX_COMPILER_WORKS@)
set(CMAKE_CXX_ABI_COMPILED @CMAKE_CXX_ABI_COMPILED@)
set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
if(CMAKE_COMPILER_IS_CYGWIN)
set(CYGWIN 1)
set(UNIX 1)
endif()
set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1)
endif()
set(CMAKE_CXX_COMPILER_ID_RUN 1)
set(CMAKE_CXX_IGNORE_EXTENSIONS inl;h;hpp;HPP;H;o;O;obj;OBJ;def;DEF;rc;RC)
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.
SET(CMAKE_CXX_SIZEOF_DATA_PTR "@CMAKE_CXX_SIZEOF_DATA_PTR@")
SET(CMAKE_CXX_COMPILER_ABI "@CMAKE_CXX_COMPILER_ABI@")
SET(CMAKE_CXX_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
set(CMAKE_CXX_SIZEOF_DATA_PTR "@CMAKE_CXX_SIZEOF_DATA_PTR@")
set(CMAKE_CXX_COMPILER_ABI "@CMAKE_CXX_COMPILER_ABI@")
set(CMAKE_CXX_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
IF(CMAKE_CXX_SIZEOF_DATA_PTR)
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
ENDIF(CMAKE_CXX_SIZEOF_DATA_PTR)
if(CMAKE_CXX_SIZEOF_DATA_PTR)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
endif()
IF(CMAKE_CXX_COMPILER_ABI)
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
ENDIF(CMAKE_CXX_COMPILER_ABI)
if(CMAKE_CXX_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
endif()
IF(CMAKE_CXX_LIBRARY_ARCHITECTURE)
SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
ENDIF()
if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
endif()
SET(CMAKE_CXX_HAS_ISYSROOT "@CMAKE_CXX_HAS_ISYSROOT@")
@CMAKE_CXX_SYSROOT_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_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
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_FRAMEWORK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@")
@SET_CMAKE_CMCLDEPS_EXECUTABLE@
@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@

@ -10,6 +10,9 @@
#if defined(__COMO__)
# 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)
# define COMPILER_ID "Intel"
@ -22,6 +25,14 @@
# define COMPILER_VERSION_TWEAK DEC(__INTEL_COMPILER_BUILD_DATE)
# 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__)
# define COMPILER_ID "Clang"
# define COMPILER_VERSION_MAJOR DEC(__clang_major__)
@ -69,6 +80,10 @@
#elif defined(__DECCXX)
# 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__)
# if defined(__COMPILER_VER__)
@ -93,14 +108,17 @@
# define COMPILER_VERSION_PATCH DEC(__PGIC_PATCHLEVEL__)
# endif
#elif defined(__PATHSCALE__)
# define COMPILER_ID "PathScale"
#elif defined(_CRAYC)
# define COMPILER_ID "Cray"
# define COMPILER_VERSION_MAJOR DEC(_RELEASE)
# define COMPILER_VERSION_MINOR DEC(_RELEASE_MINOR)
#elif defined(__TI_COMPILER_VERSION__)
# 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__)
# define COMPILER_ID "SCO"
@ -131,9 +149,16 @@
# define COMPILER_VERSION_TWEAK DEC(_MSC_BUILD)
# 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__)
/* Analog Devices C++ compiler for Blackfin, TigerSHARC and
SHARC (21000) DSPs */
# define COMPILER_ID "ADSP"
#elif defined(_SGI_COMPILER_VERSION) || defined(_COMPILER_VERSION)

@ -20,59 +20,59 @@
# 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
IF(UNIX)
SET(CMAKE_CXX_OUTPUT_EXTENSION .o)
ELSE(UNIX)
SET(CMAKE_CXX_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
if(UNIX)
set(CMAKE_CXX_OUTPUT_EXTENSION .o)
else()
set(CMAKE_CXX_OUTPUT_EXTENSION .obj)
endif()
SET(_INCLUDED_FILE 0)
set(_INCLUDED_FILE 0)
# Load compiler-specific information.
IF(CMAKE_CXX_COMPILER_ID)
INCLUDE(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL)
ENDIF(CMAKE_CXX_COMPILER_ID)
if(CMAKE_CXX_COMPILER_ID)
include(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL)
endif()
SET(CMAKE_BASE_NAME)
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
set(CMAKE_BASE_NAME)
get_filename_component(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
# since the gnu compiler has several names force g++
IF(CMAKE_COMPILER_IS_GNUCXX)
SET(CMAKE_BASE_NAME g++)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_BASE_NAME g++)
endif()
# load a hardware specific file, mostly useful for embedded compilers
IF(CMAKE_SYSTEM_PROCESSOR)
IF(CMAKE_CXX_COMPILER_ID)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
ENDIF(CMAKE_CXX_COMPILER_ID)
IF (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
ENDIF (NOT _INCLUDED_FILE)
ENDIF(CMAKE_SYSTEM_PROCESSOR)
if(CMAKE_SYSTEM_PROCESSOR)
if(CMAKE_CXX_COMPILER_ID)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif()
if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
endif ()
endif()
# load the system- and compiler specific files
IF(CMAKE_CXX_COMPILER_ID)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
ENDIF(CMAKE_CXX_COMPILER_ID)
IF (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
if(CMAKE_CXX_COMPILER_ID)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif()
if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
RESULT_VARIABLE _INCLUDED_FILE)
ENDIF (NOT _INCLUDED_FILE)
endif ()
# We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info.
# Remove this when all compiler info is removed from system files.
IF (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
ENDIF (NOT _INCLUDED_FILE)
if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
endif ()
IF(CMAKE_CXX_SIZEOF_DATA_PTR)
FOREACH(f ${CMAKE_CXX_ABI_FILES})
INCLUDE(${f})
ENDFOREACH()
UNSET(CMAKE_CXX_ABI_FILES)
ENDIF()
if(CMAKE_CXX_SIZEOF_DATA_PTR)
foreach(f ${CMAKE_CXX_ABI_FILES})
include(${f})
endforeach()
unset(CMAKE_CXX_ABI_FILES)
endif()
# This should be included before the _INIT variables are
# used to initialize the cache. Since the rule variables
@ -80,150 +80,150 @@ ENDIF()
# But, it should still be after the platform file so changes can
# 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.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
ENDIF()
include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
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.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX "${_override}")
ENDIF()
include(${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} RESULT_VARIABLE _override)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX "${_override}")
endif()
# Create a set of shared library variable specific to C++
# 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
IF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
ENDIF(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})
endif()
IF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
SET(CMAKE_CXX_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
set(CMAKE_CXX_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
endif()
IF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
SET(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
set(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
endif()
IF(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
SET(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
if(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
set(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
endif()
IF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
ENDIF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
if(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
ENDIF(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})
endif()
IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
ENDIF(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})
endif()
IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_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)
if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
endif()
IF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_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)
if(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
set(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
endif()
IF(NOT DEFINED CMAKE_EXE_EXPORTS_CXX_FLAG)
SET(CMAKE_EXE_EXPORTS_CXX_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
ENDIF()
if(NOT DEFINED CMAKE_EXE_EXPORTS_CXX_FLAG)
set(CMAKE_EXE_EXPORTS_CXX_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG)
SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
ENDIF()
if(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG)
set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
endif()
IF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
SET(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG})
ENDIF(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})
endif()
IF(NOT CMAKE_EXECUTABLE_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)
if(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
set(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP})
endif()
IF(NOT CMAKE_EXECUTABLE_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)
if(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
set(CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG})
endif()
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})
ENDIF(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})
endif()
IF(NOT CMAKE_INCLUDE_FLAG_CXX)
SET(CMAKE_INCLUDE_FLAG_CXX ${CMAKE_INCLUDE_FLAG_C})
ENDIF(NOT CMAKE_INCLUDE_FLAG_CXX)
if(NOT CMAKE_INCLUDE_FLAG_CXX)
set(CMAKE_INCLUDE_FLAG_CXX ${CMAKE_INCLUDE_FLAG_C})
endif()
IF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
SET(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C})
ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
if(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
set(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C})
endif()
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
IF(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
ENDIF(NOT CMAKE_MODULE_EXISTS)
if(NOT CMAKE_MODULE_EXISTS)
set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
endif()
# repeat for modules
IF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
ENDIF(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})
endif()
IF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
ENDIF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
if(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
endif()
# Initialize CXX link type selection flags from C versions.
FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
IF(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS
foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
if(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS
${CMAKE_${type}_LINK_STATIC_C_FLAGS})
ENDIF(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
IF(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS
endif()
if(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS
${CMAKE_${type}_LINK_DYNAMIC_C_FLAGS})
ENDIF(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
ENDFOREACH(type)
endif()
endforeach()
# add the flags to the cache based
# on the initial values computed in the platform/*.cmake files
# use _INIT variables so that this only happens the first time
# 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
IF(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
SET(CMAKE_CXX_FLAGS_INIT)
ENDIF(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING
if(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
set(CMAKE_CXX_FLAGS_INIT)
endif()
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING
"Flags used by the compiler during all build types.")
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG_INIT}" CACHE STRING
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG_INIT}" CACHE STRING
"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.")
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).")
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.")
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
endif()
IF(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}"
if(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.")
MARK_AS_ADVANCED(CMAKE_CXX_STANDARD_LIBRARIES)
ENDIF(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
endif()
INCLUDE(CMakeCommonLanguageInclude)
include(CMakeCommonLanguageInclude)
# now define the following rules:
# CMAKE_CXX_CREATE_SHARED_LIBRARY
@ -252,41 +252,41 @@ INCLUDE(CMakeCommonLanguageInclude)
# create a shared C++ library
IF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
if(NOT 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>")
ENDIF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
endif()
# create a c++ shared module copy the shared library rule by default
IF(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
ENDIF(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
if(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
endif()
# Create a static archive incrementally for large object file counts.
# If CMAKE_CXX_CREATE_STATIC_LIBRARY is set it will override these.
IF(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE)
SET(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF()
IF(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND)
SET(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF()
IF(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH)
SET(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
ENDIF()
if(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE)
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND)
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH)
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
endif()
# compile a C++ file into an object file
IF(NOT CMAKE_CXX_COMPILE_OBJECT)
SET(CMAKE_CXX_COMPILE_OBJECT
if(NOT CMAKE_CXX_COMPILE_OBJECT)
set(CMAKE_CXX_COMPILE_OBJECT
"<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
ENDIF(NOT CMAKE_CXX_COMPILE_OBJECT)
endif()
IF(NOT CMAKE_CXX_LINK_EXECUTABLE)
SET(CMAKE_CXX_LINK_EXECUTABLE
if(NOT CMAKE_CXX_LINK_EXECUTABLE)
set(CMAKE_CXX_LINK_EXECUTABLE
"<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_VERBOSE_MAKEFILE
CMAKE_CXX_FLAGS
@ -295,5 +295,5 @@ CMAKE_CXX_FLAGS_RELWITHDEBINFO
CMAKE_CXX_FLAGS_MINSIZEREL
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.
#
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})
SET(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
FILE(WRITE ${showdir}/foo.h "\n")
FILE(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE showOut)
STRING(REPLACE main.c "" showOut1 ${showOut})
STRING(REPLACE "/" "\\" header1 ${showdir}/foo.h)
STRING(TOLOWER ${header1} header2)
STRING(REPLACE ${header2} "" showOut2 ${showOut1})
STRING(REPLACE "\n" "" showOut3 ${showOut2})
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()
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})
set(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
file(WRITE ${showdir}/foo.h "\n")
file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
execute_process(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE outLine)
string(REGEX MATCH "\n([^:]*:[^:]*:[ \t]*)" tmp "${outLine}")
set(localizedPrefix "${CMAKE_MATCH_1}")
set(SET_CMAKE_CMCLDEPS_EXECUTABLE "set(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
set(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "set(CMAKE_CL_SHOWINCLUDE_PREFIX \"${localizedPrefix}\")")
endif()

@ -16,72 +16,72 @@
# cache values that can be initialized in the platform-compiler.cmake file
# 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.")
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
# default build type is none
IF(NOT CMAKE_NO_BUILD_TYPE)
SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
if(NOT CMAKE_NO_BUILD_TYPE)
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.")
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.")
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.")
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.")
SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
"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.")
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
"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.")
SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
"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.")
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
"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.")
SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
"Flags used by the linker during Release with Debug Info builds.")
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
endif()
# 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.")
# 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.")
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.")
MARK_AS_ADVANCED(
mark_as_advanced(
CMAKE_BUILD_TOOL
CMAKE_VERBOSE_MAKEFILE

@ -25,27 +25,27 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CMAKE_DEPENDENT_OPTION option doc default depends force)
IF(${option}_ISSET MATCHES "^${option}_ISSET$")
SET(${option}_AVAILABLE 1)
FOREACH(d ${depends})
STRING(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
IF(${CMAKE_DEPENDENT_OPTION_DEP})
ELSE(${CMAKE_DEPENDENT_OPTION_DEP})
SET(${option}_AVAILABLE 0)
ENDIF(${CMAKE_DEPENDENT_OPTION_DEP})
ENDFOREACH(d)
IF(${option}_AVAILABLE)
OPTION(${option} "${doc}" "${default}")
SET(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
ELSE(${option}_AVAILABLE)
IF(${option} MATCHES "^${option}$")
ELSE(${option} MATCHES "^${option}$")
SET(${option} "${${option}}" CACHE INTERNAL "${doc}")
ENDIF(${option} MATCHES "^${option}$")
SET(${option} ${force})
ENDIF(${option}_AVAILABLE)
ELSE(${option}_ISSET MATCHES "^${option}_ISSET$")
SET(${option} "${${option}_ISSET}")
ENDIF(${option}_ISSET MATCHES "^${option}_ISSET$")
ENDMACRO(CMAKE_DEPENDENT_OPTION)
macro(CMAKE_DEPENDENT_OPTION option doc default depends force)
if(${option}_ISSET MATCHES "^${option}_ISSET$")
set(${option}_AVAILABLE 1)
foreach(d ${depends})
string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
if(${CMAKE_DEPENDENT_OPTION_DEP})
else()
set(${option}_AVAILABLE 0)
endif()
endforeach()
if(${option}_AVAILABLE)
option(${option} "${doc}" "${default}")
set(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
else()
if(${option} MATCHES "^${option}$")
else()
set(${option} "${${option}}" CACHE INTERNAL "${doc}")
endif()
set(${option} ${force})
endif()
else()
set(${option} "${${option}_ISSET}")
endif()
endmacro()

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

@ -14,52 +14,40 @@
# 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
IF($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}")
ENDIF($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
if($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}")
endif()
# finally list compilers to try
IF("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
IF(CMAKE_ASM_COMPILER_INIT)
SET(CMAKE_ASM_COMPILER_LIST ${CMAKE_ASM_COMPILER_INIT})
ELSE(CMAKE_ASM_COMPILER_INIT)
IF(CMAKE_C_COMPILER)
SET(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "The ASM compiler")
SET(CMAKE_ASM_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
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)
if("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
if(NOT CMAKE_ASM_COMPILER_INIT)
if(CMAKE_C_COMPILER)
set(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "The ASM compiler")
set(CMAKE_ASM_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
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()
# 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
${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ CC aCC cl bcc xlC)
ENDIF(CMAKE_C_COMPILER)
ENDIF(CMAKE_ASM_COMPILER_INIT)
ELSE("ASM${ASM_DIALECT}" STREQUAL "ASM") # some specific assembler "dialect"
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
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")
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_LIST
${_CMAKE_TOOLCHAIN_PREFIX}cc ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc
CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ aCC cl bcc xlC)
endif()
endif()
else() # some specific assembler "dialect"
if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
message(FATAL_ERROR "CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT must be preset !")
endif()
endif()
# Find the compiler.
IF (_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_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")
_cmake_find_compiler(ASM${ASM_DIALECT})
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
# (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
# if it is found, force it into the cache,
# 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)
IF(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH)
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)
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)
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
ENDIF(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH)
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_COMPILER)
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)
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)
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)
endif()
endif()
endif()
mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER)
IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
if (NOT _CMAKE_TOOLCHAIN_LOCATION)
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
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.
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_REGEX_GNU "(GNU assembler)|(GCC)|(Free Software Foundation)")
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_REGEX_GNU "(GNU assembler)|(GCC)|(Free Software Foundation)")
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_REGEX_HP "HP C")
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_REGEX_HP "HP C")
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_REGEX_Intel "(ICC)")
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_REGEX_Intel "(ICC)")
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_REGEX_SunPro "Sun C")
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_REGEX_SunPro "Sun C")
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_REGEX_XL "XL C")
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_REGEX_XL "XL C")
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_REGEX_MSVC "Microsoft")
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_REGEX_MSVC "Microsoft")
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_REGEX_TI_DSP "Texas Instruments")
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_REGEX_TI_DSP "Texas Instruments")
INCLUDE(CMakeDetermineCompilerId)
include(CMakeDetermineCompilerId)
CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})
ENDIF()
endif()
IF(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)
MESSAGE(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
ENDIF(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}")
else()
message(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
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
# "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-"
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME)
IF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
if (NOT _CMAKE_TOOLCHAIN_PREFIX)
get_filename_component(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME)
if (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif ()
endif ()
# Now try the C compiler regexp:
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
if (NOT _CMAKE_TOOLCHAIN_PREFIX)
if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif ()
endif ()
# Finally try the CXX compiler regexp:
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
if (NOT _CMAKE_TOOLCHAIN_PREFIX)
if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif ()
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)
MESSAGE(STATUS "Found assembler: ${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER)
MESSAGE(STATUS "Didn't find assembler")
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER)
if(CMAKE_ASM${ASM_DIALECT}_COMPILER)
message(STATUS "Found assembler: ${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
else()
message(STATUS "Didn't find assembler")
endif()
SET(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
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_ENV_VAR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR}")
set(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
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_ENV_VAR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR}")
# configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeASM${ASM_DIALECT}Compiler.cmake IMMEDIATE @ONLY)
configure_file(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
${CMAKE_PLATFORM_INFO_DIR}/CMakeASM${ASM_DIALECT}Compiler.cmake IMMEDIATE @ONLY)
SET(_CMAKE_ASM_COMPILER)
SET(_CMAKE_ASM_COMPILER_ARG1)
SET(_CMAKE_ASM_COMPILER_ENV_VAR)
set(_CMAKE_ASM_COMPILER)
set(_CMAKE_ASM_COMPILER_ARG1)
set(_CMAKE_ASM_COMPILER_ENV_VAR)

@ -14,14 +14,14 @@
# 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(CMAKE_CL_64)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml64)
ELSE(CMAKE_CL_64)
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml)
ENDIF(CMAKE_CL_64)
if(CMAKE_CL_64)
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml64)
else()
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml)
endif()
INCLUDE(CMakeDetermineASMCompiler)
SET(ASM_DIALECT)
include(CMakeDetermineASMCompiler)
set(ASM_DIALECT)

@ -14,14 +14,14 @@
# 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)
FIND_PROGRAM(CMAKE_ASM_NASM_COMPILER nasm
if(NOT CMAKE_ASM_NASM_COMPILER)
find_program(CMAKE_ASM_NASM_COMPILER nasm
"$ENV{ProgramFiles}/NASM")
ENDIF(NOT CMAKE_ASM_NASM_COMPILER)
endif()
# Load the generic DetermineASM compiler file with the DIALECT set properly:
SET(ASM_DIALECT "_NASM")
INCLUDE(CMakeDetermineASMCompiler)
SET(ASM_DIALECT)
set(ASM_DIALECT "_NASM")
include(CMakeDetermineASMCompiler)
set(ASM_DIALECT)

@ -31,114 +31,112 @@
# If not already set before, it also sets
# _CMAKE_TOOLCHAIN_PREFIX
IF(NOT CMAKE_C_COMPILER)
SET(CMAKE_C_COMPILER_INIT NOTFOUND)
# prefer the environment variable CC
IF($ENV{CC} MATCHES ".+")
GET_FILENAME_COMPONENT(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
IF(CMAKE_C_FLAGS_ENV_INIT)
SET(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
ENDIF(CMAKE_C_FLAGS_ENV_INIT)
IF(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
ENDIF(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
ENDIF($ENV{CC} MATCHES ".+")
# next try prefer the compiler specified by the generator
IF(CMAKE_GENERATOR_CC)
IF(NOT CMAKE_C_COMPILER_INIT)
SET(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC})
ENDIF(NOT CMAKE_C_COMPILER_INIT)
ENDIF(CMAKE_GENERATOR_CC)
# finally list compilers to try
IF(CMAKE_C_COMPILER_INIT)
SET(CMAKE_C_COMPILER_LIST ${CMAKE_C_COMPILER_INIT})
ELSE(CMAKE_C_COMPILER_INIT)
SET(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}gcc ${_CMAKE_TOOLCHAIN_PREFIX}cc cl bcc xlc)
ENDIF(CMAKE_C_COMPILER_INIT)
# Find the compiler.
IF (_CMAKE_USER_CXX_COMPILER_PATH)
FIND_PROGRAM(CMAKE_C_COMPILER NAMES ${CMAKE_C_COMPILER_LIST} PATHS ${_CMAKE_USER_CXX_COMPILER_PATH} DOC "C compiler" NO_DEFAULT_PATH)
ENDIF (_CMAKE_USER_CXX_COMPILER_PATH)
FIND_PROGRAM(CMAKE_C_COMPILER NAMES ${CMAKE_C_COMPILER_LIST} DOC "C compiler")
IF(CMAKE_C_COMPILER_INIT AND NOT CMAKE_C_COMPILER)
SET(CMAKE_C_COMPILER "${CMAKE_C_COMPILER_INIT}" CACHE FILEPATH "C compiler" FORCE)
ENDIF(CMAKE_C_COMPILER_INIT AND NOT CMAKE_C_COMPILER)
ELSE(NOT CMAKE_C_COMPILER)
# 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
# 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
LIST(LENGTH CMAKE_C_COMPILER _CMAKE_C_COMPILER_LIST_LENGTH)
IF("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
LIST(GET CMAKE_C_COMPILER 1 CMAKE_C_COMPILER_ARG1)
LIST(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER)
ENDIF("${_CMAKE_C_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_C_COMPILER_PATH "${CMAKE_C_COMPILER}" PATH)
IF(NOT _CMAKE_USER_C_COMPILER_PATH)
FIND_PROGRAM(CMAKE_C_COMPILER_WITH_PATH NAMES ${CMAKE_C_COMPILER})
MARK_AS_ADVANCED(CMAKE_C_COMPILER_WITH_PATH)
IF(CMAKE_C_COMPILER_WITH_PATH)
SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE)
ENDIF(CMAKE_C_COMPILER_WITH_PATH)
ENDIF(NOT _CMAKE_USER_C_COMPILER_PATH)
ENDIF(NOT CMAKE_C_COMPILER)
MARK_AS_ADVANCED(CMAKE_C_COMPILER)
IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
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)
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
# Load system-specific compiler preferences for this language.
include(Platform/${CMAKE_SYSTEM_NAME}-C OPTIONAL)
if(NOT CMAKE_C_COMPILER_NAMES)
set(CMAKE_C_COMPILER_NAMES cc)
endif()
if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
set(CMAKE_C_COMPILER_XCODE_TYPE sourcecode.c.c)
else()
if(NOT CMAKE_C_COMPILER)
set(CMAKE_C_COMPILER_INIT NOTFOUND)
# prefer the environment variable CC
if($ENV{CC} MATCHES ".+")
get_filename_component(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
if(CMAKE_C_FLAGS_ENV_INIT)
set(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
endif()
if(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
endif()
endif()
# next try prefer the compiler specified by the generator
if(CMAKE_GENERATOR_CC)
if(NOT CMAKE_C_COMPILER_INIT)
set(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC})
endif()
endif()
# finally list compilers to try
if(NOT CMAKE_C_COMPILER_INIT)
set(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}cc ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc clang)
endif()
_cmake_find_compiler(C)
else()
# 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
# 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
list(LENGTH CMAKE_C_COMPILER _CMAKE_C_COMPILER_LIST_LENGTH)
if("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
list(GET CMAKE_C_COMPILER 1 CMAKE_C_COMPILER_ARG1)
list(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER)
endif()
# 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_C_COMPILER_PATH "${CMAKE_C_COMPILER}" PATH)
if(NOT _CMAKE_USER_C_COMPILER_PATH)
find_program(CMAKE_C_COMPILER_WITH_PATH NAMES ${CMAKE_C_COMPILER})
mark_as_advanced(CMAKE_C_COMPILER_WITH_PATH)
if(CMAKE_C_COMPILER_WITH_PATH)
set(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE)
endif()
endif()
endif()
mark_as_advanced(CMAKE_C_COMPILER)
# Each entry in this list is a set of extra flags to try
# adding to the compile line to see if it helps produce
# 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.
"-c"
# Try enabling ANSI mode on HP.
"-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.
SET(CMAKE_C_COMPILER_ID)
FILE(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
set(CMAKE_C_COMPILER_ID)
file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
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)
# Set old compiler and platform id variables.
IF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_COMPILER_IS_GNUCC 1)
ENDIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
IF("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
SET(CMAKE_COMPILER_IS_MINGW 1)
ELSEIF("${CMAKE_C_PLATFORM_ID}" MATCHES "Cygwin")
SET(CMAKE_COMPILER_IS_CYGWIN 1)
ENDIF("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
ENDIF(NOT CMAKE_C_COMPILER_ID_RUN)
if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_COMPILER_IS_GNUCC 1)
endif()
if("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
set(CMAKE_COMPILER_IS_MINGW 1)
elseif("${CMAKE_C_PLATFORM_ID}" MATCHES "Cygwin")
set(CMAKE_COMPILER_IS_CYGWIN 1)
endif()
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
# 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
# "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
if (CMAKE_CROSSCOMPILING
AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME)
IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME)
if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[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 ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
ENDIF (CMAKE_CROSSCOMPILING
AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
INCLUDE(CMakeFindBinUtils)
IF(MSVC_C_ARCHITECTURE_ID)
SET(SET_MSVC_C_ARCHITECTURE_ID
"SET(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
ENDIF(MSVC_C_ARCHITECTURE_ID)
if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif ()
endif ()
include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
include(CMakeFindBinUtils)
if(MSVC_C_ARCHITECTURE_ID)
set(SET_MSVC_C_ARCHITECTURE_ID
"set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
endif()
# configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
"${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake"
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
)
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
# _CMAKE_TOOLCHAIN_PREFIX
IF(NOT CMAKE_CXX_COMPILER)
SET(CMAKE_CXX_COMPILER_INIT NOTFOUND)
# prefer the environment variable CXX
IF($ENV{CXX} MATCHES ".+")
GET_FILENAME_COMPONENT(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT)
IF(CMAKE_CXX_FLAGS_ENV_INIT)
SET(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
ENDIF(CMAKE_CXX_FLAGS_ENV_INIT)
IF(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}.\n${CMAKE_CXX_COMPILER_INIT}")
ENDIF(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
ENDIF($ENV{CXX} MATCHES ".+")
# next prefer the generator specified compiler
IF(CMAKE_GENERATOR_CXX)
IF(NOT CMAKE_CXX_COMPILER_INIT)
SET(CMAKE_CXX_COMPILER_INIT ${CMAKE_GENERATOR_CXX})
ENDIF(NOT CMAKE_CXX_COMPILER_INIT)
ENDIF(CMAKE_GENERATOR_CXX)
# finally list compilers to try
IF(CMAKE_CXX_COMPILER_INIT)
SET(CMAKE_CXX_COMPILER_LIST ${CMAKE_CXX_COMPILER_INIT})
ELSE(CMAKE_CXX_COMPILER_INIT)
SET(CMAKE_CXX_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ CC aCC cl bcc xlC)
ENDIF(CMAKE_CXX_COMPILER_INIT)
# Find the compiler.
IF (_CMAKE_USER_C_COMPILER_PATH)
FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES ${CMAKE_CXX_COMPILER_LIST} PATHS ${_CMAKE_USER_C_COMPILER_PATH} DOC "C++ compiler" NO_DEFAULT_PATH)
ENDIF (_CMAKE_USER_C_COMPILER_PATH)
FIND_PROGRAM(CMAKE_CXX_COMPILER NAMES ${CMAKE_CXX_COMPILER_LIST} DOC "C++ compiler")
IF(CMAKE_CXX_COMPILER_INIT AND NOT CMAKE_CXX_COMPILER)
SET(CMAKE_CXX_COMPILER "${CMAKE_CXX_COMPILER_INIT}" CACHE FILEPATH "C++ compiler" FORCE)
ENDIF(CMAKE_CXX_COMPILER_INIT AND NOT CMAKE_CXX_COMPILER)
ELSE(NOT CMAKE_CXX_COMPILER)
# we only get here if CMAKE_CXX_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
#
# if CMAKE_CXX_COMPILER is a list of length 2, use the first item as
# CMAKE_CXX_COMPILER and the 2nd one as CMAKE_CXX_COMPILER_ARG1
LIST(LENGTH CMAKE_CXX_COMPILER _CMAKE_CXX_COMPILER_LIST_LENGTH)
IF("${_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)
ENDIF("${_CMAKE_CXX_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 CXX compiler already had a path, reuse it for searching the C compiler
GET_FILENAME_COMPONENT(_CMAKE_USER_CXX_COMPILER_PATH "${CMAKE_CXX_COMPILER}" PATH)
IF(NOT _CMAKE_USER_CXX_COMPILER_PATH)
FIND_PROGRAM(CMAKE_CXX_COMPILER_WITH_PATH NAMES ${CMAKE_CXX_COMPILER})
MARK_AS_ADVANCED(CMAKE_CXX_COMPILER_WITH_PATH)
IF(CMAKE_CXX_COMPILER_WITH_PATH)
SET(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE)
ENDIF(CMAKE_CXX_COMPILER_WITH_PATH)
ENDIF(NOT _CMAKE_USER_CXX_COMPILER_PATH)
ENDIF(NOT CMAKE_CXX_COMPILER)
MARK_AS_ADVANCED(CMAKE_CXX_COMPILER)
IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
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)
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
# Load system-specific compiler preferences for this language.
include(Platform/${CMAKE_SYSTEM_NAME}-CXX OPTIONAL)
if(NOT CMAKE_CXX_COMPILER_NAMES)
set(CMAKE_CXX_COMPILER_NAMES CC)
endif()
if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
set(CMAKE_CXX_COMPILER_XCODE_TYPE sourcecode.cpp.cpp)
else()
if(NOT CMAKE_CXX_COMPILER)
set(CMAKE_CXX_COMPILER_INIT NOTFOUND)
# prefer the environment variable CXX
if($ENV{CXX} MATCHES ".+")
get_filename_component(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT)
if(CMAKE_CXX_FLAGS_ENV_INIT)
set(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
endif()
if(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
message(FATAL_ERROR "Could not find compiler set in environment variable CXX:\n$ENV{CXX}.\n${CMAKE_CXX_COMPILER_INIT}")
endif()
endif()
# next prefer the generator specified compiler
if(CMAKE_GENERATOR_CXX)
if(NOT CMAKE_CXX_COMPILER_INIT)
set(CMAKE_CXX_COMPILER_INIT ${CMAKE_GENERATOR_CXX})
endif()
endif()
# finally list compilers to try
if(NOT CMAKE_CXX_COMPILER_INIT)
set(CMAKE_CXX_COMPILER_LIST CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ aCC cl bcc xlC clang++)
endif()
_cmake_find_compiler(CXX)
else()
# we only get here if CMAKE_CXX_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
#
# if CMAKE_CXX_COMPILER is a list of length 2, use the first item as
# CMAKE_CXX_COMPILER and the 2nd one as CMAKE_CXX_COMPILER_ARG1
list(LENGTH CMAKE_CXX_COMPILER _CMAKE_CXX_COMPILER_LIST_LENGTH)
if("${_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)
endif()
# 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 CXX compiler already had a path, reuse it for searching the C compiler
get_filename_component(_CMAKE_USER_CXX_COMPILER_PATH "${CMAKE_CXX_COMPILER}" PATH)
if(NOT _CMAKE_USER_CXX_COMPILER_PATH)
find_program(CMAKE_CXX_COMPILER_WITH_PATH NAMES ${CMAKE_CXX_COMPILER})
mark_as_advanced(CMAKE_CXX_COMPILER_WITH_PATH)
if(CMAKE_CXX_COMPILER_WITH_PATH)
set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE)
endif()
endif()
endif()
mark_as_advanced(CMAKE_CXX_COMPILER)
# Each entry in this list is a set of extra flags to try
# adding to the compile line to see if it helps produce
# 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.
"-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.
SET(CMAKE_CXX_COMPILER_ID)
FILE(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
set(CMAKE_CXX_COMPILER_ID)
file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
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)
# Set old compiler and platform id variables.
IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_COMPILER_IS_GNUCXX 1)
ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
IF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
SET(CMAKE_COMPILER_IS_MINGW 1)
ELSEIF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "Cygwin")
SET(CMAKE_COMPILER_IS_CYGWIN 1)
ENDIF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
ENDIF(NOT CMAKE_CXX_COMPILER_ID_RUN)
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_COMPILER_IS_GNUCXX 1)
endif()
if("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
set(CMAKE_COMPILER_IS_MINGW 1)
elseif("${CMAKE_CXX_PLATFORM_ID}" MATCHES "Cygwin")
set(CMAKE_COMPILER_IS_CYGWIN 1)
endif()
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
# 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
# "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
if (CMAKE_CROSSCOMPILING
AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[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 ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
ENDIF (CMAKE_CROSSCOMPILING
AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
INCLUDE(CMakeFindBinUtils)
IF(MSVC_CXX_ARCHITECTURE_ID)
SET(SET_MSVC_CXX_ARCHITECTURE_ID
"SET(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
ENDIF(MSVC_CXX_ARCHITECTURE_ID)
if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif ()
endif ()
include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
include(CMakeFindBinUtils)
if(MSVC_CXX_ARCHITECTURE_ID)
set(SET_MSVC_CXX_ARCHITECTURE_ID
"set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
endif()
# configure all variables set in this file
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake
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
)
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
# code.
INCLUDE(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
IF(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED)
MESSAGE(STATUS "Detecting ${lang} compiler ABI info")
function(CMAKE_DETERMINE_COMPILER_ABI lang src)
if(NOT DEFINED CMAKE_${lang}_ABI_COMPILED)
message(STATUS "Detecting ${lang} compiler ABI info")
# Compile the ABI identification source.
SET(BIN "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDetermineCompilerABI_${lang}.bin")
SET(CMAKE_FLAGS )
IF(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
SET(CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
ENDIF()
TRY_COMPILE(CMAKE_DETERMINE_${lang}_ABI_COMPILED
set(BIN "${CMAKE_PLATFORM_INFO_DIR}/CMakeDetermineCompilerABI_${lang}.bin")
set(CMAKE_FLAGS )
if(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
set(CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
endif()
try_compile(CMAKE_${lang}_ABI_COMPILED
${CMAKE_BINARY_DIR} ${src}
CMAKE_FLAGS "${CMAKE_FLAGS}"
"-DCMAKE_${lang}_STANDARD_LIBRARIES="
@ -39,93 +39,96 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
OUTPUT_VARIABLE OUTPUT
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.
IF(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
MESSAGE(STATUS "Detecting ${lang} compiler ABI info - done")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
if(CMAKE_${lang}_ABI_COMPILED)
message(STATUS "Detecting ${lang} compiler ABI info - done")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n")
FILE(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[^[]*\\[")
FOREACH(info ${ABI_STRINGS})
IF("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
STRING(REGEX REPLACE ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*" "\\1" ABI_SIZEOF_DPTR "${info}")
ENDIF("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
IF("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
STRING(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}")
ENDIF("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
ENDFOREACH(info)
file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[^[]*\\[")
foreach(info ${ABI_STRINGS})
if("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
string(REGEX REPLACE ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*" "\\1" ABI_SIZEOF_DPTR "${info}")
endif()
if("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
string(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}")
endif()
endforeach()
IF(ABI_SIZEOF_DPTR)
SET(CMAKE_${lang}_SIZEOF_DATA_PTR "${ABI_SIZEOF_DPTR}" PARENT_SCOPE)
ELSEIF(CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT)
SET(CMAKE_${lang}_SIZEOF_DATA_PTR "${CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT}" PARENT_SCOPE)
ENDIF(ABI_SIZEOF_DPTR)
if(ABI_SIZEOF_DPTR)
set(CMAKE_${lang}_SIZEOF_DATA_PTR "${ABI_SIZEOF_DPTR}" PARENT_SCOPE)
elseif(CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT)
set(CMAKE_${lang}_SIZEOF_DATA_PTR "${CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT}" PARENT_SCOPE)
endif()
IF(ABI_NAME)
SET(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
ENDIF(ABI_NAME)
if(ABI_NAME)
set(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
endif()
# Parse implicit linker information for this language, if available.
SET(implicit_dirs "")
SET(implicit_libs "")
SET(MULTI_ARCH FALSE)
IF(DEFINED CMAKE_OSX_ARCHITECTURES)
IF( "${CMAKE_OSX_ARCHITECTURES}" MATCHES ";" )
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
set(implicit_dirs "")
set(implicit_libs "")
set(implicit_fwks "")
if(CMAKE_${lang}_VERBOSE_FLAG)
CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs implicit_fwks log
"${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")
ENDIF()
endif()
# for VS IDE Intel Fortran we have to figure out the
# implicit link path for the fortran run time using
# a try-compile
IF("${lang}" MATCHES "Fortran"
if("${lang}" MATCHES "Fortran"
AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
SET(_desc "Determine Intel Fortran Compiler Implicit Link Path")
MESSAGE(STATUS "${_desc}")
set(_desc "Determine Intel Fortran Compiler Implicit Link Path")
message(STATUS "${_desc}")
# 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_ROOT}/Modules/IntelVSImplicitPath
IntelFortranImplicit
CMAKE_FLAGS
"-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}"
OUTPUT_VARIABLE _output)
FILE(WRITE
file(WRITE
"${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.txt"
"${_output}")
INCLUDE(${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.cmake OPTIONAL)
SET(_desc "Determine Intel Fortran Compiler Implicit Link Path -- done")
MESSAGE(STATUS "${_desc}")
ENDIF()
include(${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.cmake OPTIONAL)
set(_desc "Determine Intel Fortran Compiler Implicit Link Path -- done")
message(STATUS "${_desc}")
endif()
SET(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "${implicit_libs}" PARENT_SCOPE)
SET(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "${implicit_dirs}" PARENT_SCOPE)
# Implicit link libraries cannot be used explicitly for multiple
# 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.
IF(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
FOREACH(dir ${implicit_dirs})
IF("${dir}" MATCHES "/lib/${CMAKE_LIBRARY_ARCHITECTURE_REGEX}$")
GET_FILENAME_COMPONENT(arch "${dir}" NAME)
SET(CMAKE_${lang}_LIBRARY_ARCHITECTURE "${arch}" PARENT_SCOPE)
BREAK()
ENDIF()
ENDFOREACH()
ENDIF()
if(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
foreach(dir ${implicit_dirs})
if("${dir}" MATCHES "/lib/${CMAKE_LIBRARY_ARCHITECTURE_REGEX}$")
get_filename_component(arch "${dir}" NAME)
set(CMAKE_${lang}_LIBRARY_ARCHITECTURE "${arch}" PARENT_SCOPE)
break()
endif()
endforeach()
endif()
ELSE(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
MESSAGE(STATUS "Detecting ${lang} compiler ABI info - failed")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
else()
message(STATUS "Detecting ${lang} compiler ABI info - failed")
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")
ENDIF(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
ENDIF(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ABI)
endif()
endif()
endfunction()

@ -16,116 +16,240 @@
# used internally by CMake and should not be included by user code.
# 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.
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(STRIP "${CMAKE_${lang}_COMPILER_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.
IF(CMAKE_${lang}_FLAGS)
SET(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS})
ELSE(CMAKE_${lang}_FLAGS)
SET(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}})
ENDIF(CMAKE_${lang}_FLAGS)
STRING(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
if(CMAKE_${lang}_FLAGS)
set(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS})
else()
set(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}})
endif()
string(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
# 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
# of helper flags. Stop when the compiler is identified.
FOREACH(flags "" ${CMAKE_${lang}_COMPILER_ID_TEST_FLAGS})
IF(NOT CMAKE_${lang}_COMPILER_ID)
foreach(flags "" ${CMAKE_${lang}_COMPILER_ID_TEST_FLAGS})
if(NOT CMAKE_${lang}_COMPILER_ID)
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}")
ENDFOREACH(file)
ENDIF(NOT CMAKE_${lang}_COMPILER_ID)
ENDFOREACH(flags)
endforeach()
endif()
endforeach()
# 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})
ENDIF()
endif()
# if the format is unknown after all files have been checked, put "Unknown" in the cache
IF(NOT CMAKE_EXECUTABLE_FORMAT)
SET(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
ENDIF(NOT CMAKE_EXECUTABLE_FORMAT)
if(NOT CMAKE_EXECUTABLE_FORMAT)
set(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
endif()
# Display the final identification result.
IF(CMAKE_${lang}_COMPILER_ID)
IF(CMAKE_${lang}_COMPILER_VERSION)
SET(_version " ${CMAKE_${lang}_COMPILER_VERSION}")
ELSE()
SET(_version "")
ENDIF()
MESSAGE(STATUS "The ${lang} compiler identification is "
if(CMAKE_${lang}_COMPILER_ID)
if(CMAKE_${lang}_COMPILER_VERSION)
set(_version " ${CMAKE_${lang}_COMPILER_VERSION}")
else()
set(_version "")
endif()
message(STATUS "The ${lang} compiler identification is "
"${CMAKE_${lang}_COMPILER_ID}${_version}")
ELSE(CMAKE_${lang}_COMPILER_ID)
MESSAGE(STATUS "The ${lang} compiler identification is unknown")
ENDIF(CMAKE_${lang}_COMPILER_ID)
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}"
else()
message(STATUS "The ${lang} compiler identification is unknown")
endif()
# Check if compiler id detection gave us the compiler tool.
if(NOT CMAKE_${lang}_COMPILER)
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)
SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID)
set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
endfunction()
#-----------------------------------------------------------------------------
# Function to write the compiler id source file.
FUNCTION(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src)
FILE(READ ${CMAKE_ROOT}/Modules/${src}.in ID_CONTENT_IN)
STRING(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY)
FILE(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}")
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_WRITE)
function(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src)
file(READ ${CMAKE_ROOT}/Modules/${src}.in ID_CONTENT_IN)
string(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY)
file(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}")
endfunction()
#-----------------------------------------------------------------------------
# Function to build the compiler id source file and look for output
# files.
FUNCTION(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
function(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
# Create a clean working directory.
FILE(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
FILE(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
file(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
file(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
CMAKE_DETERMINE_COMPILER_ID_WRITE("${lang}" "${src}")
# Construct a description of this test case.
SET(COMPILER_DESCRIPTION
set(COMPILER_DESCRIPTION
"Compiler: ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_ARG1}
Build flags: ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
Id flags: ${testflags}
")
# Compile the compiler identification source.
IF(COMMAND EXECUTE_PROCESS)
EXECUTE_PROCESS(
COMMAND ${CMAKE_${lang}_COMPILER}
${CMAKE_${lang}_COMPILER_ID_ARG1}
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
${testflags}
"${src}"
if("${CMAKE_GENERATOR}" MATCHES "Visual Studio ([0-9]+)")
set(vs_version ${CMAKE_MATCH_1})
set(id_arch ${CMAKE_VS_PLATFORM_NAME})
set(id_lang "${lang}")
set(id_cl cl.exe)
if(NOT id_arch)
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}
OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
)
ELSE(COMMAND EXECUTE_PROCESS)
EXEC_PROGRAM(
${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_DIR}
ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1}
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
${testflags}
\"${src}\"
# Match the compiler location line printed out.
if("${CMAKE_${lang}_COMPILER_ID_OUTPUT}" MATCHES "CMAKE_${lang}_COMPILER=([^%\r\n]+)[\r\n]")
set(_comp "${CMAKE_MATCH_1}")
if(EXISTS "${_comp}")
file(TO_CMAKE_PATH "${_comp}" _comp)
set(CMAKE_${lang}_COMPILER_ID_TOOL "${_comp}" PARENT_SCOPE)
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
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.
IF(CMAKE_${lang}_COMPILER_ID_RESULT)
if(CMAKE_${lang}_COMPILER_ID_RESULT)
# Compilation failed.
SET(MSG
set(MSG
"Compiling the ${lang} compiler identification source file \"${src}\" failed.
${COMPILER_DESCRIPTION}
The output was:
@ -133,16 +257,16 @@ ${CMAKE_${lang}_COMPILER_ID_RESULT}
${CMAKE_${lang}_COMPILER_ID_OUTPUT}
")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}")
#IF(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
# MESSAGE(FATAL_ERROR "${MSG}")
#ENDIF(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}")
#if(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
# message(FATAL_ERROR "${MSG}")
#endif()
# No output files should be inspected.
SET(COMPILER_${lang}_PRODUCED_FILES)
ELSE(CMAKE_${lang}_COMPILER_ID_RESULT)
set(COMPILER_${lang}_PRODUCED_FILES)
else()
# 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.
${COMPILER_DESCRIPTION}
The output was:
@ -153,120 +277,124 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
# Find the executable produced by the compiler, try all files in the
# binary dir.
FILE(GLOB COMPILER_${lang}_PRODUCED_FILES
file(GLOB files
RELATIVE ${CMAKE_${lang}_COMPILER_ID_DIR}
${CMAKE_${lang}_COMPILER_ID_DIR}/*)
LIST(REMOVE_ITEM COMPILER_${lang}_PRODUCED_FILES "${src}")
FOREACH(file ${COMPILER_${lang}_PRODUCED_FILES})
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Compilation of the ${lang} compiler identification source \""
"${src}\" produced \"${file}\"\n\n")
ENDFOREACH(file)
IF(NOT COMPILER_${lang}_PRODUCED_FILES)
list(REMOVE_ITEM files "${src}")
set(COMPILER_${lang}_PRODUCED_FILES "")
foreach(file ${files})
if(NOT IS_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR}/${file})
list(APPEND COMPILER_${lang}_PRODUCED_FILES ${file})
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Compilation of the ${lang} compiler identification source \""
"${src}\" produced \"${file}\"\n\n")
endif()
endforeach()
if(NOT COMPILER_${lang}_PRODUCED_FILES)
# 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 \""
"${src}\" did not produce an executable in \""
"${CMAKE_${lang}_COMPILER_ID_DIR}\".\n\n")
ENDIF(NOT COMPILER_${lang}_PRODUCED_FILES)
ENDIF(CMAKE_${lang}_COMPILER_ID_RESULT)
endif()
endif()
# Return the files produced by the compilation.
SET(COMPILER_${lang}_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
set(COMPILER_${lang}_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE)
endfunction()
#-----------------------------------------------------------------------------
# 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.
IF(NOT CMAKE_${lang}_COMPILER_ID)
if(NOT CMAKE_${lang}_COMPILER_ID)
# Read the compiler identification string from the executable file.
SET(COMPILER_ID)
SET(COMPILER_VERSION)
SET(PLATFORM_ID)
FILE(STRINGS ${file}
set(COMPILER_ID)
set(COMPILER_VERSION)
set(PLATFORM_ID)
file(STRINGS ${file}
CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 4 REGEX "INFO:")
SET(HAVE_COMPILER_TWICE 0)
FOREACH(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
IF("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
IF(COMPILER_ID)
SET(COMPILER_ID_TWICE 1)
ENDIF(COMPILER_ID)
STRING(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1"
set(HAVE_COMPILER_TWICE 0)
foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
if("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
if(COMPILER_ID)
set(COMPILER_ID_TWICE 1)
endif()
string(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1"
COMPILER_ID "${info}")
ENDIF("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
IF("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
STRING(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1"
endif()
if("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
string(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1"
PLATFORM_ID "${info}")
ENDIF("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
IF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
STRING(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
endif()
if("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
string(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
ARCHITECTURE_ID "${info}")
ENDIF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
IF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
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}")
ENDIF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
ENDFOREACH(info)
endif()
if("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
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}")
endif()
endforeach()
# Check if a valid compiler and platform were found.
IF(COMPILER_ID AND NOT COMPILER_ID_TWICE)
SET(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}")
SET(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}")
SET(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
SET(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}")
ENDIF(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}_PLATFORM_ID "${PLATFORM_ID}")
set(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
set(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}")
endif()
# Check the compiler identification string.
IF(CMAKE_${lang}_COMPILER_ID)
if(CMAKE_${lang}_COMPILER_ID)
# 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 \""
"${file}\"\n\n")
ELSE(CMAKE_${lang}_COMPILER_ID)
else()
# 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 \""
"${file}\"\n\n")
ENDIF(CMAKE_${lang}_COMPILER_ID)
ENDIF(NOT CMAKE_${lang}_COMPILER_ID)
endif()
endif()
# try to figure out the executable format: ELF, COFF, Mach-O
IF(NOT CMAKE_EXECUTABLE_FORMAT)
FILE(READ ${file} CMAKE_EXECUTABLE_MAGIC LIMIT 4 HEX)
if(NOT CMAKE_EXECUTABLE_FORMAT)
file(READ ${file} CMAKE_EXECUTABLE_MAGIC LIMIT 4 HEX)
# ELF files start with 0x7f"ELF"
IF("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
SET(CMAKE_EXECUTABLE_FORMAT "ELF" CACHE INTERNAL "Executable file format")
ENDIF("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
if("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
set(CMAKE_EXECUTABLE_FORMAT "ELF" CACHE INTERNAL "Executable file format")
endif()
# # COFF (.exe) files start with "MZ"
# IF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
# SET(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format")
# ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
# set(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format")
# endif()
#
# # 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")
# SET(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
# ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
# IF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
# SET(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
# ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
ENDIF(NOT CMAKE_EXECUTABLE_FORMAT)
IF(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)
SET(CMAKE_EXECUTABLE_FORMAT)
ENDIF()
# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
# set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
# endif()
# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
# set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
# endif()
endif()
if(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)
set(CMAKE_EXECUTABLE_FORMAT)
endif()
# Return the information extracted.
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}"
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)
SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
SET(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
set(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
endfunction()
#-----------------------------------------------------------------------------
# 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")
# We try running the compiler with the flag for each vendor and
# 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()
# 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.
SET(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang})
FILE(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
FILE(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
ENDIF(NOT CMAKE_${lang}_COMPILER_ID_DIR)
set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_PLATFORM_INFO_DIR}/CompilerId${lang})
file(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
file(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
endif()
FOREACH(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS})
SET(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}})
SET(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}})
EXECUTE_PROCESS(
foreach(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS})
set(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}})
set(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}})
execute_process(
COMMAND ${CMAKE_${lang}_COMPILER}
${CMAKE_${lang}_COMPILER_ID_ARG1}
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
@ -302,22 +430,22 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
TIMEOUT 10
)
IF("${output}" MATCHES "${regex}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
if("${output}" MATCHES "${regex}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
"matched \"${regex}\":\n${output}")
SET(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE)
BREAK()
ELSE()
IF("${result}" MATCHES "timeout")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
set(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE)
break()
else()
if("${result}" MATCHES "timeout")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
"terminated after 10 s due to timeout.")
ELSE()
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
else()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
"did not match \"${regex}\":\n${output}")
ENDIF()
ENDIF()
ENDFOREACH()
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR)
endif()
endif()
endforeach()
endfunction()

@ -19,210 +19,211 @@
# the cmake variable CMAKE_GENERATOR_FC which can be defined by a generator
# as a default compiler
IF(NOT CMAKE_Fortran_COMPILER)
# prefer the environment variable CC
IF($ENV{FC} MATCHES ".+")
GET_FILENAME_COMPONENT(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
IF(CMAKE_Fortran_FLAGS_ENV_INIT)
SET(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler")
ENDIF(CMAKE_Fortran_FLAGS_ENV_INIT)
IF(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
ELSE(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.")
ENDIF(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
ENDIF($ENV{FC} MATCHES ".+")
# next try prefer the compiler specified by the generator
IF(CMAKE_GENERATOR_FC)
IF(NOT CMAKE_Fortran_COMPILER_INIT)
SET(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
ENDIF(NOT CMAKE_Fortran_COMPILER_INIT)
ENDIF(CMAKE_GENERATOR_FC)
# finally list compilers to try
IF(CMAKE_Fortran_COMPILER_INIT)
SET(CMAKE_Fortran_COMPILER_LIST ${CMAKE_Fortran_COMPILER_INIT})
ELSE(CMAKE_Fortran_COMPILER_INIT)
# Known compilers:
# f77/f90/f95: generic compiler names
# g77: GNU Fortran 77 compiler
# gfortran: putative GNU Fortran 95+ compiler (in progress)
# fort77: native F77 compiler under HP-UX (and some older Crays)
# frt: Fujitsu F77 compiler
# pathf90/pathf95/pathf2003: PathScale Fortran compiler
# pgf77/pgf90/pgf95/pgfortran: Portland Group F77/F90/F95 compilers
# xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers
# lf95: Lahey-Fujitsu F95 compiler
# fl32: Microsoft Fortran 77 "PowerStation" compiler
# 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
# ifc: Intel Fortran 95 compiler for Linux/x86
# efc: Intel Fortran 95 compiler for IA64
#
# The order is 95 or newer compilers first, then 90,
# then 77 or older compilers, gnu is always last in the group,
# so if you paid for a compiler it is picked by default.
SET(CMAKE_Fortran_COMPILER_LIST
ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 pgfortran lf95 xlf95
fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77
frt pgf77 xlf fl32 af77 g77 f77
)
# Vendor-specific compiler names.
SET(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77)
SET(_Fortran_COMPILER_NAMES_Intel ifort ifc efc)
SET(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77)
SET(_Fortran_COMPILER_NAMES_PGI pgf95 pgfortran pgf90 pgf77)
SET(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90)
SET(_Fortran_COMPILER_NAMES_XL xlf)
SET(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf)
# Prefer vendors matching the C and C++ compilers.
SET(CMAKE_Fortran_COMPILER_LIST
${_Fortran_COMPILER_NAMES_${CMAKE_C_COMPILER_ID}}
${_Fortran_COMPILER_NAMES_${CMAKE_CXX_COMPILER_ID}}
${CMAKE_Fortran_COMPILER_LIST})
LIST(REMOVE_DUPLICATES CMAKE_Fortran_COMPILER_LIST)
ENDIF(CMAKE_Fortran_COMPILER_INIT)
# Look for directories containing the C and C++ compilers.
SET(_Fortran_COMPILER_HINTS)
FOREACH(lang C CXX)
IF(CMAKE_${lang}_COMPILER AND IS_ABSOLUTE "${CMAKE_${lang}_COMPILER}")
GET_FILENAME_COMPONENT(_hint "${CMAKE_${lang}_COMPILER}" PATH)
IF(IS_DIRECTORY "${_hint}")
LIST(APPEND _Fortran_COMPILER_HINTS "${_hint}")
ENDIF()
SET(_hint)
ENDIF()
ENDFOREACH()
# Find the compiler.
IF(_Fortran_COMPILER_HINTS)
# Prefer directories containing C and C++ compilers.
LIST(REMOVE_DUPLICATES _Fortran_COMPILER_HINTS)
FIND_PROGRAM(CMAKE_Fortran_COMPILER
NAMES ${CMAKE_Fortran_COMPILER_LIST}
PATHS ${_Fortran_COMPILER_HINTS}
NO_DEFAULT_PATH
DOC "Fortran compiler")
ENDIF()
FIND_PROGRAM(CMAKE_Fortran_COMPILER NAMES ${CMAKE_Fortran_COMPILER_LIST} DOC "Fortran compiler")
IF(CMAKE_Fortran_COMPILER_INIT AND NOT CMAKE_Fortran_COMPILER)
SET(CMAKE_Fortran_COMPILER "${CMAKE_Fortran_COMPILER_INIT}" CACHE FILEPATH "Fortran compiler" FORCE)
ENDIF(CMAKE_Fortran_COMPILER_INIT AND NOT CMAKE_Fortran_COMPILER)
ELSE(NOT CMAKE_Fortran_COMPILER)
# we only get here if CMAKE_Fortran_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
# 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
LIST(LENGTH CMAKE_Fortran_COMPILER _CMAKE_Fortran_COMPILER_LIST_LENGTH)
IF("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
LIST(GET CMAKE_Fortran_COMPILER 1 CMAKE_Fortran_COMPILER_ARG1)
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)
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
include(Platform/${CMAKE_SYSTEM_NAME}-Fortran OPTIONAL)
if(NOT CMAKE_Fortran_COMPILER_NAMES)
set(CMAKE_Fortran_COMPILER_NAMES f95)
endif()
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")
set(CMAKE_Fortran_COMPILER "${CMAKE_GENERATOR_FC}")
elseif("${CMAKE_GENERATOR}" MATCHES "Xcode")
set(CMAKE_Fortran_COMPILER_XCODE_TYPE sourcecode.fortran.f90)
else()
if(NOT CMAKE_Fortran_COMPILER)
# prefer the environment variable CC
if($ENV{FC} MATCHES ".+")
get_filename_component(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
if(CMAKE_Fortran_FLAGS_ENV_INIT)
set(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler")
endif()
if(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
else()
message(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.")
endif()
endif()
# next try prefer the compiler specified by the generator
if(CMAKE_GENERATOR_FC)
if(NOT CMAKE_Fortran_COMPILER_INIT)
set(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
endif()
endif()
# finally list compilers to try
if(NOT CMAKE_Fortran_COMPILER_INIT)
# Known compilers:
# f77/f90/f95: generic compiler names
# g77: GNU Fortran 77 compiler
# gfortran: putative GNU Fortran 95+ compiler (in progress)
# fort77: native F77 compiler under HP-UX (and some older Crays)
# frt: Fujitsu F77 compiler
# pathf90/pathf95/pathf2003: PathScale Fortran compiler
# pgf77/pgf90/pgf95/pgfortran: Portland Group F77/F90/F95 compilers
# xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers
# lf95: Lahey-Fujitsu F95 compiler
# fl32: Microsoft Fortran 77 "PowerStation" compiler
# 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
# ifc: Intel Fortran 95 compiler for Linux/x86
# efc: Intel Fortran 95 compiler for IA64
#
# The order is 95 or newer compilers first, then 90,
# then 77 or older compilers, gnu is always last in the group,
# so if you paid for a compiler it is picked by default.
set(CMAKE_Fortran_COMPILER_LIST
ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 pgfortran lf95 xlf95
fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77
frt pgf77 xlf fl32 af77 g77 f77
)
# Vendor-specific compiler names.
set(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77)
set(_Fortran_COMPILER_NAMES_Intel ifort ifc efc)
set(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77)
set(_Fortran_COMPILER_NAMES_PGI pgf95 pgfortran pgf90 pgf77)
set(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90)
set(_Fortran_COMPILER_NAMES_XL xlf)
set(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf)
endif()
_cmake_find_compiler(Fortran)
else()
# we only get here if CMAKE_Fortran_COMPILER was specified using -D or a pre-made CMakeCache.txt
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
# 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
list(LENGTH CMAKE_Fortran_COMPILER _CMAKE_Fortran_COMPILER_LIST_LENGTH)
if("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
list(GET CMAKE_Fortran_COMPILER 1 CMAKE_Fortran_COMPILER_ARG1)
list(GET CMAKE_Fortran_COMPILER 0 CMAKE_Fortran_COMPILER)
endif()
# 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()
endif()
endif()
mark_as_advanced(CMAKE_Fortran_COMPILER)
# Each entry in this list is a set of extra flags to try
# adding to the compile line to see if it helps produce
# 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.
"-c"
# Intel on windows does not preprocess by default.
"-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.
LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS Compaq)
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_Compaq "-what")
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_Compaq "Compaq Visual Fortran")
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_REGEX_NAG "NAG Fortran Compiler")
list(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS Compaq)
set(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_Compaq "-what")
set(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_Compaq "Compaq Visual Fortran")
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_REGEX_NAG "NAG Fortran Compiler")
# Try to identify the compiler.
SET(CMAKE_Fortran_COMPILER_ID)
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
set(CMAKE_Fortran_COMPILER_ID)
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
CMAKE_DETERMINE_COMPILER_ID(Fortran FFLAGS CMakeFortranCompilerId.F)
# Fall back to old is-GNU test.
IF(NOT CMAKE_Fortran_COMPILER_ID)
EXEC_PROGRAM(${CMAKE_Fortran_COMPILER}
if(NOT CMAKE_Fortran_COMPILER_ID)
exec_program(${CMAKE_Fortran_COMPILER}
ARGS ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\""
OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN)
IF(NOT CMAKE_COMPILER_RETURN)
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
SET(CMAKE_Fortran_COMPILER_ID "GNU")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
if(NOT CMAKE_COMPILER_RETURN)
if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
set(CMAKE_Fortran_COMPILER_ID "GNU")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler is GNU succeeded with "
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
ELSE("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
else()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler is GNU failed with "
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
IF(NOT CMAKE_Fortran_PLATFORM_ID)
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
SET(CMAKE_Fortran_PLATFORM_ID "MinGW")
ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
SET(CMAKE_Fortran_PLATFORM_ID "Cygwin")
ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
ENDIF(NOT CMAKE_Fortran_PLATFORM_ID)
ENDIF(NOT CMAKE_COMPILER_RETURN)
ENDIF(NOT CMAKE_Fortran_COMPILER_ID)
endif()
if(NOT CMAKE_Fortran_PLATFORM_ID)
if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
set(CMAKE_Fortran_PLATFORM_ID "MinGW")
endif()
if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
set(CMAKE_Fortran_PLATFORM_ID "Cygwin")
endif()
endif()
endif()
endif()
# Set old compiler and platform id variables.
IF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_COMPILER_IS_GNUG77 1)
ENDIF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
IF("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
SET(CMAKE_COMPILER_IS_MINGW 1)
ELSEIF("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin")
SET(CMAKE_COMPILER_IS_CYGWIN 1)
ENDIF("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
ENDIF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
INCLUDE(CMakeFindBinUtils)
IF(MSVC_Fortran_ARCHITECTURE_ID)
SET(SET_MSVC_Fortran_ARCHITECTURE_ID
"SET(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})")
ENDIF()
if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_COMPILER_IS_GNUG77 1)
endif()
if("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
set(CMAKE_COMPILER_IS_MINGW 1)
elseif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin")
set(CMAKE_COMPILER_IS_CYGWIN 1)
endif()
endif()
if (NOT _CMAKE_TOOLCHAIN_LOCATION)
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_Fortran_COMPILER}" PATH)
endif ()
# if we have a fortran cross compiler, they have usually some prefix, like
# 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_FILE(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake
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
)
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
# loading this file to force a compiler.
IF(NOT CMAKE_Java_COMPILER)
if(NOT CMAKE_Java_COMPILER)
# prefer the environment variable CC
IF($ENV{JAVA_COMPILER} MATCHES ".+")
GET_FILENAME_COMPONENT(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS 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")
ENDIF(CMAKE_Java_FLAGS_ENV_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}.")
ENDIF(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
ENDIF($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)
if(CMAKE_Java_FLAGS_ENV_INIT)
set(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler")
endif()
if(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.")
endif()
endif()
IF($ENV{JAVA_RUNTIME} MATCHES ".+")
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})
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($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)
if(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
endif()
endif()
IF($ENV{JAVA_ARCHIVE} MATCHES ".+")
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})
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($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)
if(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")
endif()
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\\1.9;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/lib/j2sdk1.5-sun/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(CMAKE_Java_COMPILER_INIT)
SET(CMAKE_Java_COMPILER ${CMAKE_Java_COMPILER_INIT} CACHE PATH "Java Compiler")
ELSE(CMAKE_Java_COMPILER_INIT)
FIND_PROGRAM(CMAKE_Java_COMPILER
if(CMAKE_Java_COMPILER_INIT)
set(CMAKE_Java_COMPILER ${CMAKE_Java_COMPILER_INIT} CACHE PATH "Java Compiler")
else()
find_program(CMAKE_Java_COMPILER
NAMES javac
PATHS ${Java_BIN_PATH}
)
ENDIF(CMAKE_Java_COMPILER_INIT)
endif()
# if no runtime has been specified yet, then look for one
IF(CMAKE_Java_RUNTIME_INIT)
SET(CMAKE_Java_RUNTIME ${CMAKE_Java_RUNTIME_INIT} CACHE PATH "Java Compiler")
ELSE(CMAKE_Java_RUNTIME_INIT)
FIND_PROGRAM(CMAKE_Java_RUNTIME
if(CMAKE_Java_RUNTIME_INIT)
set(CMAKE_Java_RUNTIME ${CMAKE_Java_RUNTIME_INIT} CACHE PATH "Java Compiler")
else()
find_program(CMAKE_Java_RUNTIME
NAMES java
PATHS ${Java_BIN_PATH}
)
ENDIF(CMAKE_Java_RUNTIME_INIT)
endif()
# if no archive has been specified yet, then look for one
IF(CMAKE_Java_ARCHIVE_INIT)
SET(CMAKE_Java_ARCHIVE ${CMAKE_Java_ARCHIVE_INIT} CACHE PATH "Java Compiler")
ELSE(CMAKE_Java_ARCHIVE_INIT)
FIND_PROGRAM(CMAKE_Java_ARCHIVE
if(CMAKE_Java_ARCHIVE_INIT)
set(CMAKE_Java_ARCHIVE ${CMAKE_Java_ARCHIVE_INIT} CACHE PATH "Java Compiler")
else()
find_program(CMAKE_Java_ARCHIVE
NAMES jar
PATHS ${Java_BIN_PATH}
)
ENDIF(CMAKE_Java_ARCHIVE_INIT)
ENDIF(NOT CMAKE_Java_COMPILER)
MARK_AS_ADVANCED(CMAKE_Java_COMPILER)
endif()
endif()
mark_as_advanced(CMAKE_Java_COMPILER)
# configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeJavaCompiler.cmake IMMEDIATE @ONLY)
SET(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")
configure_file(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in
${CMAKE_PLATFORM_INFO_DIR}/CMakeJavaCompiler.cmake IMMEDIATE @ONLY)
set(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")

@ -18,50 +18,50 @@
# use environment variable CCC first if defined by user, next use
# the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
# as a default compiler
IF(NOT CMAKE_RC_COMPILER)
if(NOT CMAKE_RC_COMPILER)
# prefer the environment variable CC
IF($ENV{RC} MATCHES ".+")
GET_FILENAME_COMPONENT(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS 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")
ENDIF(CMAKE_RC_FLAGS_ENV_INIT)
IF(EXISTS ${CMAKE_RC_COMPILER_INIT})
ELSE(EXISTS ${CMAKE_RC_COMPILER_INIT})
MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.")
ENDIF(EXISTS ${CMAKE_RC_COMPILER_INIT})
ENDIF($ENV{RC} MATCHES ".+")
if($ENV{RC} MATCHES ".+")
get_filename_component(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS 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")
endif()
if(EXISTS ${CMAKE_RC_COMPILER_INIT})
else()
message(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.")
endif()
endif()
# next try prefer the compiler specified by the generator
IF(CMAKE_GENERATOR_RC)
IF(NOT CMAKE_RC_COMPILER_INIT)
SET(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC})
ENDIF(NOT CMAKE_RC_COMPILER_INIT)
ENDIF(CMAKE_GENERATOR_RC)
if(CMAKE_GENERATOR_RC)
if(NOT CMAKE_RC_COMPILER_INIT)
set(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC})
endif()
endif()
# finally list compilers to try
IF(CMAKE_RC_COMPILER_INIT)
SET(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
ELSE(CMAKE_RC_COMPILER_INIT)
SET(CMAKE_RC_COMPILER_LIST rc)
ENDIF(CMAKE_RC_COMPILER_INIT)
if(CMAKE_RC_COMPILER_INIT)
set(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
else()
set(CMAKE_RC_COMPILER_LIST rc)
endif()
# Find the compiler.
FIND_PROGRAM(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "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)
ENDIF(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
ENDIF(NOT CMAKE_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)
set(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE)
endif()
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)
IF(_CMAKE_RC_COMPILER_NAME_WE STREQUAL "windres")
SET(CMAKE_RC_OUTPUT_EXTENSION .obj)
ELSE()
SET(CMAKE_RC_OUTPUT_EXTENSION .res)
ENDIF()
get_filename_component(_CMAKE_RC_COMPILER_NAME_WE ${CMAKE_RC_COMPILER} NAME_WE)
if(_CMAKE_RC_COMPILER_NAME_WE STREQUAL "windres")
set(CMAKE_RC_OUTPUT_EXTENSION .obj)
else()
set(CMAKE_RC_OUTPUT_EXTENSION .res)
endif()
# configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeRCCompiler.cmake IMMEDIATE)
SET(CMAKE_RC_COMPILER_ENV_VAR "RC")
configure_file(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in
${CMAKE_PLATFORM_INFO_DIR}/CMakeRCCompiler.cmake IMMEDIATE)
set(CMAKE_RC_COMPILER_ENV_VAR "RC")

@ -42,135 +42,145 @@
# find out on which system cmake runs
IF(CMAKE_HOST_UNIX)
FIND_PROGRAM(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
IF(CMAKE_UNAME)
EXEC_PROGRAM(uname ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_NAME)
EXEC_PROGRAM(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*")
EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
if(CMAKE_HOST_UNIX)
find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
if(CMAKE_UNAME)
exec_program(uname ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_NAME)
exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*")
exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val)
ELSEIF(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD")
EXEC_PROGRAM(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD")
exec_program(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val)
ELSE()
EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
else()
exec_program(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val)
IF("${val}" GREATER 0)
EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
if("${val}" GREATER 0)
exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
RETURN_VALUE val)
ENDIF("${val}" GREATER 0)
ENDIF()
endif()
endif()
# check the return of the last uname -m or -p
IF("${val}" GREATER 0)
SET(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")
ENDIF("${val}" GREATER 0)
SET(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command")
if("${val}" GREATER 0)
set(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")
endif()
set(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command")
# 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}")
ENDIF(CMAKE_UNAME)
ELSE(CMAKE_HOST_UNIX)
IF(CMAKE_HOST_WIN32)
SET (CMAKE_HOST_SYSTEM_NAME "Windows")
SET (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
ENDIF(CMAKE_HOST_WIN32)
ENDIF(CMAKE_HOST_UNIX)
string(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
string(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
endif()
else()
if(CMAKE_HOST_WIN32)
set (CMAKE_HOST_SYSTEM_NAME "Windows")
if (DEFINED ENV{PROCESSOR_ARCHITEW6432})
set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITEW6432}")
else()
set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
endif()
endif()
endif()
# 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_*
# variables around so they can be used in CMakeLists.txt.
# 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
INCLUDE("${CMAKE_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
IF(NOT _INCLUDED_TOOLCHAIN_FILE)
include("${CMAKE_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
if(NOT _INCLUDED_TOOLCHAIN_FILE)
# if the file isn't found there, check the default locations
INCLUDE("${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
ENDIF(NOT _INCLUDED_TOOLCHAIN_FILE)
include("${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
endif()
IF(_INCLUDED_TOOLCHAIN_FILE)
SET(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE)
ELSE(_INCLUDED_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)
ENDIF(_INCLUDED_TOOLCHAIN_FILE)
ENDIF(CMAKE_TOOLCHAIN_FILE)
if(_INCLUDED_TOOLCHAIN_FILE)
set(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE)
else()
message(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
set(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE)
endif()
endif()
# if CMAKE_SYSTEM_NAME is here already set, either it comes from a toolchain file
# or it was set via -DCMAKE_SYSTEM_NAME=...
# if that's the case, assume we are crosscompiling
IF(CMAKE_SYSTEM_NAME)
IF(NOT DEFINED CMAKE_CROSSCOMPILING)
SET(CMAKE_CROSSCOMPILING TRUE)
ENDIF(NOT DEFINED CMAKE_CROSSCOMPILING)
SET(PRESET_CMAKE_SYSTEM_NAME TRUE)
ELSE(CMAKE_SYSTEM_NAME)
SET(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
SET(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
SET(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
SET(CMAKE_CROSSCOMPILING FALSE)
SET(PRESET_CMAKE_SYSTEM_NAME FALSE)
ENDIF(CMAKE_SYSTEM_NAME)
MACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
IF(NOT ${_PREFIX}_NAME)
SET(${_PREFIX}_NAME "UnknownOS")
ENDIF(NOT ${_PREFIX}_NAME)
if(CMAKE_SYSTEM_NAME)
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING TRUE)
endif()
set(PRESET_CMAKE_SYSTEM_NAME TRUE)
elseif(CMAKE_VS_WINCE_VERSION)
set(CMAKE_SYSTEM_NAME "WindowsCE")
set(CMAKE_SYSTEM_VERSION "${CMAKE_VS_WINCE_VERSION}")
set(CMAKE_SYSTEM_PROCESSOR "${MSVC_C_ARCHITECTURE_ID}")
set(CMAKE_CROSSCOMPILING TRUE)
set(PRESET_CMAKE_SYSTEM_NAME TRUE)
else()
set(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
set(CMAKE_CROSSCOMPILING FALSE)
set(PRESET_CMAKE_SYSTEM_NAME FALSE)
endif()
macro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
if(NOT ${_PREFIX}_NAME)
set(${_PREFIX}_NAME "UnknownOS")
endif()
# fix for BSD/OS , remove the /
IF(${_PREFIX}_NAME MATCHES BSD.OS)
SET(${_PREFIX}_NAME BSDOS)
ENDIF(${_PREFIX}_NAME MATCHES BSD.OS)
if(${_PREFIX}_NAME MATCHES BSD.OS)
set(${_PREFIX}_NAME BSDOS)
endif()
# fix for GNU/kFreeBSD, remove the GNU/
IF(${_PREFIX}_NAME MATCHES kFreeBSD)
SET(${_PREFIX}_NAME kFreeBSD)
ENDIF(${_PREFIX}_NAME MATCHES kFreeBSD)
if(${_PREFIX}_NAME MATCHES kFreeBSD)
set(${_PREFIX}_NAME kFreeBSD)
endif()
# fix for CYGWIN which has windows version in it
IF(${_PREFIX}_NAME MATCHES CYGWIN)
SET(${_PREFIX}_NAME CYGWIN)
ENDIF(${_PREFIX}_NAME MATCHES CYGWIN)
if(${_PREFIX}_NAME MATCHES CYGWIN)
set(${_PREFIX}_NAME CYGWIN)
endif()
# 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(${_PREFIX}_VERSION)
SET(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION})
ENDIF(${_PREFIX}_VERSION)
if(${_PREFIX}_VERSION)
set(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION})
endif()
ENDMACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
endmacro()
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM)
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM)
# 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
IF(CMAKE_BINARY_DIR)
if(CMAKE_BINARY_DIR)
# write entry to the log file
IF(PRESET_CMAKE_SYSTEM_NAME)
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
if(PRESET_CMAKE_SYSTEM_NAME)
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"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")
ELSE(PRESET_CMAKE_SYSTEM_NAME)
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
else()
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"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,
# 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)
IF(DEFINED CMAKE_TOOLCHAIN_FILE)
SET(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED "INCLUDE(\"${CMAKE_TOOLCHAIN_FILE}\")")
ENDIF(DEFINED CMAKE_TOOLCHAIN_FILE)
# 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)
if(DEFINED CMAKE_TOOLCHAIN_FILE)
set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED "include(\"${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_FILE(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
configure_file(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
${CMAKE_PLATFORM_INFO_DIR}/CMakeSystem.cmake
IMMEDIATE @ONLY)
ENDIF(CMAKE_BINARY_DIR)
endif()

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

@ -10,7 +10,7 @@
# the first configuration from ${CMAKE_CONFIGURATION_TYPES} if set, otherwise
# ${CMAKE_BUILD_TYPE}.
# This macro is used by all Check*.cmake files which use
# TRY_COMPILE() or TRY_RUN() and support CMAKE_REQUIRED_LIBRARIES , so that
# try_compile() or try_run() and support CMAKE_REQUIRED_LIBRARIES , so that
# these checks support imported targets in CMAKE_REQUIRED_LIBRARIES:
# cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
# CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
@ -30,7 +30,7 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
include(CMakeParseArguments)
include(${CMAKE_CURRENT_LIST_DIR}/CMakeParseArguments.cmake)
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)
if ("${_CCSR_LOOP_COUNTER}" LESS 100)
set(_CHECK_FOR_IMPORTED_TARGETS TRUE)
# else ("${_CCSR_LOOP_COUNTER}" LESS 1)
# else ()
# 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},
# use it, otherwise simply use the first one:
list(FIND _importedConfigs "${CEIT_CONFIGURATION}" _configIndexToUse)
if("${_configIndexToUse}" EQUAL -1)
set(_configIndexToUse 0)
endif("${_configIndexToUse}" EQUAL -1)
endif()
list(GET _importedConfigs ${_configIndexToUse} _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}")
if(_currentLinkInterfaceLib)
list(APPEND _CCSR_NEW_REQ_LIBS "${_currentLinkInterfaceLib}" )
endif(_currentLinkInterfaceLib)
endforeach(_currentLinkInterfaceLib "${_linkInterfaceLibs}")
endif(_linkInterfaceLibs)
else(_importedConfigs)
endif()
endforeach()
endif()
else()
# "Normal" libraries are just used as they are.
list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
# message(STATUS "Appending lib directly: ${_CURRENT_LIB}")
endif(_importedConfigs)
endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
endif()
endforeach()
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
# 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)
list(APPEND _CCSR_NEW_REQ_LIBS "${_CURRENT_LIB}" )
# message(STATUS "final: appending ${_CURRENT_LIB}")
else (NOT _importedConfigs)
else ()
# message(STATUS "final: skipping ${_CURRENT_LIB}")
endif (NOT _importedConfigs)
endforeach(_CURRENT_LIB ${_CCSR_REQ_LIBS})
endif ()
endforeach()
# message(STATUS "setting -${_RESULT}- to -${_CCSR_NEW_REQ_LIBS}-")
set(${_RESULT} "${_CCSR_NEW_REQ_LIBS}" PARENT_SCOPE)

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

@ -18,39 +18,42 @@
# 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
# system include directories, which are parsed then and stored in the cache.
MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines)
SET(${_resultIncludeDirs})
SET(_gccOutput)
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
IF (${_lang} STREQUAL "c++")
SET(_compilerExecutable "${CMAKE_CXX_COMPILER}")
SET(_arg1 "${CMAKE_CXX_COMPILER_ARG1}")
ELSE ()
SET(_compilerExecutable "${CMAKE_C_COMPILER}")
SET(_arg1 "${CMAKE_C_COMPILER_ARG1}")
ENDIF ()
EXECUTE_PROCESS(COMMAND ${_compilerExecutable} ${_arg1} -v -E -x ${_lang} -dD dummy
macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines)
set(${_resultIncludeDirs})
set(_gccOutput)
file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
if (${_lang} STREQUAL "c++")
set(_compilerExecutable "${CMAKE_CXX_COMPILER}")
set(_arg1 "${CMAKE_CXX_COMPILER_ARG1}")
else ()
set(_compilerExecutable "${CMAKE_C_COMPILER}")
set(_arg1 "${CMAKE_C_COMPILER_ARG1}")
endif ()
execute_process(COMMAND ${_compilerExecutable} ${_arg1} -v -E -x ${_lang} -dD dummy
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
ERROR_VARIABLE _gccOutput
OUTPUT_VARIABLE _gccStdout )
FILE(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
# 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:
STRING(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
FOREACH(nextLine ${_includeLines})
STRING(STRIP "${nextLine}" _includePath)
LIST(APPEND ${_resultIncludeDirs} "${_includePath}")
ENDFOREACH(nextLine)
string(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
foreach(nextLine ${_includeLines})
# on OSX, gcc says things like this: "/System/Library/Frameworks (framework directory)", strip the last part
string(REGEX REPLACE "\\(framework directory\\)" "" nextLineNoFramework "${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:
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:
# #define MAX(a,b) ((a) > (b) ? (a) : (b))
# #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 __i386__ 1
FOREACH(nextLine ${_defineLines})
STRING(REGEX MATCH "^#define +([A-Za-z_][A-Za-z0-9_]*)(\\([^\\)]+\\))? +(.+) *$" _dummy "${nextLine}")
SET(_name "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
STRING(STRIP "${CMAKE_MATCH_3}" _value)
#MESSAGE(STATUS "m1: -${CMAKE_MATCH_1}- m2: -${CMAKE_MATCH_2}- m3: -${CMAKE_MATCH_3}-")
foreach(nextLine ${_defineLines})
string(REGEX MATCH "^#define +([A-Za-z_][A-Za-z0-9_]*)(\\([^\\)]+\\))? +(.+) *$" _dummy "${nextLine}")
set(_name "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
string(STRIP "${CMAKE_MATCH_3}" _value)
#message(STATUS "m1: -${CMAKE_MATCH_1}- m2: -${CMAKE_MATCH_2}- m3: -${CMAKE_MATCH_3}-")
LIST(APPEND ${_resultDefines} "${_name}")
IF(_value)
LIST(APPEND ${_resultDefines} "${_value}")
ELSE()
LIST(APPEND ${_resultDefines} " ")
ENDIF()
ENDFOREACH(nextLine)
list(APPEND ${_resultDefines} "${_name}")
if(_value)
list(APPEND ${_resultDefines} "${_value}")
else()
list(APPEND ${_resultDefines} " ")
endif()
endforeach()
ENDMACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang)
endmacro()
# 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.
SET(_orig_lc_all $ENV{LC_ALL})
SET(_orig_lc_messages $ENV{LC_MESSAGES})
SET(_orig_lang $ENV{LANG})
set(_orig_lc_all $ENV{LC_ALL})
set(_orig_lc_messages $ENV{LC_MESSAGES})
set(_orig_lang $ENV{LANG})
SET(ENV{LC_ALL} C)
SET(ENV{LC_MESSAGES} C)
SET(ENV{LANG} C)
set(ENV{LC_ALL} C)
set(ENV{LC_MESSAGES} C)
set(ENV{LANG} C)
# Now check for C, works for gcc and Intel compiler at least
IF (NOT CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS)
IF ("${CMAKE_C_COMPILER_ID}" MATCHES GNU OR "${CMAKE_C_COMPILER_ID}" MATCHES Intel)
if (NOT CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS)
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)
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")
ENDIF ()
ENDIF ()
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")
endif ()
endif ()
# And now the same for C++
IF (NOT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS)
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Intel)
if (NOT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS)
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)
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")
ENDIF ()
ENDIF ()
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")
endif ()
endif ()
# Restore original LC_ALL, LC_MESSAGES, and LANG
SET(ENV{LC_ALL} ${_orig_lc_all})
SET(ENV{LC_MESSAGES} ${_orig_lc_messages})
SET(ENV{LANG} ${_orig_lang})
set(ENV{LC_ALL} ${_orig_lc_all})
set(ENV{LC_MESSAGES} ${_orig_lc_messages})
set(ENV{LANG} ${_orig_lang})

@ -30,46 +30,42 @@
# License text for the above reference.)
# 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_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.
ELSE("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
else()
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})
IF(NOT CMAKE_RANLIB)
SET(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib")
ENDIF(NOT CMAKE_RANLIB)
find_program(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
if(NOT CMAKE_RANLIB)
set(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib")
endif()
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_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_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy 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_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_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"
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
endif()
# on Apple there really should be install_name_tool
IF(APPLE)
FIND_PROGRAM(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
if(APPLE)
find_program(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
IF(NOT CMAKE_INSTALL_NAME_TOOL)
MESSAGE(FATAL_ERROR "Could not find install_name_tool, please check your installation.")
ENDIF(NOT CMAKE_INSTALL_NAME_TOOL)
if(NOT CMAKE_INSTALL_NAME_TOOL)
message(FATAL_ERROR "Could not find install_name_tool, please check your installation.")
endif()
MARK_AS_ADVANCED(CMAKE_INSTALL_NAME_TOOL)
ENDIF(APPLE)
mark_as_advanced(CMAKE_INSTALL_NAME_TOOL)
endif()

@ -15,11 +15,11 @@
# This file is included in CMakeSystemSpecificInformation.cmake if
# 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)
SET(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_CODEBLOCKS_EXECUTABLE} <PROJECT_FILE>" )
ENDIF(CMAKE_CODEBLOCKS_EXECUTABLE)
if(CMAKE_CODEBLOCKS_EXECUTABLE)
set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_CODEBLOCKS_EXECUTABLE} <PROJECT_FILE>" )
endif()
# 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
# 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
IF(CMAKE_ECLIPSE_EXECUTABLE)
if(CMAKE_ECLIPSE_EXECUTABLE)
# 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(_ECLIPSE_DIR "${_REALPATH_CMAKE_ECLIPSE_EXECUTABLE}" PATH)
FILE(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/features/org.eclipse.platform*")
IF("${_ECLIPSE_FEATURE_DIR}" MATCHES ".+org.eclipse.platform_([0-9]+\\.[0-9]+).+")
SET(_ECLIPSE_VERSION ${CMAKE_MATCH_1})
ENDIF()
ENDIF()
get_filename_component(_REALPATH_CMAKE_ECLIPSE_EXECUTABLE "${CMAKE_ECLIPSE_EXECUTABLE}" REALPATH)
get_filename_component(_ECLIPSE_DIR "${_REALPATH_CMAKE_ECLIPSE_EXECUTABLE}" PATH)
file(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/features/org.eclipse.platform*")
if(APPLE AND NOT _ECLIPSE_FEATURE_DIR)
file(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/../../../features/org.eclipse.platform*")
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(_ECLIPSE_VERSION_NAME_ "Unknown" )
SET(_ECLIPSE_VERSION_NAME_3.2 "Callisto" )
SET(_ECLIPSE_VERSION_NAME_3.3 "Europa" )
SET(_ECLIPSE_VERSION_NAME_3.4 "Ganymede" )
SET(_ECLIPSE_VERSION_NAME_3.5 "Galileo" )
SET(_ECLIPSE_VERSION_NAME_3.6 "Helios" )
SET(_ECLIPSE_VERSION_NAME_3.7 "Indigo" )
set(_ECLIPSE_VERSION_NAME_ "Unknown" )
set(_ECLIPSE_VERSION_NAME_3.2 "Callisto" )
set(_ECLIPSE_VERSION_NAME_3.3 "Europa" )
set(_ECLIPSE_VERSION_NAME_3.4 "Ganymede" )
set(_ECLIPSE_VERSION_NAME_3.5 "Galileo" )
set(_ECLIPSE_VERSION_NAME_3.6 "Helios" )
set(_ECLIPSE_VERSION_NAME_3.7 "Indigo" )
set(_ECLIPSE_VERSION_NAME_4.2 "Juno" )
IF(_ECLIPSE_VERSION)
MESSAGE(STATUS "Found Eclipse version ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})")
ELSE()
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.")
ENDIF()
if(_ECLIPSE_VERSION)
message(STATUS "Found Eclipse version ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})")
else()
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.")
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_PROPERTY(CACHE CMAKE_ECLIPSE_VERSION PROPERTY STRINGS "3.2 (${_ECLIPSE_VERSION_NAME_3.2})"
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})"
"3.3 (${_ECLIPSE_VERSION_NAME_3.3})"
"3.4 (${_ECLIPSE_VERSION_NAME_3.4})"
"3.5 (${_ECLIPSE_VERSION_NAME_3.5})"
"3.6 (${_ECLIPSE_VERSION_NAME_3.6})"
"3.7 (${_ECLIPSE_VERSION_NAME_3.7})")
ENDFUNCTION()
"3.7 (${_ECLIPSE_VERSION_NAME_3.7})"
"4.2 (${_ECLIPSE_VERSION_NAME_4.2})"
)
endfunction()
_FIND_ECLIPSE_VERSION()
# 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)
# 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)
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}")
ENDIF()
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}")
endif()
# 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.
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)
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)
# 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
# License text for the above reference.)
IF(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
SET(CMAKE_FIND_FRAMEWORKS_INCLUDED 1)
MACRO(CMAKE_FIND_FRAMEWORKS fwk)
SET(${fwk}_FRAMEWORKS)
IF(APPLE)
FOREACH(dir
if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
set(CMAKE_FIND_FRAMEWORKS_INCLUDED 1)
macro(CMAKE_FIND_FRAMEWORKS fwk)
set(${fwk}_FRAMEWORKS)
if(APPLE)
foreach(dir
~/Library/Frameworks/${fwk}.framework
/Library/Frameworks/${fwk}.framework
/System/Library/Frameworks/${fwk}.framework
/Network/Library/Frameworks/${fwk}.framework)
IF(EXISTS ${dir})
SET(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
ENDIF(EXISTS ${dir})
ENDFOREACH(dir)
ENDIF(APPLE)
ENDMACRO(CMAKE_FIND_FRAMEWORKS)
ENDIF(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
if(EXISTS ${dir})
set(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
endif()
endforeach()
endif()
endmacro()
endif()

@ -15,9 +15,9 @@
# This file is included in CMakeSystemSpecificInformation.cmake if
# 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)
SET(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} <PROJECT_FILE>" )
ENDIF(CMAKE_KDEVELOP3_EXECUTABLE)
if(CMAKE_KDEVELOP3_EXECUTABLE)
set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} <PROJECT_FILE>" )
endif()

@ -47,12 +47,14 @@ macro(ENABLE_LANGUAGE)
# But in --find-package mode, we don't want (and can't) enable any language.
endmacro()
set(CMAKE_PLATFORM_INFO_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY})
include(CMakeDetermineSystem)
# short-cut some tests on Darwin, see Darwin-GNU.cmake:
if("${CMAKE_SYSTEM_NAME}" MATCHES Darwin AND "${COMPILER_ID}" MATCHES GNU)
set(${CMAKE_${LANGUAGE}_HAS_ISYSROOT} 0 )
set(CMAKE_${lang}_OSX_DEPLOYMENT_TARGET_FLAG "")
set(CMAKE_${LANGUAGE}_SYSROOT_FLAG "")
set(CMAKE_${LANGUAGE}_OSX_DEPLOYMENT_TARGET_FLAG "")
endif()
# 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})
elseif("${MODE}" STREQUAL "LINK")
set_link_flags_var(${NAME})
else("${MODE}" STREQUAL "LINK")
else()
message(FATAL_ERROR "Invalid mode argument ${MODE} given.")
endif()

@ -12,6 +12,6 @@
# (To distribute this file outside of CMake, substitute the full
# 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.")
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
# License text for the above reference.)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
find_program(CMAKE_MAKE_PROGRAM
NAMES xcodebuild
PATHS
/usr/bin
)
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
mark_as_advanced(CMAKE_MAKE_PROGRAM)

@ -24,8 +24,8 @@
# information tests.
#
# So a simple toolchain file could look like this:
# INCLUDE (CMakeForceCompiler)
# SET(CMAKE_SYSTEM_NAME Generic)
# include (CMakeForceCompiler)
# set(CMAKE_SYSTEM_NAME Generic)
# CMAKE_FORCE_C_COMPILER (chc12 MetrowerksHicross)
# CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross)
@ -42,41 +42,38 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MACRO(CMAKE_FORCE_C_COMPILER compiler id)
SET(CMAKE_C_COMPILER "${compiler}")
SET(CMAKE_C_COMPILER_ID_RUN TRUE)
SET(CMAKE_C_COMPILER_ID ${id})
SET(CMAKE_C_COMPILER_WORKS TRUE)
SET(CMAKE_C_COMPILER_FORCED TRUE)
macro(CMAKE_FORCE_C_COMPILER compiler id)
set(CMAKE_C_COMPILER "${compiler}")
set(CMAKE_C_COMPILER_ID_RUN TRUE)
set(CMAKE_C_COMPILER_ID ${id})
set(CMAKE_C_COMPILER_FORCED TRUE)
# Set old compiler id variables.
IF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_COMPILER_IS_GNUCC 1)
ENDIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
ENDMACRO(CMAKE_FORCE_C_COMPILER)
if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_COMPILER_IS_GNUCC 1)
endif()
endmacro()
MACRO(CMAKE_FORCE_CXX_COMPILER compiler id)
SET(CMAKE_CXX_COMPILER "${compiler}")
SET(CMAKE_CXX_COMPILER_ID_RUN TRUE)
SET(CMAKE_CXX_COMPILER_ID ${id})
SET(CMAKE_CXX_COMPILER_WORKS TRUE)
SET(CMAKE_CXX_COMPILER_FORCED TRUE)
macro(CMAKE_FORCE_CXX_COMPILER compiler id)
set(CMAKE_CXX_COMPILER "${compiler}")
set(CMAKE_CXX_COMPILER_ID_RUN TRUE)
set(CMAKE_CXX_COMPILER_ID ${id})
set(CMAKE_CXX_COMPILER_FORCED TRUE)
# Set old compiler id variables.
IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_COMPILER_IS_GNUCXX 1)
ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
ENDMACRO(CMAKE_FORCE_CXX_COMPILER)
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_COMPILER_IS_GNUCXX 1)
endif()
endmacro()
MACRO(CMAKE_FORCE_Fortran_COMPILER compiler id)
SET(CMAKE_Fortran_COMPILER "${compiler}")
SET(CMAKE_Fortran_COMPILER_ID_RUN TRUE)
SET(CMAKE_Fortran_COMPILER_ID ${id})
SET(CMAKE_Fortran_COMPILER_WORKS TRUE)
SET(CMAKE_Fortran_COMPILER_FORCED TRUE)
macro(CMAKE_FORCE_Fortran_COMPILER compiler id)
set(CMAKE_Fortran_COMPILER "${compiler}")
set(CMAKE_Fortran_COMPILER_ID_RUN TRUE)
set(CMAKE_Fortran_COMPILER_ID ${id})
set(CMAKE_Fortran_COMPILER_FORCED TRUE)
# Set old compiler id variables.
IF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_COMPILER_IS_GNUG77 1)
ENDIF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
ENDMACRO(CMAKE_FORCE_Fortran_COMPILER)
if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
set(CMAKE_COMPILER_IS_GNUG77 1)
endif()
endmacro()

@ -1,52 +1,55 @@
SET(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@")
SET(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@")
SET(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
SET(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@")
set(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@")
set(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
set(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
@SET_MSVC_Fortran_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@")
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
SET(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@)
SET(CMAKE_Fortran_COMPILER_LOADED 1)
SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
IF(CMAKE_COMPILER_IS_CYGWIN)
SET(CYGWIN 1)
SET(UNIX 1)
ENDIF(CMAKE_COMPILER_IS_CYGWIN)
SET(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 @CMAKE_Fortran_COMPILER_SUPPORTS_F90@)
IF(CMAKE_COMPILER_IS_MINGW)
SET(MINGW 1)
ENDIF(CMAKE_COMPILER_IS_MINGW)
SET(CMAKE_Fortran_COMPILER_ID_RUN 1)
SET(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;f77;F77;f90;F90;for;For;FOR;f95;F95)
SET(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
SET(CMAKE_Fortran_LINKER_PREFERENCE 20)
IF(UNIX)
SET(CMAKE_Fortran_OUTPUT_EXTENSION .o)
ELSE(UNIX)
SET(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
set(CMAKE_AR "@CMAKE_AR@")
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
set(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@)
set(CMAKE_Fortran_COMPILER_LOADED 1)
set(CMAKE_Fortran_COMPILER_WORKS @CMAKE_Fortran_COMPILER_WORKS@)
set(CMAKE_Fortran_ABI_COMPILED @CMAKE_Fortran_ABI_COMPILED@)
set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
if(CMAKE_COMPILER_IS_CYGWIN)
set(CYGWIN 1)
set(UNIX 1)
endif()
set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 @CMAKE_Fortran_COMPILER_SUPPORTS_F90@)
if(CMAKE_COMPILER_IS_MINGW)
set(MINGW 1)
endif()
set(CMAKE_Fortran_COMPILER_ID_RUN 1)
set(CMAKE_Fortran_SOURCE_FILE_EXTENSIONS f;F;f77;F77;f90;F90;for;For;FOR;f95;F95)
set(CMAKE_Fortran_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
set(CMAKE_Fortran_LINKER_PREFERENCE 20)
if(UNIX)
set(CMAKE_Fortran_OUTPUT_EXTENSION .o)
else()
set(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
endif()
# Save compiler ABI information.
SET(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
SET(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@")
SET(CMAKE_Fortran_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
set(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
set(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@")
set(CMAKE_Fortran_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
IF(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P)
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
ENDIF()
if(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P)
set(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
endif()
IF(CMAKE_Fortran_COMPILER_ABI)
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
ENDIF(CMAKE_Fortran_COMPILER_ABI)
if(CMAKE_Fortran_COMPILER_ABI)
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
endif()
IF(CMAKE_Fortran_LIBRARY_ARCHITECTURE)
SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
ENDIF()
if(CMAKE_Fortran_LIBRARY_ARCHITECTURE)
set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
endif()
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_LIBRARIES "@CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES@")
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]'
#elif defined(__hpux) || defined(__hpux__)
PRINT *, 'INFO:platform[HP-UX]'
#elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU)
#elif defined(__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)
PRINT *, 'INFO:platform[BeOS]'
#elif defined(__QNX__) || defined(__QNXNTO__)

@ -16,40 +16,40 @@
# It also loads the available platform file for the system-compiler
# if it exists.
SET(_INCLUDED_FILE 0)
set(_INCLUDED_FILE 0)
# Load compiler-specific information.
IF(CMAKE_Fortran_COMPILER_ID)
INCLUDE(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL)
ENDIF(CMAKE_Fortran_COMPILER_ID)
if(CMAKE_Fortran_COMPILER_ID)
include(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL)
endif()
SET(CMAKE_BASE_NAME)
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE)
set(CMAKE_BASE_NAME)
get_filename_component(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE)
# since the gnu compiler has several names force g++
IF(CMAKE_COMPILER_IS_GNUG77)
SET(CMAKE_BASE_NAME g77)
ENDIF(CMAKE_COMPILER_IS_GNUG77)
IF(CMAKE_Fortran_COMPILER_ID)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
ENDIF(CMAKE_Fortran_COMPILER_ID)
IF (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
if(CMAKE_COMPILER_IS_GNUG77)
set(CMAKE_BASE_NAME g77)
endif()
if(CMAKE_Fortran_COMPILER_ID)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
endif()
if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
RESULT_VARIABLE _INCLUDED_FILE)
ENDIF (NOT _INCLUDED_FILE)
endif ()
# We specify the compiler information in the system file for some
# platforms, but this language may not have been enabled when the file
# was first included. Include it again to get the language info.
# Remove this when all compiler info is removed from system files.
IF (NOT _INCLUDED_FILE)
INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
ENDIF (NOT _INCLUDED_FILE)
if (NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
endif ()
IF(CMAKE_Fortran_SIZEOF_DATA_PTR)
FOREACH(f ${CMAKE_Fortran_ABI_FILES})
INCLUDE(${f})
ENDFOREACH()
UNSET(CMAKE_Fortran_ABI_FILES)
ENDIF()
if(CMAKE_Fortran_SIZEOF_DATA_PTR)
foreach(f ${CMAKE_Fortran_ABI_FILES})
include(${f})
endforeach()
unset(CMAKE_Fortran_ABI_FILES)
endif()
# This should be included before the _INIT variables are
# used to initialize the cache. Since the rule variables
@ -57,122 +57,122 @@ ENDIF()
# But, it should still be after the platform file so changes can
# 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.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
ENDIF()
include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
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.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran "${_override}")
ENDIF()
include(${CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran} RESULT_VARIABLE _override)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran "${_override}")
endif()
# Fortran needs cmake to do a requires step during its build process to
# 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)
SET(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
set(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
endif()
IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
SET(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
set(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
endif()
IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
SET(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
if(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
set(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
endif()
# Create a set of shared library variable specific to Fortran
# 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
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
ENDIF()
if(NOT DEFINED CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
ENDIF()
if(NOT DEFINED CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
ENDIF()
if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
ENDIF()
if(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
endif()
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})
ENDIF()
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})
endif()
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})
ENDIF()
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})
endif()
IF(NOT DEFINED CMAKE_EXE_EXPORTS_Fortran_FLAG)
SET(CMAKE_EXE_EXPORTS_Fortran_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
ENDIF()
if(NOT DEFINED CMAKE_EXE_EXPORTS_Fortran_FLAG)
set(CMAKE_EXE_EXPORTS_Fortran_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
endif()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
ENDIF()
if(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
endif()
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
IF(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
ENDIF(NOT CMAKE_MODULE_EXISTS)
if(NOT CMAKE_MODULE_EXISTS)
set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
endif()
# repeat for modules
IF(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
ENDIF()
if(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
endif()
IF(NOT DEFINED CMAKE_SHARED_MODULE_Fortran_FLAGS)
SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
ENDIF()
if(NOT DEFINED CMAKE_SHARED_MODULE_Fortran_FLAGS)
set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
endif()
IF(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG})
ENDIF()
if(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG})
endif()
IF(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP})
ENDIF()
if(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP})
endif()
IF(NOT DEFINED CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
SET(CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG})
ENDIF()
if(NOT DEFINED CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
set(CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG})
endif()
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})
ENDIF(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})
endif()
IF(NOT CMAKE_INCLUDE_FLAG_Fortran)
SET(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C})
ENDIF(NOT CMAKE_INCLUDE_FLAG_Fortran)
if(NOT CMAKE_INCLUDE_FLAG_Fortran)
set(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C})
endif()
IF(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
SET(CMAKE_INCLUDE_FLAG_SEP_Fortran ${CMAKE_INCLUDE_FLAG_SEP_C})
ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
if(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
set(CMAKE_INCLUDE_FLAG_SEP_Fortran ${CMAKE_INCLUDE_FLAG_SEP_C})
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
IF(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
SET(CMAKE_Fortran_FLAGS_INIT)
ENDIF(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
SET (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING
if(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
set(CMAKE_Fortran_FLAGS_INIT)
endif()
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING
"Flags for Fortran compiler.")
INCLUDE(CMakeCommonLanguageInclude)
include(CMakeCommonLanguageInclude)
# now define the following rule variables
# CMAKE_Fortran_CREATE_SHARED_LIBRARY
@ -181,60 +181,60 @@ INCLUDE(CMakeCommonLanguageInclude)
# CMAKE_Fortran_LINK_EXECUTABLE
# create a Fortran shared library
IF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
if(NOT 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>")
ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
endif()
# create a Fortran shared module just copy the shared library rule
IF(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
SET(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
if(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
set(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
endif()
# Create a static archive incrementally for large object file counts.
# If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these.
IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_CREATE)
SET(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF()
IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND)
SET(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
ENDIF()
IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH)
SET(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
ENDIF()
if(NOT DEFINED CMAKE_Fortran_ARCHIVE_CREATE)
set(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND)
set(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
endif()
if(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH)
set(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
endif()
# compile a Fortran file into an object file
# (put -o after -c to workaround bug in at least one mpif77 wrapper)
IF(NOT CMAKE_Fortran_COMPILE_OBJECT)
SET(CMAKE_Fortran_COMPILE_OBJECT
if(NOT CMAKE_Fortran_COMPILE_OBJECT)
set(CMAKE_Fortran_COMPILE_OBJECT
"<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -c <SOURCE> -o <OBJECT>")
ENDIF(NOT CMAKE_Fortran_COMPILE_OBJECT)
endif()
# link a fortran program
IF(NOT CMAKE_Fortran_LINK_EXECUTABLE)
SET(CMAKE_Fortran_LINK_EXECUTABLE
if(NOT CMAKE_Fortran_LINK_EXECUTABLE)
set(CMAKE_Fortran_LINK_EXECUTABLE
"<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)
SET(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}"
if(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.")
MARK_AS_ADVANCED(CMAKE_Fortran_STANDARD_LIBRARIES)
ENDIF(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
mark_as_advanced(CMAKE_Fortran_STANDARD_LIBRARIES)
endif()
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
SET (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG_INIT}" CACHE STRING
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG_INIT}" CACHE STRING
"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.")
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).")
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.")
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
endif()
MARK_AS_ADVANCED(
mark_as_advanced(
CMAKE_Fortran_FLAGS
CMAKE_Fortran_FLAGS_DEBUG
CMAKE_Fortran_FLAGS_MINSIZEREL
@ -242,4 +242,4 @@ CMAKE_Fortran_FLAGS_RELEASE
CMAKE_Fortran_FLAGS_RELWITHDEBINFO)
# 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
# License text for the above reference.)
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
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_RUNTIME_C_FLAG "") # -rpath
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
SET(CMAKE_INCLUDE_FLAG_C "-I") # -I
SET(CMAKE_INCLUDE_FLAG_C_SEP "") # , or empty
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_LINK_LIBRARY_FLAG "-l")
SET(CMAKE_LINK_LIBRARY_SUFFIX "")
SET(CMAKE_STATIC_LIBRARY_PREFIX "lib")
SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
SET(CMAKE_EXECUTABLE_SUFFIX "") # .exe
SET(CMAKE_DL_LIBS "dl")
SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
set(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
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_RUNTIME_C_FLAG "") # -rpath
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
set(CMAKE_INCLUDE_FLAG_C "-I") # -I
set(CMAKE_INCLUDE_FLAG_C_SEP "") # , or empty
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_LINK_LIBRARY_FLAG "-l")
set(CMAKE_LINK_LIBRARY_SUFFIX "")
set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
set(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
set(CMAKE_EXECUTABLE_SUFFIX "") # .exe
set(CMAKE_DL_LIBS "dl")
set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
# 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.")
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.")
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")
SET(CMAKE_COLOR_MAKEFILE ON CACHE BOOL
if(CMAKE_GENERATOR MATCHES "Makefiles")
set(CMAKE_COLOR_MAKEFILE ON CACHE BOOL
"Enable/Disable color output during build."
)
MARK_AS_ADVANCED(CMAKE_COLOR_MAKEFILE)
IF(DEFINED CMAKE_RULE_MESSAGES)
SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
ENDIF(DEFINED CMAKE_RULE_MESSAGES)
IF(CMAKE_GENERATOR MATCHES "Unix Makefiles")
SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
mark_as_advanced(CMAKE_COLOR_MAKEFILE)
if(DEFINED CMAKE_RULE_MESSAGES)
set_property(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
endif()
if(CMAKE_GENERATOR MATCHES "Unix Makefiles")
set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
"Enable/Disable output of compile commands during generation."
)
MARK_AS_ADVANCED(CMAKE_EXPORT_COMPILE_COMMANDS)
ENDIF(CMAKE_GENERATOR MATCHES "Unix Makefiles")
ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
endif()
endif()
IF(CMAKE_GENERATOR MATCHES "Ninja")
SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
if(CMAKE_GENERATOR MATCHES "Ninja")
set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
"Enable/Disable output of compile commands during generation."
)
MARK_AS_ADVANCED(CMAKE_EXPORT_COMPILE_COMMANDS)
ENDIF(CMAKE_GENERATOR MATCHES "Ninja")
mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
endif()
# GetDefaultWindowsPrefixBase
#
@ -160,27 +160,27 @@ endfunction()
# was initialized by the block below. This is useful for user
# projects to change the default prefix while still allowing the
# command line to override it.
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
endif()
# Choose a default install prefix for this platform.
IF(CMAKE_HOST_UNIX)
SET(CMAKE_INSTALL_PREFIX "/usr/local"
if(CMAKE_HOST_UNIX)
set(CMAKE_INSTALL_PREFIX "/usr/local"
CACHE PATH "Install path prefix, prepended onto install directories.")
ELSE(CMAKE_HOST_UNIX)
else()
GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
SET(CMAKE_INSTALL_PREFIX
set(CMAKE_INSTALL_PREFIX
"${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
CACHE PATH "Install path prefix, prepended onto install directories.")
SET(CMAKE_GENERIC_PROGRAM_FILES)
ENDIF(CMAKE_HOST_UNIX)
set(CMAKE_GENERIC_PROGRAM_FILES)
endif()
# Set a variable which will be used as component name in install() commands
# 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_INSTALL_RPATH
CMAKE_VERBOSE_MAKEFILE

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

@ -13,6 +13,6 @@
# 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.")
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_ARG1 "@CMAKE_Java_COMPILER_ARG1@")
SET(CMAKE_Java_RUNTIME "@CMAKE_Java_RUNTIME@")
SET(CMAKE_Java_ARCHIVE "@CMAKE_Java_ARCHIVE@")
SET(CMAKE_Java_COMPILER_LOADED 1)
set(CMAKE_Java_COMPILER "@CMAKE_Java_COMPILER@")
set(CMAKE_Java_COMPILER_ARG1 "@CMAKE_Java_COMPILER_ARG1@")
set(CMAKE_Java_RUNTIME "@CMAKE_Java_RUNTIME@")
set(CMAKE_Java_ARCHIVE "@CMAKE_Java_ARCHIVE@")
set(CMAKE_Java_COMPILER_LOADED 1)
SET(CMAKE_Java_SOURCE_FILE_EXTENSIONS java)
SET(CMAKE_Java_LINKER_PREFERENCE 40)
SET(CMAKE_Java_OUTPUT_EXTENSION .class)
SET(CMAKE_Java_OUTPUT_EXTENSION_REPLACE 1)
SET(CMAKE_STATIC_LIBRARY_PREFIX_Java "")
SET(CMAKE_STATIC_LIBRARY_SUFFIX_Java ".jar")
SET(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")
set(CMAKE_Java_SOURCE_FILE_EXTENSIONS java)
set(CMAKE_Java_LINKER_PREFERENCE 40)
set(CMAKE_Java_OUTPUT_EXTENSION .class)
set(CMAKE_Java_OUTPUT_EXTENSION_REPLACE 1)
set(CMAKE_STATIC_LIBRARY_PREFIX_Java "")
set(CMAKE_STATIC_LIBRARY_SUFFIX_Java ".jar")
set(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")

@ -18,42 +18,42 @@
# But, it should still be after the platform file so changes can
# 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.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
ENDIF()
include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
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.
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Java} RESULT_VARIABLE _override)
SET(CMAKE_USER_MAKE_RULES_OVERRIDE_Java "${_override}")
ENDIF()
include(${CMAKE_USER_MAKE_RULES_OVERRIDE_Java} RESULT_VARIABLE _override)
set(CMAKE_USER_MAKE_RULES_OVERRIDE_Java "${_override}")
endif()
# this is a place holder if java needed flags for javac they would go here.
IF(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
# IF(WIN32)
# SET(class_files_mask "*.class")
# ELSE(WIN32)
SET(class_files_mask ".")
# ENDIF(WIN32)
SET(CMAKE_Java_CREATE_STATIC_LIBRARY
if(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
# if(WIN32)
# set(class_files_mask "*.class")
# else()
set(class_files_mask ".")
# endif()
set(CMAKE_Java_CREATE_STATIC_LIBRARY
"<CMAKE_Java_ARCHIVE> -cf <TARGET> -C <OBJECT_DIR> ${class_files_mask}")
# "${class_files_mask}" should really be "<OBJECTS>" but compling a *.java
# file can create more than one *.class file...
ENDIF(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
endif()
# compile a Java file into an object file
IF(NOT CMAKE_Java_COMPILE_OBJECT)
SET(CMAKE_Java_COMPILE_OBJECT
if(NOT CMAKE_Java_COMPILE_OBJECT)
set(CMAKE_Java_COMPILE_OBJECT
"<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(CMAKE_INCLUDE_FLAG_Java "-classpath ")
IF(WIN32 AND NOT CYGWIN)
SET(CMAKE_INCLUDE_FLAG_SEP_Java ";")
ELSE(WIN32 AND NOT CYGWIN)
SET(CMAKE_INCLUDE_FLAG_SEP_Java ":")
ENDIF(WIN32 AND NOT CYGWIN)
set(CMAKE_INCLUDE_FLAG_Java "-classpath ")
if(WIN32 AND NOT CYGWIN)
set(CMAKE_INCLUDE_FLAG_SEP_Java ";")
else()
set(CMAKE_INCLUDE_FLAG_SEP_Java ":")
endif()

@ -12,9 +12,9 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM make
find_program(CMAKE_MAKE_PROGRAM make
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\\MinGW;InstallLocation]/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
# 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"
c:/MinGW/bin /MinGW/bin)
FIND_PROGRAM(CMAKE_SH sh.exe )
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")
SET(CMAKE_MAKE_PROGRAM NOTFOUND)
ENDIF(CMAKE_SH)
find_program(CMAKE_SH sh.exe )
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")
set(CMAKE_MAKE_PROGRAM NOTFOUND)
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.)
SET (CMAKE_MAKE_PROGRAM "nmake" CACHE STRING
set (CMAKE_MAKE_PROGRAM "nmake" CACHE STRING
"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
# 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.")
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
mark_as_advanced(CMAKE_MAKE_PROGRAM)

@ -6,9 +6,11 @@
# [NO_CHECK_REQUIRED_COMPONENTS_MACRO])
#
# 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
# 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
# install destinations know to the using project:
@ -31,12 +33,12 @@
# Usage:
# 1. write a FooConfig.cmake.in file as you are used to
# 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)
# 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
# as in CONFIGURE_FILE().
# as in configure_file().
#
# 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.
@ -77,7 +79,7 @@
# 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>.
# 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.
# major.minor.patch is the version number of the project to be installed
# The COMPATIBILITY mode AnyNewerVersion means that the installed package version
@ -173,23 +175,44 @@ function(CONFIGURE_PACKAGE_CONFIG_FILE _inputFile _outputFile)
else()
set(absInstallDir "${CMAKE_INSTALL_PREFIX}/${CCF_INSTALL_DESTINATION}")
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}" )
foreach(var ${CCF_PATH_VARS})
if(NOT DEFINED ${var})
message(FATAL_ERROR "Variable ${var} does not exist")
else()
if(IS_ABSOLUTE "${${var}}")
string(REPLACE "${CMAKE_INSTALL_PREFIX}" "\${PACKAGE_PREFIX_DIR}"
PACKAGE_${var} "${${var}}")
if(forceAbsolutePaths)
if(IS_ABSOLUTE "${${var}}")
set(PACKAGE_${var} "${${var}}")
else()
set(PACKAGE_${var} "${CMAKE_INSTALL_PREFIX}/${${var}}")
endif()
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()
endforeach()
get_filename_component(inputFileName "${_inputFile}" NAME)
set(PACKAGE_INIT "
####### 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)
")
@ -214,7 +237,7 @@ macro(check_required_components _NAME)
set(\${_NAME}_FOUND FALSE)
endif()
endif()
endforeach(comp)
endforeach()
endmacro()
")
endif()

@ -84,11 +84,11 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
# first set all result variables to empty/FALSE
foreach(arg_name ${_singleArgNames} ${_multiArgNames})
set(${prefix}_${arg_name})
endforeach(arg_name)
endforeach()
foreach(option ${_optionNames})
set(${prefix}_${option} FALSE)
endforeach(option)
endforeach()
set(${prefix}_UNPARSED_ARGUMENTS)
@ -109,9 +109,9 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
elseif("${insideValues}" STREQUAL "MULTI")
list(APPEND ${prefix}_${currentArgName} ${currentArg})
endif()
else(insideValues)
else()
list(APPEND ${prefix}_UNPARSED_ARGUMENTS ${currentArg})
endif(insideValues)
endif()
else()
if(NOT ${optionIndex} EQUAL -1)
set(${prefix}_${currentArg} TRUE)
@ -127,12 +127,12 @@ function(CMAKE_PARSE_ARGUMENTS prefix _optionNames _singleArgNames _multiArgName
endif()
endif()
endforeach(currentArg)
endforeach()
# propagate the result variables to the caller:
foreach(arg_name ${_singleArgNames} ${_multiArgNames} ${_optionNames})
set(${prefix}_${arg_name} ${${prefix}_${arg_name}} PARENT_SCOPE)
endforeach(arg_name)
endforeach()
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
# 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_dirs_tmp)
set(implicit_fwks_tmp)
set(log "")
# 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)
if("${line}" MATCHES "${linker_regex}" AND
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)
separate_arguments(args UNIX_COMMAND "${line}")
else()
@ -97,32 +108,62 @@ function(CMAKE_PARSE_IMPLICIT_LINK_INFO text lib_var dir_var log_var obj_regex)
endif()
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.
# We remove items that are not language-specific.
set(implicit_libs "")
foreach(lib IN LISTS implicit_libs_tmp)
if("${lib}" MATCHES "^(crt.*\\.o|gcc.*|System.*)$")
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()
list(APPEND implicit_libs "${lib}")
endif()
endforeach()
# Cleanup list of directories.
set(implicit_dirs "")
foreach(d IN LISTS implicit_dirs_tmp)
get_filename_component(dir "${d}" ABSOLUTE)
list(APPEND implicit_dirs "${dir}")
set(log "${log} collapse dir [${d}] ==> [${dir}]\n")
# Cleanup list of library and framework directories.
set(desc_dirs "library")
set(desc_fwks "framework")
foreach(t dirs fwks)
set(implicit_${t} "")
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()
list(REMOVE_DUPLICATES implicit_dirs)
# Log results.
set(log "${log} implicit libs: [${implicit_libs}]\n")
set(log "${log} implicit dirs: [${implicit_dirs}]\n")
set(log "${log} implicit fwks: [${implicit_fwks}]\n")
# Return results.
set(${lib_var} "${implicit_libs}" PARENT_SCOPE)
set(${dir_var} "${implicit_dirs}" PARENT_SCOPE)
set(${fwk_var} "${implicit_fwks}" PARENT_SCOPE)
set(${log_var} "${log}" PARENT_SCOPE)
endfunction()

@ -35,11 +35,8 @@
#elif defined(__hpux) || defined(__hpux__)
# define PLATFORM_ID "HP-UX"
#elif defined(__HAIKU) || defined(__HAIKU__) || defined(_HAIKU)
#elif defined(__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)
# define PLATFORM_ID "BeOS"
@ -100,6 +97,12 @@
# elif defined(_M_ARM)
# define ARCHITECTURE_ID "ARM"
# elif defined(_M_MIPS)
# define ARCHITECTURE_ID "MIPS"
# elif defined(_M_SH)
# define ARCHITECTURE_ID "SHx"
# else /* unknown architecture */
# define ARCHITECTURE_ID ""
# endif

@ -16,31 +16,31 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
MESSAGE("CMAKE_SYSTEM is ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}")
MESSAGE("CMAKE_SYSTEM file is ${CMAKE_SYSTEM_INFO_FILE}")
MESSAGE("CMAKE_C_COMPILER is ${CMAKE_C_COMPILER}")
MESSAGE("CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}")
message("CMAKE_SYSTEM is ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}")
message("CMAKE_SYSTEM file is ${CMAKE_SYSTEM_INFO_FILE}")
message("CMAKE_C_COMPILER is ${CMAKE_C_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_CXX_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
MESSAGE("CMAKE_DL_LIBS is ${CMAKE_DL_LIBS}")
MESSAGE("CMAKE_SHARED_LIBRARY_PREFIX is ${CMAKE_SHARED_LIBRARY_PREFIX}")
MESSAGE("CMAKE_SHARED_LIBRARY_SUFFIX is ${CMAKE_SHARED_LIBRARY_SUFFIX}")
MESSAGE("CMAKE_COMPILER_IS_GNUCC = ${CMAKE_COMPILER_IS_GNUCC}")
MESSAGE("CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}")
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_DL_LIBS is ${CMAKE_DL_LIBS}")
message("CMAKE_SHARED_LIBRARY_PREFIX is ${CMAKE_SHARED_LIBRARY_PREFIX}")
message("CMAKE_SHARED_LIBRARY_SUFFIX is ${CMAKE_SHARED_LIBRARY_SUFFIX}")
message("CMAKE_COMPILER_IS_GNUCC = ${CMAKE_COMPILER_IS_GNUCC}")
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_MODULE is ${CMAKE_CXX_CREATE_SHARED_MODULE}")
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_LINK_EXECUTABLE ${CMAKE_CXX_LINK_EXECUTABLE}")
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_STATIC_LIBRARY is ${CMAKE_CXX_CREATE_STATIC_LIBRARY}")
message("CMAKE_CXX_COMPILE_OBJECT is ${CMAKE_CXX_COMPILE_OBJECT}")
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_MODULE is ${CMAKE_C_CREATE_SHARED_MODULE}")
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_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE}")
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_STATIC_LIBRARY is ${CMAKE_C_CREATE_STATIC_LIBRARY}")
message("CMAKE_C_COMPILE_OBJECT is ${CMAKE_C_COMPILE_OBJECT}")
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_C_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_C_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}")

@ -31,31 +31,31 @@
# License text for the above reference.)
MACRO(CMAKE_PUSH_CHECK_STATE)
macro(CMAKE_PUSH_CHECK_STATE)
IF(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER)
SET(_CMAKE_PUSH_CHECK_STATE_COUNTER 0)
ENDIF()
if(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER)
set(_CMAKE_PUSH_CHECK_STATE_COUNTER 0)
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_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_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
ENDMACRO(CMAKE_PUSH_CHECK_STATE)
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_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
endmacro()
MACRO(CMAKE_POP_CHECK_STATE)
macro(CMAKE_POP_CHECK_STATE)
# 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_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_FLAGS ${_CMAKE_REQUIRED_FLAGS_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_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_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")
ENDIF()
math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
endif()
ENDMACRO(CMAKE_POP_CHECK_STATE)
endmacro()

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

@ -18,36 +18,36 @@
# if it exists.
# make sure we don't use CMAKE_BASE_NAME from somewhere else
SET(CMAKE_BASE_NAME)
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE)
IF("${CMAKE_BASE_NAME}" MATCHES "windres")
SET(CMAKE_BASE_NAME "windres")
ENDIF()
SET(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
set(CMAKE_BASE_NAME)
get_filename_component(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE)
if("${CMAKE_BASE_NAME}" MATCHES "windres")
set(CMAKE_BASE_NAME "windres")
endif()
set(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
${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.")
# 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
# 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
# CMAKE_RC_COMPILE_OBJECT
SET(CMAKE_INCLUDE_FLAG_RC "-I")
set(CMAKE_INCLUDE_FLAG_RC "-I")
# compile a Resource file into an object file
IF(NOT CMAKE_RC_COMPILE_OBJECT)
SET(CMAKE_RC_COMPILE_OBJECT
if(NOT CMAKE_RC_COMPILE_OBJECT)
set(CMAKE_RC_COMPILE_OBJECT
"<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> /fo<OBJECT> <SOURCE>")
ENDIF(NOT CMAKE_RC_COMPILE_OBJECT)
endif()
MARK_AS_ADVANCED(
mark_as_advanced(
CMAKE_RC_FLAGS
)
# 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@
SET(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
SET(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@")
SET(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
set(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
set(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
set(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@")
set(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
SET(CMAKE_HOST_SYSTEM_NAME "@CMAKE_HOST_SYSTEM_NAME@")
SET(CMAKE_HOST_SYSTEM_VERSION "@CMAKE_HOST_SYSTEM_VERSION@")
SET(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
set(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
set(CMAKE_HOST_SYSTEM_NAME "@CMAKE_HOST_SYSTEM_NAME@")
set(CMAKE_HOST_SYSTEM_VERSION "@CMAKE_HOST_SYSTEM_VERSION@")
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
# platform, so they can be used for testing the target platform instead
# of testing the host platform.
SET(APPLE )
SET(UNIX )
SET(CYGWIN )
SET(WIN32 )
set(APPLE )
set(UNIX )
set(CYGWIN )
set(WIN32 )
# include Generic system information
INCLUDE(CMakeGenericSystem)
include(CMakeGenericSystem)
# 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)
MESSAGE("System is unknown to cmake, create:\n${CMAKE_SYSTEM_INFO_FILE}"
if(NOT _INCLUDED_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 "
"cmake@www.cmake.org so it can be added to cmake")
IF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/CMakeCache.txt
if(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
configure_file(${CMAKE_BINARY_DIR}/CMakeCache.txt
${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.")
ENDIF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
ENDIF(NOT _INCLUDED_SYSTEM_INFO_FILE)
endif()
endif()
# 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
IF(CMAKE_EXTRA_GENERATOR)
STRING(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} )
INCLUDE("CMakeFind${_CMAKE_EXTRA_GENERATOR_NO_SPACES}" OPTIONAL)
ENDIF(CMAKE_EXTRA_GENERATOR)
if(CMAKE_EXTRA_GENERATOR)
string(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} )
include("CMakeFind${_CMAKE_EXTRA_GENERATOR_NO_SPACES}" OPTIONAL)
endif()
# for most systems a module is the same as a shared library
# so unless the variable CMAKE_MODULE_EXISTS is set just
# copy the values from the LIBRARY variables
# this has to be done after the system information has been loaded
IF(NOT CMAKE_MODULE_EXISTS)
SET(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
SET(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
ENDIF(NOT CMAKE_MODULE_EXISTS)
if(NOT CMAKE_MODULE_EXISTS)
set(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
set(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
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
# for each assembler on every architecture.
SET(ASM_DIALECT "-ATT")
INCLUDE(CMakeTestASMCompiler)
SET(ASM_DIALECT)
set(ASM_DIALECT "-ATT")
include(CMakeTestASMCompiler)
set(ASM_DIALECT)

@ -19,17 +19,17 @@
# for each assembler on every architecture.
SET(_ASM_COMPILER_WORKS 0)
set(_ASM_COMPILER_WORKS 0)
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER)
SET(_ASM_COMPILER_WORKS 1)
ENDIF()
if(CMAKE_ASM${ASM_DIALECT}_COMPILER)
set(_ASM_COMPILER_WORKS 1)
endif()
# when using generic "ASM" support, we must have detected the compiler ID, fail otherwise:
IF("ASM${ASM_DIALECT}" STREQUAL "ASM")
IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
SET(_ASM_COMPILER_WORKS 0)
ENDIF()
ENDIF()
if("ASM${ASM_DIALECT}" STREQUAL "ASM")
if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
set(_ASM_COMPILER_WORKS 0)
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
# for each assembler on every architecture.
SET(ASM_DIALECT "_MASM")
INCLUDE(CMakeTestASMCompiler)
SET(ASM_DIALECT)
set(ASM_DIALECT "_MASM")
include(CMakeTestASMCompiler)
set(ASM_DIALECT)

@ -18,6 +18,6 @@
# because otherwise there would have to be a separate assembler source file
# for each assembler on every architecture.
SET(ASM_DIALECT "_NASM")
INCLUDE(CMakeTestASMCompiler)
SET(ASM_DIALECT)
set(ASM_DIALECT "_NASM")
include(CMakeTestASMCompiler)
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");
# see accompanying file Copyright.txt for details.
@ -12,16 +12,27 @@
# (To distribute this file outside of CMake, substitute the full
# 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
# determine that that selected C compiler can actually compile
# and link the most basic of programs. If not, a fatal error
# is set and cmake stops processing commands and will not generate
# any makefiles or projects.
IF(NOT CMAKE_C_COMPILER_WORKS)
if(NOT CMAKE_C_COMPILER_WORKS)
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"
"# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n"
"#endif\n"
@ -33,55 +44,50 @@ IF(NOT CMAKE_C_COMPILER_WORKS)
"int main(int argc, char* argv[])\n"
"#endif\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
OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT)
SET(C_TEST_WAS_RUN 1)
ENDIF(NOT CMAKE_C_COMPILER_WORKS)
# Move result from cache to normal variable.
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")
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 "
"the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
# if the compiler is broken make sure to remove the platform file
# 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}\" "
message(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
"is not able to compile a simple test program.\nIt fails "
"with the following output:\n ${__CMAKE_C_COMPILER_OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.")
ELSE(NOT CMAKE_C_COMPILER_WORKS)
IF(C_TEST_WAS_RUN)
else()
if(C_TEST_WAS_RUN)
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 "
"the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
ENDIF(C_TEST_WAS_RUN)
SET(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
endif()
# 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)
# The compiler configuration was forced by the user.
# Assume the user has configured all compiler information.
ELSE(CMAKE_C_COMPILER_FORCED)
# 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)
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)
if(CMAKE_C_SIZEOF_DATA_PTR)
foreach(f ${CMAKE_C_ABI_FILES})
include(${f})
endforeach()
unset(CMAKE_C_ABI_FILES)
endif()
endif()
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");
# see accompanying file Copyright.txt for details.
@ -12,69 +12,75 @@
# (To distribute this file outside of CMake, substitute the full
# 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
# determine that that selected C++ compiler can actually compile
# and link the most basic of programs. If not, a fatal error
# is set and cmake stops processing commands and will not generate
# any makefiles or projects.
IF(NOT CMAKE_CXX_COMPILER_WORKS)
if(NOT CMAKE_CXX_COMPILER_WORKS)
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"
"# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n"
"#endif\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
OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT)
SET(CXX_TEST_WAS_RUN 1)
ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
# Move result from cache to normal variable.
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")
# if the compiler is broken make sure to remove the platform file
# 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
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the CXX compiler works failed with "
"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 "
"with the following output:\n ${__CMAKE_CXX_COMPILER_OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.")
ELSE(NOT CMAKE_CXX_COMPILER_WORKS)
IF(CXX_TEST_WAS_RUN)
else()
if(CXX_TEST_WAS_RUN)
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 "
"the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
ENDIF(CXX_TEST_WAS_RUN)
SET(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")
endif()
# 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)
# The compiler configuration was forced by the user.
# Assume the user has configured all compiler information.
ELSE(CMAKE_CXX_COMPILER_FORCED)
# 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)
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)
if(CMAKE_CXX_SIZEOF_DATA_PTR)
foreach(f ${CMAKE_CXX_ABI_FILES})
include(${f})
endforeach()
unset(CMAKE_CXX_ABI_FILES)
endif()
endif()
UNSET(__CMAKE_CXX_COMPILER_OUTPUT)
unset(__CMAKE_CXX_COMPILER_OUTPUT)

@ -13,9 +13,9 @@
# License text for the above reference.)
function(PrintTestCompilerStatus LANG MSG)
IF(CMAKE_GENERATOR MATCHES Make)
MESSAGE(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
ELSE()
MESSAGE(STATUS "Check for working ${LANG} compiler using: ${CMAKE_GENERATOR}${MSG}")
ENDIF()
if(CMAKE_GENERATOR MATCHES Make)
message(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
else()
message(STATUS "Check for working ${LANG} compiler using: ${CMAKE_GENERATOR}${MSG}")
endif()
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");
# see accompanying file Copyright.txt for details.
@ -12,90 +12,100 @@
# (To distribute this file outside of CMake, substitute the full
# 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
# determine that that selected Fortran compiler can actually compile
# and link the most basic of programs. If not, a fatal error
# is set and cmake stops processing commands and will not generate
# any makefiles or projects.
IF(NOT CMAKE_Fortran_COMPILER_WORKS)
if(NOT CMAKE_Fortran_COMPILER_WORKS)
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
PRINT *, 'Hello'
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
OUTPUT_VARIABLE OUTPUT)
SET(FORTRAN_TEST_WAS_RUN 1)
ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS)
# Move result from cache to normal variable.
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")
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 "
"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 "
"with the following output:\n ${OUTPUT}\n\n"
"CMake will not be able to correctly generate this project.")
ELSE(NOT CMAKE_Fortran_COMPILER_WORKS)
IF(FORTRAN_TEST_WAS_RUN)
else()
if(FORTRAN_TEST_WAS_RUN)
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 "
"the following output:\n${OUTPUT}\n\n")
ENDIF(FORTRAN_TEST_WAS_RUN)
SET(CMAKE_Fortran_COMPILER_WORKS 1 CACHE INTERNAL "")
endif()
IF(CMAKE_Fortran_COMPILER_FORCED)
# The compiler configuration was forced by the user.
# Assume the user has configured all compiler information.
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)
# 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.
IF(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90")
FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 "
# Test for Fortran 90 support by using an f90-specific construct.
if(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90")
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 "
PROGRAM TESTFortran90
stop = 1 ; do while ( stop .eq. 0 ) ; end do
END PROGRAM TESTFortran90
")
TRY_COMPILE(CMAKE_Fortran_COMPILER_SUPPORTS_F90 ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90
OUTPUT_VARIABLE OUTPUT)
IF(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- yes")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler supports Fortran 90 passed with "
"the following output:\n${OUTPUT}\n\n")
SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
ELSE(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- no")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the Fortran compiler supports Fortran 90 failed with "
"the following output:\n${OUTPUT}\n\n")
SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0)
ENDIF(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
UNSET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE)
ENDIF(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
try_compile(CMAKE_Fortran_COMPILER_SUPPORTS_F90 ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90
OUTPUT_VARIABLE OUTPUT)
if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- yes")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Determining if the Fortran compiler supports Fortran 90 passed with "
"the following output:\n${OUTPUT}\n\n")
set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
else()
message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- no")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the Fortran compiler supports Fortran 90 failed with "
"the following output:\n${OUTPUT}\n\n")
set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0)
endif()
unset(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE)
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(
${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
)
INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake)
ENDIF(CMAKE_Fortran_COMPILER_FORCED)
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)
if(CMAKE_Fortran_SIZEOF_DATA_PTR)
foreach(f ${CMAKE_Fortran_ABI_FILES})
include(${f})
endforeach()
unset(CMAKE_Fortran_ABI_FILES)
endif()
endif()

@ -17,4 +17,4 @@
# and link the most basic of programs. If not, a fatal error
# is set and cmake stops processing commands and will not generate
# 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
# 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
# License text for the above reference.)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES gmake make smake)
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
find_program(CMAKE_MAKE_PROGRAM NAMES gmake make smake)
mark_as_advanced(CMAKE_MAKE_PROGRAM)

@ -15,7 +15,7 @@
# 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
# since Intel Fortran uses the older devenv file format.
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
find_program(CMAKE_MAKE_PROGRAM
NAMES devenv
HINTS
[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
# is a better choice for this. However, VCExpress does not support
# cross compiling needed for Win CE.
IF(NOT CMAKE_CROSSCOMPILING)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
if(NOT CMAKE_CROSSCOMPILING)
find_program(CMAKE_MAKE_PROGRAM
NAMES MSBuild
HINTS
[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]/"
"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]/")
ENDIF()
endif()
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
SET(MSVC10 1)
SET(MSVC_VERSION 1600)
mark_as_advanced(CMAKE_MAKE_PROGRAM)
set(MSVC10 1)
set(MSVC_VERSION 1600)

@ -15,7 +15,7 @@
# 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
# since Intel Fortran uses the older devenv file format.
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
find_program(CMAKE_MAKE_PROGRAM
NAMES devenv
HINTS
[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.
# it is expected that if devenv is not found, then we are
# dealing with Visual Studio Express. VCExpress has random
# failures when being run as a command line build tool which
# causes the compiler checks and try-compile stuff to fail. MSbuild
# is a better choice for this. However, VCExpress does not support
# cross compiling needed for Win CE.
IF(NOT CMAKE_CROSSCOMPILING)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
# dealing with Visual Studio Express.
if(NOT CMAKE_CROSSCOMPILING)
set(_FDIR "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkDir32]")
set(_FVER "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\SxS\\VC7;FrameworkVer32]")
find_program(CMAKE_MAKE_PROGRAM
NAMES MSBuild
HINTS
${_FDIR}/${_FVER}
[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]/"
"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]/")
ENDIF()
endif()
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
SET(MSVC11 1)
SET(MSVC_VERSION 1700)
mark_as_advanced(CMAKE_MAKE_PROGRAM)
set(MSVC11 1)
set(MSVC_VERSION 1700)

@ -13,14 +13,14 @@
# License text for the above reference.)
# hard code these for fast backwards compatibility tests
SET (CMAKE_SIZEOF_INT 4 CACHE INTERNAL "Size of int data type")
SET (CMAKE_SIZEOF_LONG 4 CACHE INTERNAL "Size of long data type")
SET (CMAKE_SIZEOF_VOID_P 4 CACHE INTERNAL "Size of void* data type")
SET (CMAKE_SIZEOF_CHAR 1 CACHE INTERNAL "Size of char data type")
SET (CMAKE_SIZEOF_SHORT 2 CACHE INTERNAL "Size of short data type")
SET (CMAKE_SIZEOF_FLOAT 4 CACHE INTERNAL "Size of float data type")
SET (CMAKE_SIZEOF_DOUBLE 8 CACHE INTERNAL "Size of double data type")
SET (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
set (CMAKE_SIZEOF_INT 4 CACHE INTERNAL "Size of int data type")
set (CMAKE_SIZEOF_LONG 4 CACHE INTERNAL "Size of long data type")
set (CMAKE_SIZEOF_VOID_P 4 CACHE INTERNAL "Size of void* data type")
set (CMAKE_SIZEOF_CHAR 1 CACHE INTERNAL "Size of char data type")
set (CMAKE_SIZEOF_SHORT 2 CACHE INTERNAL "Size of short data type")
set (CMAKE_SIZEOF_FLOAT 4 CACHE INTERNAL "Size of float data type")
set (CMAKE_SIZEOF_DOUBLE 8 CACHE INTERNAL "Size of double data type")
set (CMAKE_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
"Does the compiler support ansi for scope.")
SET (CMAKE_USE_WIN32_THREADS TRUE CACHE BOOL "Use the win32 thread library.")
SET (CMAKE_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")
set (CMAKE_USE_WIN32_THREADS TRUE CACHE BOOL "Use the win32 thread library.")
set (CMAKE_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")

@ -12,7 +12,7 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
find_program(CMAKE_MAKE_PROGRAM
NAMES msdev
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\6.0\\Setup;VsCommonDir]/MSDev98/Bin
@ -20,6 +20,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
"c:/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin"
"/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin"
)
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
SET(MSVC60 1)
SET(MSVC_VERSION 1200)
mark_as_advanced(CMAKE_MAKE_PROGRAM)
set(MSVC60 1)
set(MSVC_VERSION 1200)

@ -12,7 +12,7 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
find_program(CMAKE_MAKE_PROGRAM
NAMES devenv
PATHS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VS;EnvironmentDirectory]
@ -21,6 +21,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
"c:/Program Files/Microsoft Visual Studio.NET/Common7/IDE"
"/Program Files/Microsoft Visual Studio .NET/Common7/IDE/"
)
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
SET(MSVC71 1)
SET(MSVC_VERSION 1310)
mark_as_advanced(CMAKE_MAKE_PROGRAM)
set(MSVC71 1)
set(MSVC_VERSION 1310)

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

Loading…
Cancel
Save