Merge topic 'cleanup-style'

68bc863 Merge branch 'master' into cleanup-style
a05eba5 CMakeVersion.bash: Update sed expression for lower-case 'set'
3c0488d Fix WarnUnusedUnusedViaUnset test pass/fail regex
6c2c483 Remove trailing TAB from NSIS.template.in
9db3116 Remove CMake-language block-end command arguments
77543bd Convert CMake-language commands to lower case
7bbaa42 Remove trailing whitespace from most CMake and C/C++ code
be9db98 Merge topic 'watcom-compiler-version'
af42ae4 Watcom: Simplify compiler version detection (#11866)
This commit is contained in:
Brad King 2012-08-14 08:31:45 -04:00 committed by CMake Topic Stage
commit cd3bd23266
1063 changed files with 20684 additions and 20697 deletions

View File

@ -11,113 +11,113 @@
#=============================================================================
# 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)
# These files are required by the cmCPackCygwinSourceGenerator and the files
# put into the release tar files.
SET(CPACK_CYGWIN_BUILD_SCRIPT
set(CPACK_CYGWIN_BUILD_SCRIPT
"${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.sh")
SET(CPACK_CYGWIN_PATCH_FILE
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()

View File

@ -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,30 @@ 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()

View File

@ -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")

View File

@ -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,155 +84,155 @@ 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_MAKEPROGRAM "${MAKEPROGRAM}")
else()
set(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
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
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)
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(CMAKE_USE_SYSTEM_${util})
ENDFOREACH(util)
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}")
@ -249,7 +249,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 +260,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}")
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()
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 +507,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 +519,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_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
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 +555,43 @@ 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
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)
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)
# 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 +600,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 +620,7 @@ INSTALL(
)
# process docs related install
ADD_SUBDIRECTORY(Docs)
add_subdirectory(Docs)
#-----------------------------------------------------------------------
# End of the main section of the CMakeLists file
@ -631,4 +631,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})

View File

@ -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")

View File

@ -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"
@ -56,21 +56,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

View File

@ -13,52 +13,52 @@
#-----------------------------------------------------------------------------
# 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 ()

View File

@ -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)

View File

@ -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()

View File

@ -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)
@ -370,12 +370,12 @@ function(set_bundle_key_values keys_var context item exepath dirs copyflag)
# 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/")
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()

View File

@ -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)

View File

@ -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)

View File

@ -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)
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(NOT _INCLUDED_FILE)
ENDIF(CMAKE_SYSTEM_PROCESSOR)
if(CMAKE_SYSTEM_PROCESSOR)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
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(NOT _INCLUDED_FILE)
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
if(NOT _INCLUDED_FILE)
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)

View File

@ -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)

View File

@ -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()

View File

@ -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(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)
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()
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)
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

View File

@ -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()

View File

@ -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)

View File

@ -1,53 +1,53 @@
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_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()
SET(CMAKE_C_COMPILER_ENV_VAR "CC")
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)
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@")
set(CMAKE_C_HAS_ISYSROOT "@CMAKE_C_HAS_ISYSROOT@")
@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_CMCLDEPS_EXECUTABLE@
@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@

View File

@ -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)

View File

@ -1,54 +1,54 @@
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_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()
SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
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)
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@")
set(CMAKE_CXX_HAS_ISYSROOT "@CMAKE_CXX_HAS_ISYSROOT@")
@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_CMCLDEPS_EXECUTABLE@
@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@

View File

@ -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)

View File

@ -20,18 +20,18 @@
# 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
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()
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()

View File

@ -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

View File

@ -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()

View File

@ -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)

View File

@ -14,40 +14,40 @@
# determine the compiler to use for ASM programs
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
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(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()
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
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()
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.
_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
@ -56,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()
@ -123,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
configure_file(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/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)

View File

@ -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)

View File

@ -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)

View File

@ -31,89 +31,89 @@
# If not already set before, it also sets
# _CMAKE_TOOLCHAIN_PREFIX
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
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()
include(Platform/${CMAKE_SYSTEM_NAME}-C OPTIONAL)
if(NOT CMAKE_C_COMPILER_NAMES)
set(CMAKE_C_COMPILER_NAMES cc)
endif()
IF(NOT CMAKE_C_COMPILER)
SET(CMAKE_C_COMPILER_INIT NOTFOUND)
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 ".+")
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(NOT CMAKE_C_COMPILER_INIT)
ENDIF(CMAKE_GENERATOR_CC)
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()
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(NOT CMAKE_C_COMPILER)
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("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
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(CMAKE_C_COMPILER_WITH_PATH)
ENDIF(NOT _CMAKE_USER_C_COMPILER_PATH)
ENDIF(NOT CMAKE_C_COMPILER)
MARK_AS_ADVANCED(CMAKE_C_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)
IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
if (NOT _CMAKE_TOOLCHAIN_LOCATION)
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
endif ()
# 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(${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()
IF(NOT CMAKE_C_COMPILER_ID_RUN)
SET(CMAKE_C_COMPILER_ID_RUN 1)
if(NOT CMAKE_C_COMPILER_ID_RUN)
set(CMAKE_C_COMPILER_ID_RUN 1)
# Each entry in this list is a set of extra flags to try
# 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"
@ -122,22 +122,22 @@ IF(NOT CMAKE_C_COMPILER_ID_RUN)
)
# 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 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
@ -146,33 +146,33 @@ 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-$")
if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif ()
ENDIF (CMAKE_CROSSCOMPILING
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)
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
configure_file(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
"${CMAKE_PLATFORM_ROOT_BIN}/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")

View File

@ -30,42 +30,42 @@
# If not already set before, it also sets
# _CMAKE_TOOLCHAIN_PREFIX
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
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()
include(Platform/${CMAKE_SYSTEM_NAME}-CXX OPTIONAL)
if(NOT CMAKE_CXX_COMPILER_NAMES)
set(CMAKE_CXX_COMPILER_NAMES CC)
endif()
IF(NOT CMAKE_CXX_COMPILER)
SET(CMAKE_CXX_COMPILER_INIT NOTFOUND)
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 ".+")
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(NOT CMAKE_CXX_COMPILER_INIT)
ENDIF(CMAKE_GENERATOR_CXX)
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()
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(NOT CMAKE_CXX_COMPILER)
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
@ -73,31 +73,31 @@ ELSE(NOT CMAKE_CXX_COMPILER)
# 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)
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(CMAKE_CXX_COMPILER_WITH_PATH)
ENDIF(NOT _CMAKE_USER_CXX_COMPILER_PATH)
ENDIF(NOT CMAKE_CXX_COMPILER)
MARK_AS_ADVANCED(CMAKE_CXX_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)
IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
if (NOT _CMAKE_TOOLCHAIN_LOCATION)
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
endif ()
# This block was used before the compiler was identified by building a
# source file. Unless g++ crashes when building a small C++
@ -106,45 +106,45 @@ ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
# 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)
# if(BEOS)
# set(CMAKE_COMPILER_IS_GNUCXX 1)
# set(CMAKE_COMPILER_IS_GNUCXX_RUN 1)
# endif()
# 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)
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()
if(NOT CMAKE_CXX_COMPILER_ID_RUN)
set(CMAKE_CXX_COMPILER_ID_RUN 1)
# Each entry in this list is a set of extra flags to try
# 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"
)
# 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 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
@ -153,34 +153,34 @@ 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-$")
if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
endif ()
ENDIF (CMAKE_CROSSCOMPILING
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)
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
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
)
SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")

View File

@ -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_DETERMINE_${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_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
${CMAKE_BINARY_DIR} ${src}
CMAKE_FLAGS "${CMAKE_FLAGS}"
"-DCMAKE_${lang}_STANDARD_LIBRARIES="
@ -41,40 +41,40 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
)
# 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_DETERMINE_${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
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
@ -82,50 +82,50 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
AND NOT "${CMAKE_GENERATOR}" MATCHES Xcode)
CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs 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)
set(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "${implicit_libs}" PARENT_SCOPE)
set(CMAKE_${lang}_IMPLICIT_LINK_DIRECTORIES "${implicit_dirs}" 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()

View File

@ -16,90 +16,90 @@
# 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_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/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)
else()
message(STATUS "The ${lang} compiler identification is unknown")
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}"
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(
if(COMMAND EXECUTE_PROCESS)
execute_process(
COMMAND ${CMAKE_${lang}_COMPILER}
${CMAKE_${lang}_COMPILER_ID_ARG1}
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
@ -110,8 +110,8 @@ Id flags: ${testflags}
ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
)
ELSE(COMMAND EXECUTE_PROCESS)
EXEC_PROGRAM(
else()
exec_program(
${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_DIR}
ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1}
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
@ -120,12 +120,12 @@ Id flags: ${testflags}
OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT
)
ENDIF(COMMAND EXECUTE_PROCESS)
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 +133,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 +153,120 @@ ${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 COMPILER_${lang}_PRODUCED_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
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)
endforeach()
IF(NOT COMPILER_${lang}_PRODUCED_FILES)
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")
# 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(NOT CMAKE_EXECUTABLE_FORMAT)
IF(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)
SET(CMAKE_EXECUTABLE_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 +276,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_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/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 +302,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()

View File

@ -19,34 +19,34 @@
# the cmake variable CMAKE_GENERATOR_FC which can be defined by a generator
# as a default compiler
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()
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(NOT CMAKE_Fortran_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 ".+")
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(NOT CMAKE_Fortran_COMPILER_INIT)
ENDIF(CMAKE_GENERATOR_FC)
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)
if(NOT CMAKE_Fortran_COMPILER_INIT)
# Known compilers:
# f77/f90/f95: generic compiler names
# g77: GNU Fortran 77 compiler
@ -67,68 +67,68 @@ IF(NOT CMAKE_Fortran_COMPILER)
# 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
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()
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(NOT CMAKE_Fortran_COMPILER)
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("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
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}
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)
endif()
endif()
endif()
MARK_AS_ADVANCED(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(${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()
IF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
SET(CMAKE_Fortran_COMPILER_ID_RUN 1)
if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
set(CMAKE_Fortran_COMPILER_ID_RUN 1)
# Each entry in this list is a set of extra flags to try
# 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"
@ -137,65 +137,65 @@ IF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
)
# 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)
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()
INCLUDE(CMakeFindBinUtils)
include(CMakeFindBinUtils)
IF(MSVC_Fortran_ARCHITECTURE_ID)
SET(SET_MSVC_Fortran_ARCHITECTURE_ID
"SET(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})")
ENDIF()
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
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
)
SET(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")

View File

@ -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"
@ -65,38 +65,38 @@ IF(NOT CMAKE_Java_COMPILER)
/opt/sun-jdk-1.5.0.04/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
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")
set(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")

View File

@ -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
configure_file(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeRCCompiler.cmake IMMEDIATE)
SET(CMAKE_RC_COMPILER_ENV_VAR "RC")
set(CMAKE_RC_COMPILER_ENV_VAR "RC")

View File

@ -42,135 +42,135 @@
# 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")
set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
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)
if(CMAKE_SYSTEM_NAME)
if(NOT DEFINED CMAKE_CROSSCOMPILING)
set(CMAKE_CROSSCOMPILING TRUE)
endif()
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(NOT ${_PREFIX}_NAME)
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
configure_file(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
IMMEDIATE @ONLY)
ENDIF(CMAKE_BINARY_DIR)
endif()

View File

@ -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}" )
@ -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)

View File

@ -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()

View File

@ -18,39 +18,39 @@
# 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" )
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
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})
string(STRIP "${nextLine}" _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 +59,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)
_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)
_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})

View File

@ -30,46 +30,46 @@
# 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"
else("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
FIND_PROGRAM(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
find_program(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
FIND_PROGRAM(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
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"
endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
# 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()

View File

@ -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)

View File

@ -15,42 +15,42 @@
# 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(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()
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_4.2 "Juno" )
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})"
@ -58,28 +58,28 @@ FUNCTION(_FIND_ECLIPSE_VERSION)
"3.7 (${_ECLIPSE_VERSION_NAME_3.7})"
"4.2 (${_ECLIPSE_VERSION_NAME_4.2})"
)
ENDFUNCTION()
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")
# 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)

View File

@ -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()

View File

@ -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()

View File

@ -179,7 +179,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()

View File

@ -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)

View File

@ -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)

View File

@ -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,41 @@
# (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_WORKS TRUE)
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_WORKS TRUE)
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_WORKS TRUE)
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()

View File

@ -1,52 +1,52 @@
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_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()
SET(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 @CMAKE_Fortran_COMPILER_SUPPORTS_F90@)
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)
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@")

View File

@ -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)

View File

@ -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_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_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_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

View File

@ -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()

View File

@ -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)

View File

@ -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")

View File

@ -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)
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
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()

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -6,7 +6,7 @@
# [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.
#
@ -31,12 +31,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 +77,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
@ -214,7 +214,7 @@ macro(check_required_components _NAME)
set(\${_NAME}_FOUND FALSE)
endif()
endif()
endforeach(comp)
endforeach()
endmacro()
")
endif()

View File

@ -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()

View File

@ -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}")

View 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()

View File

@ -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")

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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)

View File

@ -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 "")

View File

@ -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)

View File

@ -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)

View File

@ -12,16 +12,16 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CMakeTestCompilerCommon)
include(CMakeTestCompilerCommon)
# 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 +33,55 @@ 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)
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}\" "
file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
message(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
"is not able to compile a simple test program.\nIt fails "
"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()
set(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
IF(CMAKE_C_COMPILER_FORCED)
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)
else()
# Try to identify the ABI and configure it into CMakeCCompiler.cmake
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
CMAKE_DETERMINE_COMPILER_ABI(C ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c)
CONFIGURE_FILE(
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)
include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake)
endif()
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)

View File

@ -12,69 +12,69 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CMakeTestCompilerCommon)
include(CMakeTestCompilerCommon)
# 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)
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(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Determining if the CXX compiler works failed with "
"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()
set(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")
IF(CMAKE_CXX_COMPILER_FORCED)
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)
else()
# Try to identify the ABI and configure it into CMakeCXXCompiler.cmake
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.cmake)
CMAKE_DETERMINE_COMPILER_ABI(CXX ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp)
CONFIGURE_FILE(
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)
include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake)
endif()
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)

View File

@ -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()

View File

@ -12,90 +12,90 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CMakeTestCompilerCommon)
include(CMakeTestCompilerCommon)
# 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)
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()
set(CMAKE_Fortran_COMPILER_WORKS 1 CACHE INTERNAL "")
IF(CMAKE_Fortran_COMPILER_FORCED)
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)
else()
# Try to identify the ABI and configure it into CMakeFortranCompiler.cmake
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerABI.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 "
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}
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
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
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(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
UNSET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE)
ENDIF(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0)
endif()
unset(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE)
endif()
CONFIGURE_FILE(
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)
include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake)
endif()
if(CMAKE_Fortran_SIZEOF_DATA_PTR)
foreach(f ${CMAKE_Fortran_ABI_FILES})
include(${f})
endforeach()
unset(CMAKE_Fortran_ABI_FILES)
endif()
endif()

View File

@ -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 "")

View File

@ -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 "")

View File

@ -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)

View File

@ -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)

View File

@ -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]
@ -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\\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)

View File

@ -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")

View File

@ -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)

View File

@ -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)

View File

@ -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 0 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 0 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")

View File

@ -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.0\\Setup\\VS;EnvironmentDirectory]
@ -20,6 +20,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(MSVC70 1)
SET(MSVC_VERSION 1300)
mark_as_advanced(CMAKE_MAKE_PROGRAM)
set(MSVC70 1)
set(MSVC_VERSION 1300)

View File

@ -13,12 +13,12 @@
# License text for the above reference.)
# VCExpress does not support cross compiling, which is necessary for Win CE
SET( _CMAKE_MAKE_PROGRAM_NAMES devenv)
IF(NOT CMAKE_CROSSCOMPILING)
SET( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
ENDIF(NOT CMAKE_CROSSCOMPILING)
set( _CMAKE_MAKE_PROGRAM_NAMES devenv)
if(NOT CMAKE_CROSSCOMPILING)
set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
endif()
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
find_program(CMAKE_MAKE_PROGRAM
NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
HINTS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;EnvironmentDirectory]
@ -29,6 +29,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
"$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/Common7/IDE"
"/Program Files/Microsoft Visual Studio 8/Common7/IDE/"
)
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
SET(MSVC80 1)
SET(MSVC_VERSION 1400)
mark_as_advanced(CMAKE_MAKE_PROGRAM)
set(MSVC80 1)
set(MSVC_VERSION 1400)

View File

@ -13,12 +13,12 @@
# License text for the above reference.)
# VCExpress does not support cross compiling, which is necessary for Win CE
SET( _CMAKE_MAKE_PROGRAM_NAMES devenv)
IF(NOT CMAKE_CROSSCOMPILING)
SET( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
ENDIF(NOT CMAKE_CROSSCOMPILING)
set( _CMAKE_MAKE_PROGRAM_NAMES devenv)
if(NOT CMAKE_CROSSCOMPILING)
set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
endif()
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
find_program(CMAKE_MAKE_PROGRAM
NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
HINTS
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;EnvironmentDirectory]
@ -34,6 +34,6 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
"/Program Files/Microsoft Visual Studio 9.0/Common7/IDE/"
"/Program Files/Microsoft Visual Studio 9/Common7/IDE/"
)
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
SET(MSVC90 1)
SET(MSVC_VERSION 1500)
mark_as_advanced(CMAKE_MAKE_PROGRAM)
set(MSVC90 1)
set(MSVC_VERSION 1500)

View File

@ -47,7 +47,7 @@ function(crt_version file list_var)
else()
message(FATAL_ERROR "Parse error could not find version in [${s}]")
endif()
endforeach(s)
endforeach()
if(NOT DEFINED has_match)
message("Information: no embeded manifest in: ${file}")
return()
@ -57,7 +57,7 @@ function(crt_version file list_var)
if(version_list)
set(${list_var} ${version_list} PARENT_SCOPE)
endif()
endfunction(crt_version)
endfunction()
set(fatal_error FALSE)
# check_version:
@ -75,7 +75,7 @@ function(check_version file manifest_versions)
message("ERROR: ${file} uses ${ver} not found in shipped manifests:[${manifest_versions}].")
set(fatal_error TRUE PARENT_SCOPE)
endif()
endforeach(ver)
endforeach()
list(LENGTH file_versions len)
if(${len} GREATER 1)
message("WARNING: found more than one version of MICROSOFT.VC80.CRT referenced in ${file}: [${file_versions}]")
@ -88,7 +88,7 @@ set(manifest_version_list )
file(GLOB_RECURSE manifest_files "*.manifest")
foreach(f ${manifest_files})
crt_version("${f}" manifest_version_list)
endforeach(f)
endforeach()
list(LENGTH manifest_version_list LEN)
if(LEN EQUAL 0)
message(FATAL_ERROR "No .manifest files found, no version check can be done.")

View File

@ -285,48 +285,48 @@
# License text for the above reference.)
# Define this var in order to avoid (or warn) concerning multiple inclusion
IF(CPack_CMake_INCLUDED)
MESSAGE(WARNING "CPack.cmake has already been included!!")
ELSE(CPack_CMake_INCLUDED)
SET(CPack_CMake_INCLUDED 1)
ENDIF(CPack_CMake_INCLUDED)
if(CPack_CMake_INCLUDED)
message(WARNING "CPack.cmake has already been included!!")
else()
set(CPack_CMake_INCLUDED 1)
endif()
# Pick a configuration file
SET(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
SET(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
SET(cpack_source_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
SET(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
set(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
if(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
set(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
endif()
set(cpack_source_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
if(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
set(cpack_source_input_file "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
endif()
# Backward compatibility
# Include CPackComponent macros if it has not already been included before.
include(CPackComponent)
# Macro for setting values if a user did not overwrite them
MACRO(cpack_set_if_not_set name value)
IF(NOT DEFINED "${name}")
SET(${name} "${value}")
ENDIF(NOT DEFINED "${name}")
ENDMACRO(cpack_set_if_not_set)
macro(cpack_set_if_not_set name value)
if(NOT DEFINED "${name}")
set(${name} "${value}")
endif()
endmacro()
# cpack_encode_variables - Macro to encode variables for the configuration file
# find any variable that starts with CPACK and create a variable
# _CPACK_OTHER_VARIABLES_ that contains SET commands for
# each cpack variable. _CPACK_OTHER_VARIABLES_ is then
# used as an @ replacment in configure_file for the CPackConfig.
MACRO(cpack_encode_variables)
SET(_CPACK_OTHER_VARIABLES_)
GET_CMAKE_PROPERTY(res VARIABLES)
FOREACH(var ${res})
IF("xxx${var}" MATCHES "xxxCPACK")
SET(_CPACK_OTHER_VARIABLES_
macro(cpack_encode_variables)
set(_CPACK_OTHER_VARIABLES_)
get_cmake_property(res VARIABLES)
foreach(var ${res})
if("xxx${var}" MATCHES "xxxCPACK")
set(_CPACK_OTHER_VARIABLES_
"${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")")
ENDIF("xxx${var}" MATCHES "xxxCPACK")
ENDFOREACH(var ${res})
ENDMACRO(cpack_encode_variables)
endif()
endforeach()
endmacro()
# Set the package name
cpack_set_if_not_set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
@ -350,22 +350,22 @@ cpack_set_if_not_set(CPACK_RESOURCE_FILE_WELCOME
cpack_set_if_not_set(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}")
IF(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
SET(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
ENDIF(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
if(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
endif()
IF(CPACK_NSIS_MODIFY_PATH)
SET(CPACK_NSIS_MODIFY_PATH ON)
ENDIF(CPACK_NSIS_MODIFY_PATH)
if(CPACK_NSIS_MODIFY_PATH)
set(CPACK_NSIS_MODIFY_PATH ON)
endif()
SET(__cpack_system_name ${CMAKE_SYSTEM_NAME})
IF(${__cpack_system_name} MATCHES Windows)
IF(CMAKE_CL_64)
SET(__cpack_system_name win64)
ELSE(CMAKE_CL_64)
SET(__cpack_system_name win32)
ENDIF(CMAKE_CL_64)
ENDIF(${__cpack_system_name} MATCHES Windows)
set(__cpack_system_name ${CMAKE_SYSTEM_NAME})
if(${__cpack_system_name} MATCHES Windows)
if(CMAKE_CL_64)
set(__cpack_system_name win64)
else()
set(__cpack_system_name win32)
endif()
endif()
cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}")
# Root dir: default value should be the string literal "$PROGRAMFILES"
@ -386,15 +386,15 @@ cpack_set_if_not_set(CPACK_PACKAGE_RELOCATABLE "true")
# always force to exactly "true" or "false" for CPack.Info.plist.in:
if(CPACK_PACKAGE_RELOCATABLE)
set(CPACK_PACKAGE_RELOCATABLE "true")
else(CPACK_PACKAGE_RELOCATABLE)
else()
set(CPACK_PACKAGE_RELOCATABLE "false")
endif(CPACK_PACKAGE_RELOCATABLE)
endif()
macro(cpack_check_file_exists file description)
if(NOT EXISTS "${file}")
message(SEND_ERROR "CPack ${description} file: \"${file}\" could not be found.")
endif(NOT EXISTS "${file}")
endmacro(cpack_check_file_exists)
endif()
endmacro()
cpack_check_file_exists("${CPACK_PACKAGE_DESCRIPTION_FILE}" "package description")
cpack_check_file_exists("${CPACK_RESOURCE_FILE_LICENSE}" "license resource")
@ -404,8 +404,8 @@ cpack_check_file_exists("${CPACK_RESOURCE_FILE_WELCOME}" "welcome resource")
macro(cpack_optional_append _list _cond _item)
if(${_cond})
set(${_list} ${${_list}} ${_item})
endif(${_cond})
endmacro(cpack_optional_append _list _cond _item)
endif()
endmacro()
##variable
# CPACK_BINARY_<GENNAME> - CPack generated options for binary generators. The
@ -420,26 +420,26 @@ if(NOT CPACK_GENERATOR)
if(UNIX)
if(CYGWIN)
option(CPACK_BINARY_CYGWIN "Enable to build Cygwin binary packages" ON)
else(CYGWIN)
else()
if(APPLE)
option(CPACK_BINARY_BUNDLE "Enable to build OSX bundles" OFF)
option(CPACK_BINARY_DRAGNDROP "Enable to build OSX Drag And Drop package" OFF)
option(CPACK_BINARY_PACKAGEMAKER "Enable to build PackageMaker packages" ON)
option(CPACK_BINARY_OSXX11 "Enable to build OSX X11 packages" OFF)
else(APPLE)
else()
option(CPACK_BINARY_TZ "Enable to build TZ packages" ON)
endif(APPLE)
endif()
option(CPACK_BINARY_STGZ "Enable to build STGZ packages" ON)
option(CPACK_BINARY_TGZ "Enable to build TGZ packages" ON)
option(CPACK_BINARY_TBZ2 "Enable to build TBZ2 packages" OFF)
option(CPACK_BINARY_DEB "Enable to build Debian packages" OFF)
option(CPACK_BINARY_RPM "Enable to build RPM packages" OFF)
option(CPACK_BINARY_NSIS "Enable to build NSIS packages" OFF)
endif(CYGWIN)
else(UNIX)
endif()
else()
option(CPACK_BINARY_NSIS "Enable to build NSIS packages" ON)
option(CPACK_BINARY_ZIP "Enable to build ZIP packages" OFF)
endif(UNIX)
endif()
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_BUNDLE Bundle)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_DRAGNDROP DragNDrop)
@ -455,29 +455,29 @@ if(NOT CPACK_GENERATOR)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_TZ TZ)
cpack_optional_append(CPACK_GENERATOR CPACK_BINARY_ZIP ZIP)
endif(NOT CPACK_GENERATOR)
endif()
# Provide options to choose source generators
if(NOT CPACK_SOURCE_GENERATOR)
if(UNIX)
if(CYGWIN)
option(CPACK_SOURCE_CYGWIN "Enable to build Cygwin source packages" ON)
else(CYGWIN)
else()
option(CPACK_SOURCE_TBZ2 "Enable to build TBZ2 source packages" ON)
option(CPACK_SOURCE_TGZ "Enable to build TGZ source packages" ON)
option(CPACK_SOURCE_TZ "Enable to build TZ source packages" ON)
option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" OFF)
endif(CYGWIN)
else(UNIX)
endif()
else()
option(CPACK_SOURCE_ZIP "Enable to build ZIP source packages" ON)
endif(UNIX)
endif()
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_CYGWIN CygwinSource)
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TGZ TGZ)
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TBZ2 TBZ2)
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_TZ TZ)
cpack_optional_append(CPACK_SOURCE_GENERATOR CPACK_SOURCE_ZIP ZIP)
endif(NOT CPACK_SOURCE_GENERATOR)
endif()
# mark the above options as advanced
mark_as_advanced(CPACK_BINARY_CYGWIN CPACK_BINARY_PACKAGEMAKER CPACK_BINARY_OSXX11
@ -494,7 +494,7 @@ cpack_set_if_not_set(CPACK_CMAKE_GENERATOR "${CMAKE_GENERATOR}")
cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}")
# if the user has set CPACK_NSIS_DISPLAY_NAME remember it
if(DEFINED CPACK_NSIS_DISPLAY_NAME)
SET(CPACK_NSIS_DISPLAY_NAME_SET TRUE)
set(CPACK_NSIS_DISPLAY_NAME_SET TRUE)
endif()
# if the user has set CPACK_NSIS_DISPLAY
# explicitly, then use that as the default
@ -522,31 +522,31 @@ cpack_set_if_not_set(CPACK_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
cpack_set_if_not_set(CPACK_NSIS_INSTALLER_ICON_CODE "")
cpack_set_if_not_set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
IF(DEFINED CPACK_COMPONENTS_ALL)
IF(CPACK_MONOLITHIC_INSTALL)
MESSAGE("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.")
SET(CPACK_COMPONENTS_ALL)
ELSE(CPACK_MONOLITHIC_INSTALL)
if(DEFINED CPACK_COMPONENTS_ALL)
if(CPACK_MONOLITHIC_INSTALL)
message("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.")
set(CPACK_COMPONENTS_ALL)
else()
# The user has provided the set of components to be installed as
# part of a component-based installation; trust her.
SET(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE)
ENDIF(CPACK_MONOLITHIC_INSTALL)
ELSE(DEFINED CPACK_COMPONENTS_ALL)
set(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE)
endif()
else()
# If the user has not specifically requested a monolithic installer
# but has specified components in various "install" commands, tell
# CPack about those components.
IF(NOT CPACK_MONOLITHIC_INSTALL)
GET_CMAKE_PROPERTY(CPACK_COMPONENTS_ALL COMPONENTS)
LIST(LENGTH CPACK_COMPONENTS_ALL CPACK_COMPONENTS_LEN)
IF(CPACK_COMPONENTS_LEN EQUAL 1)
if(NOT CPACK_MONOLITHIC_INSTALL)
get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
list(LENGTH CPACK_COMPONENTS_ALL CPACK_COMPONENTS_LEN)
if(CPACK_COMPONENTS_LEN EQUAL 1)
# Only one component: this is not a component-based installation
# (at least, it isn't a component-based installation, but may
# become one later if the user uses the cpack_add_* commands).
SET(CPACK_COMPONENTS_ALL)
ENDIF(CPACK_COMPONENTS_LEN EQUAL 1)
SET(CPACK_COMPONENTS_LEN)
ENDIF(NOT CPACK_MONOLITHIC_INSTALL)
ENDIF(DEFINED CPACK_COMPONENTS_ALL)
set(CPACK_COMPONENTS_ALL)
endif()
set(CPACK_COMPONENTS_LEN)
endif()
endif()
# CMake always generates a component named "Unspecified", which is
# used to install everything that doesn't have an explicitly-provided
@ -566,13 +566,13 @@ cpack_set_if_not_set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Source")
cpack_set_if_not_set(CPACK_SOURCE_IGNORE_FILES
"/CVS/;/\\\\\\\\.svn/;/\\\\\\\\.bzr/;/\\\\\\\\.hg/;/\\\\\\\\.git/;\\\\\\\\.swp$;\\\\\\\\.#;/#")
SET(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_SOURCE_INSTALL_CMAKE_PROJECTS}")
SET(CPACK_INSTALLED_DIRECTORIES "${CPACK_SOURCE_INSTALLED_DIRECTORIES}")
SET(CPACK_GENERATOR "${CPACK_SOURCE_GENERATOR}")
SET(CPACK_TOPLEVEL_TAG "${CPACK_SOURCE_TOPLEVEL_TAG}")
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
SET(CPACK_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}")
SET(CPACK_STRIP_FILES "${CPACK_SOURCE_STRIP_FILES}")
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_SOURCE_INSTALL_CMAKE_PROJECTS}")
set(CPACK_INSTALLED_DIRECTORIES "${CPACK_SOURCE_INSTALLED_DIRECTORIES}")
set(CPACK_GENERATOR "${CPACK_SOURCE_GENERATOR}")
set(CPACK_TOPLEVEL_TAG "${CPACK_SOURCE_TOPLEVEL_TAG}")
set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
set(CPACK_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}")
set(CPACK_STRIP_FILES "${CPACK_SOURCE_STRIP_FILES}")
cpack_encode_variables()
configure_file("${cpack_source_input_file}"

View File

@ -275,84 +275,84 @@
# License text for the above reference.)
# Define var in order to avoid multiple inclusion
IF(NOT CPackComponent_CMake_INCLUDED)
SET(CPackComponent_CMake_INCLUDED 1)
if(NOT CPackComponent_CMake_INCLUDED)
set(CPackComponent_CMake_INCLUDED 1)
# Argument-parsing macro from http://www.cmake.org/Wiki/CMakeMacroParseArguments
MACRO(cpack_parse_arguments prefix arg_names option_names)
SET(${prefix}_DEFAULT_ARGS)
FOREACH(arg_name ${arg_names})
SET(${prefix}_${arg_name})
ENDFOREACH(arg_name)
FOREACH(option ${option_names})
SET(${prefix}_${option} FALSE)
ENDFOREACH(option)
macro(cpack_parse_arguments prefix arg_names option_names)
set(${prefix}_DEFAULT_ARGS)
foreach(arg_name ${arg_names})
set(${prefix}_${arg_name})
endforeach()
foreach(option ${option_names})
set(${prefix}_${option} FALSE)
endforeach()
SET(current_arg_name DEFAULT_ARGS)
SET(current_arg_list)
FOREACH(arg ${ARGN})
SET(larg_names ${arg_names})
LIST(FIND larg_names "${arg}" is_arg_name)
IF (is_arg_name GREATER -1)
SET(${prefix}_${current_arg_name} ${current_arg_list})
SET(current_arg_name ${arg})
SET(current_arg_list)
ELSE (is_arg_name GREATER -1)
SET(loption_names ${option_names})
LIST(FIND loption_names "${arg}" is_option)
IF (is_option GREATER -1)
SET(${prefix}_${arg} TRUE)
ELSE (is_option GREATER -1)
SET(current_arg_list ${current_arg_list} ${arg})
ENDIF (is_option GREATER -1)
ENDIF (is_arg_name GREATER -1)
ENDFOREACH(arg)
SET(${prefix}_${current_arg_name} ${current_arg_list})
ENDMACRO(cpack_parse_arguments)
set(current_arg_name DEFAULT_ARGS)
set(current_arg_list)
foreach(arg ${ARGN})
set(larg_names ${arg_names})
list(FIND larg_names "${arg}" is_arg_name)
if (is_arg_name GREATER -1)
set(${prefix}_${current_arg_name} ${current_arg_list})
set(current_arg_name ${arg})
set(current_arg_list)
else ()
set(loption_names ${option_names})
list(FIND loption_names "${arg}" is_option)
if (is_option GREATER -1)
set(${prefix}_${arg} TRUE)
else ()
set(current_arg_list ${current_arg_list} ${arg})
endif ()
endif ()
endforeach()
set(${prefix}_${current_arg_name} ${current_arg_list})
endmacro()
# Macro that appends a SET command for the given variable name (var)
# to the macro named strvar, but only if the variable named "var"
# has been defined. The string will eventually be appended to a CPack
# configuration file.
MACRO(cpack_append_variable_set_command var strvar)
IF (DEFINED ${var})
SET(${strvar} "${${strvar}}SET(${var}")
FOREACH(APPENDVAL ${${var}})
SET(${strvar} "${${strvar}} ${APPENDVAL}")
ENDFOREACH(APPENDVAL)
SET(${strvar} "${${strvar}})\n")
ENDIF (DEFINED ${var})
ENDMACRO(cpack_append_variable_set_command)
macro(cpack_append_variable_set_command var strvar)
if (DEFINED ${var})
set(${strvar} "${${strvar}}set(${var}")
foreach(APPENDVAL ${${var}})
set(${strvar} "${${strvar}} ${APPENDVAL}")
endforeach()
set(${strvar} "${${strvar}})\n")
endif ()
endmacro()
# Macro that appends a SET command for the given variable name (var)
# to the macro named strvar, but only if the variable named "var"
# has been defined and is a string. The string will eventually be
# appended to a CPack configuration file.
MACRO(cpack_append_string_variable_set_command var strvar)
IF (DEFINED ${var})
LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
SET(${strvar} "${${strvar}}SET(${var} \"${${var}}\")\n")
ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
ENDIF (DEFINED ${var})
ENDMACRO(cpack_append_string_variable_set_command)
macro(cpack_append_string_variable_set_command var strvar)
if (DEFINED ${var})
list(LENGTH ${var} CPACK_APP_VALUE_LEN)
if(${CPACK_APP_VALUE_LEN} EQUAL 1)
set(${strvar} "${${strvar}}set(${var} \"${${var}}\")\n")
endif()
endif ()
endmacro()
# Macro that appends a SET command for the given variable name (var)
# to the macro named strvar, but only if the variable named "var"
# has been set to true. The string will eventually be
# appended to a CPack configuration file.
MACRO(cpack_append_option_set_command var strvar)
IF (${var})
LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
SET(${strvar} "${${strvar}}SET(${var} TRUE)\n")
ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
ENDIF (${var})
ENDMACRO(cpack_append_option_set_command)
macro(cpack_append_option_set_command var strvar)
if (${var})
list(LENGTH ${var} CPACK_APP_VALUE_LEN)
if(${CPACK_APP_VALUE_LEN} EQUAL 1)
set(${strvar} "${${strvar}}set(${var} TRUE)\n")
endif()
endif ()
endmacro()
# Macro that adds a component to the CPack installer
MACRO(cpack_add_component compname)
STRING(TOUPPER ${compname} CPACK_ADDCOMP_UNAME)
macro(cpack_add_component compname)
string(TOUPPER ${compname} CPACK_ADDCOMP_UNAME)
cpack_parse_arguments(CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}
"DISPLAY_NAME;DESCRIPTION;GROUP;DEPENDS;INSTALL_TYPES;ARCHIVE_FILE"
"HIDDEN;REQUIRED;DISABLED;DOWNLOADED"
@ -360,25 +360,25 @@ MACRO(cpack_add_component compname)
)
if (CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED)
SET(CPACK_ADDCOMP_STR "\n# Configuration for downloaded component \"${compname}\"\n")
set(CPACK_ADDCOMP_STR "\n# Configuration for downloaded component \"${compname}\"\n")
else ()
SET(CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n")
set(CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n")
endif ()
IF(NOT CPACK_MONOLITHIC_INSTALL)
if(NOT CPACK_MONOLITHIC_INSTALL)
# If the user didn't set CPACK_COMPONENTS_ALL explicitly, update the
# value of CPACK_COMPONENTS_ALL in the configuration file. This will
# take care of any components that have been added after the CPack
# moduled was included.
IF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
GET_CMAKE_PROPERTY(CPACK_ADDCOMP_COMPONENTS COMPONENTS)
SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
FOREACH(COMP ${CPACK_ADDCOMP_COMPONENTS})
SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}")
ENDFOREACH(COMP)
SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n")
ENDIF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
ENDIF(NOT CPACK_MONOLITHIC_INSTALL)
if(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
get_cmake_property(CPACK_ADDCOMP_COMPONENTS COMPONENTS)
set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
foreach(COMP ${CPACK_ADDCOMP_COMPONENTS})
set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}")
endforeach()
set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n")
endif()
endif()
cpack_append_string_variable_set_command(
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISPLAY_NAME
@ -414,21 +414,21 @@ MACRO(cpack_add_component compname)
# Write to config iff the macros is used after CPack.cmake has been
# included, other it's not necessary because the variables
# will be encoded by cpack_encode_variables.
IF(CPack_CMake_INCLUDED)
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}")
ENDIF(CPack_CMake_INCLUDED)
ENDMACRO(cpack_add_component)
if(CPack_CMake_INCLUDED)
file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}")
endif()
endmacro()
# Macro that adds a component group to the CPack installer
MACRO(cpack_add_component_group grpname)
STRING(TOUPPER ${grpname} CPACK_ADDGRP_UNAME)
macro(cpack_add_component_group grpname)
string(TOUPPER ${grpname} CPACK_ADDGRP_UNAME)
cpack_parse_arguments(CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}
"DISPLAY_NAME;DESCRIPTION"
"EXPANDED;BOLD_TITLE"
${ARGN}
)
SET(CPACK_ADDGRP_STR "\n# Configuration for component group \"${grpname}\"\n")
set(CPACK_ADDGRP_STR "\n# Configuration for component group \"${grpname}\"\n")
cpack_append_string_variable_set_command(
CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_DISPLAY_NAME
CPACK_ADDGRP_STR)
@ -445,24 +445,24 @@ MACRO(cpack_add_component_group grpname)
# Write to config iff the macros is used after CPack.cmake has been
# included, other it's not necessary because the variables
# will be encoded by cpack_encode_variables.
IF(CPack_CMake_INCLUDED)
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}")
ENDIF(CPack_CMake_INCLUDED)
ENDMACRO(cpack_add_component_group)
if(CPack_CMake_INCLUDED)
file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}")
endif()
endmacro()
# Macro that adds an installation type to the CPack installer
MACRO(cpack_add_install_type insttype)
STRING(TOUPPER ${insttype} CPACK_INSTTYPE_UNAME)
macro(cpack_add_install_type insttype)
string(TOUPPER ${insttype} CPACK_INSTTYPE_UNAME)
cpack_parse_arguments(CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}
"DISPLAY_NAME"
""
${ARGN}
)
SET(CPACK_INSTTYPE_STR
set(CPACK_INSTTYPE_STR
"\n# Configuration for installation type \"${insttype}\"\n")
SET(CPACK_INSTTYPE_STR
"${CPACK_INSTTYPE_STR}LIST(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
set(CPACK_INSTTYPE_STR
"${CPACK_INSTTYPE_STR}list(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
cpack_append_string_variable_set_command(
CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}_DISPLAY_NAME
CPACK_INSTTYPE_STR)
@ -470,22 +470,22 @@ MACRO(cpack_add_install_type insttype)
# Write to config iff the macros is used after CPack.cmake has been
# included, other it's not necessary because the variables
# will be encoded by cpack_encode_variables.
IF(CPack_CMake_INCLUDED)
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}")
ENDIF(CPack_CMake_INCLUDED)
ENDMACRO(cpack_add_install_type)
if(CPack_CMake_INCLUDED)
file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}")
endif()
endmacro()
MACRO(cpack_configure_downloads site)
macro(cpack_configure_downloads site)
cpack_parse_arguments(CPACK_DOWNLOAD
"UPLOAD_DIRECTORY"
"ALL;ADD_REMOVE;NO_ADD_REMOVE"
${ARGN}
)
SET(CPACK_CONFIG_DL_STR
set(CPACK_CONFIG_DL_STR
"\n# Downloaded components configuration\n")
SET(CPACK_UPLOAD_DIRECTORY ${CPACK_DOWNLOAD_UPLOAD_DIRECTORY})
SET(CPACK_DOWNLOAD_SITE ${site})
set(CPACK_UPLOAD_DIRECTORY ${CPACK_DOWNLOAD_UPLOAD_DIRECTORY})
set(CPACK_DOWNLOAD_SITE ${site})
cpack_append_string_variable_set_command(
CPACK_DOWNLOAD_SITE
CPACK_CONFIG_DL_STR)
@ -495,10 +495,10 @@ MACRO(cpack_configure_downloads site)
cpack_append_option_set_command(
CPACK_DOWNLOAD_ALL
CPACK_CONFIG_DL_STR)
IF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
SET(CPACK_DOWNLOAD_ADD_REMOVE ON)
ENDIF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
SET(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
if (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
set(CPACK_DOWNLOAD_ADD_REMOVE ON)
endif ()
set(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
cpack_append_option_set_command(
CPACK_ADD_REMOVE
CPACK_CONFIG_DL_STR)
@ -506,8 +506,8 @@ MACRO(cpack_configure_downloads site)
# Write to config iff the macros is used after CPack.cmake has been
# included, other it's not necessary because the variables
# will be encoded by cpack_encode_variables.
IF(CPack_CMake_INCLUDED)
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
ENDIF(CPack_CMake_INCLUDED)
ENDMACRO(cpack_configure_downloads)
ENDIF(NOT CPackComponent_CMake_INCLUDED)
if(CPack_CMake_INCLUDED)
file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
endif()
endmacro()
endif()

View File

@ -161,7 +161,7 @@
# Default : -
# This variable allow advanced user to add custom script to the control.tar.gz
# Typical usage is for conffiles, postinst, postrm, prerm.
# Usage: SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# Usage: set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
##end
@ -185,115 +185,115 @@
#
# http://wiki.debian.org/HowToPackageForDebian
IF(CMAKE_BINARY_DIR)
MESSAGE(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.")
ENDIF(CMAKE_BINARY_DIR)
if(CMAKE_BINARY_DIR)
message(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.")
endif()
IF(NOT UNIX)
MESSAGE(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.")
ENDIF(NOT UNIX)
if(NOT UNIX)
message(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.")
endif()
# CPACK_DEBIAN_PACKAGE_SHLIBDEPS
# If specify OFF, only user depends are used
IF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
ENDIF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
if(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
endif()
FIND_PROGRAM(FAKEROOT_EXECUTABLE fakeroot)
IF(FAKEROOT_EXECUTABLE)
SET(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE})
ENDIF(FAKEROOT_EXECUTABLE)
find_program(FAKEROOT_EXECUTABLE fakeroot)
if(FAKEROOT_EXECUTABLE)
set(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE})
endif()
IF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
# dpkg-shlibdeps is a Debian utility for generating dependency list
FIND_PROGRAM(SHLIBDEPS_EXECUTABLE dpkg-shlibdeps)
find_program(SHLIBDEPS_EXECUTABLE dpkg-shlibdeps)
# Check version of the dpkg-shlibdeps tool using CPackRPM method
IF(SHLIBDEPS_EXECUTABLE)
EXECUTE_PROCESS(COMMAND ${SHLIBDEPS_EXECUTABLE} --version
if(SHLIBDEPS_EXECUTABLE)
execute_process(COMMAND ${SHLIBDEPS_EXECUTABLE} --version
OUTPUT_VARIABLE _TMP_VERSION
ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX MATCH "dpkg-shlibdeps version ([0-9]+\\.[0-9]+\\.[0-9]+)"
string(REGEX MATCH "dpkg-shlibdeps version ([0-9]+\\.[0-9]+\\.[0-9]+)"
SHLIBDEPS_EXECUTABLE_VERSION
${_TMP_VERSION})
SET(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
IF(CPACK_DEBIAN_PACKAGE_DEBUG)
MESSAGE( "CPackDeb Debug: dpkg-shlibdeps version is <${SHLIBDEPS_EXECUTABLE_VERSION}>")
ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
set(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
if(CPACK_DEBIAN_PACKAGE_DEBUG)
message( "CPackDeb Debug: dpkg-shlibdeps version is <${SHLIBDEPS_EXECUTABLE_VERSION}>")
endif()
# Generating binary list - Get type of all install files
EXECUTE_PROCESS(COMMAND find -type f
execute_process(COMMAND find -type f
COMMAND xargs file
WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
OUTPUT_VARIABLE CPACK_DEB_INSTALL_FILES)
# Convert to CMake list
STRING(REGEX REPLACE "\n" ";" CPACK_DEB_INSTALL_FILES ${CPACK_DEB_INSTALL_FILES})
string(REGEX REPLACE "\n" ";" CPACK_DEB_INSTALL_FILES ${CPACK_DEB_INSTALL_FILES})
# Only dynamically linked ELF files are included
# Extract only file name infront of ":"
FOREACH ( _FILE ${CPACK_DEB_INSTALL_FILES})
IF ( ${_FILE} MATCHES "ELF.*dynamically linked")
STRING(REGEX MATCH "(^.*):" _FILE_NAME ${_FILE})
LIST(APPEND CPACK_DEB_BINARY_FILES ${CMAKE_MATCH_1})
ENDIF()
ENDFOREACH()
foreach ( _FILE ${CPACK_DEB_INSTALL_FILES})
if ( ${_FILE} MATCHES "ELF.*dynamically linked")
string(REGEX MATCH "(^.*):" _FILE_NAME ${_FILE})
list(APPEND CPACK_DEB_BINARY_FILES ${CMAKE_MATCH_1})
endif()
endforeach()
MESSAGE( "CPackDeb: - Generating dependency list")
message( "CPackDeb: - Generating dependency list")
# Create blank control file for running dpkg-shlibdeps
# There might be some other way to invoke dpkg-shlibdeps without creating this file
# but standard debian package should not have anything that can collide with this file or directory
FILE(MAKE_DIRECTORY ${CPACK_TEMPORARY_DIRECTORY}/debian)
FILE(WRITE ${CPACK_TEMPORARY_DIRECTORY}/debian/control "")
file(MAKE_DIRECTORY ${CPACK_TEMPORARY_DIRECTORY}/debian)
file(WRITE ${CPACK_TEMPORARY_DIRECTORY}/debian/control "")
# Execute dpkg-shlibdeps
# --ignore-missing-info : allow dpkg-shlibdeps to run even if some libs do not belong to a package
# -O : print to STDOUT
EXECUTE_PROCESS(COMMAND ${SHLIBDEPS_EXECUTABLE} --ignore-missing-info -O ${CPACK_DEB_BINARY_FILES}
execute_process(COMMAND ${SHLIBDEPS_EXECUTABLE} --ignore-missing-info -O ${CPACK_DEB_BINARY_FILES}
WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
OUTPUT_VARIABLE SHLIBDEPS_OUTPUT
RESULT_VARIABLE SHLIBDEPS_RESULT
ERROR_VARIABLE SHLIBDEPS_ERROR
OUTPUT_STRIP_TRAILING_WHITESPACE )
IF(CPACK_DEBIAN_PACKAGE_DEBUG)
if(CPACK_DEBIAN_PACKAGE_DEBUG)
# dpkg-shlibdeps will throw some warnings if some input files are not binary
MESSAGE( "CPackDeb Debug: dpkg-shlibdeps warnings \n${SHLIBDEPS_ERROR}")
ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
IF (NOT SHLIBDEPS_RESULT EQUAL 0)
MESSAGE (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}")
ENDIF (NOT SHLIBDEPS_RESULT EQUAL 0)
message( "CPackDeb Debug: dpkg-shlibdeps warnings \n${SHLIBDEPS_ERROR}")
endif()
if (NOT SHLIBDEPS_RESULT EQUAL 0)
message (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}")
endif ()
#Get rid of prefix generated by dpkg-shlibdeps
string (REGEX REPLACE "^.*Depends=" "" CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS ${SHLIBDEPS_OUTPUT})
IF(CPACK_DEBIAN_PACKAGE_DEBUG)
MESSAGE( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
if(CPACK_DEBIAN_PACKAGE_DEBUG)
message( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
endif()
# Remove blank control file
# Might not be safe if package actual contain file or directory named debian
FILE(REMOVE_RECURSE "${CPACK_TEMPORARY_DIRECTORY}/debian")
file(REMOVE_RECURSE "${CPACK_TEMPORARY_DIRECTORY}/debian")
# Append user depend if set
IF (CPACK_DEBIAN_PACKAGE_DEPENDS)
SET (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
ELSE (CPACK_DEBIAN_PACKAGE_DEPENDS)
SET (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
ENDIF (CPACK_DEBIAN_PACKAGE_DEPENDS)
if (CPACK_DEBIAN_PACKAGE_DEPENDS)
set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
else ()
set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
endif ()
ELSE (SHLIBDEPS_EXECUTABLE)
IF(CPACK_DEBIAN_PACKAGE_DEBUG)
MESSAGE( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.")
ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
ENDIF(SHLIBDEPS_EXECUTABLE)
else ()
if(CPACK_DEBIAN_PACKAGE_DEBUG)
message( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.")
endif()
endif()
ELSE (CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
IF(CPACK_DEBIAN_PACKAGE_DEBUG)
MESSAGE( "CPackDeb Debug: Using only user-provided depends")
ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
ENDIF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
else ()
if(CPACK_DEBIAN_PACKAGE_DEBUG)
message( "CPackDeb Debug: Using only user-provided depends")
endif()
endif()
# Let's define the control file found in debian package:
@ -303,67 +303,67 @@ ENDIF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
# DEBIAN/control
# debian policy enforce lower case for package name
# Package: (mandatory)
IF(NOT CPACK_DEBIAN_PACKAGE_NAME)
STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
ENDIF(NOT CPACK_DEBIAN_PACKAGE_NAME)
if(NOT CPACK_DEBIAN_PACKAGE_NAME)
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
endif()
# Version: (mandatory)
IF(NOT CPACK_DEBIAN_PACKAGE_VERSION)
IF(NOT CPACK_PACKAGE_VERSION)
MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a package version")
ENDIF(NOT CPACK_PACKAGE_VERSION)
SET(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
ENDIF(NOT CPACK_DEBIAN_PACKAGE_VERSION)
if(NOT CPACK_DEBIAN_PACKAGE_VERSION)
if(NOT CPACK_PACKAGE_VERSION)
message(FATAL_ERROR "CPackDeb: Debian package requires a package version")
endif()
set(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
endif()
# Architecture: (mandatory)
IF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
if(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
# There is no such thing as i686 architecture on debian, you should use i386 instead
# $ dpkg --print-architecture
FIND_PROGRAM(DPKG_CMD dpkg)
IF(NOT DPKG_CMD)
MESSAGE(STATUS "CPackDeb: Can not find dpkg in your path, default to i386.")
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
ENDIF(NOT DPKG_CMD)
EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture
find_program(DPKG_CMD dpkg)
if(NOT DPKG_CMD)
message(STATUS "CPackDeb: Can not find dpkg in your path, default to i386.")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
endif()
execute_process(COMMAND "${DPKG_CMD}" --print-architecture
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
OUTPUT_STRIP_TRAILING_WHITESPACE
)
ENDIF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
endif()
# have a look at GET_PROPERTY(result GLOBAL PROPERTY ENABLED_FEATURES),
# this returns the successful FIND_PACKAGE() calls, maybe this can help
# have a look at get_property(result GLOBAL PROPERTY ENABLED_FEATURES),
# this returns the successful find_package() calls, maybe this can help
# Depends:
# You should set: DEBIAN_PACKAGE_DEPENDS
# TODO: automate 'objdump -p | grep NEEDED'
IF(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
MESSAGE(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.")
ENDIF(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
if(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
message(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.")
endif()
# Maintainer: (mandatory)
IF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
IF(NOT CPACK_PACKAGE_CONTACT)
MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER")
ENDIF(NOT CPACK_PACKAGE_CONTACT)
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
ENDIF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
if(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
if(NOT CPACK_PACKAGE_CONTACT)
message(FATAL_ERROR "CPackDeb: Debian package requires a maintainer for a package, set CPACK_PACKAGE_CONTACT or CPACK_DEBIAN_PACKAGE_MAINTAINER")
endif()
set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
endif()
# Description: (mandatory)
IF(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
IF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION")
ENDIF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
ENDIF(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
message(FATAL_ERROR "CPackDeb: Debian package requires a summary for a package, set CPACK_PACKAGE_DESCRIPTION_SUMMARY or CPACK_DEBIAN_PACKAGE_DESCRIPTION")
endif()
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
endif()
# Section: (recommended)
IF(NOT CPACK_DEBIAN_PACKAGE_SECTION)
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
ENDIF(NOT CPACK_DEBIAN_PACKAGE_SECTION)
if(NOT CPACK_DEBIAN_PACKAGE_SECTION)
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
endif()
# Priority: (recommended)
IF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY)
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
ENDIF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY )
if(NOT CPACK_DEBIAN_PACKAGE_PRIORITY)
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
endif()
# Recommends:
# You should set: CPACK_DEBIAN_PACKAGE_RECOMMENDS
@ -379,32 +379,32 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY )
# - postrm
# - prerm"
# Usage:
# SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
# "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
# Are we packaging components ?
IF(CPACK_DEB_PACKAGE_COMPONENT)
SET(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "-${CPACK_DEB_PACKAGE_COMPONENT}")
SET(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "/${CPACK_DEB_PACKAGE_COMPONENT}")
SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_DEB_PACKAGE_COMPONENT}")
STRING(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
ELSE(CPACK_DEB_PACKAGE_COMPONENT)
SET(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "")
SET(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "")
SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
ENDIF(CPACK_DEB_PACKAGE_COMPONENT)
if(CPACK_DEB_PACKAGE_COMPONENT)
set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "-${CPACK_DEB_PACKAGE_COMPONENT}")
set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "/${CPACK_DEB_PACKAGE_COMPONENT}")
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_DEB_PACKAGE_COMPONENT}")
string(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
else()
set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "")
set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "")
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
endif()
# Print out some debug information if we were asked for that
IF(CPACK_DEBIAN_PACKAGE_DEBUG)
MESSAGE("CPackDeb:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}")
MESSAGE("CPackDeb:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}")
MESSAGE("CPackDeb:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}")
MESSAGE("CPackDeb:Debug: CPACK_OUTPUT_FILE_NAME = ${CPACK_OUTPUT_FILE_NAME}")
MESSAGE("CPackDeb:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}")
MESSAGE("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
MESSAGE("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
MESSAGE("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
if(CPACK_DEBIAN_PACKAGE_DEBUG)
message("CPackDeb:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}")
message("CPackDeb:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}")
message("CPackDeb:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}")
message("CPackDeb:Debug: CPACK_OUTPUT_FILE_NAME = ${CPACK_OUTPUT_FILE_NAME}")
message("CPackDeb:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}")
message("CPackDeb:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
message("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
message("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
endif()
# For debian source packages:
# debian/control
@ -414,8 +414,8 @@ ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
# http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-debiansourcecontrolfiles
# Builds-Depends:
#IF(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS)
# SET(CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS
#if(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS)
# set(CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS
# "debhelper (>> 5.0.0), libncurses5-dev, tcl8.4"
# )
#ENDIF(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS)
#endif()

View File

@ -162,7 +162,7 @@
# Default : -
# May be set by the user in order to specify a USER binary spec file
# to be used by CPackRPM instead of generating the file.
# The specified file will be processed by CONFIGURE_FILE( @ONLY).
# The specified file will be processed by configure_file( @ONLY).
##end
##variable
# CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE - Spec file template.
@ -239,22 +239,22 @@
# Author: Eric Noulard with the help of Alexander Neundorf.
IF(CMAKE_BINARY_DIR)
MESSAGE(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.")
ENDIF(CMAKE_BINARY_DIR)
if(CMAKE_BINARY_DIR)
message(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.")
endif()
IF(NOT UNIX)
MESSAGE(FATAL_ERROR "CPackRPM.cmake may only be used under UNIX.")
ENDIF(NOT UNIX)
if(NOT UNIX)
message(FATAL_ERROR "CPackRPM.cmake may only be used under UNIX.")
endif()
# rpmbuild is the basic command for building RPM package
# it may be a simple (symbolic) link to rpm command.
FIND_PROGRAM(RPMBUILD_EXECUTABLE rpmbuild)
find_program(RPMBUILD_EXECUTABLE rpmbuild)
# Check version of the rpmbuild tool this would be easier to
# track bugs with users and CPackRPM debug mode.
# We may use RPM version in order to check for available version dependent features
IF(RPMBUILD_EXECUTABLE)
if(RPMBUILD_EXECUTABLE)
execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --version
OUTPUT_VARIABLE _TMP_VERSION
ERROR_QUIET
@ -262,19 +262,19 @@ IF(RPMBUILD_EXECUTABLE)
string(REGEX REPLACE "^.*\ " ""
RPMBUILD_EXECUTABLE_VERSION
${_TMP_VERSION})
IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
ENDIF(RPMBUILD_EXECUTABLE)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>")
endif()
endif()
IF(NOT RPMBUILD_EXECUTABLE)
MESSAGE(FATAL_ERROR "RPM package requires rpmbuild executable")
ENDIF(NOT RPMBUILD_EXECUTABLE)
if(NOT RPMBUILD_EXECUTABLE)
message(FATAL_ERROR "RPM package requires rpmbuild executable")
endif()
# Display lsb_release output if DEBUG mode enable
# This will help to diagnose problem with CPackRPM
# because we will know on which kind of Linux we are
IF(CPACK_RPM_PACKAGE_DEBUG)
if(CPACK_RPM_PACKAGE_DEBUG)
find_program(LSB_RELEASE_EXECUTABLE lsb_release)
if(LSB_RELEASE_EXECUTABLE)
execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -a
@ -284,40 +284,40 @@ IF(CPACK_RPM_PACKAGE_DEBUG)
string(REGEX REPLACE "\n" ", "
LSB_RELEASE_OUTPUT
${_TMP_LSB_RELEASE_OUTPUT})
else (LSB_RELEASE_EXECUTABLE)
else ()
set(LSB_RELEASE_OUTPUT "lsb_release not installed/found!")
endif(LSB_RELEASE_EXECUTABLE)
MESSAGE("CPackRPM:Debug: LSB_RELEASE = ${LSB_RELEASE_OUTPUT}")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
endif()
message("CPackRPM:Debug: LSB_RELEASE = ${LSB_RELEASE_OUTPUT}")
endif()
# We may use RPM version in the future in order
# to shut down warning about space in buildtree
# some recent RPM version should support space in different places.
# not checked [yet].
IF(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
MESSAGE(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.")
ENDIF(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
if(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
message(FATAL_ERROR "${RPMBUILD_EXECUTABLE} can't handle paths with spaces, use a build directory without spaces for building RPMs.")
endif()
# If rpmbuild is found
# we try to discover alien since we may be on non RPM distro like Debian.
# In this case we may try to to use more advanced features
# like generating RPM directly from DEB using alien.
# FIXME feature not finished (yet)
FIND_PROGRAM(ALIEN_EXECUTABLE alien)
IF(ALIEN_EXECUTABLE)
MESSAGE(STATUS "alien found, we may be on a Debian based distro.")
ENDIF(ALIEN_EXECUTABLE)
find_program(ALIEN_EXECUTABLE alien)
if(ALIEN_EXECUTABLE)
message(STATUS "alien found, we may be on a Debian based distro.")
endif()
# Are we packaging components ?
IF(CPACK_RPM_PACKAGE_COMPONENT)
SET(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}")
SET(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "/${CPACK_RPM_PACKAGE_COMPONENT}")
SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_RPM_PACKAGE_COMPONENT}")
ELSE(CPACK_RPM_PACKAGE_COMPONENT)
SET(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "")
SET(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "")
SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
ENDIF(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_PACKAGE_COMPONENT)
set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}")
set(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "/${CPACK_RPM_PACKAGE_COMPONENT}")
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_RPM_PACKAGE_COMPONENT}")
else()
set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "")
set(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "")
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
endif()
#
# Use user-defined RPM specific variables value
@ -329,42 +329,42 @@ ENDIF(CPACK_RPM_PACKAGE_COMPONENT)
#
# CPACK_RPM_PACKAGE_SUMMARY (mandatory)
IF(NOT CPACK_RPM_PACKAGE_SUMMARY)
if(NOT CPACK_RPM_PACKAGE_SUMMARY)
# if neither var is defined lets use the name as summary
IF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY)
ELSE(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
SET(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
ENDIF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
ENDIF(NOT CPACK_RPM_PACKAGE_SUMMARY)
if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY)
else()
set(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
endif()
endif()
# CPACK_RPM_PACKAGE_NAME (mandatory)
IF(NOT CPACK_RPM_PACKAGE_NAME)
STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
ENDIF(NOT CPACK_RPM_PACKAGE_NAME)
if(NOT CPACK_RPM_PACKAGE_NAME)
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
endif()
# CPACK_RPM_PACKAGE_VERSION (mandatory)
IF(NOT CPACK_RPM_PACKAGE_VERSION)
IF(NOT CPACK_PACKAGE_VERSION)
MESSAGE(FATAL_ERROR "RPM package requires a package version")
ENDIF(NOT CPACK_PACKAGE_VERSION)
SET(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
ENDIF(NOT CPACK_RPM_PACKAGE_VERSION)
if(NOT CPACK_RPM_PACKAGE_VERSION)
if(NOT CPACK_PACKAGE_VERSION)
message(FATAL_ERROR "RPM package requires a package version")
endif()
set(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
endif()
# Replace '-' in version with '_'
# '-' character is an Illegal RPM version character
# it is illegal because it is used to separate
# RPM "Version" from RPM "Release"
STRING(REPLACE "-" "_" CPACK_RPM_PACKAGE_VERSION ${CPACK_RPM_PACKAGE_VERSION})
string(REPLACE "-" "_" CPACK_RPM_PACKAGE_VERSION ${CPACK_RPM_PACKAGE_VERSION})
# CPACK_RPM_PACKAGE_ARCHITECTURE (optional)
IF(CPACK_RPM_PACKAGE_ARCHITECTURE)
SET(TMP_RPM_BUILDARCH "Buildarch: ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: using user-specified build arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
ELSE(CPACK_RPM_PACKAGE_ARCHITECTURE)
SET(TMP_RPM_BUILDARCH "")
ENDIF(CPACK_RPM_PACKAGE_ARCHITECTURE)
if(CPACK_RPM_PACKAGE_ARCHITECTURE)
set(TMP_RPM_BUILDARCH "Buildarch: ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: using user-specified build arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
endif()
else()
set(TMP_RPM_BUILDARCH "")
endif()
# CPACK_RPM_PACKAGE_RELEASE
# The RPM release is the numbering of the RPM package ITSELF
@ -374,28 +374,28 @@ ENDIF(CPACK_RPM_PACKAGE_ARCHITECTURE)
# without changing the version of the packaged software.
# This is the case when the packaging is buggy (not) the software :=)
# If not set, 1 is a good candidate
IF(NOT CPACK_RPM_PACKAGE_RELEASE)
SET(CPACK_RPM_PACKAGE_RELEASE 1)
ENDIF(NOT CPACK_RPM_PACKAGE_RELEASE)
if(NOT CPACK_RPM_PACKAGE_RELEASE)
set(CPACK_RPM_PACKAGE_RELEASE 1)
endif()
# CPACK_RPM_PACKAGE_LICENSE
IF(NOT CPACK_RPM_PACKAGE_LICENSE)
SET(CPACK_RPM_PACKAGE_LICENSE "unknown")
ENDIF(NOT CPACK_RPM_PACKAGE_LICENSE)
if(NOT CPACK_RPM_PACKAGE_LICENSE)
set(CPACK_RPM_PACKAGE_LICENSE "unknown")
endif()
# CPACK_RPM_PACKAGE_GROUP
IF(NOT CPACK_RPM_PACKAGE_GROUP)
SET(CPACK_RPM_PACKAGE_GROUP "unknown")
ENDIF(NOT CPACK_RPM_PACKAGE_GROUP)
if(NOT CPACK_RPM_PACKAGE_GROUP)
set(CPACK_RPM_PACKAGE_GROUP "unknown")
endif()
# CPACK_RPM_PACKAGE_VENDOR
IF(NOT CPACK_RPM_PACKAGE_VENDOR)
IF(CPACK_PACKAGE_VENDOR)
SET(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}")
ELSE(CPACK_PACKAGE_VENDOR)
SET(CPACK_RPM_PACKAGE_VENDOR "unknown")
ENDIF(CPACK_PACKAGE_VENDOR)
ENDIF(NOT CPACK_RPM_PACKAGE_VENDOR)
if(NOT CPACK_RPM_PACKAGE_VENDOR)
if(CPACK_PACKAGE_VENDOR)
set(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}")
else()
set(CPACK_RPM_PACKAGE_VENDOR "unknown")
endif()
endif()
# CPACK_RPM_PACKAGE_SOURCE
# The name of the source tarball in case we generate a source RPM
@ -407,103 +407,103 @@ ENDIF(NOT CPACK_RPM_PACKAGE_VENDOR)
# if it is defined
# - set to a default value
#
IF (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
IF (CPACK_PACKAGE_DESCRIPTION_FILE)
FILE(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION)
ELSE (CPACK_PACKAGE_DESCRIPTION_FILE)
SET(CPACK_RPM_PACKAGE_DESCRIPTION "no package description available")
ENDIF (CPACK_PACKAGE_DESCRIPTION_FILE)
ENDIF (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
if (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
if (CPACK_PACKAGE_DESCRIPTION_FILE)
file(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION)
else ()
set(CPACK_RPM_PACKAGE_DESCRIPTION "no package description available")
endif ()
endif ()
# CPACK_RPM_COMPRESSION_TYPE
#
IF (CPACK_RPM_COMPRESSION_TYPE)
IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio")
ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio")
ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio")
ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio")
ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
ELSE(CPACK_RPM_COMPRESSION_TYPE)
SET(CPACK_RPM_COMPRESSION_TYPE_TMP "")
ENDIF(CPACK_RPM_COMPRESSION_TYPE)
if (CPACK_RPM_COMPRESSION_TYPE)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}")
endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio")
endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio")
endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio")
endif()
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio")
endif()
else()
set(CPACK_RPM_COMPRESSION_TYPE_TMP "")
endif()
if(CPACK_PACKAGE_RELOCATABLE)
set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
endif(CPACK_PACKAGE_RELOCATABLE)
endif()
if(CPACK_RPM_PACKAGE_RELOCATABLE)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Trying to build a relocatable package")
endif(CPACK_RPM_PACKAGE_DEBUG)
endif()
if(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
message("CPackRPM:Warning: CPACK_SET_DESTDIR is set (=${CPACK_SET_DESTDIR}) while requesting a relocatable package (CPACK_RPM_PACKAGE_RELOCATABLE is set): this is not supported, the package won't be relocatable.")
else(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
else()
set(CPACK_RPM_PACKAGE_PREFIX ${CPACK_PACKAGING_INSTALL_PREFIX})
endif(CPACK_SET_DESTDIR AND (NOT CPACK_SET_DESTDIR STREQUAL "I_ON"))
endif(CPACK_RPM_PACKAGE_RELOCATABLE)
endif()
endif()
# Check if additional fields for RPM spec header are given
# There may be some COMPONENT specific variables as well
FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV)
IF(CPACK_RPM_PACKAGE_DEBUG)
foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
endif()
if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER})
IF(CPACK_RPM_PACKAGE_DEBUG)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: using CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
endif()
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}})
else()
IF(CPACK_RPM_PACKAGE_DEBUG)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER} not defined")
message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
endif()
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
endif()
else()
IF(CPACK_RPM_PACKAGE_DEBUG)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
endif()
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
endif()
IF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
STRING(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH)
MATH(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1")
STRING(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL)
STRING(TOLOWER "${_PACKAGE_HEADER_TAIL}" _PACKAGE_HEADER_TAIL)
STRING(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME)
SET(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
ELSE(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
if(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
string(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH)
math(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1")
string(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL)
string(TOLOWER "${_PACKAGE_HEADER_TAIL}" _PACKAGE_HEADER_TAIL)
string(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME)
set(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
endif()
set(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
else()
# Do not forget to unset previously set header (from previous component)
UNSET(TMP_RPM_${_RPM_SPEC_HEADER})
ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
ENDFOREACH(_RPM_SPEC_HEADER)
unset(TMP_RPM_${_RPM_SPEC_HEADER})
endif()
endforeach()
# CPACK_RPM_SPEC_INSTALL_POST
# May be used to define a RPM post intallation script
# for example setting it to "/bin/true" may prevent
# rpmbuild from stripping binaries.
IF(CPACK_RPM_SPEC_INSTALL_POST)
IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: User defined CPACK_RPM_SPEC_INSTALL_POST = ${CPACK_RPM_SPEC_INSTALL_POST}")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
SET(TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}")
ENDIF(CPACK_RPM_SPEC_INSTALL_POST)
if(CPACK_RPM_SPEC_INSTALL_POST)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: User defined CPACK_RPM_SPEC_INSTALL_POST = ${CPACK_RPM_SPEC_INSTALL_POST}")
endif()
set(TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}")
endif()
# CPACK_RPM_POST_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE)
# CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE)
@ -518,39 +518,39 @@ if(CPACK_RPM_PACKAGE_COMPONENT)
endif()
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE)
set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE})
else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE)
else()
set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_POST_UNINSTALL_SCRIPT_FILE)
else(CPACK_RPM_PACKAGE_COMPONENT)
endif()
else()
set(CPACK_RPM_POST_INSTALL_READ_FILE ${CPACK_RPM_POST_INSTALL_SCRIPT_FILE})
set(CPACK_RPM_POST_UNINSTALL_READ_FILE ${CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE})
endif(CPACK_RPM_PACKAGE_COMPONENT)
endif()
# Handle post-install file if it has been specified
if(CPACK_RPM_POST_INSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
file(READ ${CPACK_RPM_POST_INSTALL_READ_FILE} CPACK_RPM_SPEC_POSTINSTALL)
else(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
else()
message("CPackRPM:Warning: CPACK_RPM_POST_INSTALL_SCRIPT_FILE <${CPACK_RPM_POST_INSTALL_READ_FILE}> does not exists - ignoring")
endif(EXISTS ${CPACK_RPM_POST_INSTALL_READ_FILE})
else(CPACK_RPM_POST_INSTALL_READ_FILE)
endif()
else()
# reset SPEC var value if no post install file has been specified
# (either globally or component-wise)
set(CPACK_RPM_SPEC_POSTINSTALL "")
endif(CPACK_RPM_POST_INSTALL_READ_FILE)
endif()
# Handle post-uninstall file if it has been specified
if(CPACK_RPM_POST_UNINSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
file(READ ${CPACK_RPM_POST_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_POSTUNINSTALL)
else(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
else()
message("CPackRPM:Warning: CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_POST_UNINSTALL_READ_FILE}> does not exists - ignoring")
endif(EXISTS ${CPACK_RPM_POST_UNINSTALL_READ_FILE})
else(CPACK_RPM_POST_UNINSTALL_READ_FILE)
endif()
else()
# reset SPEC var value if no post uninstall file has been specified
# (either globally or component-wise)
set(CPACK_RPM_SPEC_POSTUNINSTALL "")
endif(CPACK_RPM_POST_UNINSTALL_READ_FILE)
endif()
# CPACK_RPM_PRE_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_INSTALL_SCRIPT_FILE)
# CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_PRE_UNINSTALL_SCRIPT_FILE)
@ -560,44 +560,44 @@ endif(CPACK_RPM_POST_UNINSTALL_READ_FILE)
if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE})
else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
else()
set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_INSTALL_SCRIPT_FILE)
endif()
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE)
set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE})
else(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE)
else()
set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
endif(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PRE_UNINSTALL_SCRIPT_FILE)
else(CPACK_RPM_PACKAGE_COMPONENT)
endif()
else()
set(CPACK_RPM_PRE_INSTALL_READ_FILE ${CPACK_RPM_PRE_INSTALL_SCRIPT_FILE})
set(CPACK_RPM_PRE_UNINSTALL_READ_FILE ${CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE})
endif(CPACK_RPM_PACKAGE_COMPONENT)
endif()
# Handle pre-install file if it has been specified
if(CPACK_RPM_PRE_INSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
file(READ ${CPACK_RPM_PRE_INSTALL_READ_FILE} CPACK_RPM_SPEC_PREINSTALL)
else(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
else()
message("CPackRPM:Warning: CPACK_RPM_PRE_INSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_INSTALL_READ_FILE}> does not exists - ignoring")
endif(EXISTS ${CPACK_RPM_PRE_INSTALL_READ_FILE})
else(CPACK_RPM_PRE_INSTALL_READ_FILE)
endif()
else()
# reset SPEC var value if no pre-install file has been specified
# (either globally or component-wise)
set(CPACK_RPM_SPEC_PREINSTALL "")
endif(CPACK_RPM_PRE_INSTALL_READ_FILE)
endif()
# Handle pre-uninstall file if it has been specified
if(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
if(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
file(READ ${CPACK_RPM_PRE_UNINSTALL_READ_FILE} CPACK_RPM_SPEC_PREUNINSTALL)
else(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
else()
message("CPackRPM:Warning: CPACK_RPM_PRE_UNINSTALL_SCRIPT_FILE <${CPACK_RPM_PRE_UNINSTALL_READ_FILE}> does not exists - ignoring")
endif(EXISTS ${CPACK_RPM_PRE_UNINSTALL_READ_FILE})
else(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
endif()
else()
# reset SPEC var value if no pre-uninstall file has been specified
# (either globally or component-wise)
set(CPACK_RPM_SPEC_PREUNINSTALL "")
endif(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
endif()
# CPACK_RPM_CHANGELOG_FILE
# May be used to embed a changelog in the spec file.
@ -605,39 +605,39 @@ endif(CPACK_RPM_PRE_UNINSTALL_READ_FILE)
if(CPACK_RPM_CHANGELOG_FILE)
if(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
file(READ ${CPACK_RPM_CHANGELOG_FILE} CPACK_RPM_SPEC_CHANGELOG)
else(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
else()
message(SEND_ERROR "CPackRPM:Warning: CPACK_RPM_CHANGELOG_FILE <${CPACK_RPM_CHANGELOG_FILE}> does not exists - ignoring")
endif(EXISTS ${CPACK_RPM_CHANGELOG_FILE})
else(CPACK_RPM_CHANGELOG_FILE)
endif()
else()
set(CPACK_RPM_SPEC_CHANGELOG "* Sun Jul 4 2010 Erk <eric.noulard@gmail.com>\n Generated by CPack RPM (no Changelog file were provided)")
endif(CPACK_RPM_CHANGELOG_FILE)
endif()
# CPACK_RPM_SPEC_MORE_DEFINE
# This is a generated spec rpm file spaceholder
IF(CPACK_RPM_SPEC_MORE_DEFINE)
IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: User defined more define spec line specified:\n ${CPACK_RPM_SPEC_MORE_DEFINE}")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
ENDIF(CPACK_RPM_SPEC_MORE_DEFINE)
if(CPACK_RPM_SPEC_MORE_DEFINE)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: User defined more define spec line specified:\n ${CPACK_RPM_SPEC_MORE_DEFINE}")
endif()
endif()
# Now we may create the RPM build tree structure
SET(CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}")
MESSAGE(STATUS "CPackRPM:Debug: Using CPACK_RPM_ROOTDIR=${CPACK_RPM_ROOTDIR}")
set(CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}")
message(STATUS "CPackRPM:Debug: Using CPACK_RPM_ROOTDIR=${CPACK_RPM_ROOTDIR}")
# Prepare RPM build tree
FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR})
FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/tmp)
FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/BUILD)
FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/RPMS)
FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SOURCES)
FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SPECS)
FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SRPMS)
file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR})
file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/tmp)
file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/BUILD)
file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/RPMS)
file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SOURCES)
file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SPECS)
file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SRPMS)
#SET(CPACK_RPM_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}-${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
SET(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}")
#set(CPACK_RPM_FILE_NAME "${CPACK_RPM_PACKAGE_NAME}-${CPACK_RPM_PACKAGE_VERSION}-${CPACK_RPM_PACKAGE_RELEASE}-${CPACK_RPM_PACKAGE_ARCHITECTURE}.rpm")
set(CPACK_RPM_FILE_NAME "${CPACK_OUTPUT_FILE_NAME}")
# it seems rpmbuild can't handle spaces in the path
# neither escaping (as below) nor putting quotes around the path seem to help
#STRING(REGEX REPLACE " " "\\\\ " CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
#string(REGEX REPLACE " " "\\\\ " CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
set(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
# if we are creating a relocatable package, omit parent directories of
# CPACK_RPM_PACKAGE_PREFIX. This is achieved by building a "filter list"
@ -666,7 +666,7 @@ endif()
# file name by enclosing it between double quotes (thus the sed)
# Then we must authorize any man pages extension (adding * at the end)
# because rpmbuild may automatically compress those files
EXECUTE_PROCESS(COMMAND find . -type f -o -type l -o (-type d -a -not ( -name "." ${_RPM_DIRS_TO_OMIT} ) )
execute_process(COMMAND find . -type f -o -type l -o (-type d -a -not ( -name "." ${_RPM_DIRS_TO_OMIT} ) )
COMMAND sed s:.*/man.*/.*:&*:
COMMAND sed s/\\.\\\(.*\\\)/\"\\1\"/
WORKING_DIRECTORY "${WDIR}"
@ -683,7 +683,7 @@ if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling Absolute Destination Files: <${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}>")
message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
endif(CPACK_RPM_PACKAGE_DEBUG)
endif()
endif()
else()
if(CPACK_ABSOLUTE_DESTINATION_FILES)
@ -698,7 +698,7 @@ if(CPACK_RPM_PACKAGE_COMPONENT)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>")
message("CPackRPM:Debug: in component = ${CPACK_RPM_PACKAGE_COMPONENT}")
endif(CPACK_RPM_PACKAGE_DEBUG)
endif()
else()
set(CPACK_RPM_USER_FILELIST_INTERNAL "")
endif()
@ -715,9 +715,9 @@ endif()
# or CPACK_RPM_INSTALL_FILES,
# hence it must be done before these auto-generated lists are processed.
if(CPACK_RPM_USER_FILELIST_INTERNAL)
IF(CPACK_RPM_PACKAGE_DEBUG)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
endif()
# Create CMake list from CPACK_RPM_INSTALL_FILES
string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
@ -747,15 +747,15 @@ if(CPACK_RPM_USER_FILELIST_INTERNAL)
set(CPACK_RPM_INSTALL_FILES "")
foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
endforeach(F)
endforeach()
else()
set(CPACK_RPM_USER_INSTALL_FILES "")
endif()
if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
IF(CPACK_RPM_PACKAGE_DEBUG)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: Handling Absolute Destination Files: ${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
endif()
# Remove trailing space
string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
# Transform endline separated - string into CMake List
@ -768,20 +768,20 @@ if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
set(CPACK_RPM_INSTALL_FILES "")
foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
endforeach(F)
endforeach()
# Build ABSOLUTE_INSTALL_FILES
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
foreach(F IN LISTS CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "${CPACK_RPM_ABSOLUTE_INSTALL_FILES}%config \"${F}\"\n")
endforeach(F)
IF(CPACK_RPM_PACKAGE_DEBUG)
endforeach()
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: CPACK_RPM_ABSOLUTE_INSTALL_FILES=${CPACK_RPM_ABSOLUTE_INSTALL_FILES}")
message("CPackRPM:Debug: CPACK_RPM_INSTALL_FILES=${CPACK_RPM_INSTALL_FILES}")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
endif()
else()
# reset vars in order to avoid leakage of value(s) from one component to another
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
endif(CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
endif()
# Prepend directories in ${CPACK_RPM_INSTALL_FILES} with %dir
# This is necessary to avoid duplicate files since rpmbuild do
@ -799,32 +799,32 @@ foreach(F IN LISTS CPACK_RPM_INSTALL_FILES_LIST)
else()
set(CPACK_RPM_INSTALL_FILES "${CPACK_RPM_INSTALL_FILES}\"${F}\"\n")
endif()
endforeach(F)
endforeach()
set(CPACK_RPM_INSTALL_FILES_LIST "")
# The name of the final spec file to be used by rpmbuild
SET(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.spec")
set(CPACK_RPM_BINARY_SPECFILE "${CPACK_RPM_ROOTDIR}/SPECS/${CPACK_RPM_PACKAGE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.spec")
# Print out some debug information if we were asked for that
IF(CPACK_RPM_PACKAGE_DEBUG)
MESSAGE("CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}")
MESSAGE("CPackRPM:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}")
MESSAGE("CPackRPM:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}")
MESSAGE("CPackRPM:Debug: CPACK_OUTPUT_FILE_NAME = ${CPACK_OUTPUT_FILE_NAME}")
MESSAGE("CPackRPM:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}")
MESSAGE("CPackRPM:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
MESSAGE("CPackRPM:Debug: CPACK_RPM_BINARY_SPECFILE = ${CPACK_RPM_BINARY_SPECFILE}")
MESSAGE("CPackRPM:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
MESSAGE("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
if(CPACK_RPM_PACKAGE_DEBUG)
message("CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}")
message("CPackRPM:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}")
message("CPackRPM:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}")
message("CPackRPM:Debug: CPACK_OUTPUT_FILE_NAME = ${CPACK_OUTPUT_FILE_NAME}")
message("CPackRPM:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}")
message("CPackRPM:Debug: CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
message("CPackRPM:Debug: CPACK_RPM_BINARY_SPECFILE = ${CPACK_RPM_BINARY_SPECFILE}")
message("CPackRPM:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
message("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
endif()
# USER generated spec file handling.
# We should generate a spec file template:
# - either because the user asked for it : CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE
# - or the user did not provide one : NOT CPACK_RPM_USER_BINARY_SPECFILE
#
IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
FILE(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in
if(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
file(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in
"# -*- rpm-spec -*-
BuildRoot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@\@CPACK_RPM_PACKAGE_COMPONENT_PART_PATH\@
Summary: \@CPACK_RPM_PACKAGE_SUMMARY\@
@ -898,28 +898,28 @@ ${CPACK_RPM_USER_INSTALL_FILES}
# Stop here if we were asked to only generate a template USER spec file
# The generated file may then be used as a template by user who wants
# to customize their own spec file.
IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
MESSAGE(FATAL_ERROR "CPackRPM: STOP here Generated USER binary spec file templare is: ${CPACK_RPM_BINARY_SPECFILE}.in")
ENDIF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
ENDIF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
if(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
message(FATAL_ERROR "CPackRPM: STOP here Generated USER binary spec file templare is: ${CPACK_RPM_BINARY_SPECFILE}.in")
endif()
endif()
# After that we may either use a user provided spec file
# or generate one using appropriate variables value.
IF(CPACK_RPM_USER_BINARY_SPECFILE)
if(CPACK_RPM_USER_BINARY_SPECFILE)
# User may have specified SPECFILE just use it
MESSAGE("CPackRPM: Will use USER specified spec file: ${CPACK_RPM_USER_BINARY_SPECFILE}")
message("CPackRPM: Will use USER specified spec file: ${CPACK_RPM_USER_BINARY_SPECFILE}")
# The user provided file is processed for @var replacement
CONFIGURE_FILE(${CPACK_RPM_USER_BINARY_SPECFILE} ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
ELSE(CPACK_RPM_USER_BINARY_SPECFILE)
configure_file(${CPACK_RPM_USER_BINARY_SPECFILE} ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
else()
# No User specified spec file, will use the generated spec file
MESSAGE("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}")
message("CPackRPM: Will use GENERATED spec file: ${CPACK_RPM_BINARY_SPECFILE}")
# Note the just created file is processed for @var replacement
CONFIGURE_FILE(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
ENDIF(CPACK_RPM_USER_BINARY_SPECFILE)
configure_file(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
endif()
IF(RPMBUILD_EXECUTABLE)
if(RPMBUILD_EXECUTABLE)
# Now call rpmbuild using the SPECFILE
EXECUTE_PROCESS(
execute_process(
COMMAND "${RPMBUILD_EXECUTABLE}" -bb
--define "_topdir ${CPACK_RPM_DIRECTORY}"
--buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
@ -928,17 +928,17 @@ IF(RPMBUILD_EXECUTABLE)
RESULT_VARIABLE CPACK_RPMBUILD_EXEC_RESULT
ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err"
OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
IF(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
FILE(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err RPMBUILDERR)
FILE(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out RPMBUILDOUT)
MESSAGE("CPackRPM:Debug: You may consult rpmbuild logs in: ")
MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err")
MESSAGE("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
MESSAGE("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
ENDIF(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
ELSE(RPMBUILD_EXECUTABLE)
IF(ALIEN_EXECUTABLE)
MESSAGE(FATAL_ERROR "RPM packaging through alien not done (yet)")
ENDIF(ALIEN_EXECUTABLE)
ENDIF(RPMBUILD_EXECUTABLE)
if(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
file(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err RPMBUILDERR)
file(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out RPMBUILDOUT)
message("CPackRPM:Debug: You may consult rpmbuild logs in: ")
message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err")
message("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
message("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
endif()
else()
if(ALIEN_EXECUTABLE)
message(FATAL_ERROR "RPM packaging through alien not done (yet)")
endif()
endif()

View File

@ -12,30 +12,30 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF(CMAKE_BINARY_DIR)
MESSAGE(FATAL_ERROR "CPackZIP.cmake may only be used by CPack internally.")
ENDIF(CMAKE_BINARY_DIR)
if(CMAKE_BINARY_DIR)
message(FATAL_ERROR "CPackZIP.cmake may only be used by CPack internally.")
endif()
FIND_PROGRAM(ZIP_EXECUTABLE wzzip PATHS "$ENV{ProgramFiles}/WinZip")
IF(ZIP_EXECUTABLE)
SET(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -P \"<ARCHIVE>\" @<FILELIST>")
SET(CPACK_ZIP_NEED_QUOTES TRUE)
ENDIF(ZIP_EXECUTABLE)
find_program(ZIP_EXECUTABLE wzzip PATHS "$ENV{ProgramFiles}/WinZip")
if(ZIP_EXECUTABLE)
set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -P \"<ARCHIVE>\" @<FILELIST>")
set(CPACK_ZIP_NEED_QUOTES TRUE)
endif()
IF(NOT ZIP_EXECUTABLE)
FIND_PROGRAM(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip")
IF(ZIP_EXECUTABLE)
SET(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" a -tzip \"<ARCHIVE>\" @<FILELIST>")
SET(CPACK_ZIP_NEED_QUOTES TRUE)
ENDIF(ZIP_EXECUTABLE)
ENDIF(NOT ZIP_EXECUTABLE)
if(NOT ZIP_EXECUTABLE)
find_program(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip")
if(ZIP_EXECUTABLE)
set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" a -tzip \"<ARCHIVE>\" @<FILELIST>")
set(CPACK_ZIP_NEED_QUOTES TRUE)
endif()
endif()
IF(NOT ZIP_EXECUTABLE)
FIND_PACKAGE(Cygwin)
FIND_PROGRAM(ZIP_EXECUTABLE zip PATHS "${CYGWIN_INSTALL_PATH}/bin")
IF(ZIP_EXECUTABLE)
SET(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -r \"<ARCHIVE>\" . -i@<FILELIST>")
SET(CPACK_ZIP_NEED_QUOTES FALSE)
ENDIF(ZIP_EXECUTABLE)
ENDIF(NOT ZIP_EXECUTABLE)
if(NOT ZIP_EXECUTABLE)
find_package(Cygwin)
find_program(ZIP_EXECUTABLE zip PATHS "${CYGWIN_INSTALL_PATH}/bin")
if(ZIP_EXECUTABLE)
set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -r \"<ARCHIVE>\" . -i@<FILELIST>")
set(CPACK_ZIP_NEED_QUOTES FALSE)
endif()
endif()

View File

@ -58,46 +58,46 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
OPTION(BUILD_TESTING "Build the testing tree." ON)
option(BUILD_TESTING "Build the testing tree." ON)
# function to turn generator name into a version string
# like vs7 vs71 vs8 vs9
FUNCTION(GET_VS_VERSION_STRING generator var)
STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1"
function(GET_VS_VERSION_STRING generator var)
string(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1"
NUMBER "${generator}")
IF("${generator}" MATCHES "Visual Studio 7 .NET 2003")
SET(ver_string "vs71")
ELSE("${generator}" MATCHES "Visual Studio 7 .NET 2003")
SET(ver_string "vs${NUMBER}")
ENDIF("${generator}" MATCHES "Visual Studio 7 .NET 2003")
SET(${var} ${ver_string} PARENT_SCOPE)
ENDFUNCTION(GET_VS_VERSION_STRING)
if("${generator}" MATCHES "Visual Studio 7 .NET 2003")
set(ver_string "vs71")
else()
set(ver_string "vs${NUMBER}")
endif()
set(${var} ${ver_string} PARENT_SCOPE)
endfunction()
IF(BUILD_TESTING)
if(BUILD_TESTING)
# Setup some auxilary macros
MACRO(SET_IF_NOT_SET var val)
IF(NOT DEFINED "${var}")
SET("${var}" "${val}")
ENDIF(NOT DEFINED "${var}")
ENDMACRO(SET_IF_NOT_SET)
macro(SET_IF_NOT_SET var val)
if(NOT DEFINED "${var}")
set("${var}" "${val}")
endif()
endmacro()
MACRO(SET_IF_SET var val)
IF(NOT "${val}" MATCHES "^$")
SET("${var}" "${val}")
ENDIF(NOT "${val}" MATCHES "^$")
ENDMACRO(SET_IF_SET)
macro(SET_IF_SET var val)
if(NOT "${val}" MATCHES "^$")
set("${var}" "${val}")
endif()
endmacro()
MACRO(SET_IF_SET_AND_NOT_SET var val)
IF(NOT "${val}" MATCHES "^$")
macro(SET_IF_SET_AND_NOT_SET var val)
if(NOT "${val}" MATCHES "^$")
SET_IF_NOT_SET("${var}" "${val}")
ENDIF(NOT "${val}" MATCHES "^$")
ENDMACRO(SET_IF_SET_AND_NOT_SET)
endif()
endmacro()
# Make sure testing is enabled
ENABLE_TESTING()
enable_testing()
IF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
INCLUDE("${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
if(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
include("${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
SET_IF_SET_AND_NOT_SET(NIGHTLY_START_TIME "${CTEST_NIGHTLY_START_TIME}")
SET_IF_SET_AND_NOT_SET(DROP_METHOD "${CTEST_DROP_METHOD}")
SET_IF_SET_AND_NOT_SET(DROP_SITE "${CTEST_DROP_SITE}")
@ -107,155 +107,155 @@ IF(BUILD_TESTING)
SET_IF_SET_AND_NOT_SET(DROP_LOCATION "${CTEST_DROP_LOCATION}")
SET_IF_SET_AND_NOT_SET(TRIGGER_SITE "${CTEST_TRIGGER_SITE}")
SET_IF_SET_AND_NOT_SET(UPDATE_TYPE "${CTEST_UPDATE_TYPE}")
ENDIF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
endif()
# the project can have a DartConfig.cmake file
IF(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
INCLUDE("${PROJECT_SOURCE_DIR}/DartConfig.cmake")
ELSE(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
if(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
include("${PROJECT_SOURCE_DIR}/DartConfig.cmake")
else()
# Dashboard is opened for submissions for a 24 hour period starting at
# the specified NIGHTLY_START_TIME. Time is specified in 24 hour format.
SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT")
SET_IF_NOT_SET(DROP_METHOD "http")
SET_IF_NOT_SET (COMPRESS_SUBMISSION ON)
ENDIF(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
endif()
SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT")
FIND_PROGRAM(CVSCOMMAND cvs )
SET(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING
find_program(CVSCOMMAND cvs )
set(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING
"Options passed to the cvs update command.")
FIND_PROGRAM(SVNCOMMAND svn)
FIND_PROGRAM(BZRCOMMAND bzr)
FIND_PROGRAM(HGCOMMAND hg)
FIND_PROGRAM(GITCOMMAND git)
find_program(SVNCOMMAND svn)
find_program(BZRCOMMAND bzr)
find_program(HGCOMMAND hg)
find_program(GITCOMMAND git)
IF(NOT UPDATE_TYPE)
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS")
SET(UPDATE_TYPE cvs)
ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
SET(UPDATE_TYPE svn)
ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
SET(UPDATE_TYPE bzr)
ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg")
SET(UPDATE_TYPE hg)
ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
SET(UPDATE_TYPE git)
ENDIF()
ENDIF(NOT UPDATE_TYPE)
if(NOT UPDATE_TYPE)
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS")
set(UPDATE_TYPE cvs)
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
set(UPDATE_TYPE svn)
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
set(UPDATE_TYPE bzr)
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg")
set(UPDATE_TYPE hg)
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
set(UPDATE_TYPE git)
endif()
endif()
STRING(TOLOWER "${UPDATE_TYPE}" _update_type)
IF("${_update_type}" STREQUAL "cvs")
SET(UPDATE_COMMAND "${CVSCOMMAND}")
SET(UPDATE_OPTIONS "${CVS_UPDATE_OPTIONS}")
ELSEIF("${_update_type}" STREQUAL "svn")
SET(UPDATE_COMMAND "${SVNCOMMAND}")
SET(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}")
ELSEIF("${_update_type}" STREQUAL "bzr")
SET(UPDATE_COMMAND "${BZRCOMMAND}")
SET(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}")
ELSEIF("${_update_type}" STREQUAL "hg")
SET(UPDATE_COMMAND "${HGCOMMAND}")
SET(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}")
ELSEIF("${_update_type}" STREQUAL "git")
SET(UPDATE_COMMAND "${GITCOMMAND}")
SET(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}")
ENDIF()
string(TOLOWER "${UPDATE_TYPE}" _update_type)
if("${_update_type}" STREQUAL "cvs")
set(UPDATE_COMMAND "${CVSCOMMAND}")
set(UPDATE_OPTIONS "${CVS_UPDATE_OPTIONS}")
elseif("${_update_type}" STREQUAL "svn")
set(UPDATE_COMMAND "${SVNCOMMAND}")
set(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}")
elseif("${_update_type}" STREQUAL "bzr")
set(UPDATE_COMMAND "${BZRCOMMAND}")
set(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}")
elseif("${_update_type}" STREQUAL "hg")
set(UPDATE_COMMAND "${HGCOMMAND}")
set(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}")
elseif("${_update_type}" STREQUAL "git")
set(UPDATE_COMMAND "${GITCOMMAND}")
set(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}")
endif()
SET(DART_TESTING_TIMEOUT 1500 CACHE STRING
set(DART_TESTING_TIMEOUT 1500 CACHE STRING
"Maximum time allowed before CTest will kill the test.")
SET(CTEST_SUBMIT_RETRY_DELAY 5 CACHE STRING
set(CTEST_SUBMIT_RETRY_DELAY 5 CACHE STRING
"How long to wait between timed-out CTest submissions.")
SET(CTEST_SUBMIT_RETRY_COUNT 3 CACHE STRING
set(CTEST_SUBMIT_RETRY_COUNT 3 CACHE STRING
"How many times to retry timed-out CTest submissions.")
FIND_PROGRAM(MEMORYCHECK_COMMAND
find_program(MEMORYCHECK_COMMAND
NAMES purify valgrind boundscheck
PATHS
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Rational Software\\Purify\\Setup;InstallFolder]"
DOC "Path to the memory checking command, used for memory error detection."
)
FIND_PROGRAM(SLURM_SBATCH_COMMAND sbatch DOC
find_program(SLURM_SBATCH_COMMAND sbatch DOC
"Path to the SLURM sbatch executable"
)
FIND_PROGRAM(SLURM_SRUN_COMMAND srun DOC
find_program(SLURM_SRUN_COMMAND srun DOC
"Path to the SLURM srun executable"
)
SET(MEMORYCHECK_SUPPRESSIONS_FILE "" CACHE FILEPATH
set(MEMORYCHECK_SUPPRESSIONS_FILE "" CACHE FILEPATH
"File that contains suppressions for the memory checker")
FIND_PROGRAM(SCPCOMMAND scp DOC
find_program(SCPCOMMAND scp DOC
"Path to scp command, used by CTest for submitting results to a Dart server"
)
FIND_PROGRAM(COVERAGE_COMMAND gcov DOC
find_program(COVERAGE_COMMAND gcov DOC
"Path to the coverage program that CTest uses for performing coverage inspection"
)
SET(COVERAGE_EXTRA_FLAGS "-l" CACHE STRING
set(COVERAGE_EXTRA_FLAGS "-l" CACHE STRING
"Extra command line flags to pass to the coverage tool")
# set the site name
SITE_NAME(SITE)
site_name(SITE)
# set the build name
IF(NOT BUILDNAME)
SET(DART_COMPILER "${CMAKE_CXX_COMPILER}")
IF(NOT DART_COMPILER)
SET(DART_COMPILER "${CMAKE_C_COMPILER}")
ENDIF(NOT DART_COMPILER)
IF(NOT DART_COMPILER)
SET(DART_COMPILER "unknown")
ENDIF(NOT DART_COMPILER)
IF(WIN32)
SET(DART_NAME_COMPONENT "NAME_WE")
ELSE(WIN32)
SET(DART_NAME_COMPONENT "NAME")
ENDIF(WIN32)
IF(NOT BUILD_NAME_SYSTEM_NAME)
SET(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
ENDIF(NOT BUILD_NAME_SYSTEM_NAME)
IF(WIN32)
SET(BUILD_NAME_SYSTEM_NAME "Win32")
ENDIF(WIN32)
IF(UNIX OR BORLAND)
GET_FILENAME_COMPONENT(DART_CXX_NAME
if(NOT BUILDNAME)
set(DART_COMPILER "${CMAKE_CXX_COMPILER}")
if(NOT DART_COMPILER)
set(DART_COMPILER "${CMAKE_C_COMPILER}")
endif()
if(NOT DART_COMPILER)
set(DART_COMPILER "unknown")
endif()
if(WIN32)
set(DART_NAME_COMPONENT "NAME_WE")
else()
set(DART_NAME_COMPONENT "NAME")
endif()
if(NOT BUILD_NAME_SYSTEM_NAME)
set(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
endif()
if(WIN32)
set(BUILD_NAME_SYSTEM_NAME "Win32")
endif()
if(UNIX OR BORLAND)
get_filename_component(DART_CXX_NAME
"${CMAKE_CXX_COMPILER}" ${DART_NAME_COMPONENT})
ELSE(UNIX OR BORLAND)
GET_FILENAME_COMPONENT(DART_CXX_NAME
else()
get_filename_component(DART_CXX_NAME
"${CMAKE_BUILD_TOOL}" ${DART_NAME_COMPONENT})
ENDIF(UNIX OR BORLAND)
IF(DART_CXX_NAME MATCHES "msdev")
SET(DART_CXX_NAME "vs60")
ENDIF(DART_CXX_NAME MATCHES "msdev")
IF(DART_CXX_NAME MATCHES "devenv")
endif()
if(DART_CXX_NAME MATCHES "msdev")
set(DART_CXX_NAME "vs60")
endif()
if(DART_CXX_NAME MATCHES "devenv")
GET_VS_VERSION_STRING("${CMAKE_GENERATOR}" DART_CXX_NAME)
ENDIF(DART_CXX_NAME MATCHES "devenv")
SET(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}")
ENDIF(NOT BUILDNAME)
endif()
set(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}")
endif()
# the build command
BUILD_COMMAND(MAKECOMMAND_DEFAULT_VALUE
build_command(MAKECOMMAND_DEFAULT_VALUE
CONFIGURATION "\${CTEST_CONFIGURATION_TYPE}")
SET(MAKECOMMAND ${MAKECOMMAND_DEFAULT_VALUE}
set(MAKECOMMAND ${MAKECOMMAND_DEFAULT_VALUE}
CACHE STRING "Command to build the project")
# the default build configuration the ctest build handler will use
# if there is no -C arg given to ctest:
SET(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
IF(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
SET(DEFAULT_CTEST_CONFIGURATION_TYPE "Release")
ENDIF(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
set(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
if(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
set(DEFAULT_CTEST_CONFIGURATION_TYPE "Release")
endif()
IF(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
SET(CTEST_USE_LAUNCHERS 0)
ENDIF(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
IF(CTEST_USE_LAUNCHERS)
SET(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --")
SET(CTEST_LAUNCH_LINK "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --")
SET(CTEST_LAUNCH_CUSTOM "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OUTPUT> --")
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}")
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}")
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}")
ENDIF(CTEST_USE_LAUNCHERS)
if(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
set(CTEST_USE_LAUNCHERS 0)
endif()
if(CTEST_USE_LAUNCHERS)
set(CTEST_LAUNCH_COMPILE "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OBJECT> --source <SOURCE> --language <LANGUAGE> --")
set(CTEST_LAUNCH_LINK "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <TARGET> --target-type <TARGET_TYPE> --language <LANGUAGE> --")
set(CTEST_LAUNCH_CUSTOM "\"${CMAKE_CTEST_COMMAND}\" --launch --target-name <TARGET_NAME> --build-dir <CMAKE_CURRENT_BINARY_DIR> --output <OUTPUT> --")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CTEST_LAUNCH_COMPILE}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}")
endif()
MARK_AS_ADVANCED(
mark_as_advanced(
BZRCOMMAND
BZR_UPDATE_OPTIONS
COVERAGE_COMMAND
@ -278,9 +278,9 @@ IF(BUILD_TESTING)
SVNCOMMAND
SVN_UPDATE_OPTIONS
)
IF(NOT RUN_FROM_DART)
SET(RUN_FROM_CTEST_OR_DART 1)
INCLUDE(CTestTargets)
SET(RUN_FROM_CTEST_OR_DART)
ENDIF(NOT RUN_FROM_DART)
ENDIF(BUILD_TESTING)
if(NOT RUN_FROM_DART)
set(RUN_FROM_CTEST_OR_DART 1)
include(CTestTargets)
set(RUN_FROM_CTEST_OR_DART)
endif()
endif()

View File

@ -12,29 +12,29 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
IF(NOT RUN_FROM_CTEST_OR_DART)
MESSAGE(FATAL_ERROR "Do not incldue CTestTargets.cmake directly")
ENDIF(NOT RUN_FROM_CTEST_OR_DART)
if(NOT RUN_FROM_CTEST_OR_DART)
message(FATAL_ERROR "Do not incldue CTestTargets.cmake directly")
endif()
# make directories in the binary tree
FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary)
GET_FILENAME_COMPONENT(CMAKE_HOST_PATH ${CMAKE_COMMAND} PATH)
SET(CMAKE_TARGET_PATH ${EXECUTABLE_OUTPUT_PATH})
FIND_PROGRAM(CMAKE_CTEST_COMMAND ctest ${CMAKE_HOST_PATH} ${CMAKE_TARGET_PATH})
MARK_AS_ADVANCED(CMAKE_CTEST_COMMAND)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary)
get_filename_component(CMAKE_HOST_PATH ${CMAKE_COMMAND} PATH)
set(CMAKE_TARGET_PATH ${EXECUTABLE_OUTPUT_PATH})
find_program(CMAKE_CTEST_COMMAND ctest ${CMAKE_HOST_PATH} ${CMAKE_TARGET_PATH})
mark_as_advanced(CMAKE_CTEST_COMMAND)
# Use CTest
# configure files
IF(CTEST_NEW_FORMAT)
CONFIGURE_FILE(
if(CTEST_NEW_FORMAT)
configure_file(
${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
${PROJECT_BINARY_DIR}/CTestConfiguration.ini )
ELSE(CTEST_NEW_FORMAT)
CONFIGURE_FILE(
else()
configure_file(
${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
ENDIF(CTEST_NEW_FORMAT)
endif()
#
# Section 3:
@ -43,53 +43,53 @@ ENDIF(CTEST_NEW_FORMAT)
# These should NOT need to be modified from project to project.
#
SET(__conf_types "")
IF(CMAKE_CONFIGURATION_TYPES)
set(__conf_types "")
if(CMAKE_CONFIGURATION_TYPES)
# We need to pass the configuration type on the test command line.
SET(__conf_types -C "${CMAKE_CFG_INTDIR}")
ENDIF(CMAKE_CONFIGURATION_TYPES)
set(__conf_types -C "${CMAKE_CFG_INTDIR}")
endif()
# Add convenience targets. Do this at most once in case of nested
# projects.
DEFINE_PROPERTY(GLOBAL PROPERTY CTEST_TARGETS_ADDED
define_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED
BRIEF_DOCS "Internal property used by CTestTargets module."
FULL_DOCS "Set by the CTestTargets module to track addition of testing targets."
)
GET_PROPERTY(_CTEST_TARGETS_ADDED GLOBAL PROPERTY CTEST_TARGETS_ADDED)
IF(NOT _CTEST_TARGETS_ADDED)
SET_PROPERTY(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
get_property(_CTEST_TARGETS_ADDED GLOBAL PROPERTY CTEST_TARGETS_ADDED)
if(NOT _CTEST_TARGETS_ADDED)
set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
# For all generators add basic testing targets.
FOREACH(mode Experimental Nightly Continuous NightlyMemoryCheck)
ADD_CUSTOM_TARGET(${mode}
foreach(mode Experimental Nightly Continuous NightlyMemoryCheck)
add_custom_target(${mode}
${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}
)
SET_PROPERTY(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "")
SET_PROPERTY(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets")
ENDFOREACH(mode)
set_property(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "")
set_property(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets")
endforeach()
# For Makefile generators add more granular targets.
IF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
if("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
# Make targets for Experimental builds
FOREACH(mode Nightly Experimental Continuous)
FOREACH(testtype
foreach(mode Nightly Experimental Continuous)
foreach(testtype
Start Update Configure Build Test Coverage MemCheck Submit
# missing purify
)
ADD_CUSTOM_TARGET(${mode}${testtype}
add_custom_target(${mode}${testtype}
${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}${testtype}
)
SET_PROPERTY(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "")
SET_PROPERTY(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets")
ENDFOREACH(testtype)
ENDFOREACH(mode)
ENDIF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
set_property(TARGET ${mode}${testtype} PROPERTY RULE_LAUNCH_CUSTOM "")
set_property(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets")
endforeach()
endforeach()
endif()
# If requested, add an alias that is the equivalent of the built-in "test"
# or "RUN_TESTS" target:
IF(CTEST_TEST_TARGET_ALIAS)
ADD_CUSTOM_TARGET(${CTEST_TEST_TARGET_ALIAS}
if(CTEST_TEST_TARGET_ALIAS)
add_custom_target(${CTEST_TEST_TARGET_ALIAS}
${CMAKE_CTEST_COMMAND} ${__conf_types}
)
ENDIF()
ENDIF(NOT _CTEST_TARGETS_ADDED)
endif()
endif()

View File

@ -21,11 +21,11 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CheckCSourceCompiles)
include(CheckCSourceCompiles)
MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT}
# Some compilers do not fail with a bad flag
FAIL_REGEX "command line option .* is valid for .* but not for C" # GNU
@ -41,5 +41,5 @@ MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
FAIL_REGEX "command option .* is not recognized" # XL
FAIL_REGEX "WARNING: unknown flag:" # Open64
)
SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
ENDMACRO (CHECK_C_COMPILER_FLAG)
set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
endmacro ()

View File

@ -24,43 +24,43 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$")
SET(_FAIL_REGEX)
SET(_key)
FOREACH(arg ${ARGN})
IF("${arg}" MATCHES "^(FAIL_REGEX)$")
SET(_key "${arg}")
ELSEIF(_key)
LIST(APPEND _${_key} "${arg}")
ELSE()
MESSAGE(FATAL_ERROR "Unknown argument:\n ${arg}\n")
ENDIF()
ENDFOREACH()
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
if("${VAR}" MATCHES "^${VAR}$")
set(_FAIL_REGEX)
set(_key)
foreach(arg ${ARGN})
if("${arg}" MATCHES "^(FAIL_REGEX)$")
set(_key "${arg}")
elseif(_key)
list(APPEND _${_key} "${arg}")
else()
message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
endif()
endforeach()
set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES)
if(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES)
IF(CMAKE_REQUIRED_INCLUDES)
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
else()
set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
endif()
if(CMAKE_REQUIRED_INCLUDES)
set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
ELSE(CMAKE_REQUIRED_INCLUDES)
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
ENDIF(CMAKE_REQUIRED_INCLUDES)
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
else()
set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
endif()
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
"${SOURCE}\n")
MESSAGE(STATUS "Performing Test ${VAR}")
TRY_COMPILE(${VAR}
message(STATUS "Performing Test ${VAR}")
try_compile(${VAR}
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@ -69,27 +69,27 @@ MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
OUTPUT_VARIABLE OUTPUT)
FOREACH(_regex ${_FAIL_REGEX})
IF("${OUTPUT}" MATCHES "${_regex}")
SET(${VAR} 0)
ENDIF()
ENDFOREACH()
foreach(_regex ${_FAIL_REGEX})
if("${OUTPUT}" MATCHES "${_regex}")
set(${VAR} 0)
endif()
endforeach()
IF(${VAR})
SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
MESSAGE(STATUS "Performing Test ${VAR} - Success")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
if(${VAR})
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
message(STATUS "Performing Test ${VAR} - Success")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
ELSE(${VAR})
MESSAGE(STATUS "Performing Test ${VAR} - Failed")
SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
else()
message(STATUS "Performing Test ${VAR} - Failed")
set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
"Source file was:\n${SOURCE}\n")
ENDIF(${VAR})
ENDIF("${VAR}" MATCHES "^${VAR}$")
ENDMACRO(CHECK_C_SOURCE_COMPILES)
endif()
endif()
endmacro()

View File

@ -24,32 +24,32 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
IF("${VAR}" MATCHES "^${VAR}$")
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
if("${VAR}" MATCHES "^${VAR}$")
set(MACRO_CHECK_FUNCTION_DEFINITIONS
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
IF(CMAKE_REQUIRED_LIBRARIES)
if(CMAKE_REQUIRED_LIBRARIES)
# this one translates potentially used imported library targets to their files on disk
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
ELSE(CMAKE_REQUIRED_LIBRARIES)
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
ENDIF(CMAKE_REQUIRED_LIBRARIES)
IF(CMAKE_REQUIRED_INCLUDES)
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
else()
set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
endif()
if(CMAKE_REQUIRED_INCLUDES)
set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
ELSE(CMAKE_REQUIRED_INCLUDES)
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
ENDIF(CMAKE_REQUIRED_INCLUDES)
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
else()
set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
endif()
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
"${SOURCE}\n")
MESSAGE(STATUS "Performing Test ${VAR}")
TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
message(STATUS "Performing Test ${VAR}")
try_run(${VAR}_EXITCODE ${VAR}_COMPILED
${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
@ -59,33 +59,33 @@ MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
COMPILE_OUTPUT_VARIABLE OUTPUT)
# if it did not compile make the return value fail code of 1
IF(NOT ${VAR}_COMPILED)
SET(${VAR}_EXITCODE 1)
ENDIF(NOT ${VAR}_COMPILED)
if(NOT ${VAR}_COMPILED)
set(${VAR}_EXITCODE 1)
endif()
# if the return value was 0 then it worked
IF("${${VAR}_EXITCODE}" EQUAL 0)
SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
MESSAGE(STATUS "Performing Test ${VAR} - Success")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
if("${${VAR}_EXITCODE}" EQUAL 0)
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
message(STATUS "Performing Test ${VAR} - Success")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
"${OUTPUT}\n"
"Return value: ${${VAR}}\n"
"Source file was:\n${SOURCE}\n")
ELSE("${${VAR}_EXITCODE}" EQUAL 0)
IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
SET(${VAR} "${${VAR}_EXITCODE}")
ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
else()
if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
set(${VAR} "${${VAR}_EXITCODE}")
else()
set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
endif()
MESSAGE(STATUS "Performing Test ${VAR} - Failed")
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
message(STATUS "Performing Test ${VAR} - Failed")
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
"${OUTPUT}\n"
"Return value: ${${VAR}_EXITCODE}\n"
"Source file was:\n${SOURCE}\n")
ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
ENDIF("${VAR}" MATCHES "^${VAR}$")
ENDMACRO(CHECK_C_SOURCE_RUNS)
endif()
endif()
endmacro()

View File

@ -21,11 +21,11 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
INCLUDE(CheckCXXSourceCompiles)
include(CheckCXXSourceCompiles)
MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}
# Some compilers do not fail with a bad flag
FAIL_REGEX "command line option .* is valid for .* but not for C\\\\+\\\\+" # GNU
@ -43,6 +43,6 @@ MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
FAIL_REGEX "File with unknown suffix passed to linker" # PGI
FAIL_REGEX "WARNING: unknown flag:" # Open64
)
SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
ENDMACRO (CHECK_CXX_COMPILER_FLAG)
set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
endmacro ()

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