Convert CMake-language commands to lower case
Ancient CMake versions required upper-case commands. Later command names became case-insensitive. Now the preferred style is lower-case. Run the following shell code: cmake --help-command-list | grep -v "cmake version" | while read c; do echo 's/\b'"$(echo $c | tr '[:lower:]' '[:upper:]')"'\(\s*\)(/'"$c"'\1(/g' done >convert.sed && git ls-files -z -- bootstrap '*.cmake' '*.cmake.in' '*CMakeLists.txt' | egrep -z -v '^(Utilities/cm|Source/kwsys/)' | xargs -0 sed -i -f convert.sed && rm convert.sed
This commit is contained in:
parent
7bbaa4283d
commit
77543bde41
134
CMakeCPack.cmake
134
CMakeCPack.cmake
|
@ -11,113 +11,113 @@
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
|
|
||||||
# If the cmake version includes cpack, use it
|
# If the cmake version includes cpack, use it
|
||||||
IF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
if(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||||
IF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
|
if(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
|
||||||
OPTION(CMAKE_INSTALL_DEBUG_LIBRARIES
|
option(CMAKE_INSTALL_DEBUG_LIBRARIES
|
||||||
"Install Microsoft runtime debug libraries with CMake." FALSE)
|
"Install Microsoft runtime debug libraries with CMake." FALSE)
|
||||||
MARK_AS_ADVANCED(CMAKE_INSTALL_DEBUG_LIBRARIES)
|
mark_as_advanced(CMAKE_INSTALL_DEBUG_LIBRARIES)
|
||||||
|
|
||||||
# By default, do not warn when built on machines using only VS Express:
|
# By default, do not warn when built on machines using only VS Express:
|
||||||
IF(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
|
if(NOT DEFINED CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS)
|
||||||
SET(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
|
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS ON)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
INCLUDE(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
|
include(${CMake_SOURCE_DIR}/Modules/InstallRequiredSystemLibraries.cmake)
|
||||||
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
|
endif(EXISTS "${CMAKE_ROOT}/Modules/InstallRequiredSystemLibraries.cmake")
|
||||||
|
|
||||||
SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
|
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "CMake is a build tool")
|
||||||
SET(CPACK_PACKAGE_VENDOR "Kitware")
|
set(CPACK_PACKAGE_VENDOR "Kitware")
|
||||||
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
|
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
|
||||||
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
|
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt")
|
||||||
SET(CPACK_PACKAGE_VERSION "${CMake_VERSION}")
|
set(CPACK_PACKAGE_VERSION "${CMake_VERSION}")
|
||||||
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
|
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
|
||||||
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
|
set(CPACK_SOURCE_PACKAGE_FILE_NAME "cmake-${CMake_VERSION}")
|
||||||
|
|
||||||
# Make this explicit here, rather than accepting the CPack default value,
|
# Make this explicit here, rather than accepting the CPack default value,
|
||||||
# so we can refer to it:
|
# so we can refer to it:
|
||||||
SET(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
|
set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
|
||||||
|
|
||||||
# Installers for 32- vs. 64-bit CMake:
|
# Installers for 32- vs. 64-bit CMake:
|
||||||
# - Root install directory (displayed to end user at installer-run time)
|
# - Root install directory (displayed to end user at installer-run time)
|
||||||
# - "NSIS package/display name" (text used in the installer GUI)
|
# - "NSIS package/display name" (text used in the installer GUI)
|
||||||
# - Registry key used to store info about the installation
|
# - Registry key used to store info about the installation
|
||||||
IF(CMAKE_CL_64)
|
if(CMAKE_CL_64)
|
||||||
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
|
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES64")
|
||||||
SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)")
|
set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} (Win64)")
|
||||||
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
|
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION} (Win64)")
|
||||||
ELSE()
|
else()
|
||||||
SET(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
|
set(CPACK_NSIS_INSTALL_ROOT "$PROGRAMFILES")
|
||||||
SET(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
|
set(CPACK_NSIS_PACKAGE_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY}")
|
||||||
SET(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
|
set(CPACK_PACKAGE_INSTALL_REGISTRY_KEY "${CPACK_PACKAGE_NAME} ${CPACK_PACKAGE_VERSION}")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT DEFINED CPACK_SYSTEM_NAME)
|
if(NOT DEFINED CPACK_SYSTEM_NAME)
|
||||||
# make sure package is not Cygwin-unknown, for Cygwin just
|
# make sure package is not Cygwin-unknown, for Cygwin just
|
||||||
# cygwin is good for the system name
|
# cygwin is good for the system name
|
||||||
IF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
if("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
||||||
SET(CPACK_SYSTEM_NAME Cygwin)
|
set(CPACK_SYSTEM_NAME Cygwin)
|
||||||
ELSE("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
else("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
||||||
SET(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
|
set(CPACK_SYSTEM_NAME ${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR})
|
||||||
ENDIF("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
endif("${CMAKE_SYSTEM_NAME}" STREQUAL "CYGWIN")
|
||||||
ENDIF(NOT DEFINED CPACK_SYSTEM_NAME)
|
endif(NOT DEFINED CPACK_SYSTEM_NAME)
|
||||||
IF(${CPACK_SYSTEM_NAME} MATCHES Windows)
|
if(${CPACK_SYSTEM_NAME} MATCHES Windows)
|
||||||
IF(CMAKE_CL_64)
|
if(CMAKE_CL_64)
|
||||||
SET(CPACK_SYSTEM_NAME win64-x64)
|
set(CPACK_SYSTEM_NAME win64-x64)
|
||||||
ELSE(CMAKE_CL_64)
|
else(CMAKE_CL_64)
|
||||||
SET(CPACK_SYSTEM_NAME win32-x86)
|
set(CPACK_SYSTEM_NAME win32-x86)
|
||||||
ENDIF(CMAKE_CL_64)
|
endif(CMAKE_CL_64)
|
||||||
ENDIF(${CPACK_SYSTEM_NAME} MATCHES Windows)
|
endif(${CPACK_SYSTEM_NAME} MATCHES Windows)
|
||||||
|
|
||||||
IF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
|
if(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
|
||||||
# if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
|
# if the CPACK_PACKAGE_FILE_NAME is not defined by the cache
|
||||||
# default to source package - system, on cygwin system is not
|
# default to source package - system, on cygwin system is not
|
||||||
# needed
|
# needed
|
||||||
IF(CYGWIN)
|
if(CYGWIN)
|
||||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
|
set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
|
||||||
ELSE(CYGWIN)
|
else(CYGWIN)
|
||||||
SET(CPACK_PACKAGE_FILE_NAME
|
set(CPACK_PACKAGE_FILE_NAME
|
||||||
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
|
"${CPACK_SOURCE_PACKAGE_FILE_NAME}-${CPACK_SYSTEM_NAME}")
|
||||||
ENDIF(CYGWIN)
|
endif(CYGWIN)
|
||||||
ENDIF(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
|
endif(NOT DEFINED CPACK_PACKAGE_FILE_NAME)
|
||||||
|
|
||||||
SET(CPACK_PACKAGE_CONTACT "cmake@cmake.org")
|
set(CPACK_PACKAGE_CONTACT "cmake@cmake.org")
|
||||||
|
|
||||||
IF(UNIX)
|
if(UNIX)
|
||||||
SET(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest")
|
set(CPACK_STRIP_FILES "bin/ccmake;bin/cmake;bin/cpack;bin/ctest")
|
||||||
SET(CPACK_SOURCE_STRIP_FILES "")
|
set(CPACK_SOURCE_STRIP_FILES "")
|
||||||
SET(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
|
set(CPACK_PACKAGE_EXECUTABLES "ccmake" "CMake")
|
||||||
ENDIF(UNIX)
|
endif(UNIX)
|
||||||
|
|
||||||
# cygwin specific packaging stuff
|
# cygwin specific packaging stuff
|
||||||
IF(CYGWIN)
|
if(CYGWIN)
|
||||||
# setup the cygwin package name
|
# setup the cygwin package name
|
||||||
SET(CPACK_PACKAGE_NAME cmake)
|
set(CPACK_PACKAGE_NAME cmake)
|
||||||
# setup the name of the package for cygwin cmake-2.4.3
|
# setup the name of the package for cygwin cmake-2.4.3
|
||||||
SET(CPACK_PACKAGE_FILE_NAME
|
set(CPACK_PACKAGE_FILE_NAME
|
||||||
"${CPACK_PACKAGE_NAME}-${CMake_VERSION}")
|
"${CPACK_PACKAGE_NAME}-${CMake_VERSION}")
|
||||||
# the source has the same name as the binary
|
# the source has the same name as the binary
|
||||||
SET(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
|
set(CPACK_SOURCE_PACKAGE_FILE_NAME ${CPACK_PACKAGE_FILE_NAME})
|
||||||
# Create a cygwin version number in case there are changes for cygwin
|
# Create a cygwin version number in case there are changes for cygwin
|
||||||
# that are not reflected upstream in CMake
|
# that are not reflected upstream in CMake
|
||||||
SET(CPACK_CYGWIN_PATCH_NUMBER 1)
|
set(CPACK_CYGWIN_PATCH_NUMBER 1)
|
||||||
# These files are required by the cmCPackCygwinSourceGenerator and the files
|
# These files are required by the cmCPackCygwinSourceGenerator and the files
|
||||||
# put into the release tar files.
|
# put into the release tar files.
|
||||||
SET(CPACK_CYGWIN_BUILD_SCRIPT
|
set(CPACK_CYGWIN_BUILD_SCRIPT
|
||||||
"${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.sh")
|
"${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.sh")
|
||||||
SET(CPACK_CYGWIN_PATCH_FILE
|
set(CPACK_CYGWIN_PATCH_FILE
|
||||||
"${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.patch")
|
"${CMake_BINARY_DIR}/@CPACK_PACKAGE_FILE_NAME@-@CPACK_CYGWIN_PATCH_NUMBER@.patch")
|
||||||
# include the sub directory cmake file for cygwin that
|
# include the sub directory cmake file for cygwin that
|
||||||
# configures some files and adds some install targets
|
# configures some files and adds some install targets
|
||||||
# this file uses some of the package file name variables
|
# this file uses some of the package file name variables
|
||||||
INCLUDE(Utilities/Release/Cygwin/CMakeLists.txt)
|
include(Utilities/Release/Cygwin/CMakeLists.txt)
|
||||||
ENDIF(CYGWIN)
|
endif(CYGWIN)
|
||||||
|
|
||||||
# Set the options file that needs to be included inside CMakeCPackOptions.cmake
|
# Set the options file that needs to be included inside CMakeCPackOptions.cmake
|
||||||
SET(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
|
set(QT_DIALOG_CPACK_OPTIONS_FILE ${CMake_BINARY_DIR}/Source/QtDialog/QtDialogCPack.cmake)
|
||||||
CONFIGURE_FILE("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
|
configure_file("${CMake_SOURCE_DIR}/CMakeCPackOptions.cmake.in"
|
||||||
"${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
|
"${CMake_BINARY_DIR}/CMakeCPackOptions.cmake" @ONLY)
|
||||||
SET(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")
|
set(CPACK_PROJECT_CONFIG_FILE "${CMake_BINARY_DIR}/CMakeCPackOptions.cmake")
|
||||||
|
|
||||||
# include CPack model once all variables are set
|
# include CPack model once all variables are set
|
||||||
INCLUDE(CPack)
|
include(CPack)
|
||||||
ENDIF(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
endif(EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||||
|
|
|
@ -3,16 +3,16 @@
|
||||||
# in this file.
|
# in this file.
|
||||||
|
|
||||||
if(CPACK_GENERATOR MATCHES "NSIS")
|
if(CPACK_GENERATOR MATCHES "NSIS")
|
||||||
SET(CPACK_NSIS_INSTALL_ROOT "@CPACK_NSIS_INSTALL_ROOT@")
|
set(CPACK_NSIS_INSTALL_ROOT "@CPACK_NSIS_INSTALL_ROOT@")
|
||||||
|
|
||||||
# set the install/unistall icon used for the installer itself
|
# set the install/unistall icon used for the installer itself
|
||||||
# There is a bug in NSI that does not handle full unix paths properly.
|
# There is a bug in NSI that does not handle full unix paths properly.
|
||||||
SET(CPACK_NSIS_MUI_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
|
set(CPACK_NSIS_MUI_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
|
||||||
SET(CPACK_NSIS_MUI_UNIICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
|
set(CPACK_NSIS_MUI_UNIICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeLogo.ico")
|
||||||
# set the package header icon for MUI
|
# set the package header icon for MUI
|
||||||
SET(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp")
|
set(CPACK_PACKAGE_ICON "@CMake_SOURCE_DIR@/Utilities/Release\\CMakeInstall.bmp")
|
||||||
# tell cpack to create links to the doc files
|
# tell cpack to create links to the doc files
|
||||||
SET(CPACK_NSIS_MENU_LINKS
|
set(CPACK_NSIS_MENU_LINKS
|
||||||
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-gui.html" "cmake-gui Help"
|
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-gui.html" "cmake-gui Help"
|
||||||
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help"
|
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake.html" "CMake Help"
|
||||||
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-properties.html"
|
"doc/cmake-@CMake_VERSION_MAJOR@.@CMake_VERSION_MINOR@/cmake-properties.html"
|
||||||
|
@ -24,23 +24,23 @@ if(CPACK_GENERATOR MATCHES "NSIS")
|
||||||
"http://www.cmake.org" "CMake Web Site"
|
"http://www.cmake.org" "CMake Web Site"
|
||||||
)
|
)
|
||||||
# Use the icon from cmake-gui for add-remove programs
|
# Use the icon from cmake-gui for add-remove programs
|
||||||
SET(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe")
|
set(CPACK_NSIS_INSTALLED_ICON_NAME "bin\\cmake-gui.exe")
|
||||||
|
|
||||||
SET(CPACK_NSIS_PACKAGE_NAME "@CPACK_NSIS_PACKAGE_NAME@")
|
set(CPACK_NSIS_PACKAGE_NAME "@CPACK_NSIS_PACKAGE_NAME@")
|
||||||
SET(CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, a cross-platform, open-source build system")
|
set(CPACK_NSIS_DISPLAY_NAME "@CPACK_NSIS_PACKAGE_NAME@, a cross-platform, open-source build system")
|
||||||
SET(CPACK_NSIS_HELP_LINK "http://www.cmake.org")
|
set(CPACK_NSIS_HELP_LINK "http://www.cmake.org")
|
||||||
SET(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com")
|
set(CPACK_NSIS_URL_INFO_ABOUT "http://www.kitware.com")
|
||||||
SET(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
|
set(CPACK_NSIS_CONTACT @CPACK_PACKAGE_CONTACT@)
|
||||||
SET(CPACK_NSIS_MODIFY_PATH ON)
|
set(CPACK_NSIS_MODIFY_PATH ON)
|
||||||
endif(CPACK_GENERATOR MATCHES "NSIS")
|
endif(CPACK_GENERATOR MATCHES "NSIS")
|
||||||
|
|
||||||
# include the cpack options for qt dialog if they exisit
|
# include the cpack options for qt dialog if they exisit
|
||||||
# they might not if qt was not enabled for the build
|
# they might not if qt was not enabled for the build
|
||||||
INCLUDE("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL)
|
include("@QT_DIALOG_CPACK_OPTIONS_FILE@" OPTIONAL)
|
||||||
|
|
||||||
if(CPACK_GENERATOR MATCHES "CygwinSource")
|
if(CPACK_GENERATOR MATCHES "CygwinSource")
|
||||||
# when packaging source make sure the .build directory is not included
|
# when packaging source make sure the .build directory is not included
|
||||||
SET(CPACK_SOURCE_IGNORE_FILES
|
set(CPACK_SOURCE_IGNORE_FILES
|
||||||
"/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$")
|
"/CVS/" "/\\.build/" "/\\.svn/" "\\.swp$" "\\.#" "/#" "~$")
|
||||||
endif(CPACK_GENERATOR MATCHES "CygwinSource")
|
endif(CPACK_GENERATOR MATCHES "CygwinSource")
|
||||||
|
|
||||||
|
|
|
@ -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")
|
||||||
|
|
672
CMakeLists.txt
672
CMakeLists.txt
|
@ -9,71 +9,71 @@
|
||||||
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
# See the License for more information.
|
# See the License for more information.
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.2 FATAL_ERROR)
|
cmake_minimum_required(VERSION 2.8.2 FATAL_ERROR)
|
||||||
SET(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
|
set(CMAKE_LEGACY_CYGWIN_WIN32 0) # Remove when CMake >= 2.8.4 is required
|
||||||
PROJECT(CMake)
|
project(CMake)
|
||||||
|
|
||||||
IF(CMAKE_BOOTSTRAP)
|
if(CMAKE_BOOTSTRAP)
|
||||||
# Running from bootstrap script. Set local variable and remove from cache.
|
# Running from bootstrap script. Set local variable and remove from cache.
|
||||||
SET(CMAKE_BOOTSTRAP 1)
|
set(CMAKE_BOOTSTRAP 1)
|
||||||
UNSET(CMAKE_BOOTSTRAP CACHE)
|
unset(CMAKE_BOOTSTRAP CACHE)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
SET(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)
|
set(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)
|
||||||
|
|
||||||
IF("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
|
if("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
|
||||||
# Disallow architecture-specific try_run. It may not run on the host.
|
# Disallow architecture-specific try_run. It may not run on the host.
|
||||||
MACRO(TRY_RUN)
|
macro(TRY_RUN)
|
||||||
IF(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
if(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
||||||
MESSAGE(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]")
|
message(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]")
|
||||||
ELSE()
|
else()
|
||||||
_TRY_RUN(${ARGV})
|
_TRY_RUN(${ARGV})
|
||||||
ENDIF()
|
endif()
|
||||||
ENDMACRO()
|
endmacro()
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
# a macro to deal with system libraries, implemented as a macro
|
# a macro to deal with system libraries, implemented as a macro
|
||||||
# simply to improve readability of the main script
|
# simply to improve readability of the main script
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
|
macro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
|
||||||
# Options have dependencies.
|
# Options have dependencies.
|
||||||
INCLUDE(CMakeDependentOption)
|
include(CMakeDependentOption)
|
||||||
|
|
||||||
# Optionally use system xmlrpc. We no longer build or use it by default.
|
# Optionally use system xmlrpc. We no longer build or use it by default.
|
||||||
OPTION(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF)
|
option(CTEST_USE_XMLRPC "Enable xmlrpc submission method in CTest." OFF)
|
||||||
MARK_AS_ADVANCED(CTEST_USE_XMLRPC)
|
mark_as_advanced(CTEST_USE_XMLRPC)
|
||||||
|
|
||||||
# Allow the user to enable/disable all system utility library options by
|
# Allow the user to enable/disable all system utility library options by
|
||||||
# defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}.
|
# defining CMAKE_USE_SYSTEM_LIBRARIES or CMAKE_USE_SYSTEM_LIBRARY_${util}.
|
||||||
SET(UTILITIES BZIP2 CURL EXPAT LIBARCHIVE ZLIB)
|
set(UTILITIES BZIP2 CURL EXPAT LIBARCHIVE ZLIB)
|
||||||
FOREACH(util ${UTILITIES})
|
foreach(util ${UTILITIES})
|
||||||
IF(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}
|
if(NOT DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util}
|
||||||
AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
|
AND DEFINED CMAKE_USE_SYSTEM_LIBRARIES)
|
||||||
SET(CMAKE_USE_SYSTEM_LIBRARY_${util} "${CMAKE_USE_SYSTEM_LIBRARIES}")
|
set(CMAKE_USE_SYSTEM_LIBRARY_${util} "${CMAKE_USE_SYSTEM_LIBRARIES}")
|
||||||
ENDIF()
|
endif()
|
||||||
IF(DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util})
|
if(DEFINED CMAKE_USE_SYSTEM_LIBRARY_${util})
|
||||||
IF(CMAKE_USE_SYSTEM_LIBRARY_${util})
|
if(CMAKE_USE_SYSTEM_LIBRARY_${util})
|
||||||
SET(CMAKE_USE_SYSTEM_LIBRARY_${util} ON)
|
set(CMAKE_USE_SYSTEM_LIBRARY_${util} ON)
|
||||||
ELSE()
|
else()
|
||||||
SET(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
|
set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
|
||||||
ENDIF()
|
endif()
|
||||||
IF(CMAKE_BOOTSTRAP)
|
if(CMAKE_BOOTSTRAP)
|
||||||
UNSET(CMAKE_USE_SYSTEM_LIBRARY_${util} CACHE)
|
unset(CMAKE_USE_SYSTEM_LIBRARY_${util} CACHE)
|
||||||
ENDIF()
|
endif()
|
||||||
STRING(TOLOWER "${util}" lutil)
|
string(TOLOWER "${util}" lutil)
|
||||||
SET(CMAKE_USE_SYSTEM_${util} "${CMAKE_USE_SYSTEM_LIBRARY_${util}}"
|
set(CMAKE_USE_SYSTEM_${util} "${CMAKE_USE_SYSTEM_LIBRARY_${util}}"
|
||||||
CACHE BOOL "Use system-installed ${lutil}" FORCE)
|
CACHE BOOL "Use system-installed ${lutil}" FORCE)
|
||||||
ELSE()
|
else()
|
||||||
SET(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
|
set(CMAKE_USE_SYSTEM_LIBRARY_${util} OFF)
|
||||||
ENDIF()
|
endif()
|
||||||
ENDFOREACH(util)
|
endforeach(util)
|
||||||
IF(CMAKE_BOOTSTRAP)
|
if(CMAKE_BOOTSTRAP)
|
||||||
UNSET(CMAKE_USE_SYSTEM_LIBRARIES CACHE)
|
unset(CMAKE_USE_SYSTEM_LIBRARIES CACHE)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# Optionally use system utility libraries.
|
# Optionally use system utility libraries.
|
||||||
OPTION(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" "${CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE}")
|
option(CMAKE_USE_SYSTEM_LIBARCHIVE "Use system-installed libarchive" "${CMAKE_USE_SYSTEM_LIBRARY_LIBARCHIVE}")
|
||||||
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl"
|
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_CURL "Use system-installed curl"
|
||||||
"${CMAKE_USE_SYSTEM_LIBRARY_CURL}" "NOT CTEST_USE_XMLRPC" ON)
|
"${CMAKE_USE_SYSTEM_LIBRARY_CURL}" "NOT CTEST_USE_XMLRPC" ON)
|
||||||
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat"
|
CMAKE_DEPENDENT_OPTION(CMAKE_USE_SYSTEM_EXPAT "Use system-installed expat"
|
||||||
|
@ -84,155 +84,155 @@ MACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
|
||||||
"${CMAKE_USE_SYSTEM_LIBRARY_BZIP2}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
|
"${CMAKE_USE_SYSTEM_LIBRARY_BZIP2}" "NOT CMAKE_USE_SYSTEM_LIBARCHIVE" ON)
|
||||||
|
|
||||||
# Mention to the user what system libraries are being used.
|
# Mention to the user what system libraries are being used.
|
||||||
FOREACH(util ${UTILITIES})
|
foreach(util ${UTILITIES})
|
||||||
IF(CMAKE_USE_SYSTEM_${util})
|
if(CMAKE_USE_SYSTEM_${util})
|
||||||
MESSAGE(STATUS "Using system-installed ${util}")
|
message(STATUS "Using system-installed ${util}")
|
||||||
ENDIF(CMAKE_USE_SYSTEM_${util})
|
endif(CMAKE_USE_SYSTEM_${util})
|
||||||
ENDFOREACH(util)
|
endforeach(util)
|
||||||
|
|
||||||
# Inform utility library header wrappers whether to use system versions.
|
# Inform utility library header wrappers whether to use system versions.
|
||||||
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in
|
configure_file(${CMake_SOURCE_DIR}/Utilities/cmThirdParty.h.in
|
||||||
${CMake_BINARY_DIR}/Utilities/cmThirdParty.h
|
${CMake_BINARY_DIR}/Utilities/cmThirdParty.h
|
||||||
@ONLY)
|
@ONLY)
|
||||||
|
|
||||||
ENDMACRO(CMAKE_HANDLE_SYSTEM_LIBRARIES)
|
endmacro(CMAKE_HANDLE_SYSTEM_LIBRARIES)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SET(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
|
set(CMAKE_BUILD_ON_VISUAL_STUDIO 0)
|
||||||
IF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
|
if(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
|
||||||
SET(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
|
set(CMAKE_BUILD_ON_VISUAL_STUDIO 1)
|
||||||
ENDIF(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
|
endif(WIN32 AND NOT UNIX AND NOT BORLAND AND NOT MINGW )
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
# a macro to determine the generator and ctest executable to use
|
# a macro to determine the generator and ctest executable to use
|
||||||
# for testing. Simply to improve readability of the main script.
|
# for testing. Simply to improve readability of the main script.
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
MACRO(CMAKE_SETUP_TESTING)
|
macro(CMAKE_SETUP_TESTING)
|
||||||
IF (NOT DART_ROOT)
|
if (NOT DART_ROOT)
|
||||||
SET(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
|
set(MAKEPROGRAM ${CMAKE_MAKE_PROGRAM})
|
||||||
ENDIF (NOT DART_ROOT)
|
endif (NOT DART_ROOT)
|
||||||
|
|
||||||
IF(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
SET(CMAKE_TEST_GENERATOR "" CACHE STRING
|
set(CMAKE_TEST_GENERATOR "" CACHE STRING
|
||||||
"Generator used when running tests")
|
"Generator used when running tests")
|
||||||
SET(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH
|
set(CMAKE_TEST_MAKEPROGRAM "" CACHE FILEPATH
|
||||||
"Generator used when running tests")
|
"Generator used when running tests")
|
||||||
IF(NOT CMAKE_TEST_GENERATOR)
|
if(NOT CMAKE_TEST_GENERATOR)
|
||||||
SET(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
|
set(CMAKE_TEST_GENERATOR "${CMAKE_GENERATOR}")
|
||||||
SET(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
|
set(CMAKE_TEST_MAKEPROGRAM "${MAKEPROGRAM}")
|
||||||
ELSE(NOT CMAKE_TEST_GENERATOR)
|
else(NOT CMAKE_TEST_GENERATOR)
|
||||||
SET(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
|
set(CMAKE_TEST_DIFFERENT_GENERATOR TRUE)
|
||||||
ENDIF(NOT CMAKE_TEST_GENERATOR)
|
endif(NOT CMAKE_TEST_GENERATOR)
|
||||||
|
|
||||||
# Are we testing with the MSVC compiler?
|
# Are we testing with the MSVC compiler?
|
||||||
SET(CMAKE_TEST_MSVC 0)
|
set(CMAKE_TEST_MSVC 0)
|
||||||
IF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
if(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
||||||
SET(CMAKE_TEST_MSVC 1)
|
set(CMAKE_TEST_MSVC 1)
|
||||||
ELSE(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
else(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
||||||
IF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
|
if("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
|
||||||
"${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
|
"${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
|
||||||
SET(CMAKE_TEST_MSVC 1)
|
set(CMAKE_TEST_MSVC 1)
|
||||||
ENDIF("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
|
endif("${CMAKE_TEST_GENERATOR}" MATCHES "NMake" OR
|
||||||
"${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
|
"${CMAKE_TEST_GENERATOR}" MATCHES "Visual Studio")
|
||||||
ENDIF(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
endif(MSVC AND NOT CMAKE_TEST_DIFFERENT_GENERATOR)
|
||||||
|
|
||||||
SET(CMAKE_TEST_SYSTEM_LIBRARIES 0)
|
set(CMAKE_TEST_SYSTEM_LIBRARIES 0)
|
||||||
FOREACH(util CURL EXPAT XMLRPC ZLIB)
|
foreach(util CURL EXPAT XMLRPC ZLIB)
|
||||||
IF(CMAKE_USE_SYSTEM_${util})
|
if(CMAKE_USE_SYSTEM_${util})
|
||||||
SET(CMAKE_TEST_SYSTEM_LIBRARIES 1)
|
set(CMAKE_TEST_SYSTEM_LIBRARIES 1)
|
||||||
ENDIF(CMAKE_USE_SYSTEM_${util})
|
endif(CMAKE_USE_SYSTEM_${util})
|
||||||
ENDFOREACH(util)
|
endforeach(util)
|
||||||
|
|
||||||
# This variable is set by cmake, however to
|
# This variable is set by cmake, however to
|
||||||
# test cmake we want to make sure that
|
# test cmake we want to make sure that
|
||||||
# the ctest from this cmake is used for testing
|
# the ctest from this cmake is used for testing
|
||||||
# and not the ctest from the cmake building and testing
|
# and not the ctest from the cmake building and testing
|
||||||
# cmake.
|
# cmake.
|
||||||
SET(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
|
set(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
|
||||||
SET(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
|
set(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
|
||||||
SET(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
|
set(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
|
||||||
ENDIF(BUILD_TESTING)
|
endif(BUILD_TESTING)
|
||||||
|
|
||||||
# configure some files for testing
|
# configure some files for testing
|
||||||
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
|
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/Templates/CTestScript.cmake.in"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/CTestScript.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/CTestScript.cmake"
|
||||||
@ONLY)
|
@ONLY)
|
||||||
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
|
configure_file(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
|
||||||
${CMake_BINARY_DIR}/Tests/.NoDartCoverage)
|
${CMake_BINARY_DIR}/Tests/.NoDartCoverage)
|
||||||
CONFIGURE_FILE(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
|
configure_file(${CMake_SOURCE_DIR}/Tests/.NoDartCoverage
|
||||||
${CMake_BINARY_DIR}/Modules/.NoDartCoverage)
|
${CMake_BINARY_DIR}/Modules/.NoDartCoverage)
|
||||||
CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.cmake.in
|
configure_file(${CMake_SOURCE_DIR}/CTestCustom.cmake.in
|
||||||
${CMake_BINARY_DIR}/CTestCustom.cmake @ONLY)
|
${CMake_BINARY_DIR}/CTestCustom.cmake @ONLY)
|
||||||
CONFIGURE_FILE(${CMake_SOURCE_DIR}/CTestCustom.ctest.in
|
configure_file(${CMake_SOURCE_DIR}/CTestCustom.ctest.in
|
||||||
${CMake_BINARY_DIR}/CTestCustom.ctest @ONLY)
|
${CMake_BINARY_DIR}/CTestCustom.ctest @ONLY)
|
||||||
IF(BUILD_TESTING AND DART_ROOT)
|
if(BUILD_TESTING AND DART_ROOT)
|
||||||
CONFIGURE_FILE(${CMake_SOURCE_DIR}/CMakeLogo.gif
|
configure_file(${CMake_SOURCE_DIR}/CMakeLogo.gif
|
||||||
${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
|
${CMake_BINARY_DIR}/Testing/HTML/TestingResults/Icons/Logo.gif COPYONLY)
|
||||||
ENDIF(BUILD_TESTING AND DART_ROOT)
|
endif(BUILD_TESTING AND DART_ROOT)
|
||||||
MARK_AS_ADVANCED(DART_ROOT)
|
mark_as_advanced(DART_ROOT)
|
||||||
MARK_AS_ADVANCED(CURL_TESTING)
|
mark_as_advanced(CURL_TESTING)
|
||||||
ENDMACRO(CMAKE_SETUP_TESTING)
|
endmacro(CMAKE_SETUP_TESTING)
|
||||||
|
|
||||||
|
|
||||||
# Provide a way for Visual Studio Express users to turn OFF the new FOLDER
|
# Provide a way for Visual Studio Express users to turn OFF the new FOLDER
|
||||||
# organization feature. Default to ON for non-Express users. Express users must
|
# organization feature. Default to ON for non-Express users. Express users must
|
||||||
# explicitly turn off this option to build CMake in the Express IDE...
|
# explicitly turn off this option to build CMake in the Express IDE...
|
||||||
#
|
#
|
||||||
OPTION(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON)
|
option(CMAKE_USE_FOLDERS "Enable folder grouping of projects in IDEs." ON)
|
||||||
MARK_AS_ADVANCED(CMAKE_USE_FOLDERS)
|
mark_as_advanced(CMAKE_USE_FOLDERS)
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
# a macro that only sets the FOLDER target property if it's
|
# a macro that only sets the FOLDER target property if it's
|
||||||
# "appropriate"
|
# "appropriate"
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
MACRO(CMAKE_SET_TARGET_FOLDER tgt folder)
|
macro(CMAKE_SET_TARGET_FOLDER tgt folder)
|
||||||
IF(CMAKE_USE_FOLDERS)
|
if(CMAKE_USE_FOLDERS)
|
||||||
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
# Really, I just want this to be an "if(TARGET ${tgt})" ...
|
# Really, I just want this to be an "if(TARGET ${tgt})" ...
|
||||||
# but I'm not sure that our min req'd., CMake 2.4.5 can handle
|
# but I'm not sure that our min req'd., CMake 2.4.5 can handle
|
||||||
# that... so I'm just activating this for now, with a version
|
# that... so I'm just activating this for now, with a version
|
||||||
# compare, and only for MSVC builds.
|
# compare, and only for MSVC builds.
|
||||||
IF(MSVC)
|
if(MSVC)
|
||||||
IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
|
if(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} LESS 2.8)
|
||||||
SET_PROPERTY(TARGET "${tgt}" PROPERTY FOLDER "${folder}")
|
set_property(TARGET "${tgt}" PROPERTY FOLDER "${folder}")
|
||||||
ENDIF()
|
endif()
|
||||||
ENDIF()
|
endif()
|
||||||
ELSE()
|
else()
|
||||||
SET_PROPERTY(GLOBAL PROPERTY USE_FOLDERS OFF)
|
set_property(GLOBAL PROPERTY USE_FOLDERS OFF)
|
||||||
ENDIF()
|
endif()
|
||||||
ENDMACRO(CMAKE_SET_TARGET_FOLDER)
|
endmacro(CMAKE_SET_TARGET_FOLDER)
|
||||||
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
# a macro to build the utilities used by CMake
|
# a macro to build the utilities used by CMake
|
||||||
# Simply to improve readability of the main script.
|
# Simply to improve readability of the main script.
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
MACRO (CMAKE_BUILD_UTILITIES)
|
macro (CMAKE_BUILD_UTILITIES)
|
||||||
#---------------------------------------------------------------------
|
#---------------------------------------------------------------------
|
||||||
# Create the KWIML library for CMake.
|
# Create the KWIML library for CMake.
|
||||||
SET(KWIML cmIML)
|
set(KWIML cmIML)
|
||||||
SET(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities)
|
set(KWIML_HEADER_ROOT ${CMake_BINARY_DIR}/Utilities)
|
||||||
ADD_SUBDIRECTORY(Utilities/KWIML)
|
add_subdirectory(Utilities/KWIML)
|
||||||
|
|
||||||
#---------------------------------------------------------------------
|
#---------------------------------------------------------------------
|
||||||
# Create the kwsys library for CMake.
|
# Create the kwsys library for CMake.
|
||||||
SET(KWSYS_NAMESPACE cmsys)
|
set(KWSYS_NAMESPACE cmsys)
|
||||||
SET(KWSYS_USE_SystemTools 1)
|
set(KWSYS_USE_SystemTools 1)
|
||||||
SET(KWSYS_USE_Directory 1)
|
set(KWSYS_USE_Directory 1)
|
||||||
SET(KWSYS_USE_RegularExpression 1)
|
set(KWSYS_USE_RegularExpression 1)
|
||||||
SET(KWSYS_USE_Base64 1)
|
set(KWSYS_USE_Base64 1)
|
||||||
SET(KWSYS_USE_MD5 1)
|
set(KWSYS_USE_MD5 1)
|
||||||
SET(KWSYS_USE_Process 1)
|
set(KWSYS_USE_Process 1)
|
||||||
SET(KWSYS_USE_CommandLineArguments 1)
|
set(KWSYS_USE_CommandLineArguments 1)
|
||||||
SET(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
|
set(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
|
||||||
SET(KWSYS_INSTALL_DOC_DIR "${CMake_DOC_DEST}")
|
set(KWSYS_INSTALL_DOC_DIR "${CMake_DOC_DEST}")
|
||||||
ADD_SUBDIRECTORY(Source/kwsys)
|
add_subdirectory(Source/kwsys)
|
||||||
SET(kwsys_folder "Utilities/KWSys")
|
set(kwsys_folder "Utilities/KWSys")
|
||||||
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}")
|
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE} "${kwsys_folder}")
|
||||||
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}_c "${kwsys_folder}")
|
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}_c "${kwsys_folder}")
|
||||||
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}EncodeExecutable "${kwsys_folder}")
|
CMAKE_SET_TARGET_FOLDER(${KWSYS_NAMESPACE}EncodeExecutable "${kwsys_folder}")
|
||||||
|
@ -249,7 +249,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
|
||||||
# Setup third-party libraries.
|
# Setup third-party libraries.
|
||||||
# Everything in the tree should be able to include files from the
|
# Everything in the tree should be able to include files from the
|
||||||
# Utilities directory.
|
# Utilities directory.
|
||||||
INCLUDE_DIRECTORIES(
|
include_directories(
|
||||||
${CMake_BINARY_DIR}/Utilities
|
${CMake_BINARY_DIR}/Utilities
|
||||||
${CMake_SOURCE_DIR}/Utilities
|
${CMake_SOURCE_DIR}/Utilities
|
||||||
)
|
)
|
||||||
|
@ -260,237 +260,237 @@ MACRO (CMAKE_BUILD_UTILITIES)
|
||||||
|
|
||||||
#---------------------------------------------------------------------
|
#---------------------------------------------------------------------
|
||||||
# Build zlib library for Curl, CMake, and CTest.
|
# Build zlib library for Curl, CMake, and CTest.
|
||||||
SET(CMAKE_ZLIB_HEADER "cm_zlib.h")
|
set(CMAKE_ZLIB_HEADER "cm_zlib.h")
|
||||||
IF(CMAKE_USE_SYSTEM_ZLIB)
|
if(CMAKE_USE_SYSTEM_ZLIB)
|
||||||
FIND_PACKAGE(ZLIB)
|
find_package(ZLIB)
|
||||||
IF(NOT ZLIB_FOUND)
|
if(NOT ZLIB_FOUND)
|
||||||
MESSAGE(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!")
|
"CMAKE_USE_SYSTEM_ZLIB is ON but a zlib is not found!")
|
||||||
ENDIF(NOT ZLIB_FOUND)
|
endif(NOT ZLIB_FOUND)
|
||||||
SET(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
|
set(CMAKE_ZLIB_INCLUDES ${ZLIB_INCLUDE_DIR})
|
||||||
SET(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
|
set(CMAKE_ZLIB_LIBRARIES ${ZLIB_LIBRARIES})
|
||||||
ELSE(CMAKE_USE_SYSTEM_ZLIB)
|
else(CMAKE_USE_SYSTEM_ZLIB)
|
||||||
SET(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
|
set(CMAKE_ZLIB_INCLUDES ${CMake_SOURCE_DIR}/Utilities)
|
||||||
SET(CMAKE_ZLIB_LIBRARIES cmzlib)
|
set(CMAKE_ZLIB_LIBRARIES cmzlib)
|
||||||
ADD_SUBDIRECTORY(Utilities/cmzlib)
|
add_subdirectory(Utilities/cmzlib)
|
||||||
CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
|
CMAKE_SET_TARGET_FOLDER(cmzlib "Utilities/3rdParty")
|
||||||
ENDIF(CMAKE_USE_SYSTEM_ZLIB)
|
endif(CMAKE_USE_SYSTEM_ZLIB)
|
||||||
|
|
||||||
#---------------------------------------------------------------------
|
#---------------------------------------------------------------------
|
||||||
# Build Curl library for CTest.
|
# Build Curl library for CTest.
|
||||||
IF(CMAKE_USE_SYSTEM_CURL)
|
if(CMAKE_USE_SYSTEM_CURL)
|
||||||
FIND_PACKAGE(CURL)
|
find_package(CURL)
|
||||||
IF(NOT CURL_FOUND)
|
if(NOT CURL_FOUND)
|
||||||
MESSAGE(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!")
|
"CMAKE_USE_SYSTEM_CURL is ON but a curl is not found!")
|
||||||
ENDIF(NOT CURL_FOUND)
|
endif(NOT CURL_FOUND)
|
||||||
SET(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
|
set(CMAKE_CURL_INCLUDES ${CURL_INCLUDE_DIRS})
|
||||||
SET(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
|
set(CMAKE_CURL_LIBRARIES ${CURL_LIBRARIES})
|
||||||
ELSE(CMAKE_USE_SYSTEM_CURL)
|
else(CMAKE_USE_SYSTEM_CURL)
|
||||||
SET(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER})
|
set(CURL_SPECIAL_ZLIB_H ${CMAKE_ZLIB_HEADER})
|
||||||
SET(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
|
set(CURL_SPECIAL_LIBZ_INCLUDES ${CMAKE_ZLIB_INCLUDES})
|
||||||
SET(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
|
set(CURL_SPECIAL_LIBZ ${CMAKE_ZLIB_LIBRARIES})
|
||||||
OPTION(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE)
|
option(CMAKE_BUILD_CURL_SHARED "Should curl be built shared" FALSE)
|
||||||
IF(NOT CMAKE_BUILD_CURL_SHARED)
|
if(NOT CMAKE_BUILD_CURL_SHARED)
|
||||||
ADD_DEFINITIONS(-DCURL_STATICLIB)
|
add_definitions(-DCURL_STATICLIB)
|
||||||
ENDIF(NOT CMAKE_BUILD_CURL_SHARED)
|
endif(NOT CMAKE_BUILD_CURL_SHARED)
|
||||||
SET(CMAKE_CURL_INCLUDES)
|
set(CMAKE_CURL_INCLUDES)
|
||||||
SET(CMAKE_CURL_LIBRARIES cmcurl)
|
set(CMAKE_CURL_LIBRARIES cmcurl)
|
||||||
IF(CMAKE_TESTS_CDASH_SERVER)
|
if(CMAKE_TESTS_CDASH_SERVER)
|
||||||
SET(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
|
set(CMAKE_CURL_TEST_URL "${CMAKE_TESTS_CDASH_SERVER}/user.php")
|
||||||
ENDIF(CMAKE_TESTS_CDASH_SERVER)
|
endif(CMAKE_TESTS_CDASH_SERVER)
|
||||||
ADD_SUBDIRECTORY(Utilities/cmcurl)
|
add_subdirectory(Utilities/cmcurl)
|
||||||
CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty")
|
CMAKE_SET_TARGET_FOLDER(cmcurl "Utilities/3rdParty")
|
||||||
CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty")
|
CMAKE_SET_TARGET_FOLDER(LIBCURL "Utilities/3rdParty")
|
||||||
ENDIF(CMAKE_USE_SYSTEM_CURL)
|
endif(CMAKE_USE_SYSTEM_CURL)
|
||||||
|
|
||||||
#---------------------------------------------------------------------
|
#---------------------------------------------------------------------
|
||||||
# Build Compress library for CTest.
|
# Build Compress library for CTest.
|
||||||
SET(CMAKE_COMPRESS_INCLUDES
|
set(CMAKE_COMPRESS_INCLUDES
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress")
|
"${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress")
|
||||||
SET(CMAKE_COMPRESS_LIBRARIES "cmcompress")
|
set(CMAKE_COMPRESS_LIBRARIES "cmcompress")
|
||||||
ADD_SUBDIRECTORY(Utilities/cmcompress)
|
add_subdirectory(Utilities/cmcompress)
|
||||||
CMAKE_SET_TARGET_FOLDER(cmcompress "Utilities/3rdParty")
|
CMAKE_SET_TARGET_FOLDER(cmcompress "Utilities/3rdParty")
|
||||||
IF(CMAKE_USE_SYSTEM_BZIP2)
|
if(CMAKE_USE_SYSTEM_BZIP2)
|
||||||
FIND_PACKAGE(BZip2)
|
find_package(BZip2)
|
||||||
ELSE()
|
else()
|
||||||
SET(BZIP2_INCLUDE_DIR
|
set(BZIP2_INCLUDE_DIR
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2")
|
"${CMAKE_CURRENT_SOURCE_DIR}/Utilities/cmbzip2")
|
||||||
SET(BZIP2_LIBRARIES cmbzip2)
|
set(BZIP2_LIBRARIES cmbzip2)
|
||||||
ADD_SUBDIRECTORY(Utilities/cmbzip2)
|
add_subdirectory(Utilities/cmbzip2)
|
||||||
CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty")
|
CMAKE_SET_TARGET_FOLDER(cmbzip2 "Utilities/3rdParty")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
#---------------------------------------------------------------------
|
#---------------------------------------------------------------------
|
||||||
# Build or use system libarchive for CMake and CTest.
|
# Build or use system libarchive for CMake and CTest.
|
||||||
IF(CMAKE_USE_SYSTEM_LIBARCHIVE)
|
if(CMAKE_USE_SYSTEM_LIBARCHIVE)
|
||||||
IF(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake) # added in 2.8.3
|
if(EXISTS ${CMAKE_ROOT}/Modules/FindLibArchive.cmake) # added in 2.8.3
|
||||||
FIND_PACKAGE(LibArchive)
|
find_package(LibArchive)
|
||||||
ELSE()
|
else()
|
||||||
INCLUDE(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake)
|
include(${CMake_SOURCE_DIR}/Modules/FindLibArchive.cmake)
|
||||||
ENDIF()
|
endif()
|
||||||
IF(NOT LibArchive_FOUND)
|
if(NOT LibArchive_FOUND)
|
||||||
MESSAGE(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
|
message(FATAL_ERROR "CMAKE_USE_SYSTEM_LIBARCHIVE is ON but LibArchive is not found!")
|
||||||
ENDIF()
|
endif()
|
||||||
SET(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
|
set(CMAKE_TAR_INCLUDES ${LibArchive_INCLUDE_DIRS})
|
||||||
SET(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
|
set(CMAKE_TAR_LIBRARIES ${LibArchive_LIBRARIES})
|
||||||
ELSE(CMAKE_USE_SYSTEM_LIBARCHIVE)
|
else(CMAKE_USE_SYSTEM_LIBARCHIVE)
|
||||||
SET(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
|
set(ZLIB_INCLUDE_DIR ${CMAKE_ZLIB_INCLUDES})
|
||||||
SET(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
|
set(ZLIB_LIBRARY ${CMAKE_ZLIB_LIBRARIES})
|
||||||
ADD_DEFINITIONS(-DLIBARCHIVE_STATIC)
|
add_definitions(-DLIBARCHIVE_STATIC)
|
||||||
SET(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle")
|
set(ENABLE_NETTLE OFF CACHE INTERNAL "Enable use of Nettle")
|
||||||
SET(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL")
|
set(ENABLE_OPENSSL ${CMAKE_USE_OPENSSL} CACHE INTERNAL "Enable use of OpenSSL")
|
||||||
SET(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support")
|
set(ENABLE_XATTR OFF CACHE INTERNAL "Enable extended attribute support")
|
||||||
SET(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support")
|
set(ENABLE_ACL OFF CACHE INTERNAL "Enable ACL support")
|
||||||
SET(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support")
|
set(ENABLE_ICONV OFF CACHE INTERNAL "Enable iconv support")
|
||||||
ADD_SUBDIRECTORY(Utilities/cmlibarchive)
|
add_subdirectory(Utilities/cmlibarchive)
|
||||||
CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty")
|
CMAKE_SET_TARGET_FOLDER(cmlibarchive "Utilities/3rdParty")
|
||||||
SET(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
|
set(CMAKE_TAR_LIBRARIES cmlibarchive ${BZIP2_LIBRARIES})
|
||||||
ENDIF(CMAKE_USE_SYSTEM_LIBARCHIVE)
|
endif(CMAKE_USE_SYSTEM_LIBARCHIVE)
|
||||||
|
|
||||||
#---------------------------------------------------------------------
|
#---------------------------------------------------------------------
|
||||||
# Build expat library for CMake and CTest.
|
# Build expat library for CMake and CTest.
|
||||||
IF(CMAKE_USE_SYSTEM_EXPAT)
|
if(CMAKE_USE_SYSTEM_EXPAT)
|
||||||
FIND_PACKAGE(EXPAT)
|
find_package(EXPAT)
|
||||||
IF(NOT EXPAT_FOUND)
|
if(NOT EXPAT_FOUND)
|
||||||
MESSAGE(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
|
"CMAKE_USE_SYSTEM_EXPAT is ON but a expat is not found!")
|
||||||
ENDIF(NOT EXPAT_FOUND)
|
endif(NOT EXPAT_FOUND)
|
||||||
SET(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
|
set(CMAKE_EXPAT_INCLUDES ${EXPAT_INCLUDE_DIRS})
|
||||||
SET(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
|
set(CMAKE_EXPAT_LIBRARIES ${EXPAT_LIBRARIES})
|
||||||
ELSE(CMAKE_USE_SYSTEM_EXPAT)
|
else(CMAKE_USE_SYSTEM_EXPAT)
|
||||||
SET(CMAKE_EXPAT_INCLUDES)
|
set(CMAKE_EXPAT_INCLUDES)
|
||||||
SET(CMAKE_EXPAT_LIBRARIES cmexpat)
|
set(CMAKE_EXPAT_LIBRARIES cmexpat)
|
||||||
ADD_SUBDIRECTORY(Utilities/cmexpat)
|
add_subdirectory(Utilities/cmexpat)
|
||||||
CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
|
CMAKE_SET_TARGET_FOLDER(cmexpat "Utilities/3rdParty")
|
||||||
ENDIF(CMAKE_USE_SYSTEM_EXPAT)
|
endif(CMAKE_USE_SYSTEM_EXPAT)
|
||||||
|
|
||||||
#---------------------------------------------------------------------
|
#---------------------------------------------------------------------
|
||||||
# Build XMLRPC library for CMake and CTest.
|
# Build XMLRPC library for CMake and CTest.
|
||||||
IF(CTEST_USE_XMLRPC)
|
if(CTEST_USE_XMLRPC)
|
||||||
FIND_PACKAGE(XMLRPC QUIET REQUIRED libwww-client)
|
find_package(XMLRPC QUIET REQUIRED libwww-client)
|
||||||
IF(NOT XMLRPC_FOUND)
|
if(NOT XMLRPC_FOUND)
|
||||||
MESSAGE(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"CTEST_USE_XMLRPC is ON but xmlrpc is not found!")
|
"CTEST_USE_XMLRPC is ON but xmlrpc is not found!")
|
||||||
ENDIF(NOT XMLRPC_FOUND)
|
endif(NOT XMLRPC_FOUND)
|
||||||
SET(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
|
set(CMAKE_XMLRPC_INCLUDES ${XMLRPC_INCLUDE_DIRS})
|
||||||
SET(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
|
set(CMAKE_XMLRPC_LIBRARIES ${XMLRPC_LIBRARIES})
|
||||||
ENDIF(CTEST_USE_XMLRPC)
|
endif(CTEST_USE_XMLRPC)
|
||||||
|
|
||||||
#---------------------------------------------------------------------
|
#---------------------------------------------------------------------
|
||||||
# Use curses?
|
# Use curses?
|
||||||
IF (UNIX)
|
if (UNIX)
|
||||||
# there is a bug in the Syllable libraries which makes linking ccmake fail, Alex
|
# there is a bug in the Syllable libraries which makes linking ccmake fail, Alex
|
||||||
IF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
|
if(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
|
||||||
SET(CURSES_NEED_NCURSES TRUE)
|
set(CURSES_NEED_NCURSES TRUE)
|
||||||
FIND_PACKAGE(Curses QUIET)
|
find_package(Curses QUIET)
|
||||||
IF (CURSES_LIBRARY)
|
if (CURSES_LIBRARY)
|
||||||
OPTION(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
|
option(BUILD_CursesDialog "Build the CMake Curses Dialog ccmake" ON)
|
||||||
ELSE (CURSES_LIBRARY)
|
else (CURSES_LIBRARY)
|
||||||
MESSAGE("Curses libraries were not found. Curses GUI for CMake will not be built.")
|
message("Curses libraries were not found. Curses GUI for CMake will not be built.")
|
||||||
SET(BUILD_CursesDialog 0)
|
set(BUILD_CursesDialog 0)
|
||||||
ENDIF (CURSES_LIBRARY)
|
endif (CURSES_LIBRARY)
|
||||||
ELSE(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
|
else(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
|
||||||
SET(BUILD_CursesDialog 0)
|
set(BUILD_CursesDialog 0)
|
||||||
ENDIF(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
|
endif(NOT "${CMAKE_SYSTEM_NAME}" MATCHES syllable)
|
||||||
ELSE (UNIX)
|
else (UNIX)
|
||||||
SET(BUILD_CursesDialog 0)
|
set(BUILD_CursesDialog 0)
|
||||||
ENDIF (UNIX)
|
endif (UNIX)
|
||||||
IF(BUILD_CursesDialog)
|
if(BUILD_CursesDialog)
|
||||||
ADD_SUBDIRECTORY(Source/CursesDialog/form)
|
add_subdirectory(Source/CursesDialog/form)
|
||||||
ENDIF(BUILD_CursesDialog)
|
endif(BUILD_CursesDialog)
|
||||||
ENDMACRO (CMAKE_BUILD_UTILITIES)
|
endmacro (CMAKE_BUILD_UTILITIES)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
IF(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
|
if(CMAKE_CXX_PLATFORM_ID MATCHES "OpenBSD")
|
||||||
EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER}
|
execute_process(COMMAND ${CMAKE_CXX_COMPILER}
|
||||||
${CMAKE_CXX_COMPILER_ARG1} -dumpversion
|
${CMAKE_CXX_COMPILER_ARG1} -dumpversion
|
||||||
OUTPUT_VARIABLE _GXX_VERSION
|
OUTPUT_VARIABLE _GXX_VERSION
|
||||||
)
|
)
|
||||||
STRING(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
|
string(REGEX REPLACE "([0-9])\\.([0-9])(\\.[0-9])?" "\\1\\2"
|
||||||
_GXX_VERSION_SHORT ${_GXX_VERSION})
|
_GXX_VERSION_SHORT ${_GXX_VERSION})
|
||||||
IF(_GXX_VERSION_SHORT EQUAL 33)
|
if(_GXX_VERSION_SHORT EQUAL 33)
|
||||||
MESSAGE(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n"
|
"GXX 3.3 on OpenBSD is known to cause CPack to Crash.\n"
|
||||||
"Please use GXX 4.2 or greater to build CMake on OpenBSD\n"
|
"Please use GXX 4.2 or greater to build CMake on OpenBSD\n"
|
||||||
"${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}")
|
"${CMAKE_CXX_COMPILER} version is: ${_GXX_VERSION}")
|
||||||
ENDIF()
|
endif()
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
# The main section of the CMakeLists file
|
# The main section of the CMakeLists file
|
||||||
#
|
#
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
INCLUDE(Source/CMakeVersion.cmake)
|
include(Source/CMakeVersion.cmake)
|
||||||
# Releases define a small tweak level.
|
# Releases define a small tweak level.
|
||||||
IF("${CMake_VERSION_TWEAK}" VERSION_LESS 20000000)
|
if("${CMake_VERSION_TWEAK}" VERSION_LESS 20000000)
|
||||||
SET(CMake_VERSION_IS_RELEASE 1)
|
set(CMake_VERSION_IS_RELEASE 1)
|
||||||
SET(CMake_VERSION_SOURCE "")
|
set(CMake_VERSION_SOURCE "")
|
||||||
ELSE()
|
else()
|
||||||
SET(CMake_VERSION_IS_RELEASE 0)
|
set(CMake_VERSION_IS_RELEASE 0)
|
||||||
INCLUDE(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake)
|
include(${CMake_SOURCE_DIR}/Source/CMakeVersionSource.cmake)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# Compute the full version string.
|
# Compute the full version string.
|
||||||
SET(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
|
set(CMake_VERSION ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}.${CMake_VERSION_PATCH})
|
||||||
IF(${CMake_VERSION_TWEAK} GREATER 0)
|
if(${CMake_VERSION_TWEAK} GREATER 0)
|
||||||
SET(CMake_VERSION ${CMake_VERSION}.${CMake_VERSION_TWEAK})
|
set(CMake_VERSION ${CMake_VERSION}.${CMake_VERSION_TWEAK})
|
||||||
ENDIF()
|
endif()
|
||||||
IF(CMake_VERSION_RC)
|
if(CMake_VERSION_RC)
|
||||||
SET(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC})
|
set(CMake_VERSION ${CMake_VERSION}-rc${CMake_VERSION_RC})
|
||||||
ENDIF()
|
endif()
|
||||||
IF(CMake_VERSION_SOURCE)
|
if(CMake_VERSION_SOURCE)
|
||||||
SET(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE})
|
set(CMake_VERSION ${CMake_VERSION}-${CMake_VERSION_SOURCE})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# Include the standard Dart testing module
|
# Include the standard Dart testing module
|
||||||
ENABLE_TESTING()
|
enable_testing()
|
||||||
INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
|
include (${CMAKE_ROOT}/Modules/Dart.cmake)
|
||||||
|
|
||||||
# Set up test-time configuration.
|
# Set up test-time configuration.
|
||||||
SET_DIRECTORY_PROPERTIES(PROPERTIES
|
set_directory_properties(PROPERTIES
|
||||||
TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake")
|
TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake")
|
||||||
|
|
||||||
# where to write the resulting executables and libraries
|
# where to write the resulting executables and libraries
|
||||||
SET(BUILD_SHARED_LIBS OFF)
|
set(BUILD_SHARED_LIBS OFF)
|
||||||
SET(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
|
set(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
|
||||||
SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
|
set(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
|
||||||
"Where to put the libraries for CMake")
|
"Where to put the libraries for CMake")
|
||||||
|
|
||||||
# The CMake executables usually do not need any rpath to run in the build or
|
# The CMake executables usually do not need any rpath to run in the build or
|
||||||
# install tree.
|
# install tree.
|
||||||
SET(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
|
set(CMAKE_SKIP_RPATH ON CACHE INTERNAL "CMake does not need RPATHs.")
|
||||||
|
|
||||||
SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
|
set(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
|
||||||
"Install location for data (relative to prefix).")
|
"Install location for data (relative to prefix).")
|
||||||
SET(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
|
set(CMAKE_DOC_DIR "/doc/cmake-${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}" CACHE STRING
|
||||||
"Install location for documentation (relative to prefix).")
|
"Install location for documentation (relative to prefix).")
|
||||||
SET(CMAKE_MAN_DIR "/man" CACHE STRING
|
set(CMAKE_MAN_DIR "/man" CACHE STRING
|
||||||
"Install location for man pages (relative to prefix).")
|
"Install location for man pages (relative to prefix).")
|
||||||
MARK_AS_ADVANCED(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
|
mark_as_advanced(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
|
||||||
IF(CYGWIN AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
if(CYGWIN AND EXISTS "${CMAKE_ROOT}/Modules/CPack.cmake")
|
||||||
# Force doc, data and man dirs to conform to cygwin layout.
|
# Force doc, data and man dirs to conform to cygwin layout.
|
||||||
SET(CMAKE_DOC_DIR "/share/doc/cmake-${CMake_VERSION}")
|
set(CMAKE_DOC_DIR "/share/doc/cmake-${CMake_VERSION}")
|
||||||
SET(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}")
|
set(CMAKE_DATA_DIR "/share/cmake-${CMake_VERSION}")
|
||||||
SET(CMAKE_MAN_DIR "/share/man")
|
set(CMAKE_MAN_DIR "/share/man")
|
||||||
# let the user know we just forced these values
|
# let the user know we just forced these values
|
||||||
MESSAGE(STATUS "Setup for Cygwin packaging")
|
message(STATUS "Setup for Cygwin packaging")
|
||||||
MESSAGE(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}")
|
message(STATUS "Override cache CMAKE_DOC_DIR = ${CMAKE_DOC_DIR}")
|
||||||
MESSAGE(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}")
|
message(STATUS "Override cache CMAKE_DATA_DIR = ${CMAKE_DATA_DIR}")
|
||||||
MESSAGE(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}")
|
message(STATUS "Override cache CMAKE_MAN_DIR = ${CMAKE_MAN_DIR}")
|
||||||
ENDIF()
|
endif()
|
||||||
STRING(REGEX REPLACE "^/" "" CMake_DATA_DEST "${CMAKE_DATA_DIR}")
|
string(REGEX REPLACE "^/" "" CMake_DATA_DEST "${CMAKE_DATA_DIR}")
|
||||||
STRING(REGEX REPLACE "^/" "" CMake_DOC_DEST "${CMAKE_DOC_DIR}")
|
string(REGEX REPLACE "^/" "" CMake_DOC_DEST "${CMAKE_DOC_DIR}")
|
||||||
|
|
||||||
IF(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
INCLUDE(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
|
include(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# include special compile flags for some compilers
|
# include special compile flags for some compilers
|
||||||
INCLUDE(CompileFlags.cmake)
|
include(CompileFlags.cmake)
|
||||||
|
|
||||||
# no clue why we are testing for this here
|
# no clue why we are testing for this here
|
||||||
INCLUDE(CheckSymbolExists)
|
include(CheckSymbolExists)
|
||||||
CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
|
CHECK_SYMBOL_EXISTS(unsetenv "stdlib.h" HAVE_UNSETENV)
|
||||||
CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
|
CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
|
||||||
|
|
||||||
|
@ -507,9 +507,9 @@ CHECK_SYMBOL_EXISTS(environ "stdlib.h" HAVE_ENVIRON_NOT_REQUIRE_PROTOTYPE)
|
||||||
# to a cdash4simpletest database. In these cases, the CDash dashboards
|
# to a cdash4simpletest database. In these cases, the CDash dashboards
|
||||||
# should be run first.
|
# should be run first.
|
||||||
#
|
#
|
||||||
IF("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
|
if("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
|
||||||
SET(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash")
|
set(CMAKE_TESTS_CDASH_SERVER "http://www.cdash.org/CDash")
|
||||||
ENDIF("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
|
endif("x${CMAKE_TESTS_CDASH_SERVER}" STREQUAL "x")
|
||||||
|
|
||||||
# build the utilities (a macro defined in this file)
|
# build the utilities (a macro defined in this file)
|
||||||
CMAKE_BUILD_UTILITIES()
|
CMAKE_BUILD_UTILITIES()
|
||||||
|
@ -519,35 +519,35 @@ CMAKE_BUILD_UTILITIES()
|
||||||
# which isn't in the default linker search path. So without RPATH ccmake
|
# which isn't in the default linker search path. So without RPATH ccmake
|
||||||
# doesn't run and the build doesn't succeed since ccmake is executed for
|
# doesn't run and the build doesn't succeed since ccmake is executed for
|
||||||
# generating the documentation.
|
# generating the documentation.
|
||||||
IF(BUILD_CursesDialog)
|
if(BUILD_CursesDialog)
|
||||||
GET_FILENAME_COMPONENT(_CURSES_DIR "${CURSES_LIBRARY}" PATH)
|
get_filename_component(_CURSES_DIR "${CURSES_LIBRARY}" PATH)
|
||||||
SET(CURSES_NEED_RPATH FALSE)
|
set(CURSES_NEED_RPATH FALSE)
|
||||||
IF(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
|
if(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
|
||||||
SET(CURSES_NEED_RPATH TRUE)
|
set(CURSES_NEED_RPATH TRUE)
|
||||||
ENDIF(NOT "${_CURSES_DIR}" STREQUAL "/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib" AND NOT "${_CURSES_DIR}" STREQUAL "/lib64" AND NOT "${_CURSES_DIR}" STREQUAL "/usr/lib64")
|
endif(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)
|
endif(BUILD_CursesDialog)
|
||||||
|
|
||||||
IF(BUILD_QtDialog)
|
if(BUILD_QtDialog)
|
||||||
IF(APPLE)
|
if(APPLE)
|
||||||
SET(CMAKE_BUNDLE_NAME
|
set(CMAKE_BUNDLE_NAME
|
||||||
"CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}-${CMake_VERSION_PATCH}")
|
"CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}-${CMake_VERSION_PATCH}")
|
||||||
SET(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
|
set(CMAKE_BUNDLE_LOCATION "${CMAKE_INSTALL_PREFIX}")
|
||||||
# make sure CMAKE_INSTALL_PREFIX ends in /
|
# make sure CMAKE_INSTALL_PREFIX ends in /
|
||||||
STRING(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
|
string(LENGTH "${CMAKE_INSTALL_PREFIX}" LEN)
|
||||||
MATH(EXPR LEN "${LEN} -1" )
|
math(EXPR LEN "${LEN} -1" )
|
||||||
STRING(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
|
string(SUBSTRING "${CMAKE_INSTALL_PREFIX}" ${LEN} 1 ENDCH)
|
||||||
IF(NOT "${ENDCH}" STREQUAL "/")
|
if(NOT "${ENDCH}" STREQUAL "/")
|
||||||
SET(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
|
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/")
|
||||||
ENDIF(NOT "${ENDCH}" STREQUAL "/")
|
endif(NOT "${ENDCH}" STREQUAL "/")
|
||||||
SET(CMAKE_INSTALL_PREFIX
|
set(CMAKE_INSTALL_PREFIX
|
||||||
"${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents")
|
"${CMAKE_INSTALL_PREFIX}${CMAKE_BUNDLE_NAME}.app/Contents")
|
||||||
ENDIF(APPLE)
|
endif(APPLE)
|
||||||
|
|
||||||
SET(QT_NEED_RPATH FALSE)
|
set(QT_NEED_RPATH FALSE)
|
||||||
IF(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
|
if(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
|
||||||
SET(QT_NEED_RPATH TRUE)
|
set(QT_NEED_RPATH TRUE)
|
||||||
ENDIF(NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/lib64" AND NOT "${QT_LIBRARY_DIR}" STREQUAL "/usr/lib64")
|
endif(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)
|
endif(BUILD_QtDialog)
|
||||||
|
|
||||||
|
|
||||||
# The same might be true on other systems for other libraries.
|
# 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.
|
# since this one has much better RPATH features than cmake 2.2.
|
||||||
# The executables are then built with the RPATH for the libraries outside
|
# The executables are then built with the RPATH for the libraries outside
|
||||||
# the build tree, which is both the build and the install RPATH.
|
# the build tree, which is both the build and the install RPATH.
|
||||||
IF (UNIX)
|
if (UNIX)
|
||||||
IF( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
|
if( CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
|
||||||
OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
|
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_SKIP_RPATH OFF CACHE INTERNAL "CMake built with RPATH.")
|
||||||
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
SET(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
|
||||||
ENDIF(CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
|
endif(CMAKE_USE_SYSTEM_CURL OR CMAKE_USE_SYSTEM_ZLIB
|
||||||
OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
|
OR CMAKE_USE_SYSTEM_EXPAT OR CTEST_USE_XMLRPC OR CURSES_NEED_RPATH OR QT_NEED_RPATH)
|
||||||
ENDIF (UNIX)
|
endif (UNIX)
|
||||||
|
|
||||||
|
|
||||||
# add the uninstall support
|
# add the uninstall support
|
||||||
CONFIGURE_FILE(
|
configure_file(
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||||
@ONLY)
|
@ONLY)
|
||||||
ADD_CUSTOM_TARGET(uninstall
|
add_custom_target(uninstall
|
||||||
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
"${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
|
||||||
|
|
||||||
INCLUDE (CMakeCPack.cmake)
|
include (CMakeCPack.cmake)
|
||||||
|
|
||||||
# setup some Testing support (a macro defined in this file)
|
# setup some Testing support (a macro defined in this file)
|
||||||
CMAKE_SETUP_TESTING()
|
CMAKE_SETUP_TESTING()
|
||||||
CONFIGURE_FILE(
|
configure_file(
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/DartLocal.conf.in"
|
"${CMAKE_CURRENT_SOURCE_DIR}/DartLocal.conf.in"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf"
|
"${CMAKE_CURRENT_BINARY_DIR}/DartLocal.conf"
|
||||||
COPYONLY)
|
COPYONLY)
|
||||||
|
|
||||||
OPTION(CMAKE_STRICT
|
option(CMAKE_STRICT
|
||||||
"Perform strict testing to record property and variable access. Can be used to report any undefined properties or variables" OFF)
|
"Perform strict testing to record property and variable access. Can be used to report any undefined properties or variables" OFF)
|
||||||
MARK_AS_ADVANCED(CMAKE_STRICT)
|
mark_as_advanced(CMAKE_STRICT)
|
||||||
|
|
||||||
|
|
||||||
# build the remaining subdirectories
|
# build the remaining subdirectories
|
||||||
ADD_SUBDIRECTORY(Source)
|
add_subdirectory(Source)
|
||||||
ADD_SUBDIRECTORY(Utilities)
|
add_subdirectory(Utilities)
|
||||||
ADD_SUBDIRECTORY(Tests)
|
add_subdirectory(Tests)
|
||||||
|
|
||||||
if(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests")
|
CMAKE_SET_TARGET_FOLDER(CMakeLibTests "Tests")
|
||||||
|
@ -600,14 +600,14 @@ CMAKE_SET_TARGET_FOLDER(cmw9xcom "Utilities/Win9xCompat")
|
||||||
CMAKE_SET_TARGET_FOLDER(documentation "Documentation")
|
CMAKE_SET_TARGET_FOLDER(documentation "Documentation")
|
||||||
|
|
||||||
# add a test
|
# add a test
|
||||||
ADD_TEST(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
|
add_test(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
|
||||||
--system-information -G "${CMAKE_TEST_GENERATOR}" )
|
--system-information -G "${CMAKE_TEST_GENERATOR}" )
|
||||||
|
|
||||||
# Install license file as it requires.
|
# Install license file as it requires.
|
||||||
INSTALL(FILES Copyright.txt DESTINATION ${CMake_DOC_DEST})
|
install(FILES Copyright.txt DESTINATION ${CMake_DOC_DEST})
|
||||||
|
|
||||||
# Install script directories.
|
# Install script directories.
|
||||||
INSTALL(
|
install(
|
||||||
DIRECTORY Modules Templates
|
DIRECTORY Modules Templates
|
||||||
DESTINATION "${CMake_DATA_DEST}"
|
DESTINATION "${CMake_DATA_DEST}"
|
||||||
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
FILE_PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
||||||
|
@ -620,7 +620,7 @@ INSTALL(
|
||||||
)
|
)
|
||||||
|
|
||||||
# process docs related install
|
# process docs related install
|
||||||
ADD_SUBDIRECTORY(Docs)
|
add_subdirectory(Docs)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------
|
#-----------------------------------------------------------------------
|
||||||
# End of the main section of the CMakeLists file
|
# End of the main section of the CMakeLists file
|
||||||
|
@ -631,4 +631,4 @@ ADD_SUBDIRECTORY(Docs)
|
||||||
# to compute the location of the "cmake" executable. We set it here
|
# to compute the location of the "cmake" executable. We set it here
|
||||||
# so that those CMake versions can find it. We wait until after all
|
# so that those CMake versions can find it. We wait until after all
|
||||||
# the add_subdirectory() calls to avoid affecting the subdirectories.
|
# the add_subdirectory() calls to avoid affecting the subdirectories.
|
||||||
SET(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
|
set(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
|
||||||
|
|
|
@ -21,5 +21,5 @@ set(CTEST_CDASH_QUERY_VERSION TRUE)
|
||||||
|
|
||||||
# use old trigger stuff so that cmake 2.4 and below will not
|
# use old trigger stuff so that cmake 2.4 and below will not
|
||||||
# get errors on trigger
|
# get errors on trigger
|
||||||
SET (TRIGGER_SITE
|
set (TRIGGER_SITE
|
||||||
"http://public.kitware.com/cgi-bin/Submit-CMake-TestingResults.cgi")
|
"http://public.kitware.com/cgi-bin/Submit-CMake-TestingResults.cgi")
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
SET(CTEST_CUSTOM_ERROR_MATCH
|
set(CTEST_CUSTOM_ERROR_MATCH
|
||||||
${CTEST_CUSTOM_ERROR_MATCH}
|
${CTEST_CUSTOM_ERROR_MATCH}
|
||||||
"ERROR:")
|
"ERROR:")
|
||||||
|
|
||||||
SET(CTEST_CUSTOM_WARNING_EXCEPTION
|
set(CTEST_CUSTOM_WARNING_EXCEPTION
|
||||||
${CTEST_CUSTOM_WARNING_EXCEPTION}
|
${CTEST_CUSTOM_WARNING_EXCEPTION}
|
||||||
"xtree.[0-9]+. : warning C4702: unreachable code"
|
"xtree.[0-9]+. : warning C4702: unreachable code"
|
||||||
"warning LNK4221"
|
"warning LNK4221"
|
||||||
|
@ -56,21 +56,21 @@ SET(CTEST_CUSTOM_WARNING_EXCEPTION
|
||||||
"[0-9,]+ warnings? generated."
|
"[0-9,]+ warnings? generated."
|
||||||
)
|
)
|
||||||
|
|
||||||
IF(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
|
if(NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
|
||||||
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
|
set(CTEST_CUSTOM_COVERAGE_EXCLUDE
|
||||||
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
|
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
|
||||||
"XCode"
|
"XCode"
|
||||||
)
|
)
|
||||||
ENDIF (NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
|
endif (NOT "@CMAKE_GENERATOR@" MATCHES "Xcode")
|
||||||
|
|
||||||
IF(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
|
if(NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
|
||||||
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
|
set(CTEST_CUSTOM_COVERAGE_EXCLUDE
|
||||||
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
|
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
|
||||||
"Kdevelop"
|
"Kdevelop"
|
||||||
)
|
)
|
||||||
ENDIF (NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
|
endif (NOT "@CMAKE_GENERATOR@" MATCHES "KDevelop")
|
||||||
|
|
||||||
SET(CTEST_CUSTOM_COVERAGE_EXCLUDE
|
set(CTEST_CUSTOM_COVERAGE_EXCLUDE
|
||||||
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
|
${CTEST_CUSTOM_COVERAGE_EXCLUDE}
|
||||||
|
|
||||||
# Exclude kwsys files from coverage results. They are reported
|
# Exclude kwsys files from coverage results. They are reported
|
||||||
|
|
|
@ -13,52 +13,52 @@
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# set some special flags for different compilers
|
# set some special flags for different compilers
|
||||||
#
|
#
|
||||||
IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
||||||
SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
|
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
|
||||||
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
endif(CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
||||||
IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
|
if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
|
||||||
SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
|
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
|
||||||
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
|
endif(CMAKE_GENERATOR MATCHES "Visual Studio 6")
|
||||||
INCLUDE (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
|
include (${CMAKE_ROOT}/Modules/CMakeBackwardCompatibilityCXX.cmake)
|
||||||
|
|
||||||
IF(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
|
if(WIN32 AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(Intel)$")
|
||||||
SET(_INTEL_WINDOWS 1)
|
set(_INTEL_WINDOWS 1)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# Disable deprecation warnings for standard C functions.
|
# Disable deprecation warnings for standard C functions.
|
||||||
# really only needed for newer versions of VS, but should
|
# really only needed for newer versions of VS, but should
|
||||||
# not hurt other versions, and this will work into the
|
# not hurt other versions, and this will work into the
|
||||||
# future
|
# future
|
||||||
IF(MSVC OR _INTEL_WINDOWS)
|
if(MSVC OR _INTEL_WINDOWS)
|
||||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
|
add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
|
||||||
ELSE()
|
else()
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
#silence duplicate symbol warnings on AIX
|
#silence duplicate symbol warnings on AIX
|
||||||
IF(CMAKE_SYSTEM MATCHES "AIX.*")
|
if(CMAKE_SYSTEM MATCHES "AIX.*")
|
||||||
IF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
if(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -bhalt:5 ")
|
||||||
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
endif(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
ENDIF(CMAKE_SYSTEM MATCHES "AIX.*")
|
endif(CMAKE_SYSTEM MATCHES "AIX.*")
|
||||||
|
|
||||||
IF(CMAKE_SYSTEM MATCHES "IRIX.*")
|
if(CMAKE_SYSTEM MATCHES "IRIX.*")
|
||||||
IF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
if(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,-woff84 -no_auto_include")
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-woff15")
|
||||||
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
endif(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
ENDIF(CMAKE_SYSTEM MATCHES "IRIX.*")
|
endif(CMAKE_SYSTEM MATCHES "IRIX.*")
|
||||||
|
|
||||||
IF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
|
if(CMAKE_SYSTEM MATCHES "OSF1-V.*")
|
||||||
IF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
if(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -timplicit_local -no_implicit_include ")
|
||||||
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
endif(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
|
endif(CMAKE_SYSTEM MATCHES "OSF1-V.*")
|
||||||
|
|
||||||
# use the ansi CXX compile flag for building cmake
|
# use the ansi CXX compile flag for building cmake
|
||||||
IF (CMAKE_ANSI_CXXFLAGS)
|
if (CMAKE_ANSI_CXXFLAGS)
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
|
||||||
ENDIF (CMAKE_ANSI_CXXFLAGS)
|
endif (CMAKE_ANSI_CXXFLAGS)
|
||||||
|
|
||||||
IF (CMAKE_ANSI_CFLAGS)
|
if (CMAKE_ANSI_CFLAGS)
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CMAKE_ANSI_CFLAGS}")
|
||||||
ENDIF (CMAKE_ANSI_CFLAGS)
|
endif (CMAKE_ANSI_CFLAGS)
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
string(REGEX REPLACE "^/(.*)" "\\1" REL_CMAKE_DATA_DIR "${CMAKE_DATA_DIR}")
|
string(REGEX REPLACE "^/(.*)" "\\1" REL_CMAKE_DATA_DIR "${CMAKE_DATA_DIR}")
|
||||||
install(FILES cmake-help.vim cmake-indent.vim cmake-syntax.vim DESTINATION ${REL_CMAKE_DATA_DIR}/editors/vim)
|
install(FILES cmake-help.vim cmake-indent.vim cmake-syntax.vim DESTINATION ${REL_CMAKE_DATA_DIR}/editors/vim)
|
||||||
install(FILES cmake-mode.el DESTINATION ${REL_CMAKE_DATA_DIR}/editors/emacs)
|
install(FILES cmake-mode.el DESTINATION ${REL_CMAKE_DATA_DIR}/editors/emacs)
|
||||||
ADD_SUBDIRECTORY (bash-completion)
|
add_subdirectory (bash-completion)
|
||||||
|
|
|
@ -15,15 +15,15 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
MACRO(ADD_FILE_DEPENDENCIES _file)
|
macro(ADD_FILE_DEPENDENCIES _file)
|
||||||
|
|
||||||
GET_SOURCE_FILE_PROPERTY(_deps ${_file} OBJECT_DEPENDS)
|
get_source_file_property(_deps ${_file} OBJECT_DEPENDS)
|
||||||
IF (_deps)
|
if (_deps)
|
||||||
SET(_deps ${_deps} ${ARGN})
|
set(_deps ${_deps} ${ARGN})
|
||||||
ELSE (_deps)
|
else (_deps)
|
||||||
SET(_deps ${ARGN})
|
set(_deps ${ARGN})
|
||||||
ENDIF (_deps)
|
endif (_deps)
|
||||||
|
|
||||||
SET_SOURCE_FILES_PROPERTIES(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
|
set_source_files_properties(${_file} PROPERTIES OBJECT_DEPENDS "${_deps}")
|
||||||
|
|
||||||
ENDMACRO(ADD_FILE_DEPENDENCIES)
|
endmacro(ADD_FILE_DEPENDENCIES)
|
||||||
|
|
|
@ -14,12 +14,12 @@
|
||||||
|
|
||||||
# support for AT&T syntax assemblers, e.g. GNU as
|
# support for AT&T syntax assemblers, e.g. GNU as
|
||||||
|
|
||||||
SET(ASM_DIALECT "-ATT")
|
set(ASM_DIALECT "-ATT")
|
||||||
# *.S files are supposed to be preprocessed, so they should not be passed to
|
# *.S files are supposed to be preprocessed, so they should not be passed to
|
||||||
# assembler but should be processed by gcc
|
# assembler but should be processed by gcc
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;asm)
|
set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;asm)
|
||||||
|
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> -o <OBJECT> <SOURCE>")
|
||||||
|
|
||||||
INCLUDE(CMakeASMInformation)
|
include(CMakeASMInformation)
|
||||||
SET(ASM_DIALECT)
|
set(ASM_DIALECT)
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
SET(CMAKE_ASM@ASM_DIALECT@_COMPILER "@_CMAKE_ASM_COMPILER@")
|
set(CMAKE_ASM@ASM_DIALECT@_COMPILER "@_CMAKE_ASM_COMPILER@")
|
||||||
SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_ARG1 "@_CMAKE_ASM_COMPILER_ARG1@")
|
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ARG1 "@_CMAKE_ASM_COMPILER_ARG1@")
|
||||||
SET(CMAKE_AR "@CMAKE_AR@")
|
set(CMAKE_AR "@CMAKE_AR@")
|
||||||
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
||||||
SET(CMAKE_LINKER "@CMAKE_LINKER@")
|
set(CMAKE_LINKER "@CMAKE_LINKER@")
|
||||||
SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1)
|
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_LOADED 1)
|
||||||
SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_ID "@_CMAKE_ASM_COMPILER_ID@")
|
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ID "@_CMAKE_ASM_COMPILER_ID@")
|
||||||
SET(CMAKE_ASM@ASM_DIALECT@_COMPILER_ENV_VAR "@_CMAKE_ASM_COMPILER_ENV_VAR@")
|
set(CMAKE_ASM@ASM_DIALECT@_COMPILER_ENV_VAR "@_CMAKE_ASM_COMPILER_ENV_VAR@")
|
||||||
|
|
||||||
SET(CMAKE_ASM@ASM_DIALECT@_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
set(CMAKE_ASM@ASM_DIALECT@_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||||
SET(CMAKE_ASM@ASM_DIALECT@_LINKER_PREFERENCE 0)
|
set(CMAKE_ASM@ASM_DIALECT@_LINKER_PREFERENCE 0)
|
||||||
|
|
||||||
|
|
|
@ -12,76 +12,76 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
IF(UNIX)
|
if(UNIX)
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
|
set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .o)
|
||||||
ELSE(UNIX)
|
else(UNIX)
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
|
set(CMAKE_ASM${ASM_DIALECT}_OUTPUT_EXTENSION .obj)
|
||||||
ENDIF(UNIX)
|
endif(UNIX)
|
||||||
|
|
||||||
SET(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I
|
set(CMAKE_INCLUDE_FLAG_ASM${ASM_DIALECT} "-I") # -I
|
||||||
SET(CMAKE_BASE_NAME)
|
set(CMAKE_BASE_NAME)
|
||||||
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE)
|
get_filename_component(CMAKE_BASE_NAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME_WE)
|
||||||
|
|
||||||
IF("${CMAKE_BASE_NAME}" STREQUAL "as")
|
if("${CMAKE_BASE_NAME}" STREQUAL "as")
|
||||||
SET(CMAKE_BASE_NAME gas)
|
set(CMAKE_BASE_NAME gas)
|
||||||
ENDIF("${CMAKE_BASE_NAME}" STREQUAL "as")
|
endif("${CMAKE_BASE_NAME}" STREQUAL "as")
|
||||||
|
|
||||||
# Load compiler-specific information.
|
# Load compiler-specific information.
|
||||||
SET(_INCLUDED_FILE "")
|
set(_INCLUDED_FILE "")
|
||||||
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||||
INCLUDE(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
include(Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||||
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
endif(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||||
IF(NOT _INCLUDED_FILE)
|
if(NOT _INCLUDED_FILE)
|
||||||
IF("ASM${ASM_DIALECT}" STREQUAL "ASM")
|
if("ASM${ASM_DIALECT}" STREQUAL "ASM")
|
||||||
MESSAGE(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
|
message(STATUS "Warning: Did not find file Compiler/${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}")
|
||||||
ENDIF("ASM${ASM_DIALECT}" STREQUAL "ASM")
|
endif("ASM${ASM_DIALECT}" STREQUAL "ASM")
|
||||||
INCLUDE(Platform/${CMAKE_BASE_NAME} OPTIONAL)
|
include(Platform/${CMAKE_BASE_NAME} OPTIONAL)
|
||||||
ENDIF(NOT _INCLUDED_FILE)
|
endif(NOT _INCLUDED_FILE)
|
||||||
|
|
||||||
IF(CMAKE_SYSTEM_PROCESSOR)
|
if(CMAKE_SYSTEM_PROCESSOR)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||||
IF(NOT _INCLUDED_FILE)
|
if(NOT _INCLUDED_FILE)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
|
||||||
ENDIF(NOT _INCLUDED_FILE)
|
endif(NOT _INCLUDED_FILE)
|
||||||
ENDIF(CMAKE_SYSTEM_PROCESSOR)
|
endif(CMAKE_SYSTEM_PROCESSOR)
|
||||||
|
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}-ASM${ASM_DIALECT} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||||
IF(NOT _INCLUDED_FILE)
|
if(NOT _INCLUDED_FILE)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
|
||||||
ENDIF(NOT _INCLUDED_FILE)
|
endif(NOT _INCLUDED_FILE)
|
||||||
|
|
||||||
# Set default assembler file extensions:
|
# Set default assembler file extensions:
|
||||||
IF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
|
if(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
|
set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS s;S;asm)
|
||||||
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
|
endif(NOT CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS)
|
||||||
|
|
||||||
|
|
||||||
# Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends:
|
# Support for CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT and friends:
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}")
|
set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT "$ENV{ASM${ASM_DIALECT}FLAGS} ${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}")
|
||||||
# avoid just having a space as the initial value for the cache
|
# avoid just having a space as the initial value for the cache
|
||||||
IF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
|
if(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
|
set(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT)
|
||||||
ENDIF(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
|
endif(CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT STREQUAL " ")
|
||||||
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
|
set (CMAKE_ASM${ASM_DIALECT}_FLAGS "${CMAKE_ASM${ASM_DIALECT}_FLAGS_INIT}" CACHE STRING
|
||||||
"Flags used by the assembler during all build types.")
|
"Flags used by the assembler during all build types.")
|
||||||
|
|
||||||
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||||
# default build type is none
|
# default build type is none
|
||||||
IF(NOT CMAKE_NO_BUILD_TYPE)
|
if(NOT CMAKE_NO_BUILD_TYPE)
|
||||||
SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
|
set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
|
||||||
"Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.")
|
"Choose the type of build, options are: None, Debug Release RelWithDebInfo MinSizeRel.")
|
||||||
ENDIF(NOT CMAKE_NO_BUILD_TYPE)
|
endif(NOT CMAKE_NO_BUILD_TYPE)
|
||||||
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
|
set (CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG "${CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG_INIT}" CACHE STRING
|
||||||
"Flags used by the assembler during debug builds.")
|
"Flags used by the assembler during debug builds.")
|
||||||
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING
|
set (CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL "${CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL_INIT}" CACHE STRING
|
||||||
"Flags used by the assembler during release minsize builds.")
|
"Flags used by the assembler during release minsize builds.")
|
||||||
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE_INIT}" CACHE STRING
|
set (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE_INIT}" CACHE STRING
|
||||||
"Flags used by the assembler during release builds.")
|
"Flags used by the assembler during release builds.")
|
||||||
SET (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
|
set (CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO "${CMAKE_ASM${ASM_DIALECT}_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
|
||||||
"Flags used by the assembler during Release with Debug Info builds.")
|
"Flags used by the assembler during Release with Debug Info builds.")
|
||||||
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||||
|
|
||||||
MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_FLAGS
|
mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_FLAGS
|
||||||
CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG
|
CMAKE_ASM${ASM_DIALECT}_FLAGS_DEBUG
|
||||||
CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL
|
CMAKE_ASM${ASM_DIALECT}_FLAGS_MINSIZEREL
|
||||||
CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE
|
CMAKE_ASM${ASM_DIALECT}_FLAGS_RELEASE
|
||||||
|
@ -89,42 +89,42 @@ MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_FLAGS
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
|
if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
||||||
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
|
endif(NOT CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT)
|
||||||
|
|
||||||
IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
|
if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
|
set(CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY
|
||||||
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
|
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
|
||||||
"<CMAKE_RANLIB> <TARGET> ")
|
"<CMAKE_RANLIB> <TARGET> ")
|
||||||
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
|
endif(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_STATIC_LIBRARY)
|
||||||
|
|
||||||
IF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
|
if(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
|
set(CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE
|
||||||
"<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
"<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> <CMAKE_ASM${ASM_DIALECT}_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||||
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
|
endif(NOT CMAKE_ASM${ASM_DIALECT}_LINK_EXECUTABLE)
|
||||||
|
|
||||||
IF(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG)
|
if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG)
|
||||||
SET(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG})
|
set(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP)
|
if(NOT CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP)
|
||||||
SET(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP})
|
set(CMAKE_EXECUTABLE_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_ASM${ASM_DIALECT}_FLAG_SEP})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG)
|
if(NOT CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG)
|
||||||
SET(CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_ASM${ASM_DIALECT}_FLAG})
|
set(CMAKE_EXECUTABLE_RPATH_LINK_ASM${ASM_DIALECT}_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_ASM${ASM_DIALECT}_FLAG})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# to be done
|
# to be done
|
||||||
IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
|
if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
|
set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
|
||||||
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
|
endif(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_LIBRARY)
|
||||||
|
|
||||||
IF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
|
if(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
|
set(CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
|
||||||
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
|
endif(NOT CMAKE_ASM${ASM_DIALECT}_CREATE_SHARED_MODULE)
|
||||||
|
|
||||||
|
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1)
|
set(CMAKE_ASM${ASM_DIALECT}_INFOMATION_LOADED 1)
|
||||||
|
|
||||||
|
|
|
@ -14,11 +14,11 @@
|
||||||
|
|
||||||
# support for the MS assembler, masm and masm64
|
# support for the MS assembler, masm and masm64
|
||||||
|
|
||||||
SET(ASM_DIALECT "_MASM")
|
set(ASM_DIALECT "_MASM")
|
||||||
|
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
|
set(CMAKE_ASM${ASM_DIALECT}_SOURCE_FILE_EXTENSIONS asm)
|
||||||
|
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> /c /Fo <OBJECT> <SOURCE>")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILE_OBJECT "<CMAKE_ASM${ASM_DIALECT}_COMPILER> <FLAGS> /c /Fo <OBJECT> <SOURCE>")
|
||||||
|
|
||||||
INCLUDE(CMakeASMInformation)
|
include(CMakeASMInformation)
|
||||||
SET(ASM_DIALECT)
|
set(ASM_DIALECT)
|
||||||
|
|
|
@ -19,21 +19,21 @@ set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS nasm asm)
|
||||||
if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
|
if(NOT CMAKE_ASM_NASM_OBJECT_FORMAT)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
||||||
SET(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
|
set(CMAKE_ASM_NASM_OBJECT_FORMAT win64)
|
||||||
else()
|
else()
|
||||||
SET(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
|
set(CMAKE_ASM_NASM_OBJECT_FORMAT win32)
|
||||||
endif()
|
endif()
|
||||||
elseif(APPLE)
|
elseif(APPLE)
|
||||||
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
||||||
SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
|
set(CMAKE_ASM_NASM_OBJECT_FORMAT macho64)
|
||||||
else()
|
else()
|
||||||
SET(CMAKE_ASM_NASM_OBJECT_FORMAT macho)
|
set(CMAKE_ASM_NASM_OBJECT_FORMAT macho)
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
if(CMAKE_C_SIZEOF_DATA_PTR EQUAL 8)
|
||||||
SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
|
set(CMAKE_ASM_NASM_OBJECT_FORMAT elf64)
|
||||||
else()
|
else()
|
||||||
SET(CMAKE_ASM_NASM_OBJECT_FORMAT elf)
|
set(CMAKE_ASM_NASM_OBJECT_FORMAT elf)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
@ -13,28 +13,28 @@
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
# Nothing here yet
|
# Nothing here yet
|
||||||
IF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
if(CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
||||||
INCLUDE(CMakeVS7BackwardCompatibility)
|
include(CMakeVS7BackwardCompatibility)
|
||||||
SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
|
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
|
||||||
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
endif(CMAKE_GENERATOR MATCHES "Visual Studio 7")
|
||||||
IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
|
if(CMAKE_GENERATOR MATCHES "Visual Studio 6")
|
||||||
INCLUDE(CMakeVS6BackwardCompatibility)
|
include(CMakeVS6BackwardCompatibility)
|
||||||
SET(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
|
set(CMAKE_SKIP_COMPATIBILITY_TESTS 1)
|
||||||
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
|
endif(CMAKE_GENERATOR MATCHES "Visual Studio 6")
|
||||||
|
|
||||||
IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
|
if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
|
||||||
# Old CMake versions did not support OS X universal binaries anyway,
|
# Old CMake versions did not support OS X universal binaries anyway,
|
||||||
# so just get through this with at least some size for the types.
|
# so just get through this with at least some size for the types.
|
||||||
LIST(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
|
list(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
|
||||||
IF(${NUM_ARCHS} GREATER 1)
|
if(${NUM_ARCHS} GREATER 1)
|
||||||
IF(NOT DEFINED CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
if(NOT DEFINED CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
||||||
MESSAGE(WARNING "This module does not work with OS X universal binaries.")
|
message(WARNING "This module does not work with OS X universal binaries.")
|
||||||
SET(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES 1)
|
set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES 1)
|
||||||
LIST(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
list(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
||||||
ENDIF()
|
endif()
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
INCLUDE (CheckTypeSize)
|
include (CheckTypeSize)
|
||||||
CHECK_TYPE_SIZE(int CMAKE_SIZEOF_INT)
|
CHECK_TYPE_SIZE(int CMAKE_SIZEOF_INT)
|
||||||
CHECK_TYPE_SIZE(long CMAKE_SIZEOF_LONG)
|
CHECK_TYPE_SIZE(long CMAKE_SIZEOF_LONG)
|
||||||
CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
|
CHECK_TYPE_SIZE("void*" CMAKE_SIZEOF_VOID_P)
|
||||||
|
@ -43,52 +43,52 @@ IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
|
||||||
CHECK_TYPE_SIZE(float CMAKE_SIZEOF_FLOAT)
|
CHECK_TYPE_SIZE(float CMAKE_SIZEOF_FLOAT)
|
||||||
CHECK_TYPE_SIZE(double CMAKE_SIZEOF_DOUBLE)
|
CHECK_TYPE_SIZE(double CMAKE_SIZEOF_DOUBLE)
|
||||||
|
|
||||||
INCLUDE (CheckIncludeFile)
|
include (CheckIncludeFile)
|
||||||
CHECK_INCLUDE_FILE("limits.h" CMAKE_HAVE_LIMITS_H)
|
CHECK_INCLUDE_FILE("limits.h" CMAKE_HAVE_LIMITS_H)
|
||||||
CHECK_INCLUDE_FILE("unistd.h" CMAKE_HAVE_UNISTD_H)
|
CHECK_INCLUDE_FILE("unistd.h" CMAKE_HAVE_UNISTD_H)
|
||||||
CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H)
|
CHECK_INCLUDE_FILE("pthread.h" CMAKE_HAVE_PTHREAD_H)
|
||||||
|
|
||||||
INCLUDE (CheckIncludeFiles)
|
include (CheckIncludeFiles)
|
||||||
CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SYS_PRCTL_H)
|
CHECK_INCLUDE_FILES("sys/types.h;sys/prctl.h" CMAKE_HAVE_SYS_PRCTL_H)
|
||||||
|
|
||||||
INCLUDE (TestBigEndian)
|
include (TestBigEndian)
|
||||||
TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
|
TEST_BIG_ENDIAN(CMAKE_WORDS_BIGENDIAN)
|
||||||
INCLUDE (FindX11)
|
include (FindX11)
|
||||||
|
|
||||||
IF("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
|
if("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
|
||||||
SET (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
|
set (CMAKE_X_CFLAGS "" CACHE STRING "X11 extra flags.")
|
||||||
ELSE("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
|
else("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
|
||||||
SET (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING
|
set (CMAKE_X_CFLAGS "-I${X11_X11_INCLUDE_PATH}" CACHE STRING
|
||||||
"X11 extra flags.")
|
"X11 extra flags.")
|
||||||
ENDIF("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
|
endif("${X11_X11_INCLUDE_PATH}" MATCHES "^/usr/include$")
|
||||||
SET (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING
|
set (CMAKE_X_LIBS "${X11_LIBRARIES}" CACHE STRING
|
||||||
"Libraries and options used in X11 programs.")
|
"Libraries and options used in X11 programs.")
|
||||||
SET (CMAKE_HAS_X "${X11_FOUND}" CACHE INTERNAL "Is X11 around.")
|
set (CMAKE_HAS_X "${X11_FOUND}" CACHE INTERNAL "Is X11 around.")
|
||||||
|
|
||||||
INCLUDE (FindThreads)
|
include (FindThreads)
|
||||||
|
|
||||||
SET (CMAKE_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING
|
set (CMAKE_THREAD_LIBS "${CMAKE_THREAD_LIBS_INIT}" CACHE STRING
|
||||||
"Thread library used.")
|
"Thread library used.")
|
||||||
|
|
||||||
SET (CMAKE_USE_PTHREADS "${CMAKE_USE_PTHREADS_INIT}" CACHE BOOL
|
set (CMAKE_USE_PTHREADS "${CMAKE_USE_PTHREADS_INIT}" CACHE BOOL
|
||||||
"Use the pthreads library.")
|
"Use the pthreads library.")
|
||||||
|
|
||||||
SET (CMAKE_USE_WIN32_THREADS "${CMAKE_USE_WIN32_THREADS_INIT}" CACHE BOOL
|
set (CMAKE_USE_WIN32_THREADS "${CMAKE_USE_WIN32_THREADS_INIT}" CACHE BOOL
|
||||||
"Use the win32 thread library.")
|
"Use the win32 thread library.")
|
||||||
|
|
||||||
SET (CMAKE_HP_PTHREADS ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL
|
set (CMAKE_HP_PTHREADS ${CMAKE_HP_PTHREADS_INIT} CACHE BOOL
|
||||||
"Use HP pthreads.")
|
"Use HP pthreads.")
|
||||||
|
|
||||||
SET (CMAKE_USE_SPROC ${CMAKE_USE_SPROC_INIT} CACHE BOOL
|
set (CMAKE_USE_SPROC ${CMAKE_USE_SPROC_INIT} CACHE BOOL
|
||||||
"Use sproc libs.")
|
"Use sproc libs.")
|
||||||
|
|
||||||
IF(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
if(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
||||||
SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
set(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
||||||
SET(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
set(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
|
||||||
ENDIF()
|
endif()
|
||||||
ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
|
endif(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
mark_as_advanced(
|
||||||
CMAKE_HP_PTHREADS
|
CMAKE_HP_PTHREADS
|
||||||
CMAKE_THREAD_LIBS
|
CMAKE_THREAD_LIBS
|
||||||
CMAKE_USE_PTHREADS
|
CMAKE_USE_PTHREADS
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
# - define a bunch of backwards compatibility variables
|
# - define a bunch of backwards compatibility variables
|
||||||
# CMAKE_ANSI_CXXFLAGS - flag for ansi c++
|
# CMAKE_ANSI_CXXFLAGS - flag for ansi c++
|
||||||
# CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
|
# CMAKE_HAS_ANSI_STRING_STREAM - has <strstream>
|
||||||
# INCLUDE(TestForANSIStreamHeaders)
|
# include(TestForANSIStreamHeaders)
|
||||||
# INCLUDE(CheckIncludeFileCXX)
|
# include(CheckIncludeFileCXX)
|
||||||
# INCLUDE(TestForSTDNamespace)
|
# include(TestForSTDNamespace)
|
||||||
# INCLUDE(TestForANSIForScope)
|
# include(TestForANSIForScope)
|
||||||
|
|
||||||
#=============================================================================
|
#=============================================================================
|
||||||
# Copyright 2002-2009 Kitware, Inc.
|
# Copyright 2002-2009 Kitware, Inc.
|
||||||
|
@ -19,36 +19,36 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
|
if(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
|
||||||
# check for some ANSI flags in the CXX compiler if it is not gnu
|
# check for some ANSI flags in the CXX compiler if it is not gnu
|
||||||
IF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
if(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
INCLUDE(TestCXXAcceptsFlag)
|
include(TestCXXAcceptsFlag)
|
||||||
SET(CMAKE_TRY_ANSI_CXX_FLAGS "")
|
set(CMAKE_TRY_ANSI_CXX_FLAGS "")
|
||||||
IF(CMAKE_SYSTEM MATCHES "IRIX.*")
|
if(CMAKE_SYSTEM MATCHES "IRIX.*")
|
||||||
SET(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std")
|
set(CMAKE_TRY_ANSI_CXX_FLAGS "-LANG:std")
|
||||||
ENDIF(CMAKE_SYSTEM MATCHES "IRIX.*")
|
endif(CMAKE_SYSTEM MATCHES "IRIX.*")
|
||||||
IF(CMAKE_SYSTEM MATCHES "OSF.*")
|
if(CMAKE_SYSTEM MATCHES "OSF.*")
|
||||||
SET(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname")
|
set(CMAKE_TRY_ANSI_CXX_FLAGS "-std strict_ansi -nopure_cname")
|
||||||
ENDIF(CMAKE_SYSTEM MATCHES "OSF.*")
|
endif(CMAKE_SYSTEM MATCHES "OSF.*")
|
||||||
# if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see
|
# if CMAKE_TRY_ANSI_CXX_FLAGS has something in it, see
|
||||||
# if the compiler accepts it
|
# if the compiler accepts it
|
||||||
IF( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
|
if( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
|
||||||
CHECK_CXX_ACCEPTS_FLAG(${CMAKE_TRY_ANSI_CXX_FLAGS} CMAKE_CXX_ACCEPTS_FLAGS)
|
CHECK_CXX_ACCEPTS_FLAG(${CMAKE_TRY_ANSI_CXX_FLAGS} CMAKE_CXX_ACCEPTS_FLAGS)
|
||||||
# if the compiler liked the flag then set CMAKE_ANSI_CXXFLAGS
|
# if the compiler liked the flag then set CMAKE_ANSI_CXXFLAGS
|
||||||
# to the flag
|
# to the flag
|
||||||
IF(CMAKE_CXX_ACCEPTS_FLAGS)
|
if(CMAKE_CXX_ACCEPTS_FLAGS)
|
||||||
SET(CMAKE_ANSI_CXXFLAGS ${CMAKE_TRY_ANSI_CXX_FLAGS} CACHE INTERNAL
|
set(CMAKE_ANSI_CXXFLAGS ${CMAKE_TRY_ANSI_CXX_FLAGS} CACHE INTERNAL
|
||||||
"What flags are required by the c++ compiler to make it ansi." )
|
"What flags are required by the c++ compiler to make it ansi." )
|
||||||
ENDIF(CMAKE_CXX_ACCEPTS_FLAGS)
|
endif(CMAKE_CXX_ACCEPTS_FLAGS)
|
||||||
ENDIF( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
|
endif( CMAKE_TRY_ANSI_CXX_FLAGS MATCHES ".+")
|
||||||
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
endif(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
SET(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
|
set(CMAKE_CXX_FLAGS_SAVE ${CMAKE_CXX_FLAGS})
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CMAKE_ANSI_CXXFLAGS}")
|
||||||
INCLUDE(TestForANSIStreamHeaders)
|
include(TestForANSIStreamHeaders)
|
||||||
INCLUDE(CheckIncludeFileCXX)
|
include(CheckIncludeFileCXX)
|
||||||
INCLUDE(TestForSTDNamespace)
|
include(TestForSTDNamespace)
|
||||||
INCLUDE(TestForANSIForScope)
|
include(TestForANSIForScope)
|
||||||
INCLUDE(TestForSSTREAM)
|
include(TestForSSTREAM)
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_SAVE}")
|
||||||
ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
|
endif(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,6 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
SET (CMAKE_MAKE_PROGRAM "make" CACHE STRING
|
set (CMAKE_MAKE_PROGRAM "make" CACHE STRING
|
||||||
"Program used to build from makefiles.")
|
"Program used to build from makefiles.")
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM)
|
||||||
|
|
|
@ -1,53 +1,53 @@
|
||||||
SET(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
|
set(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
|
||||||
SET(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
|
set(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
|
||||||
SET(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
|
set(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
|
||||||
SET(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
|
set(CMAKE_C_COMPILER_VERSION "@CMAKE_C_COMPILER_VERSION@")
|
||||||
SET(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
|
set(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
|
||||||
@SET_MSVC_C_ARCHITECTURE_ID@
|
@SET_MSVC_C_ARCHITECTURE_ID@
|
||||||
SET(CMAKE_AR "@CMAKE_AR@")
|
set(CMAKE_AR "@CMAKE_AR@")
|
||||||
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
||||||
SET(CMAKE_LINKER "@CMAKE_LINKER@")
|
set(CMAKE_LINKER "@CMAKE_LINKER@")
|
||||||
SET(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@)
|
set(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@)
|
||||||
SET(CMAKE_C_COMPILER_LOADED 1)
|
set(CMAKE_C_COMPILER_LOADED 1)
|
||||||
SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
|
set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
|
||||||
SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
|
set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
|
||||||
IF(CMAKE_COMPILER_IS_CYGWIN)
|
if(CMAKE_COMPILER_IS_CYGWIN)
|
||||||
SET(CYGWIN 1)
|
set(CYGWIN 1)
|
||||||
SET(UNIX 1)
|
set(UNIX 1)
|
||||||
ENDIF(CMAKE_COMPILER_IS_CYGWIN)
|
endif(CMAKE_COMPILER_IS_CYGWIN)
|
||||||
|
|
||||||
SET(CMAKE_C_COMPILER_ENV_VAR "CC")
|
set(CMAKE_C_COMPILER_ENV_VAR "CC")
|
||||||
|
|
||||||
IF(CMAKE_COMPILER_IS_MINGW)
|
if(CMAKE_COMPILER_IS_MINGW)
|
||||||
SET(MINGW 1)
|
set(MINGW 1)
|
||||||
ENDIF(CMAKE_COMPILER_IS_MINGW)
|
endif(CMAKE_COMPILER_IS_MINGW)
|
||||||
SET(CMAKE_C_COMPILER_ID_RUN 1)
|
set(CMAKE_C_COMPILER_ID_RUN 1)
|
||||||
SET(CMAKE_C_SOURCE_FILE_EXTENSIONS c)
|
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_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||||
SET(CMAKE_C_LINKER_PREFERENCE 10)
|
set(CMAKE_C_LINKER_PREFERENCE 10)
|
||||||
|
|
||||||
# Save compiler ABI information.
|
# Save compiler ABI information.
|
||||||
SET(CMAKE_C_SIZEOF_DATA_PTR "@CMAKE_C_SIZEOF_DATA_PTR@")
|
set(CMAKE_C_SIZEOF_DATA_PTR "@CMAKE_C_SIZEOF_DATA_PTR@")
|
||||||
SET(CMAKE_C_COMPILER_ABI "@CMAKE_C_COMPILER_ABI@")
|
set(CMAKE_C_COMPILER_ABI "@CMAKE_C_COMPILER_ABI@")
|
||||||
SET(CMAKE_C_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
|
set(CMAKE_C_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
|
||||||
|
|
||||||
IF(CMAKE_C_SIZEOF_DATA_PTR)
|
if(CMAKE_C_SIZEOF_DATA_PTR)
|
||||||
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
|
set(CMAKE_SIZEOF_VOID_P "${CMAKE_C_SIZEOF_DATA_PTR}")
|
||||||
ENDIF(CMAKE_C_SIZEOF_DATA_PTR)
|
endif(CMAKE_C_SIZEOF_DATA_PTR)
|
||||||
|
|
||||||
IF(CMAKE_C_COMPILER_ABI)
|
if(CMAKE_C_COMPILER_ABI)
|
||||||
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
|
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_C_COMPILER_ABI}")
|
||||||
ENDIF(CMAKE_C_COMPILER_ABI)
|
endif(CMAKE_C_COMPILER_ABI)
|
||||||
|
|
||||||
IF(CMAKE_C_LIBRARY_ARCHITECTURE)
|
if(CMAKE_C_LIBRARY_ARCHITECTURE)
|
||||||
SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
|
set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_C_LIBRARY_ARCHITECTURE@")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
SET(CMAKE_C_HAS_ISYSROOT "@CMAKE_C_HAS_ISYSROOT@")
|
set(CMAKE_C_HAS_ISYSROOT "@CMAKE_C_HAS_ISYSROOT@")
|
||||||
@CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
|
@CMAKE_C_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
|
||||||
|
|
||||||
SET(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
|
set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "@CMAKE_C_IMPLICIT_LINK_LIBRARIES@")
|
||||||
SET(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
|
set(CMAKE_C_IMPLICIT_LINK_DIRECTORIES "@CMAKE_C_IMPLICIT_LINK_DIRECTORIES@")
|
||||||
|
|
||||||
@SET_CMAKE_CMCLDEPS_EXECUTABLE@
|
@SET_CMAKE_CMCLDEPS_EXECUTABLE@
|
||||||
@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@
|
@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@
|
||||||
|
|
|
@ -20,60 +20,60 @@
|
||||||
|
|
||||||
# some compilers use different extensions (e.g. sdcc uses .rel)
|
# some compilers use different extensions (e.g. sdcc uses .rel)
|
||||||
# so set the extension here first so it can be overridden by the compiler specific file
|
# so set the extension here first so it can be overridden by the compiler specific file
|
||||||
IF(UNIX)
|
if(UNIX)
|
||||||
SET(CMAKE_C_OUTPUT_EXTENSION .o)
|
set(CMAKE_C_OUTPUT_EXTENSION .o)
|
||||||
ELSE(UNIX)
|
else(UNIX)
|
||||||
SET(CMAKE_C_OUTPUT_EXTENSION .obj)
|
set(CMAKE_C_OUTPUT_EXTENSION .obj)
|
||||||
ENDIF(UNIX)
|
endif(UNIX)
|
||||||
|
|
||||||
SET(_INCLUDED_FILE 0)
|
set(_INCLUDED_FILE 0)
|
||||||
|
|
||||||
# Load compiler-specific information.
|
# Load compiler-specific information.
|
||||||
IF(CMAKE_C_COMPILER_ID)
|
if(CMAKE_C_COMPILER_ID)
|
||||||
INCLUDE(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL)
|
include(Compiler/${CMAKE_C_COMPILER_ID}-C OPTIONAL)
|
||||||
ENDIF(CMAKE_C_COMPILER_ID)
|
endif(CMAKE_C_COMPILER_ID)
|
||||||
|
|
||||||
SET(CMAKE_BASE_NAME)
|
set(CMAKE_BASE_NAME)
|
||||||
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE)
|
get_filename_component(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE)
|
||||||
IF(CMAKE_COMPILER_IS_GNUCC)
|
if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
SET(CMAKE_BASE_NAME gcc)
|
set(CMAKE_BASE_NAME gcc)
|
||||||
ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
endif(CMAKE_COMPILER_IS_GNUCC)
|
||||||
|
|
||||||
|
|
||||||
# load a hardware specific file, mostly useful for embedded compilers
|
# load a hardware specific file, mostly useful for embedded compilers
|
||||||
IF(CMAKE_SYSTEM_PROCESSOR)
|
if(CMAKE_SYSTEM_PROCESSOR)
|
||||||
IF(CMAKE_C_COMPILER_ID)
|
if(CMAKE_C_COMPILER_ID)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||||
ENDIF(CMAKE_C_COMPILER_ID)
|
endif(CMAKE_C_COMPILER_ID)
|
||||||
IF (NOT _INCLUDED_FILE)
|
if (NOT _INCLUDED_FILE)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
|
||||||
ENDIF (NOT _INCLUDED_FILE)
|
endif (NOT _INCLUDED_FILE)
|
||||||
ENDIF(CMAKE_SYSTEM_PROCESSOR)
|
endif(CMAKE_SYSTEM_PROCESSOR)
|
||||||
|
|
||||||
|
|
||||||
# load the system- and compiler specific files
|
# load the system- and compiler specific files
|
||||||
IF(CMAKE_C_COMPILER_ID)
|
if(CMAKE_C_COMPILER_ID)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER_ID}-C
|
||||||
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||||
ENDIF(CMAKE_C_COMPILER_ID)
|
endif(CMAKE_C_COMPILER_ID)
|
||||||
IF (NOT _INCLUDED_FILE)
|
if (NOT _INCLUDED_FILE)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}
|
||||||
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||||
ENDIF (NOT _INCLUDED_FILE)
|
endif (NOT _INCLUDED_FILE)
|
||||||
# We specify the compiler information in the system file for some
|
# We specify the compiler information in the system file for some
|
||||||
# platforms, but this language may not have been enabled when the file
|
# platforms, but this language may not have been enabled when the file
|
||||||
# was first included. Include it again to get the language info.
|
# was first included. Include it again to get the language info.
|
||||||
# Remove this when all compiler info is removed from system files.
|
# Remove this when all compiler info is removed from system files.
|
||||||
IF (NOT _INCLUDED_FILE)
|
if (NOT _INCLUDED_FILE)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
|
include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
|
||||||
ENDIF (NOT _INCLUDED_FILE)
|
endif (NOT _INCLUDED_FILE)
|
||||||
|
|
||||||
IF(CMAKE_C_SIZEOF_DATA_PTR)
|
if(CMAKE_C_SIZEOF_DATA_PTR)
|
||||||
FOREACH(f ${CMAKE_C_ABI_FILES})
|
foreach(f ${CMAKE_C_ABI_FILES})
|
||||||
INCLUDE(${f})
|
include(${f})
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
UNSET(CMAKE_C_ABI_FILES)
|
unset(CMAKE_C_ABI_FILES)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# This should be included before the _INIT variables are
|
# This should be included before the _INIT variables are
|
||||||
# used to initialize the cache. Since the rule variables
|
# used to initialize the cache. Since the rule variables
|
||||||
|
@ -81,58 +81,58 @@ ENDIF()
|
||||||
# But, it should still be after the platform file so changes can
|
# But, it should still be after the platform file so changes can
|
||||||
# be made to those values.
|
# be made to those values.
|
||||||
|
|
||||||
IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
if(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
||||||
# Save the full path of the file so try_compile can use it.
|
# Save the full path of the file so try_compile can use it.
|
||||||
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
|
include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
|
||||||
SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
|
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
|
if(CMAKE_USER_MAKE_RULES_OVERRIDE_C)
|
||||||
# Save the full path of the file so try_compile can use it.
|
# Save the full path of the file so try_compile can use it.
|
||||||
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_C} RESULT_VARIABLE _override)
|
include(${CMAKE_USER_MAKE_RULES_OVERRIDE_C} RESULT_VARIABLE _override)
|
||||||
SET(CMAKE_USER_MAKE_RULES_OVERRIDE_C "${_override}")
|
set(CMAKE_USER_MAKE_RULES_OVERRIDE_C "${_override}")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# for most systems a module is the same as a shared library
|
# for most systems a module is the same as a shared library
|
||||||
# so unless the variable CMAKE_MODULE_EXISTS is set just
|
# so unless the variable CMAKE_MODULE_EXISTS is set just
|
||||||
# copy the values from the LIBRARY variables
|
# copy the values from the LIBRARY variables
|
||||||
IF(NOT CMAKE_MODULE_EXISTS)
|
if(NOT CMAKE_MODULE_EXISTS)
|
||||||
SET(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
|
set(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
|
||||||
SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
|
set(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
|
||||||
ENDIF(NOT CMAKE_MODULE_EXISTS)
|
endif(NOT CMAKE_MODULE_EXISTS)
|
||||||
|
|
||||||
SET(CMAKE_C_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}")
|
set(CMAKE_C_FLAGS_INIT "$ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}")
|
||||||
# avoid just having a space as the initial value for the cache
|
# avoid just having a space as the initial value for the cache
|
||||||
IF(CMAKE_C_FLAGS_INIT STREQUAL " ")
|
if(CMAKE_C_FLAGS_INIT STREQUAL " ")
|
||||||
SET(CMAKE_C_FLAGS_INIT)
|
set(CMAKE_C_FLAGS_INIT)
|
||||||
ENDIF(CMAKE_C_FLAGS_INIT STREQUAL " ")
|
endif(CMAKE_C_FLAGS_INIT STREQUAL " ")
|
||||||
SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
|
||||||
"Flags used by the compiler during all build types.")
|
"Flags used by the compiler during all build types.")
|
||||||
|
|
||||||
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||||
# default build type is none
|
# default build type is none
|
||||||
IF(NOT CMAKE_NO_BUILD_TYPE)
|
if(NOT CMAKE_NO_BUILD_TYPE)
|
||||||
SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
|
set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
|
||||||
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
|
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
|
||||||
ENDIF(NOT CMAKE_NO_BUILD_TYPE)
|
endif(NOT CMAKE_NO_BUILD_TYPE)
|
||||||
SET (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
|
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING
|
||||||
"Flags used by the compiler during debug builds.")
|
"Flags used by the compiler during debug builds.")
|
||||||
SET (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING
|
set (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING
|
||||||
"Flags used by the compiler during release minsize builds.")
|
"Flags used by the compiler during release minsize builds.")
|
||||||
SET (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE_INIT}" CACHE STRING
|
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE_INIT}" CACHE STRING
|
||||||
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
|
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
|
||||||
SET (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
|
set (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
|
||||||
"Flags used by the compiler during Release with Debug Info builds.")
|
"Flags used by the compiler during Release with Debug Info builds.")
|
||||||
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||||
|
|
||||||
IF(CMAKE_C_STANDARD_LIBRARIES_INIT)
|
if(CMAKE_C_STANDARD_LIBRARIES_INIT)
|
||||||
SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}"
|
set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}"
|
||||||
CACHE STRING "Libraries linked by defalut with all C applications.")
|
CACHE STRING "Libraries linked by defalut with all C applications.")
|
||||||
MARK_AS_ADVANCED(CMAKE_C_STANDARD_LIBRARIES)
|
mark_as_advanced(CMAKE_C_STANDARD_LIBRARIES)
|
||||||
ENDIF(CMAKE_C_STANDARD_LIBRARIES_INIT)
|
endif(CMAKE_C_STANDARD_LIBRARIES_INIT)
|
||||||
|
|
||||||
INCLUDE(CMakeCommonLanguageInclude)
|
include(CMakeCommonLanguageInclude)
|
||||||
|
|
||||||
# now define the following rule variables
|
# now define the following rule variables
|
||||||
|
|
||||||
|
@ -162,58 +162,58 @@ INCLUDE(CMakeCommonLanguageInclude)
|
||||||
|
|
||||||
|
|
||||||
# create a C shared library
|
# create a C shared library
|
||||||
IF(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
|
if(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
|
||||||
SET(CMAKE_C_CREATE_SHARED_LIBRARY
|
set(CMAKE_C_CREATE_SHARED_LIBRARY
|
||||||
"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||||
ENDIF(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
|
endif(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
|
||||||
|
|
||||||
# create a C shared module just copy the shared library rule
|
# create a C shared module just copy the shared library rule
|
||||||
IF(NOT CMAKE_C_CREATE_SHARED_MODULE)
|
if(NOT CMAKE_C_CREATE_SHARED_MODULE)
|
||||||
SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
|
set(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY})
|
||||||
ENDIF(NOT CMAKE_C_CREATE_SHARED_MODULE)
|
endif(NOT CMAKE_C_CREATE_SHARED_MODULE)
|
||||||
|
|
||||||
# Create a static archive incrementally for large object file counts.
|
# Create a static archive incrementally for large object file counts.
|
||||||
# If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these.
|
# If CMAKE_C_CREATE_STATIC_LIBRARY is set it will override these.
|
||||||
IF(NOT DEFINED CMAKE_C_ARCHIVE_CREATE)
|
if(NOT DEFINED CMAKE_C_ARCHIVE_CREATE)
|
||||||
SET(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
set(CMAKE_C_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||||
ENDIF()
|
endif()
|
||||||
IF(NOT DEFINED CMAKE_C_ARCHIVE_APPEND)
|
if(NOT DEFINED CMAKE_C_ARCHIVE_APPEND)
|
||||||
SET(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
|
set(CMAKE_C_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||||
ENDIF()
|
endif()
|
||||||
IF(NOT DEFINED CMAKE_C_ARCHIVE_FINISH)
|
if(NOT DEFINED CMAKE_C_ARCHIVE_FINISH)
|
||||||
SET(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
|
set(CMAKE_C_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# compile a C file into an object file
|
# compile a C file into an object file
|
||||||
IF(NOT CMAKE_C_COMPILE_OBJECT)
|
if(NOT CMAKE_C_COMPILE_OBJECT)
|
||||||
SET(CMAKE_C_COMPILE_OBJECT
|
set(CMAKE_C_COMPILE_OBJECT
|
||||||
"<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
"<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
||||||
ENDIF(NOT CMAKE_C_COMPILE_OBJECT)
|
endif(NOT CMAKE_C_COMPILE_OBJECT)
|
||||||
|
|
||||||
IF(NOT CMAKE_C_LINK_EXECUTABLE)
|
if(NOT CMAKE_C_LINK_EXECUTABLE)
|
||||||
SET(CMAKE_C_LINK_EXECUTABLE
|
set(CMAKE_C_LINK_EXECUTABLE
|
||||||
"<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
"<CMAKE_C_COMPILER> <FLAGS> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||||
ENDIF(NOT CMAKE_C_LINK_EXECUTABLE)
|
endif(NOT CMAKE_C_LINK_EXECUTABLE)
|
||||||
|
|
||||||
IF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG)
|
if(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG)
|
||||||
SET(CMAKE_EXECUTABLE_RUNTIME_C_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
|
set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
|
||||||
ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG)
|
endif(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG)
|
||||||
|
|
||||||
IF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
|
if(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
|
||||||
SET(CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
|
set(CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
|
||||||
ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
|
endif(NOT CMAKE_EXECUTABLE_RUNTIME_C_FLAG_SEP)
|
||||||
|
|
||||||
IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
|
if(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
|
||||||
SET(CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
|
set(CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
|
||||||
ENDIF(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
|
endif(NOT CMAKE_EXECUTABLE_RPATH_LINK_C_FLAG)
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
mark_as_advanced(
|
||||||
CMAKE_C_FLAGS
|
CMAKE_C_FLAGS
|
||||||
CMAKE_C_FLAGS_DEBUG
|
CMAKE_C_FLAGS_DEBUG
|
||||||
CMAKE_C_FLAGS_MINSIZEREL
|
CMAKE_C_FLAGS_MINSIZEREL
|
||||||
CMAKE_C_FLAGS_RELEASE
|
CMAKE_C_FLAGS_RELEASE
|
||||||
CMAKE_C_FLAGS_RELWITHDEBINFO
|
CMAKE_C_FLAGS_RELWITHDEBINFO
|
||||||
)
|
)
|
||||||
SET(CMAKE_C_INFORMATION_LOADED 1)
|
set(CMAKE_C_INFORMATION_LOADED 1)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,54 +1,54 @@
|
||||||
SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
|
set(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
|
||||||
SET(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
|
set(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
|
||||||
SET(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
|
set(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
|
||||||
SET(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
|
set(CMAKE_CXX_COMPILER_VERSION "@CMAKE_CXX_COMPILER_VERSION@")
|
||||||
SET(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
|
set(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
|
||||||
@SET_MSVC_CXX_ARCHITECTURE_ID@
|
@SET_MSVC_CXX_ARCHITECTURE_ID@
|
||||||
SET(CMAKE_AR "@CMAKE_AR@")
|
set(CMAKE_AR "@CMAKE_AR@")
|
||||||
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
||||||
SET(CMAKE_LINKER "@CMAKE_LINKER@")
|
set(CMAKE_LINKER "@CMAKE_LINKER@")
|
||||||
SET(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
|
set(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
|
||||||
SET(CMAKE_CXX_COMPILER_LOADED 1)
|
set(CMAKE_CXX_COMPILER_LOADED 1)
|
||||||
SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
|
set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
|
||||||
SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
|
set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
|
||||||
IF(CMAKE_COMPILER_IS_CYGWIN)
|
if(CMAKE_COMPILER_IS_CYGWIN)
|
||||||
SET(CYGWIN 1)
|
set(CYGWIN 1)
|
||||||
SET(UNIX 1)
|
set(UNIX 1)
|
||||||
ENDIF(CMAKE_COMPILER_IS_CYGWIN)
|
endif(CMAKE_COMPILER_IS_CYGWIN)
|
||||||
|
|
||||||
SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
|
set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
|
||||||
|
|
||||||
IF(CMAKE_COMPILER_IS_MINGW)
|
if(CMAKE_COMPILER_IS_MINGW)
|
||||||
SET(MINGW 1)
|
set(MINGW 1)
|
||||||
ENDIF(CMAKE_COMPILER_IS_MINGW)
|
endif(CMAKE_COMPILER_IS_MINGW)
|
||||||
SET(CMAKE_CXX_COMPILER_ID_RUN 1)
|
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_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_SOURCE_FILE_EXTENSIONS C;M;c++;cc;cpp;cxx;m;mm;CPP)
|
||||||
SET(CMAKE_CXX_LINKER_PREFERENCE 30)
|
set(CMAKE_CXX_LINKER_PREFERENCE 30)
|
||||||
SET(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
|
set(CMAKE_CXX_LINKER_PREFERENCE_PROPAGATES 1)
|
||||||
|
|
||||||
# Save compiler ABI information.
|
# Save compiler ABI information.
|
||||||
SET(CMAKE_CXX_SIZEOF_DATA_PTR "@CMAKE_CXX_SIZEOF_DATA_PTR@")
|
set(CMAKE_CXX_SIZEOF_DATA_PTR "@CMAKE_CXX_SIZEOF_DATA_PTR@")
|
||||||
SET(CMAKE_CXX_COMPILER_ABI "@CMAKE_CXX_COMPILER_ABI@")
|
set(CMAKE_CXX_COMPILER_ABI "@CMAKE_CXX_COMPILER_ABI@")
|
||||||
SET(CMAKE_CXX_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
|
set(CMAKE_CXX_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
|
||||||
|
|
||||||
IF(CMAKE_CXX_SIZEOF_DATA_PTR)
|
if(CMAKE_CXX_SIZEOF_DATA_PTR)
|
||||||
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
|
set(CMAKE_SIZEOF_VOID_P "${CMAKE_CXX_SIZEOF_DATA_PTR}")
|
||||||
ENDIF(CMAKE_CXX_SIZEOF_DATA_PTR)
|
endif(CMAKE_CXX_SIZEOF_DATA_PTR)
|
||||||
|
|
||||||
IF(CMAKE_CXX_COMPILER_ABI)
|
if(CMAKE_CXX_COMPILER_ABI)
|
||||||
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
|
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_CXX_COMPILER_ABI}")
|
||||||
ENDIF(CMAKE_CXX_COMPILER_ABI)
|
endif(CMAKE_CXX_COMPILER_ABI)
|
||||||
|
|
||||||
IF(CMAKE_CXX_LIBRARY_ARCHITECTURE)
|
if(CMAKE_CXX_LIBRARY_ARCHITECTURE)
|
||||||
SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
|
set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_CXX_LIBRARY_ARCHITECTURE@")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
SET(CMAKE_CXX_HAS_ISYSROOT "@CMAKE_CXX_HAS_ISYSROOT@")
|
set(CMAKE_CXX_HAS_ISYSROOT "@CMAKE_CXX_HAS_ISYSROOT@")
|
||||||
@CMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
|
@CMAKE_CXX_OSX_DEPLOYMENT_TARGET_FLAG_CODE@
|
||||||
|
|
||||||
SET(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
|
set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "@CMAKE_CXX_IMPLICIT_LINK_LIBRARIES@")
|
||||||
SET(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
|
set(CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES "@CMAKE_CXX_IMPLICIT_LINK_DIRECTORIES@")
|
||||||
|
|
||||||
@SET_CMAKE_CMCLDEPS_EXECUTABLE@
|
@SET_CMAKE_CMCLDEPS_EXECUTABLE@
|
||||||
@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@
|
@SET_CMAKE_CL_SHOWINCLUDE_PREFIX@
|
||||||
|
|
|
@ -20,59 +20,59 @@
|
||||||
|
|
||||||
# some compilers use different extensions (e.g. sdcc uses .rel)
|
# some compilers use different extensions (e.g. sdcc uses .rel)
|
||||||
# so set the extension here first so it can be overridden by the compiler specific file
|
# so set the extension here first so it can be overridden by the compiler specific file
|
||||||
IF(UNIX)
|
if(UNIX)
|
||||||
SET(CMAKE_CXX_OUTPUT_EXTENSION .o)
|
set(CMAKE_CXX_OUTPUT_EXTENSION .o)
|
||||||
ELSE(UNIX)
|
else(UNIX)
|
||||||
SET(CMAKE_CXX_OUTPUT_EXTENSION .obj)
|
set(CMAKE_CXX_OUTPUT_EXTENSION .obj)
|
||||||
ENDIF(UNIX)
|
endif(UNIX)
|
||||||
|
|
||||||
SET(_INCLUDED_FILE 0)
|
set(_INCLUDED_FILE 0)
|
||||||
|
|
||||||
# Load compiler-specific information.
|
# Load compiler-specific information.
|
||||||
IF(CMAKE_CXX_COMPILER_ID)
|
if(CMAKE_CXX_COMPILER_ID)
|
||||||
INCLUDE(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL)
|
include(Compiler/${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL)
|
||||||
ENDIF(CMAKE_CXX_COMPILER_ID)
|
endif(CMAKE_CXX_COMPILER_ID)
|
||||||
|
|
||||||
SET(CMAKE_BASE_NAME)
|
set(CMAKE_BASE_NAME)
|
||||||
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
|
get_filename_component(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE)
|
||||||
# since the gnu compiler has several names force g++
|
# since the gnu compiler has several names force g++
|
||||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
SET(CMAKE_BASE_NAME g++)
|
set(CMAKE_BASE_NAME g++)
|
||||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
endif(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
||||||
|
|
||||||
# load a hardware specific file, mostly useful for embedded compilers
|
# load a hardware specific file, mostly useful for embedded compilers
|
||||||
IF(CMAKE_SYSTEM_PROCESSOR)
|
if(CMAKE_SYSTEM_PROCESSOR)
|
||||||
IF(CMAKE_CXX_COMPILER_ID)
|
if(CMAKE_CXX_COMPILER_ID)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||||
ENDIF(CMAKE_CXX_COMPILER_ID)
|
endif(CMAKE_CXX_COMPILER_ID)
|
||||||
IF (NOT _INCLUDED_FILE)
|
if (NOT _INCLUDED_FILE)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}-${CMAKE_SYSTEM_PROCESSOR} OPTIONAL)
|
||||||
ENDIF (NOT _INCLUDED_FILE)
|
endif (NOT _INCLUDED_FILE)
|
||||||
ENDIF(CMAKE_SYSTEM_PROCESSOR)
|
endif(CMAKE_SYSTEM_PROCESSOR)
|
||||||
|
|
||||||
# load the system- and compiler specific files
|
# load the system- and compiler specific files
|
||||||
IF(CMAKE_CXX_COMPILER_ID)
|
if(CMAKE_CXX_COMPILER_ID)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_CXX_COMPILER_ID}-CXX OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||||
ENDIF(CMAKE_CXX_COMPILER_ID)
|
endif(CMAKE_CXX_COMPILER_ID)
|
||||||
IF (NOT _INCLUDED_FILE)
|
if (NOT _INCLUDED_FILE)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
|
||||||
RESULT_VARIABLE _INCLUDED_FILE)
|
RESULT_VARIABLE _INCLUDED_FILE)
|
||||||
ENDIF (NOT _INCLUDED_FILE)
|
endif (NOT _INCLUDED_FILE)
|
||||||
# We specify the compiler information in the system file for some
|
# We specify the compiler information in the system file for some
|
||||||
# platforms, but this language may not have been enabled when the file
|
# platforms, but this language may not have been enabled when the file
|
||||||
# was first included. Include it again to get the language info.
|
# was first included. Include it again to get the language info.
|
||||||
# Remove this when all compiler info is removed from system files.
|
# Remove this when all compiler info is removed from system files.
|
||||||
IF (NOT _INCLUDED_FILE)
|
if (NOT _INCLUDED_FILE)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
|
include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
|
||||||
ENDIF (NOT _INCLUDED_FILE)
|
endif (NOT _INCLUDED_FILE)
|
||||||
|
|
||||||
IF(CMAKE_CXX_SIZEOF_DATA_PTR)
|
if(CMAKE_CXX_SIZEOF_DATA_PTR)
|
||||||
FOREACH(f ${CMAKE_CXX_ABI_FILES})
|
foreach(f ${CMAKE_CXX_ABI_FILES})
|
||||||
INCLUDE(${f})
|
include(${f})
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
UNSET(CMAKE_CXX_ABI_FILES)
|
unset(CMAKE_CXX_ABI_FILES)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# This should be included before the _INIT variables are
|
# This should be included before the _INIT variables are
|
||||||
# used to initialize the cache. Since the rule variables
|
# used to initialize the cache. Since the rule variables
|
||||||
|
@ -80,150 +80,150 @@ ENDIF()
|
||||||
# But, it should still be after the platform file so changes can
|
# But, it should still be after the platform file so changes can
|
||||||
# be made to those values.
|
# be made to those values.
|
||||||
|
|
||||||
IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
if(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
||||||
# Save the full path of the file so try_compile can use it.
|
# Save the full path of the file so try_compile can use it.
|
||||||
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
|
include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
|
||||||
SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
|
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
|
if(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX)
|
||||||
# Save the full path of the file so try_compile can use it.
|
# Save the full path of the file so try_compile can use it.
|
||||||
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} RESULT_VARIABLE _override)
|
include(${CMAKE_USER_MAKE_RULES_OVERRIDE_CXX} RESULT_VARIABLE _override)
|
||||||
SET(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX "${_override}")
|
set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX "${_override}")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Create a set of shared library variable specific to C++
|
# Create a set of shared library variable specific to C++
|
||||||
# For 90% of the systems, these are the same flags as the C versions
|
# For 90% of the systems, these are the same flags as the C versions
|
||||||
# so if these are not set just copy the flags from the c version
|
# so if these are not set just copy the flags from the c version
|
||||||
IF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
|
if(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
|
||||||
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
|
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
|
||||||
ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
|
endif(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
|
||||||
|
|
||||||
IF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
|
if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
|
||||||
SET(CMAKE_CXX_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
|
set(CMAKE_CXX_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
|
||||||
ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
|
endif(NOT CMAKE_CXX_COMPILE_OPTIONS_PIC)
|
||||||
|
|
||||||
IF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
|
if(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
|
||||||
SET(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
|
set(CMAKE_CXX_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
|
||||||
ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
|
endif(NOT CMAKE_CXX_COMPILE_OPTIONS_PIE)
|
||||||
|
|
||||||
IF(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
|
if(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
|
||||||
SET(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
|
set(CMAKE_CXX_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
|
||||||
ENDIF(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
|
endif(NOT CMAKE_CXX_COMPILE_OPTIONS_DLL)
|
||||||
|
|
||||||
IF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
|
if(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
|
||||||
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
|
set(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
|
||||||
ENDIF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
|
endif(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS)
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
|
if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
|
||||||
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
|
set(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
|
||||||
ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
|
endif(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS)
|
||||||
|
|
||||||
IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
|
if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
|
||||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
|
set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
|
||||||
ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
|
endif(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG)
|
||||||
|
|
||||||
IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
|
if(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
|
||||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
|
set(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
|
||||||
ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
|
endif(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP)
|
||||||
|
|
||||||
IF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
|
if(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
|
||||||
SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
|
set(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
|
||||||
ENDIF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
|
endif(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_EXE_EXPORTS_CXX_FLAG)
|
if(NOT DEFINED CMAKE_EXE_EXPORTS_CXX_FLAG)
|
||||||
SET(CMAKE_EXE_EXPORTS_CXX_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
|
set(CMAKE_EXE_EXPORTS_CXX_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG)
|
if(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG)
|
||||||
SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
|
set(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
|
if(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
|
||||||
SET(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG})
|
set(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG})
|
||||||
ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
|
endif(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
|
||||||
|
|
||||||
IF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
|
if(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
|
||||||
SET(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP})
|
set(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP})
|
||||||
ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
|
endif(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG_SEP)
|
||||||
|
|
||||||
IF(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
|
if(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
|
||||||
SET(CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG})
|
set(CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG})
|
||||||
ENDIF(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
|
endif(NOT CMAKE_EXECUTABLE_RPATH_LINK_CXX_FLAG)
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
|
if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
|
||||||
SET(CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
|
set(CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
|
||||||
ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
|
endif(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_CXX_WITH_RUNTIME_PATH)
|
||||||
|
|
||||||
IF(NOT CMAKE_INCLUDE_FLAG_CXX)
|
if(NOT CMAKE_INCLUDE_FLAG_CXX)
|
||||||
SET(CMAKE_INCLUDE_FLAG_CXX ${CMAKE_INCLUDE_FLAG_C})
|
set(CMAKE_INCLUDE_FLAG_CXX ${CMAKE_INCLUDE_FLAG_C})
|
||||||
ENDIF(NOT CMAKE_INCLUDE_FLAG_CXX)
|
endif(NOT CMAKE_INCLUDE_FLAG_CXX)
|
||||||
|
|
||||||
IF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
|
if(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
|
||||||
SET(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C})
|
set(CMAKE_INCLUDE_FLAG_SEP_CXX ${CMAKE_INCLUDE_FLAG_SEP_C})
|
||||||
ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
|
endif(NOT CMAKE_INCLUDE_FLAG_SEP_CXX)
|
||||||
|
|
||||||
# for most systems a module is the same as a shared library
|
# for most systems a module is the same as a shared library
|
||||||
# so unless the variable CMAKE_MODULE_EXISTS is set just
|
# so unless the variable CMAKE_MODULE_EXISTS is set just
|
||||||
# copy the values from the LIBRARY variables
|
# copy the values from the LIBRARY variables
|
||||||
IF(NOT CMAKE_MODULE_EXISTS)
|
if(NOT CMAKE_MODULE_EXISTS)
|
||||||
SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
|
set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS})
|
||||||
SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
|
set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS})
|
||||||
ENDIF(NOT CMAKE_MODULE_EXISTS)
|
endif(NOT CMAKE_MODULE_EXISTS)
|
||||||
|
|
||||||
# repeat for modules
|
# repeat for modules
|
||||||
IF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
|
if(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
|
||||||
SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
|
set(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
|
||||||
ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
|
endif(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS)
|
||||||
|
|
||||||
IF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
|
if(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
|
||||||
SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
|
set(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
|
||||||
ENDIF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
|
endif(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
|
||||||
|
|
||||||
# Initialize CXX link type selection flags from C versions.
|
# Initialize CXX link type selection flags from C versions.
|
||||||
FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
|
foreach(type SHARED_LIBRARY SHARED_MODULE EXE)
|
||||||
IF(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
|
if(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
|
||||||
SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS
|
set(CMAKE_${type}_LINK_STATIC_CXX_FLAGS
|
||||||
${CMAKE_${type}_LINK_STATIC_C_FLAGS})
|
${CMAKE_${type}_LINK_STATIC_C_FLAGS})
|
||||||
ENDIF(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
|
endif(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
|
||||||
IF(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
|
if(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
|
||||||
SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS
|
set(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS
|
||||||
${CMAKE_${type}_LINK_DYNAMIC_C_FLAGS})
|
${CMAKE_${type}_LINK_DYNAMIC_C_FLAGS})
|
||||||
ENDIF(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
|
endif(NOT CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS)
|
||||||
ENDFOREACH(type)
|
endforeach(type)
|
||||||
|
|
||||||
# add the flags to the cache based
|
# add the flags to the cache based
|
||||||
# on the initial values computed in the platform/*.cmake files
|
# on the initial values computed in the platform/*.cmake files
|
||||||
# use _INIT variables so that this only happens the first time
|
# use _INIT variables so that this only happens the first time
|
||||||
# and you can set these flags in the cmake cache
|
# and you can set these flags in the cmake cache
|
||||||
SET(CMAKE_CXX_FLAGS_INIT "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}")
|
set(CMAKE_CXX_FLAGS_INIT "$ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}")
|
||||||
# avoid just having a space as the initial value for the cache
|
# avoid just having a space as the initial value for the cache
|
||||||
IF(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
|
if(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
|
||||||
SET(CMAKE_CXX_FLAGS_INIT)
|
set(CMAKE_CXX_FLAGS_INIT)
|
||||||
ENDIF(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
|
endif(CMAKE_CXX_FLAGS_INIT STREQUAL " ")
|
||||||
SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING
|
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_INIT}" CACHE STRING
|
||||||
"Flags used by the compiler during all build types.")
|
"Flags used by the compiler during all build types.")
|
||||||
|
|
||||||
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||||
SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG_INIT}" CACHE STRING
|
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG_INIT}" CACHE STRING
|
||||||
"Flags used by the compiler during debug builds.")
|
"Flags used by the compiler during debug builds.")
|
||||||
SET (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" CACHE STRING
|
set (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" CACHE STRING
|
||||||
"Flags used by the compiler during release minsize builds.")
|
"Flags used by the compiler during release minsize builds.")
|
||||||
SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE_INIT}" CACHE STRING
|
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE_INIT}" CACHE STRING
|
||||||
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
|
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
|
||||||
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
|
set (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
|
||||||
"Flags used by the compiler during Release with Debug Info builds.")
|
"Flags used by the compiler during Release with Debug Info builds.")
|
||||||
|
|
||||||
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||||
|
|
||||||
IF(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
|
if(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
|
||||||
SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}"
|
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}"
|
||||||
CACHE STRING "Libraries linked by defalut with all C++ applications.")
|
CACHE STRING "Libraries linked by defalut with all C++ applications.")
|
||||||
MARK_AS_ADVANCED(CMAKE_CXX_STANDARD_LIBRARIES)
|
mark_as_advanced(CMAKE_CXX_STANDARD_LIBRARIES)
|
||||||
ENDIF(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
|
endif(CMAKE_CXX_STANDARD_LIBRARIES_INIT)
|
||||||
|
|
||||||
INCLUDE(CMakeCommonLanguageInclude)
|
include(CMakeCommonLanguageInclude)
|
||||||
|
|
||||||
# now define the following rules:
|
# now define the following rules:
|
||||||
# CMAKE_CXX_CREATE_SHARED_LIBRARY
|
# CMAKE_CXX_CREATE_SHARED_LIBRARY
|
||||||
|
@ -252,41 +252,41 @@ INCLUDE(CMakeCommonLanguageInclude)
|
||||||
|
|
||||||
|
|
||||||
# create a shared C++ library
|
# create a shared C++ library
|
||||||
IF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
|
if(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
|
||||||
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
|
set(CMAKE_CXX_CREATE_SHARED_LIBRARY
|
||||||
"<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
"<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||||
ENDIF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
|
endif(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
|
||||||
|
|
||||||
# create a c++ shared module copy the shared library rule by default
|
# create a c++ shared module copy the shared library rule by default
|
||||||
IF(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
|
if(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
|
||||||
SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
|
set(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
|
||||||
ENDIF(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
|
endif(NOT CMAKE_CXX_CREATE_SHARED_MODULE)
|
||||||
|
|
||||||
|
|
||||||
# Create a static archive incrementally for large object file counts.
|
# Create a static archive incrementally for large object file counts.
|
||||||
# If CMAKE_CXX_CREATE_STATIC_LIBRARY is set it will override these.
|
# If CMAKE_CXX_CREATE_STATIC_LIBRARY is set it will override these.
|
||||||
IF(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE)
|
if(NOT DEFINED CMAKE_CXX_ARCHIVE_CREATE)
|
||||||
SET(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
set(CMAKE_CXX_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||||
ENDIF()
|
endif()
|
||||||
IF(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND)
|
if(NOT DEFINED CMAKE_CXX_ARCHIVE_APPEND)
|
||||||
SET(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
|
set(CMAKE_CXX_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||||
ENDIF()
|
endif()
|
||||||
IF(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH)
|
if(NOT DEFINED CMAKE_CXX_ARCHIVE_FINISH)
|
||||||
SET(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
|
set(CMAKE_CXX_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# compile a C++ file into an object file
|
# compile a C++ file into an object file
|
||||||
IF(NOT CMAKE_CXX_COMPILE_OBJECT)
|
if(NOT CMAKE_CXX_COMPILE_OBJECT)
|
||||||
SET(CMAKE_CXX_COMPILE_OBJECT
|
set(CMAKE_CXX_COMPILE_OBJECT
|
||||||
"<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
"<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -o <OBJECT> -c <SOURCE>")
|
||||||
ENDIF(NOT CMAKE_CXX_COMPILE_OBJECT)
|
endif(NOT CMAKE_CXX_COMPILE_OBJECT)
|
||||||
|
|
||||||
IF(NOT CMAKE_CXX_LINK_EXECUTABLE)
|
if(NOT CMAKE_CXX_LINK_EXECUTABLE)
|
||||||
SET(CMAKE_CXX_LINK_EXECUTABLE
|
set(CMAKE_CXX_LINK_EXECUTABLE
|
||||||
"<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
"<CMAKE_CXX_COMPILER> <FLAGS> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||||
ENDIF(NOT CMAKE_CXX_LINK_EXECUTABLE)
|
endif(NOT CMAKE_CXX_LINK_EXECUTABLE)
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
mark_as_advanced(
|
||||||
CMAKE_BUILD_TOOL
|
CMAKE_BUILD_TOOL
|
||||||
CMAKE_VERBOSE_MAKEFILE
|
CMAKE_VERBOSE_MAKEFILE
|
||||||
CMAKE_CXX_FLAGS
|
CMAKE_CXX_FLAGS
|
||||||
|
@ -295,5 +295,5 @@ CMAKE_CXX_FLAGS_RELWITHDEBINFO
|
||||||
CMAKE_CXX_FLAGS_MINSIZEREL
|
CMAKE_CXX_FLAGS_MINSIZEREL
|
||||||
CMAKE_CXX_FLAGS_DEBUG)
|
CMAKE_CXX_FLAGS_DEBUG)
|
||||||
|
|
||||||
SET(CMAKE_CXX_INFORMATION_LOADED 1)
|
set(CMAKE_CXX_INFORMATION_LOADED 1)
|
||||||
|
|
||||||
|
|
|
@ -20,18 +20,18 @@
|
||||||
# in front of each include path, so it can remove it.
|
# in front of each include path, so it can remove it.
|
||||||
#
|
#
|
||||||
|
|
||||||
IF(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND)
|
if(MSVC_C_ARCHITECTURE_ID AND CMAKE_GENERATOR MATCHES "Ninja" AND CMAKE_C_COMPILER AND CMAKE_COMMAND)
|
||||||
STRING(REPLACE "cmake.exe" "cmcldeps.exe" CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND})
|
string(REPLACE "cmake.exe" "cmcldeps.exe" CMAKE_CMCLDEPS_EXECUTABLE ${CMAKE_COMMAND})
|
||||||
SET(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
|
set(showdir ${CMAKE_BINARY_DIR}/CMakeFiles/ShowIncludes)
|
||||||
FILE(WRITE ${showdir}/foo.h "\n")
|
file(WRITE ${showdir}/foo.h "\n")
|
||||||
FILE(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
|
file(WRITE ${showdir}/main.c "#include \"foo.h\" \nint main(){}\n")
|
||||||
EXECUTE_PROCESS(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
|
execute_process(COMMAND ${CMAKE_C_COMPILER} /nologo /showIncludes ${showdir}/main.c
|
||||||
WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE showOut)
|
WORKING_DIRECTORY ${showdir} OUTPUT_VARIABLE showOut)
|
||||||
STRING(REPLACE main.c "" showOut1 ${showOut})
|
string(REPLACE main.c "" showOut1 ${showOut})
|
||||||
STRING(REPLACE "/" "\\" header1 ${showdir}/foo.h)
|
string(REPLACE "/" "\\" header1 ${showdir}/foo.h)
|
||||||
STRING(TOLOWER ${header1} header2)
|
string(TOLOWER ${header1} header2)
|
||||||
STRING(REPLACE ${header2} "" showOut2 ${showOut1})
|
string(REPLACE ${header2} "" showOut2 ${showOut1})
|
||||||
STRING(REPLACE "\n" "" showOut3 ${showOut2})
|
string(REPLACE "\n" "" showOut3 ${showOut2})
|
||||||
SET(SET_CMAKE_CMCLDEPS_EXECUTABLE "SET(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
|
set(SET_CMAKE_CMCLDEPS_EXECUTABLE "set(CMAKE_CMCLDEPS_EXECUTABLE \"${CMAKE_CMCLDEPS_EXECUTABLE}\")")
|
||||||
SET(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "SET(CMAKE_CL_SHOWINCLUDE_PREFIX \"${showOut3}\")")
|
set(SET_CMAKE_CL_SHOWINCLUDE_PREFIX "set(CMAKE_CL_SHOWINCLUDE_PREFIX \"${showOut3}\")")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
|
@ -16,72 +16,72 @@
|
||||||
# cache values that can be initialized in the platform-compiler.cmake file
|
# cache values that can be initialized in the platform-compiler.cmake file
|
||||||
# it may be included by more than one language.
|
# it may be included by more than one language.
|
||||||
|
|
||||||
SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
|
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
|
||||||
CACHE STRING "Flags used by the linker.")
|
CACHE STRING "Flags used by the linker.")
|
||||||
|
|
||||||
|
|
||||||
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||||
# default build type is none
|
# default build type is none
|
||||||
IF(NOT CMAKE_NO_BUILD_TYPE)
|
if(NOT CMAKE_NO_BUILD_TYPE)
|
||||||
SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
|
set (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING
|
||||||
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
|
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
|
||||||
ENDIF(NOT CMAKE_NO_BUILD_TYPE)
|
endif(NOT CMAKE_NO_BUILD_TYPE)
|
||||||
|
|
||||||
SET (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
|
set (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
|
||||||
"Flags used by the linker during debug builds.")
|
"Flags used by the linker during debug builds.")
|
||||||
|
|
||||||
SET (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT} CACHE STRING
|
set (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT} CACHE STRING
|
||||||
"Flags used by the linker during release minsize builds.")
|
"Flags used by the linker during release minsize builds.")
|
||||||
|
|
||||||
SET (CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
|
set (CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
|
||||||
"Flags used by the linker during release builds.")
|
"Flags used by the linker during release builds.")
|
||||||
|
|
||||||
SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
|
set (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
|
||||||
${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
|
${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
|
||||||
"Flags used by the linker during Release with Debug Info builds.")
|
"Flags used by the linker during Release with Debug Info builds.")
|
||||||
|
|
||||||
SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
|
set (CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
|
||||||
"Flags used by the linker during debug builds.")
|
"Flags used by the linker during debug builds.")
|
||||||
|
|
||||||
SET (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL ${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT}
|
set (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL ${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT}
|
||||||
CACHE STRING
|
CACHE STRING
|
||||||
"Flags used by the linker during release minsize builds.")
|
"Flags used by the linker during release minsize builds.")
|
||||||
|
|
||||||
SET (CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
|
set (CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
|
||||||
"Flags used by the linker during release builds.")
|
"Flags used by the linker during release builds.")
|
||||||
|
|
||||||
SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
|
set (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
|
||||||
${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
|
${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
|
||||||
"Flags used by the linker during Release with Debug Info builds.")
|
"Flags used by the linker during Release with Debug Info builds.")
|
||||||
|
|
||||||
SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG ${CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
|
set (CMAKE_MODULE_LINKER_FLAGS_DEBUG ${CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING
|
||||||
"Flags used by the linker during debug builds.")
|
"Flags used by the linker during debug builds.")
|
||||||
|
|
||||||
SET (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL ${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT}
|
set (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL ${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT}
|
||||||
CACHE STRING
|
CACHE STRING
|
||||||
"Flags used by the linker during release minsize builds.")
|
"Flags used by the linker during release minsize builds.")
|
||||||
|
|
||||||
SET (CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
|
set (CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} CACHE STRING
|
||||||
"Flags used by the linker during release builds.")
|
"Flags used by the linker during release builds.")
|
||||||
|
|
||||||
SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
|
set (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
|
||||||
${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
|
${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING
|
||||||
"Flags used by the linker during Release with Debug Info builds.")
|
"Flags used by the linker during Release with Debug Info builds.")
|
||||||
|
|
||||||
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||||
# shared linker flags
|
# shared linker flags
|
||||||
SET (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
|
set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
|
||||||
CACHE STRING "Flags used by the linker during the creation of dll's.")
|
CACHE STRING "Flags used by the linker during the creation of dll's.")
|
||||||
|
|
||||||
# module linker flags
|
# module linker flags
|
||||||
SET (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
|
set (CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS}"
|
||||||
CACHE STRING "Flags used by the linker during the creation of modules.")
|
CACHE STRING "Flags used by the linker during the creation of modules.")
|
||||||
|
|
||||||
SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
|
set(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL
|
||||||
"What is the target build tool cmake is generating for.")
|
"What is the target build tool cmake is generating for.")
|
||||||
|
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
mark_as_advanced(
|
||||||
CMAKE_BUILD_TOOL
|
CMAKE_BUILD_TOOL
|
||||||
CMAKE_VERBOSE_MAKEFILE
|
CMAKE_VERBOSE_MAKEFILE
|
||||||
|
|
||||||
|
|
|
@ -25,27 +25,27 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
MACRO(CMAKE_DEPENDENT_OPTION option doc default depends force)
|
macro(CMAKE_DEPENDENT_OPTION option doc default depends force)
|
||||||
IF(${option}_ISSET MATCHES "^${option}_ISSET$")
|
if(${option}_ISSET MATCHES "^${option}_ISSET$")
|
||||||
SET(${option}_AVAILABLE 1)
|
set(${option}_AVAILABLE 1)
|
||||||
FOREACH(d ${depends})
|
foreach(d ${depends})
|
||||||
STRING(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
|
string(REGEX REPLACE " +" ";" CMAKE_DEPENDENT_OPTION_DEP "${d}")
|
||||||
IF(${CMAKE_DEPENDENT_OPTION_DEP})
|
if(${CMAKE_DEPENDENT_OPTION_DEP})
|
||||||
ELSE(${CMAKE_DEPENDENT_OPTION_DEP})
|
else(${CMAKE_DEPENDENT_OPTION_DEP})
|
||||||
SET(${option}_AVAILABLE 0)
|
set(${option}_AVAILABLE 0)
|
||||||
ENDIF(${CMAKE_DEPENDENT_OPTION_DEP})
|
endif(${CMAKE_DEPENDENT_OPTION_DEP})
|
||||||
ENDFOREACH(d)
|
endforeach(d)
|
||||||
IF(${option}_AVAILABLE)
|
if(${option}_AVAILABLE)
|
||||||
OPTION(${option} "${doc}" "${default}")
|
option(${option} "${doc}" "${default}")
|
||||||
SET(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
|
set(${option} "${${option}}" CACHE BOOL "${doc}" FORCE)
|
||||||
ELSE(${option}_AVAILABLE)
|
else(${option}_AVAILABLE)
|
||||||
IF(${option} MATCHES "^${option}$")
|
if(${option} MATCHES "^${option}$")
|
||||||
ELSE(${option} MATCHES "^${option}$")
|
else(${option} MATCHES "^${option}$")
|
||||||
SET(${option} "${${option}}" CACHE INTERNAL "${doc}")
|
set(${option} "${${option}}" CACHE INTERNAL "${doc}")
|
||||||
ENDIF(${option} MATCHES "^${option}$")
|
endif(${option} MATCHES "^${option}$")
|
||||||
SET(${option} ${force})
|
set(${option} ${force})
|
||||||
ENDIF(${option}_AVAILABLE)
|
endif(${option}_AVAILABLE)
|
||||||
ELSE(${option}_ISSET MATCHES "^${option}_ISSET$")
|
else(${option}_ISSET MATCHES "^${option}_ISSET$")
|
||||||
SET(${option} "${${option}_ISSET}")
|
set(${option} "${${option}_ISSET}")
|
||||||
ENDIF(${option}_ISSET MATCHES "^${option}_ISSET$")
|
endif(${option}_ISSET MATCHES "^${option}_ISSET$")
|
||||||
ENDMACRO(CMAKE_DEPENDENT_OPTION)
|
endmacro(CMAKE_DEPENDENT_OPTION)
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
# determine the compiler to use for ASM using AT&T syntax, e.g. GNU as
|
# determine the compiler to use for ASM using AT&T syntax, e.g. GNU as
|
||||||
|
|
||||||
SET(ASM_DIALECT "-ATT")
|
set(ASM_DIALECT "-ATT")
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ${_CMAKE_TOOLCHAIN_PREFIX}gas ${_CMAKE_TOOLCHAIN_PREFIX}as)
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ${_CMAKE_TOOLCHAIN_PREFIX}gas ${_CMAKE_TOOLCHAIN_PREFIX}as)
|
||||||
INCLUDE(CMakeDetermineASMCompiler)
|
include(CMakeDetermineASMCompiler)
|
||||||
SET(ASM_DIALECT)
|
set(ASM_DIALECT)
|
||||||
|
|
|
@ -14,40 +14,40 @@
|
||||||
|
|
||||||
# determine the compiler to use for ASM programs
|
# 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
|
# prefer the environment variable ASM
|
||||||
IF($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
|
if($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT "$ENV{ASM${ASM_DIALECT}}")
|
||||||
ENDIF($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
|
endif($ENV{ASM${ASM_DIALECT}} MATCHES ".+")
|
||||||
|
|
||||||
# finally list compilers to try
|
# finally list compilers to try
|
||||||
IF("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
|
if("ASM${ASM_DIALECT}" STREQUAL "ASM") # the generic assembler support
|
||||||
IF(NOT CMAKE_ASM_COMPILER_INIT)
|
if(NOT CMAKE_ASM_COMPILER_INIT)
|
||||||
IF(CMAKE_C_COMPILER)
|
if(CMAKE_C_COMPILER)
|
||||||
SET(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "The ASM compiler")
|
set(CMAKE_ASM_COMPILER "${CMAKE_C_COMPILER}" CACHE FILEPATH "The ASM compiler")
|
||||||
SET(CMAKE_ASM_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
|
set(CMAKE_ASM_COMPILER_ID "${CMAKE_C_COMPILER_ID}")
|
||||||
ELSEIF(CMAKE_CXX_COMPILER)
|
elseif(CMAKE_CXX_COMPILER)
|
||||||
SET(CMAKE_ASM_COMPILER "${CMAKE_CXX_COMPILER}" CACHE FILEPATH "The ASM compiler")
|
set(CMAKE_ASM_COMPILER "${CMAKE_CXX_COMPILER}" CACHE FILEPATH "The ASM compiler")
|
||||||
SET(CMAKE_ASM_COMPILER_ID "${CMAKE_CXX_COMPILER_ID}")
|
set(CMAKE_ASM_COMPILER_ID "${CMAKE_CXX_COMPILER_ID}")
|
||||||
ELSE()
|
else()
|
||||||
# List all default C and CXX compilers
|
# 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
|
${_CMAKE_TOOLCHAIN_PREFIX}cc ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc
|
||||||
CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ aCC cl bcc xlC)
|
CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ aCC cl bcc xlC)
|
||||||
ENDIF()
|
endif()
|
||||||
ENDIF()
|
endif()
|
||||||
ELSE() # some specific assembler "dialect"
|
else() # some specific assembler "dialect"
|
||||||
IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
|
if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT)
|
||||||
MESSAGE(FATAL_ERROR "CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT must be preset !")
|
message(FATAL_ERROR "CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT must be preset !")
|
||||||
ENDIF()
|
endif()
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# Find the compiler.
|
# Find the compiler.
|
||||||
_cmake_find_compiler(ASM${ASM_DIALECT})
|
_cmake_find_compiler(ASM${ASM_DIALECT})
|
||||||
|
|
||||||
ELSE(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
else(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
||||||
|
|
||||||
# we only get here if CMAKE_ASM${ASM_DIALECT}_COMPILER was specified using -D or a pre-made CMakeCache.txt
|
# we only get here if CMAKE_ASM${ASM_DIALECT}_COMPILER was specified using -D or a pre-made CMakeCache.txt
|
||||||
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
|
# (e.g. via ctest) or set in CMAKE_TOOLCHAIN_FILE
|
||||||
|
@ -56,63 +56,63 @@ ELSE(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
||||||
# now try to find it with the full path
|
# now try to find it with the full path
|
||||||
# if it is found, force it into the cache,
|
# if it is found, force it into the cache,
|
||||||
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
|
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
|
||||||
GET_FILENAME_COMPONENT(_CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
|
get_filename_component(_CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
|
||||||
IF(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH)
|
if(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH)
|
||||||
FIND_PROGRAM(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER})
|
find_program(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH NAMES ${CMAKE_ASM${ASM_DIALECT}_COMPILER})
|
||||||
MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
|
mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
|
||||||
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
|
if(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER ${CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH} CACHE FILEPATH "Assembler" FORCE)
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER ${CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH} CACHE FILEPATH "Assembler" FORCE)
|
||||||
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
|
endif(CMAKE_ASM${ASM_DIALECT}_COMPILER_WITH_PATH)
|
||||||
ENDIF(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH)
|
endif(NOT _CMAKE_USER_ASM${ASM_DIALECT}_COMPILER_PATH)
|
||||||
ENDIF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
endif(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
||||||
MARK_AS_ADVANCED(CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
mark_as_advanced(CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
||||||
|
|
||||||
IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
if (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
||||||
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
|
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" PATH)
|
||||||
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
endif (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
||||||
|
|
||||||
|
|
||||||
IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||||
|
|
||||||
# Table of per-vendor compiler id flags with expected output.
|
# Table of per-vendor compiler id flags with expected output.
|
||||||
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS GNU )
|
list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS GNU )
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_GNU "--version")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_GNU "--version")
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_GNU "(GNU assembler)|(GCC)|(Free Software Foundation)")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_GNU "(GNU assembler)|(GCC)|(Free Software Foundation)")
|
||||||
|
|
||||||
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS HP )
|
list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS HP )
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_HP "-V")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_HP "-V")
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_HP "HP C")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_HP "HP C")
|
||||||
|
|
||||||
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS Intel )
|
list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS Intel )
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Intel "--version")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_Intel "--version")
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Intel "(ICC)")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_Intel "(ICC)")
|
||||||
|
|
||||||
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS SunPro )
|
list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS SunPro )
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_SunPro "-V")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_SunPro "-V")
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_SunPro "Sun C")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_SunPro "Sun C")
|
||||||
|
|
||||||
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS XL )
|
list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS XL )
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_XL "-qversion")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_XL "-qversion")
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_XL "XL C")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_XL "XL C")
|
||||||
|
|
||||||
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS MSVC )
|
list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS MSVC )
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_MSVC "/?")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_MSVC "/?")
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_MSVC "Microsoft")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_MSVC "Microsoft")
|
||||||
|
|
||||||
LIST(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI_DSP )
|
list(APPEND CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDORS TI_DSP )
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI_DSP "-h")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_FLAGS_TI_DSP "-h")
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI_DSP "Texas Instruments")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID_VENDOR_REGEX_TI_DSP "Texas Instruments")
|
||||||
|
|
||||||
INCLUDE(CMakeDetermineCompilerId)
|
include(CMakeDetermineCompilerId)
|
||||||
CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})
|
CMAKE_DETERMINE_COMPILER_ID_VENDOR(ASM${ASM_DIALECT})
|
||||||
|
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
if(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||||
MESSAGE(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
|
message(STATUS "The ASM${ASM_DIALECT} compiler identification is ${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
|
||||||
ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
else(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||||
MESSAGE(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
|
message(STATUS "The ASM${ASM_DIALECT} compiler identification is unknown")
|
||||||
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
endif(CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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
|
# NAME_WE cannot be used since then this test will fail for names lile
|
||||||
# "arm-unknown-nto-qnx6.3.0-gas.exe", where BASENAME would be
|
# "arm-unknown-nto-qnx6.3.0-gas.exe", where BASENAME would be
|
||||||
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
|
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
|
||||||
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
if (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME)
|
get_filename_component(COMPILER_BASENAME "${CMAKE_ASM${ASM_DIALECT}_COMPILER}" NAME)
|
||||||
IF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
if (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||||
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
||||||
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
endif (COMPILER_BASENAME MATCHES "^(.+-)g?as(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||||
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
endif (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
|
|
||||||
# Now try the C compiler regexp:
|
# Now try the C compiler regexp:
|
||||||
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
if (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||||
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
||||||
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
endif (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||||
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
endif (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
|
|
||||||
# Finally try the CXX compiler regexp:
|
# Finally try the CXX compiler regexp:
|
||||||
IF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
if (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||||
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
||||||
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
endif (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||||
ENDIF (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
endif (NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
|
|
||||||
|
|
||||||
INCLUDE(CMakeFindBinUtils)
|
include(CMakeFindBinUtils)
|
||||||
|
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR "ASM${ASM_DIALECT}")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR "ASM${ASM_DIALECT}")
|
||||||
|
|
||||||
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
if(CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
||||||
MESSAGE(STATUS "Found assembler: ${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
|
message(STATUS "Found assembler: ${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
|
||||||
ELSE(CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
else(CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
||||||
MESSAGE(STATUS "Didn't find assembler")
|
message(STATUS "Didn't find assembler")
|
||||||
ENDIF(CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
endif(CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
||||||
|
|
||||||
|
|
||||||
SET(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
|
set(_CMAKE_ASM_COMPILER "${CMAKE_ASM${ASM_DIALECT}_COMPILER}")
|
||||||
SET(_CMAKE_ASM_COMPILER_ID "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
|
set(_CMAKE_ASM_COMPILER_ID "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ID}")
|
||||||
SET(_CMAKE_ASM_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1}")
|
set(_CMAKE_ASM_COMPILER_ARG1 "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ARG1}")
|
||||||
SET(_CMAKE_ASM_COMPILER_ENV_VAR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR}")
|
set(_CMAKE_ASM_COMPILER_ENV_VAR "${CMAKE_ASM${ASM_DIALECT}_COMPILER_ENV_VAR}")
|
||||||
|
|
||||||
# configure variables set in this file for fast reload later on
|
# configure variables set in this file for fast reload later on
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
|
configure_file(${CMAKE_ROOT}/Modules/CMakeASMCompiler.cmake.in
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeASM${ASM_DIALECT}Compiler.cmake IMMEDIATE @ONLY)
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeASM${ASM_DIALECT}Compiler.cmake IMMEDIATE @ONLY)
|
||||||
|
|
||||||
SET(_CMAKE_ASM_COMPILER)
|
set(_CMAKE_ASM_COMPILER)
|
||||||
SET(_CMAKE_ASM_COMPILER_ARG1)
|
set(_CMAKE_ASM_COMPILER_ARG1)
|
||||||
SET(_CMAKE_ASM_COMPILER_ENV_VAR)
|
set(_CMAKE_ASM_COMPILER_ENV_VAR)
|
||||||
|
|
|
@ -14,14 +14,14 @@
|
||||||
|
|
||||||
# Find the MS assembler (masm or masm64)
|
# Find the MS assembler (masm or masm64)
|
||||||
|
|
||||||
SET(ASM_DIALECT "_MASM")
|
set(ASM_DIALECT "_MASM")
|
||||||
|
|
||||||
# if we are using the 64bit cl compiler, assume we also want the 64bit assembler
|
# if we are using the 64bit cl compiler, assume we also want the 64bit assembler
|
||||||
IF(CMAKE_CL_64)
|
if(CMAKE_CL_64)
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml64)
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml64)
|
||||||
ELSE(CMAKE_CL_64)
|
else(CMAKE_CL_64)
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml)
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_INIT ml)
|
||||||
ENDIF(CMAKE_CL_64)
|
endif(CMAKE_CL_64)
|
||||||
|
|
||||||
INCLUDE(CMakeDetermineASMCompiler)
|
include(CMakeDetermineASMCompiler)
|
||||||
SET(ASM_DIALECT)
|
set(ASM_DIALECT)
|
||||||
|
|
|
@ -14,14 +14,14 @@
|
||||||
|
|
||||||
# Find the nasm assembler. yasm (http://www.tortall.net/projects/yasm/) is nasm compatible
|
# Find the nasm assembler. yasm (http://www.tortall.net/projects/yasm/) is nasm compatible
|
||||||
|
|
||||||
SET(CMAKE_ASM_NASM_COMPILER_INIT nasm yasm)
|
set(CMAKE_ASM_NASM_COMPILER_INIT nasm yasm)
|
||||||
|
|
||||||
IF(NOT CMAKE_ASM_NASM_COMPILER)
|
if(NOT CMAKE_ASM_NASM_COMPILER)
|
||||||
FIND_PROGRAM(CMAKE_ASM_NASM_COMPILER nasm
|
find_program(CMAKE_ASM_NASM_COMPILER nasm
|
||||||
"$ENV{ProgramFiles}/NASM")
|
"$ENV{ProgramFiles}/NASM")
|
||||||
ENDIF(NOT CMAKE_ASM_NASM_COMPILER)
|
endif(NOT CMAKE_ASM_NASM_COMPILER)
|
||||||
|
|
||||||
# Load the generic DetermineASM compiler file with the DIALECT set properly:
|
# Load the generic DetermineASM compiler file with the DIALECT set properly:
|
||||||
SET(ASM_DIALECT "_NASM")
|
set(ASM_DIALECT "_NASM")
|
||||||
INCLUDE(CMakeDetermineASMCompiler)
|
include(CMakeDetermineASMCompiler)
|
||||||
SET(ASM_DIALECT)
|
set(ASM_DIALECT)
|
||||||
|
|
|
@ -31,89 +31,89 @@
|
||||||
# If not already set before, it also sets
|
# If not already set before, it also sets
|
||||||
# _CMAKE_TOOLCHAIN_PREFIX
|
# _CMAKE_TOOLCHAIN_PREFIX
|
||||||
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
|
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
|
||||||
|
|
||||||
# Load system-specific compiler preferences for this language.
|
# Load system-specific compiler preferences for this language.
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-C OPTIONAL)
|
include(Platform/${CMAKE_SYSTEM_NAME}-C OPTIONAL)
|
||||||
IF(NOT CMAKE_C_COMPILER_NAMES)
|
if(NOT CMAKE_C_COMPILER_NAMES)
|
||||||
SET(CMAKE_C_COMPILER_NAMES cc)
|
set(CMAKE_C_COMPILER_NAMES cc)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT CMAKE_C_COMPILER)
|
if(NOT CMAKE_C_COMPILER)
|
||||||
SET(CMAKE_C_COMPILER_INIT NOTFOUND)
|
set(CMAKE_C_COMPILER_INIT NOTFOUND)
|
||||||
|
|
||||||
# prefer the environment variable CC
|
# prefer the environment variable CC
|
||||||
IF($ENV{CC} MATCHES ".+")
|
if($ENV{CC} MATCHES ".+")
|
||||||
GET_FILENAME_COMPONENT(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
|
get_filename_component(CMAKE_C_COMPILER_INIT $ENV{CC} PROGRAM PROGRAM_ARGS CMAKE_C_FLAGS_ENV_INIT)
|
||||||
IF(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")
|
set(CMAKE_C_COMPILER_ARG1 "${CMAKE_C_FLAGS_ENV_INIT}" CACHE STRING "First argument to C compiler")
|
||||||
ENDIF(CMAKE_C_FLAGS_ENV_INIT)
|
endif(CMAKE_C_FLAGS_ENV_INIT)
|
||||||
IF(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
|
if(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
|
||||||
MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
|
message(FATAL_ERROR "Could not find compiler set in environment variable CC:\n$ENV{CC}.")
|
||||||
ENDIF(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
|
endif(NOT EXISTS ${CMAKE_C_COMPILER_INIT})
|
||||||
ENDIF($ENV{CC} MATCHES ".+")
|
endif($ENV{CC} MATCHES ".+")
|
||||||
|
|
||||||
# next try prefer the compiler specified by the generator
|
# next try prefer the compiler specified by the generator
|
||||||
IF(CMAKE_GENERATOR_CC)
|
if(CMAKE_GENERATOR_CC)
|
||||||
IF(NOT CMAKE_C_COMPILER_INIT)
|
if(NOT CMAKE_C_COMPILER_INIT)
|
||||||
SET(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC})
|
set(CMAKE_C_COMPILER_INIT ${CMAKE_GENERATOR_CC})
|
||||||
ENDIF(NOT CMAKE_C_COMPILER_INIT)
|
endif(NOT CMAKE_C_COMPILER_INIT)
|
||||||
ENDIF(CMAKE_GENERATOR_CC)
|
endif(CMAKE_GENERATOR_CC)
|
||||||
|
|
||||||
# finally list compilers to try
|
# finally list compilers to try
|
||||||
IF(NOT CMAKE_C_COMPILER_INIT)
|
if(NOT CMAKE_C_COMPILER_INIT)
|
||||||
SET(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}cc ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc clang)
|
set(CMAKE_C_COMPILER_LIST ${_CMAKE_TOOLCHAIN_PREFIX}cc ${_CMAKE_TOOLCHAIN_PREFIX}gcc cl bcc xlc clang)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
_cmake_find_compiler(C)
|
_cmake_find_compiler(C)
|
||||||
|
|
||||||
ELSE(NOT CMAKE_C_COMPILER)
|
else(NOT CMAKE_C_COMPILER)
|
||||||
|
|
||||||
# we only get here if CMAKE_C_COMPILER was specified using -D or a pre-made CMakeCache.txt
|
# 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
|
# (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
|
# 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
|
# CMAKE_C_COMPILER and the 2nd one as CMAKE_C_COMPILER_ARG1
|
||||||
|
|
||||||
LIST(LENGTH CMAKE_C_COMPILER _CMAKE_C_COMPILER_LIST_LENGTH)
|
list(LENGTH CMAKE_C_COMPILER _CMAKE_C_COMPILER_LIST_LENGTH)
|
||||||
IF("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
|
if("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
|
||||||
LIST(GET CMAKE_C_COMPILER 1 CMAKE_C_COMPILER_ARG1)
|
list(GET CMAKE_C_COMPILER 1 CMAKE_C_COMPILER_ARG1)
|
||||||
LIST(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER)
|
list(GET CMAKE_C_COMPILER 0 CMAKE_C_COMPILER)
|
||||||
ENDIF("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
|
endif("${_CMAKE_C_COMPILER_LIST_LENGTH}" EQUAL 2)
|
||||||
|
|
||||||
# if a compiler was specified by the user but without path,
|
# if a compiler was specified by the user but without path,
|
||||||
# now try to find it with the full path
|
# now try to find it with the full path
|
||||||
# if it is found, force it into the cache,
|
# if it is found, force it into the cache,
|
||||||
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
|
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
|
||||||
# if the C compiler already had a path, reuse it for searching the CXX compiler
|
# 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)
|
get_filename_component(_CMAKE_USER_C_COMPILER_PATH "${CMAKE_C_COMPILER}" PATH)
|
||||||
IF(NOT _CMAKE_USER_C_COMPILER_PATH)
|
if(NOT _CMAKE_USER_C_COMPILER_PATH)
|
||||||
FIND_PROGRAM(CMAKE_C_COMPILER_WITH_PATH NAMES ${CMAKE_C_COMPILER})
|
find_program(CMAKE_C_COMPILER_WITH_PATH NAMES ${CMAKE_C_COMPILER})
|
||||||
MARK_AS_ADVANCED(CMAKE_C_COMPILER_WITH_PATH)
|
mark_as_advanced(CMAKE_C_COMPILER_WITH_PATH)
|
||||||
IF(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)
|
set(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_WITH_PATH} CACHE STRING "C compiler" FORCE)
|
||||||
ENDIF(CMAKE_C_COMPILER_WITH_PATH)
|
endif(CMAKE_C_COMPILER_WITH_PATH)
|
||||||
ENDIF(NOT _CMAKE_USER_C_COMPILER_PATH)
|
endif(NOT _CMAKE_USER_C_COMPILER_PATH)
|
||||||
ENDIF(NOT CMAKE_C_COMPILER)
|
endif(NOT CMAKE_C_COMPILER)
|
||||||
MARK_AS_ADVANCED(CMAKE_C_COMPILER)
|
mark_as_advanced(CMAKE_C_COMPILER)
|
||||||
|
|
||||||
IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
if (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
||||||
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
|
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_C_COMPILER}" PATH)
|
||||||
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
endif (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
||||||
|
|
||||||
# Build a small source file to identify the compiler.
|
# Build a small source file to identify the compiler.
|
||||||
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
||||||
SET(CMAKE_C_COMPILER_ID_RUN 1)
|
set(CMAKE_C_COMPILER_ID_RUN 1)
|
||||||
SET(CMAKE_C_PLATFORM_ID "Windows")
|
set(CMAKE_C_PLATFORM_ID "Windows")
|
||||||
SET(CMAKE_C_COMPILER_ID "MSVC")
|
set(CMAKE_C_COMPILER_ID "MSVC")
|
||||||
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
endif(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
||||||
|
|
||||||
IF(NOT CMAKE_C_COMPILER_ID_RUN)
|
if(NOT CMAKE_C_COMPILER_ID_RUN)
|
||||||
SET(CMAKE_C_COMPILER_ID_RUN 1)
|
set(CMAKE_C_COMPILER_ID_RUN 1)
|
||||||
|
|
||||||
# Each entry in this list is a set of extra flags to try
|
# Each entry in this list is a set of extra flags to try
|
||||||
# adding to the compile line to see if it helps produce
|
# adding to the compile line to see if it helps produce
|
||||||
# a valid identification file.
|
# a valid identification file.
|
||||||
SET(CMAKE_C_COMPILER_ID_TEST_FLAGS
|
set(CMAKE_C_COMPILER_ID_TEST_FLAGS
|
||||||
# Try compiling to an object file only.
|
# Try compiling to an object file only.
|
||||||
"-c"
|
"-c"
|
||||||
|
|
||||||
|
@ -122,22 +122,22 @@ IF(NOT CMAKE_C_COMPILER_ID_RUN)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Try to identify the compiler.
|
# Try to identify the compiler.
|
||||||
SET(CMAKE_C_COMPILER_ID)
|
set(CMAKE_C_COMPILER_ID)
|
||||||
FILE(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
|
file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
|
||||||
CMAKE_C_COMPILER_ID_PLATFORM_CONTENT)
|
CMAKE_C_COMPILER_ID_PLATFORM_CONTENT)
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
|
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
|
||||||
CMAKE_DETERMINE_COMPILER_ID(C CFLAGS CMakeCCompilerId.c)
|
CMAKE_DETERMINE_COMPILER_ID(C CFLAGS CMakeCCompilerId.c)
|
||||||
|
|
||||||
# Set old compiler and platform id variables.
|
# Set old compiler and platform id variables.
|
||||||
IF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
|
if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
|
||||||
SET(CMAKE_COMPILER_IS_GNUCC 1)
|
set(CMAKE_COMPILER_IS_GNUCC 1)
|
||||||
ENDIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
|
endif("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
|
||||||
IF("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
|
if("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
|
||||||
SET(CMAKE_COMPILER_IS_MINGW 1)
|
set(CMAKE_COMPILER_IS_MINGW 1)
|
||||||
ELSEIF("${CMAKE_C_PLATFORM_ID}" MATCHES "Cygwin")
|
elseif("${CMAKE_C_PLATFORM_ID}" MATCHES "Cygwin")
|
||||||
SET(CMAKE_COMPILER_IS_CYGWIN 1)
|
set(CMAKE_COMPILER_IS_CYGWIN 1)
|
||||||
ENDIF("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
|
endif("${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
|
||||||
ENDIF(NOT CMAKE_C_COMPILER_ID_RUN)
|
endif(NOT CMAKE_C_COMPILER_ID_RUN)
|
||||||
|
|
||||||
# If we have a gcc cross compiler, they have usually some prefix, like
|
# If we have a gcc cross compiler, they have usually some prefix, like
|
||||||
# e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc, optionally
|
# e.g. powerpc-linux-gcc, arm-elf-gcc or i586-mingw32msvc-gcc, optionally
|
||||||
|
@ -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
|
# NAME_WE cannot be used since then this test will fail for names lile
|
||||||
# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
|
# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
|
||||||
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
|
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
|
||||||
IF (CMAKE_CROSSCOMPILING
|
if (CMAKE_CROSSCOMPILING
|
||||||
AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
|
AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
|
||||||
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
|
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME)
|
get_filename_component(COMPILER_BASENAME "${CMAKE_C_COMPILER}" NAME)
|
||||||
IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
if (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||||
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
||||||
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
endif (COMPILER_BASENAME MATCHES "^(.+-)g?cc(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||||
|
|
||||||
# if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
|
# if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
|
||||||
# but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
|
# but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
|
||||||
IF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
|
if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
|
||||||
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
||||||
ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
|
endif ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
|
||||||
|
|
||||||
ENDIF (CMAKE_CROSSCOMPILING
|
endif (CMAKE_CROSSCOMPILING
|
||||||
AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
|
AND "${CMAKE_C_COMPILER_ID}" MATCHES "GNU"
|
||||||
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
|
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
|
include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
|
||||||
INCLUDE(CMakeFindBinUtils)
|
include(CMakeFindBinUtils)
|
||||||
IF(MSVC_C_ARCHITECTURE_ID)
|
if(MSVC_C_ARCHITECTURE_ID)
|
||||||
SET(SET_MSVC_C_ARCHITECTURE_ID
|
set(SET_MSVC_C_ARCHITECTURE_ID
|
||||||
"SET(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
|
"set(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
|
||||||
ENDIF(MSVC_C_ARCHITECTURE_ID)
|
endif(MSVC_C_ARCHITECTURE_ID)
|
||||||
# configure variables set in this file for fast reload later on
|
# configure variables set in this file for fast reload later on
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
|
configure_file(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
|
||||||
"${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake"
|
"${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake"
|
||||||
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
|
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
|
||||||
)
|
)
|
||||||
SET(CMAKE_C_COMPILER_ENV_VAR "CC")
|
set(CMAKE_C_COMPILER_ENV_VAR "CC")
|
||||||
|
|
|
@ -30,42 +30,42 @@
|
||||||
# If not already set before, it also sets
|
# If not already set before, it also sets
|
||||||
# _CMAKE_TOOLCHAIN_PREFIX
|
# _CMAKE_TOOLCHAIN_PREFIX
|
||||||
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
|
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
|
||||||
|
|
||||||
# Load system-specific compiler preferences for this language.
|
# Load system-specific compiler preferences for this language.
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-CXX OPTIONAL)
|
include(Platform/${CMAKE_SYSTEM_NAME}-CXX OPTIONAL)
|
||||||
IF(NOT CMAKE_CXX_COMPILER_NAMES)
|
if(NOT CMAKE_CXX_COMPILER_NAMES)
|
||||||
SET(CMAKE_CXX_COMPILER_NAMES CC)
|
set(CMAKE_CXX_COMPILER_NAMES CC)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT CMAKE_CXX_COMPILER)
|
if(NOT CMAKE_CXX_COMPILER)
|
||||||
SET(CMAKE_CXX_COMPILER_INIT NOTFOUND)
|
set(CMAKE_CXX_COMPILER_INIT NOTFOUND)
|
||||||
|
|
||||||
# prefer the environment variable CXX
|
# prefer the environment variable CXX
|
||||||
IF($ENV{CXX} MATCHES ".+")
|
if($ENV{CXX} MATCHES ".+")
|
||||||
GET_FILENAME_COMPONENT(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT)
|
get_filename_component(CMAKE_CXX_COMPILER_INIT $ENV{CXX} PROGRAM PROGRAM_ARGS CMAKE_CXX_FLAGS_ENV_INIT)
|
||||||
IF(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")
|
set(CMAKE_CXX_COMPILER_ARG1 "${CMAKE_CXX_FLAGS_ENV_INIT}" CACHE STRING "First argument to CXX compiler")
|
||||||
ENDIF(CMAKE_CXX_FLAGS_ENV_INIT)
|
endif(CMAKE_CXX_FLAGS_ENV_INIT)
|
||||||
IF(NOT EXISTS ${CMAKE_CXX_COMPILER_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}")
|
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(NOT EXISTS ${CMAKE_CXX_COMPILER_INIT})
|
||||||
ENDIF($ENV{CXX} MATCHES ".+")
|
endif($ENV{CXX} MATCHES ".+")
|
||||||
|
|
||||||
# next prefer the generator specified compiler
|
# next prefer the generator specified compiler
|
||||||
IF(CMAKE_GENERATOR_CXX)
|
if(CMAKE_GENERATOR_CXX)
|
||||||
IF(NOT CMAKE_CXX_COMPILER_INIT)
|
if(NOT CMAKE_CXX_COMPILER_INIT)
|
||||||
SET(CMAKE_CXX_COMPILER_INIT ${CMAKE_GENERATOR_CXX})
|
set(CMAKE_CXX_COMPILER_INIT ${CMAKE_GENERATOR_CXX})
|
||||||
ENDIF(NOT CMAKE_CXX_COMPILER_INIT)
|
endif(NOT CMAKE_CXX_COMPILER_INIT)
|
||||||
ENDIF(CMAKE_GENERATOR_CXX)
|
endif(CMAKE_GENERATOR_CXX)
|
||||||
|
|
||||||
# finally list compilers to try
|
# finally list compilers to try
|
||||||
IF(NOT CMAKE_CXX_COMPILER_INIT)
|
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++)
|
set(CMAKE_CXX_COMPILER_LIST CC ${_CMAKE_TOOLCHAIN_PREFIX}c++ ${_CMAKE_TOOLCHAIN_PREFIX}g++ aCC cl bcc xlC clang++)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
_cmake_find_compiler(CXX)
|
_cmake_find_compiler(CXX)
|
||||||
ELSE(NOT CMAKE_CXX_COMPILER)
|
else(NOT CMAKE_CXX_COMPILER)
|
||||||
|
|
||||||
# we only get here if CMAKE_CXX_COMPILER was specified using -D or a pre-made CMakeCache.txt
|
# 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
|
# (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
|
# 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
|
# CMAKE_CXX_COMPILER and the 2nd one as CMAKE_CXX_COMPILER_ARG1
|
||||||
|
|
||||||
LIST(LENGTH CMAKE_CXX_COMPILER _CMAKE_CXX_COMPILER_LIST_LENGTH)
|
list(LENGTH CMAKE_CXX_COMPILER _CMAKE_CXX_COMPILER_LIST_LENGTH)
|
||||||
IF("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
|
if("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
|
||||||
LIST(GET CMAKE_CXX_COMPILER 1 CMAKE_CXX_COMPILER_ARG1)
|
list(GET CMAKE_CXX_COMPILER 1 CMAKE_CXX_COMPILER_ARG1)
|
||||||
LIST(GET CMAKE_CXX_COMPILER 0 CMAKE_CXX_COMPILER)
|
list(GET CMAKE_CXX_COMPILER 0 CMAKE_CXX_COMPILER)
|
||||||
ENDIF("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
|
endif("${_CMAKE_CXX_COMPILER_LIST_LENGTH}" EQUAL 2)
|
||||||
|
|
||||||
# if a compiler was specified by the user but without path,
|
# if a compiler was specified by the user but without path,
|
||||||
# now try to find it with the full path
|
# now try to find it with the full path
|
||||||
# if it is found, force it into the cache,
|
# if it is found, force it into the cache,
|
||||||
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
|
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
|
||||||
# if the CXX compiler already had a path, reuse it for searching the C compiler
|
# 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)
|
get_filename_component(_CMAKE_USER_CXX_COMPILER_PATH "${CMAKE_CXX_COMPILER}" PATH)
|
||||||
IF(NOT _CMAKE_USER_CXX_COMPILER_PATH)
|
if(NOT _CMAKE_USER_CXX_COMPILER_PATH)
|
||||||
FIND_PROGRAM(CMAKE_CXX_COMPILER_WITH_PATH NAMES ${CMAKE_CXX_COMPILER})
|
find_program(CMAKE_CXX_COMPILER_WITH_PATH NAMES ${CMAKE_CXX_COMPILER})
|
||||||
MARK_AS_ADVANCED(CMAKE_CXX_COMPILER_WITH_PATH)
|
mark_as_advanced(CMAKE_CXX_COMPILER_WITH_PATH)
|
||||||
IF(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)
|
set(CMAKE_CXX_COMPILER ${CMAKE_CXX_COMPILER_WITH_PATH} CACHE STRING "CXX compiler" FORCE)
|
||||||
ENDIF(CMAKE_CXX_COMPILER_WITH_PATH)
|
endif(CMAKE_CXX_COMPILER_WITH_PATH)
|
||||||
ENDIF(NOT _CMAKE_USER_CXX_COMPILER_PATH)
|
endif(NOT _CMAKE_USER_CXX_COMPILER_PATH)
|
||||||
ENDIF(NOT CMAKE_CXX_COMPILER)
|
endif(NOT CMAKE_CXX_COMPILER)
|
||||||
MARK_AS_ADVANCED(CMAKE_CXX_COMPILER)
|
mark_as_advanced(CMAKE_CXX_COMPILER)
|
||||||
|
|
||||||
IF (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
if (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
||||||
GET_FILENAME_COMPONENT(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
|
get_filename_component(_CMAKE_TOOLCHAIN_LOCATION "${CMAKE_CXX_COMPILER}" PATH)
|
||||||
ENDIF (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
endif (NOT _CMAKE_TOOLCHAIN_LOCATION)
|
||||||
|
|
||||||
# This block was used before the compiler was identified by building a
|
# This block was used before the compiler was identified by building a
|
||||||
# source file. Unless g++ crashes when building a small C++
|
# 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"
|
# 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
|
# ("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++.
|
# until the user clicks "OK"...so for now, we just assume it's g++.
|
||||||
# IF(BEOS)
|
# if(BEOS)
|
||||||
# SET(CMAKE_COMPILER_IS_GNUCXX 1)
|
# set(CMAKE_COMPILER_IS_GNUCXX 1)
|
||||||
# SET(CMAKE_COMPILER_IS_GNUCXX_RUN 1)
|
# set(CMAKE_COMPILER_IS_GNUCXX_RUN 1)
|
||||||
# ENDIF(BEOS)
|
# endif(BEOS)
|
||||||
|
|
||||||
# Build a small source file to identify the compiler.
|
# Build a small source file to identify the compiler.
|
||||||
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
||||||
SET(CMAKE_CXX_COMPILER_ID_RUN 1)
|
set(CMAKE_CXX_COMPILER_ID_RUN 1)
|
||||||
SET(CMAKE_CXX_PLATFORM_ID "Windows")
|
set(CMAKE_CXX_PLATFORM_ID "Windows")
|
||||||
SET(CMAKE_CXX_COMPILER_ID "MSVC")
|
set(CMAKE_CXX_COMPILER_ID "MSVC")
|
||||||
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
endif(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
||||||
IF(NOT CMAKE_CXX_COMPILER_ID_RUN)
|
if(NOT CMAKE_CXX_COMPILER_ID_RUN)
|
||||||
SET(CMAKE_CXX_COMPILER_ID_RUN 1)
|
set(CMAKE_CXX_COMPILER_ID_RUN 1)
|
||||||
|
|
||||||
# Each entry in this list is a set of extra flags to try
|
# Each entry in this list is a set of extra flags to try
|
||||||
# adding to the compile line to see if it helps produce
|
# adding to the compile line to see if it helps produce
|
||||||
# a valid identification file.
|
# a valid identification file.
|
||||||
SET(CMAKE_CXX_COMPILER_ID_TEST_FLAGS
|
set(CMAKE_CXX_COMPILER_ID_TEST_FLAGS
|
||||||
# Try compiling to an object file only.
|
# Try compiling to an object file only.
|
||||||
"-c"
|
"-c"
|
||||||
)
|
)
|
||||||
|
|
||||||
# Try to identify the compiler.
|
# Try to identify the compiler.
|
||||||
SET(CMAKE_CXX_COMPILER_ID)
|
set(CMAKE_CXX_COMPILER_ID)
|
||||||
FILE(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
|
file(READ ${CMAKE_ROOT}/Modules/CMakePlatformId.h.in
|
||||||
CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT)
|
CMAKE_CXX_COMPILER_ID_PLATFORM_CONTENT)
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
|
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
|
||||||
CMAKE_DETERMINE_COMPILER_ID(CXX CXXFLAGS CMakeCXXCompilerId.cpp)
|
CMAKE_DETERMINE_COMPILER_ID(CXX CXXFLAGS CMakeCXXCompilerId.cpp)
|
||||||
|
|
||||||
# Set old compiler and platform id variables.
|
# Set old compiler and platform id variables.
|
||||||
IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
||||||
SET(CMAKE_COMPILER_IS_GNUCXX 1)
|
set(CMAKE_COMPILER_IS_GNUCXX 1)
|
||||||
ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
||||||
IF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
|
if("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
|
||||||
SET(CMAKE_COMPILER_IS_MINGW 1)
|
set(CMAKE_COMPILER_IS_MINGW 1)
|
||||||
ELSEIF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "Cygwin")
|
elseif("${CMAKE_CXX_PLATFORM_ID}" MATCHES "Cygwin")
|
||||||
SET(CMAKE_COMPILER_IS_CYGWIN 1)
|
set(CMAKE_COMPILER_IS_CYGWIN 1)
|
||||||
ENDIF("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
|
endif("${CMAKE_CXX_PLATFORM_ID}" MATCHES "MinGW")
|
||||||
ENDIF(NOT CMAKE_CXX_COMPILER_ID_RUN)
|
endif(NOT CMAKE_CXX_COMPILER_ID_RUN)
|
||||||
|
|
||||||
# if we have a g++ cross compiler, they have usually some prefix, like
|
# if we have a g++ cross compiler, they have usually some prefix, like
|
||||||
# e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++ , optionally
|
# e.g. powerpc-linux-g++, arm-elf-g++ or i586-mingw32msvc-g++ , optionally
|
||||||
|
@ -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
|
# NAME_WE cannot be used since then this test will fail for names lile
|
||||||
# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
|
# "arm-unknown-nto-qnx6.3.0-gcc.exe", where BASENAME would be
|
||||||
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
|
# "arm-unknown-nto-qnx6" instead of the correct "arm-unknown-nto-qnx6.3.0-"
|
||||||
IF (CMAKE_CROSSCOMPILING
|
if (CMAKE_CROSSCOMPILING
|
||||||
AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
|
AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
|
||||||
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
|
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
GET_FILENAME_COMPONENT(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
|
get_filename_component(COMPILER_BASENAME "${CMAKE_CXX_COMPILER}" NAME)
|
||||||
IF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
if (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||||
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
||||||
ENDIF (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
endif (COMPILER_BASENAME MATCHES "^(.+-)[gc]\\+\\+(-[0-9]+\\.[0-9]+\\.[0-9]+)?(\\.exe)?$")
|
||||||
|
|
||||||
# if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
|
# if "llvm-" is part of the prefix, remove it, since llvm doesn't have its own binutils
|
||||||
# but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
|
# but uses the regular ar, objcopy, etc. (instead of llvm-objcopy etc.)
|
||||||
IF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
|
if ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
|
||||||
SET(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
set(_CMAKE_TOOLCHAIN_PREFIX ${CMAKE_MATCH_1})
|
||||||
ENDIF ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
|
endif ("${_CMAKE_TOOLCHAIN_PREFIX}" MATCHES "(.+-)?llvm-$")
|
||||||
|
|
||||||
ENDIF (CMAKE_CROSSCOMPILING
|
endif (CMAKE_CROSSCOMPILING
|
||||||
AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
|
AND "${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU"
|
||||||
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
|
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
|
||||||
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
|
include(${CMAKE_ROOT}/Modules/CMakeClDeps.cmake)
|
||||||
INCLUDE(CMakeFindBinUtils)
|
include(CMakeFindBinUtils)
|
||||||
IF(MSVC_CXX_ARCHITECTURE_ID)
|
if(MSVC_CXX_ARCHITECTURE_ID)
|
||||||
SET(SET_MSVC_CXX_ARCHITECTURE_ID
|
set(SET_MSVC_CXX_ARCHITECTURE_ID
|
||||||
"SET(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
|
"set(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
|
||||||
ENDIF(MSVC_CXX_ARCHITECTURE_ID)
|
endif(MSVC_CXX_ARCHITECTURE_ID)
|
||||||
# configure all variables set in this file
|
# configure all variables set in this file
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
|
configure_file(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake
|
||||||
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
|
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
|
set(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
|
||||||
|
|
|
@ -16,19 +16,19 @@
|
||||||
# This is used internally by CMake and should not be included by user
|
# This is used internally by CMake and should not be included by user
|
||||||
# code.
|
# code.
|
||||||
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
|
include(${CMAKE_ROOT}/Modules/CMakeParseImplicitLinkInfo.cmake)
|
||||||
|
|
||||||
FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
|
function(CMAKE_DETERMINE_COMPILER_ABI lang src)
|
||||||
IF(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED)
|
if(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED)
|
||||||
MESSAGE(STATUS "Detecting ${lang} compiler ABI info")
|
message(STATUS "Detecting ${lang} compiler ABI info")
|
||||||
|
|
||||||
# Compile the ABI identification source.
|
# Compile the ABI identification source.
|
||||||
SET(BIN "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDetermineCompilerABI_${lang}.bin")
|
set(BIN "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeDetermineCompilerABI_${lang}.bin")
|
||||||
SET(CMAKE_FLAGS )
|
set(CMAKE_FLAGS )
|
||||||
IF(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
|
if(DEFINED CMAKE_${lang}_VERBOSE_FLAG)
|
||||||
SET(CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
|
set(CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${CMAKE_${lang}_VERBOSE_FLAG}")
|
||||||
ENDIF()
|
endif()
|
||||||
TRY_COMPILE(CMAKE_DETERMINE_${lang}_ABI_COMPILED
|
try_compile(CMAKE_DETERMINE_${lang}_ABI_COMPILED
|
||||||
${CMAKE_BINARY_DIR} ${src}
|
${CMAKE_BINARY_DIR} ${src}
|
||||||
CMAKE_FLAGS "${CMAKE_FLAGS}"
|
CMAKE_FLAGS "${CMAKE_FLAGS}"
|
||||||
"-DCMAKE_${lang}_STANDARD_LIBRARIES="
|
"-DCMAKE_${lang}_STANDARD_LIBRARIES="
|
||||||
|
@ -41,40 +41,40 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Load the resulting information strings.
|
# Load the resulting information strings.
|
||||||
IF(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
|
if(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
|
||||||
MESSAGE(STATUS "Detecting ${lang} compiler ABI info - done")
|
message(STATUS "Detecting ${lang} compiler ABI info - done")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n")
|
"Detecting ${lang} compiler ABI info compiled with the following output:\n${OUTPUT}\n\n")
|
||||||
FILE(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[^[]*\\[")
|
file(STRINGS "${BIN}" ABI_STRINGS LIMIT_COUNT 2 REGEX "INFO:[^[]*\\[")
|
||||||
FOREACH(info ${ABI_STRINGS})
|
foreach(info ${ABI_STRINGS})
|
||||||
IF("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
|
if("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
|
||||||
STRING(REGEX REPLACE ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*" "\\1" ABI_SIZEOF_DPTR "${info}")
|
string(REGEX REPLACE ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*" "\\1" ABI_SIZEOF_DPTR "${info}")
|
||||||
ENDIF("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
|
endif("${info}" MATCHES ".*INFO:sizeof_dptr\\[0*([^]]*)\\].*")
|
||||||
IF("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
|
if("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
|
||||||
STRING(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}")
|
string(REGEX REPLACE ".*INFO:abi\\[([^]]*)\\].*" "\\1" ABI_NAME "${info}")
|
||||||
ENDIF("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
|
endif("${info}" MATCHES ".*INFO:abi\\[([^]]*)\\].*")
|
||||||
ENDFOREACH(info)
|
endforeach(info)
|
||||||
|
|
||||||
IF(ABI_SIZEOF_DPTR)
|
if(ABI_SIZEOF_DPTR)
|
||||||
SET(CMAKE_${lang}_SIZEOF_DATA_PTR "${ABI_SIZEOF_DPTR}" PARENT_SCOPE)
|
set(CMAKE_${lang}_SIZEOF_DATA_PTR "${ABI_SIZEOF_DPTR}" PARENT_SCOPE)
|
||||||
ELSEIF(CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT)
|
elseif(CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT)
|
||||||
SET(CMAKE_${lang}_SIZEOF_DATA_PTR "${CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT}" PARENT_SCOPE)
|
set(CMAKE_${lang}_SIZEOF_DATA_PTR "${CMAKE_${lang}_SIZEOF_DATA_PTR_DEFAULT}" PARENT_SCOPE)
|
||||||
ENDIF(ABI_SIZEOF_DPTR)
|
endif(ABI_SIZEOF_DPTR)
|
||||||
|
|
||||||
IF(ABI_NAME)
|
if(ABI_NAME)
|
||||||
SET(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
|
set(CMAKE_${lang}_COMPILER_ABI "${ABI_NAME}" PARENT_SCOPE)
|
||||||
ENDIF(ABI_NAME)
|
endif(ABI_NAME)
|
||||||
|
|
||||||
# Parse implicit linker information for this language, if available.
|
# Parse implicit linker information for this language, if available.
|
||||||
SET(implicit_dirs "")
|
set(implicit_dirs "")
|
||||||
SET(implicit_libs "")
|
set(implicit_libs "")
|
||||||
SET(MULTI_ARCH FALSE)
|
set(MULTI_ARCH FALSE)
|
||||||
IF(DEFINED CMAKE_OSX_ARCHITECTURES)
|
if(DEFINED CMAKE_OSX_ARCHITECTURES)
|
||||||
IF( "${CMAKE_OSX_ARCHITECTURES}" MATCHES ";" )
|
if( "${CMAKE_OSX_ARCHITECTURES}" MATCHES ";" )
|
||||||
SET(MULTI_ARCH TRUE)
|
set(MULTI_ARCH TRUE)
|
||||||
ENDIF()
|
endif()
|
||||||
ENDIF()
|
endif()
|
||||||
IF(CMAKE_${lang}_VERBOSE_FLAG
|
if(CMAKE_${lang}_VERBOSE_FLAG
|
||||||
# Implicit link information cannot be used explicitly for
|
# Implicit link information cannot be used explicitly for
|
||||||
# multiple OS X architectures, so we skip it.
|
# multiple OS X architectures, so we skip it.
|
||||||
AND NOT MULTI_ARCH
|
AND NOT MULTI_ARCH
|
||||||
|
@ -82,50 +82,50 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ABI lang src)
|
||||||
AND NOT "${CMAKE_GENERATOR}" MATCHES Xcode)
|
AND NOT "${CMAKE_GENERATOR}" MATCHES Xcode)
|
||||||
CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs log
|
CMAKE_PARSE_IMPLICIT_LINK_INFO("${OUTPUT}" implicit_libs implicit_dirs log
|
||||||
"${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}")
|
"${CMAKE_${lang}_IMPLICIT_OBJECT_REGEX}")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Parsed ${lang} implicit link information from above output:\n${log}\n\n")
|
"Parsed ${lang} implicit link information from above output:\n${log}\n\n")
|
||||||
ENDIF()
|
endif()
|
||||||
# for VS IDE Intel Fortran we have to figure out the
|
# for VS IDE Intel Fortran we have to figure out the
|
||||||
# implicit link path for the fortran run time using
|
# implicit link path for the fortran run time using
|
||||||
# a try-compile
|
# a try-compile
|
||||||
IF("${lang}" MATCHES "Fortran"
|
if("${lang}" MATCHES "Fortran"
|
||||||
AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
|
AND "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
|
||||||
SET(_desc "Determine Intel Fortran Compiler Implicit Link Path")
|
set(_desc "Determine Intel Fortran Compiler Implicit Link Path")
|
||||||
MESSAGE(STATUS "${_desc}")
|
message(STATUS "${_desc}")
|
||||||
# Build a sample project which reports symbols.
|
# Build a sample project which reports symbols.
|
||||||
TRY_COMPILE(IFORT_LIB_PATH_COMPILED
|
try_compile(IFORT_LIB_PATH_COMPILED
|
||||||
${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath
|
${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath
|
||||||
${CMAKE_ROOT}/Modules/IntelVSImplicitPath
|
${CMAKE_ROOT}/Modules/IntelVSImplicitPath
|
||||||
IntelFortranImplicit
|
IntelFortranImplicit
|
||||||
CMAKE_FLAGS
|
CMAKE_FLAGS
|
||||||
"-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}"
|
"-DCMAKE_Fortran_FLAGS:STRING=${CMAKE_Fortran_FLAGS}"
|
||||||
OUTPUT_VARIABLE _output)
|
OUTPUT_VARIABLE _output)
|
||||||
FILE(WRITE
|
file(WRITE
|
||||||
"${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.txt"
|
"${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.txt"
|
||||||
"${_output}")
|
"${_output}")
|
||||||
INCLUDE(${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.cmake OPTIONAL)
|
include(${CMAKE_BINARY_DIR}/CMakeFiles/IntelVSImplicitPath/output.cmake OPTIONAL)
|
||||||
SET(_desc "Determine Intel Fortran Compiler Implicit Link Path -- done")
|
set(_desc "Determine Intel Fortran Compiler Implicit Link Path -- done")
|
||||||
MESSAGE(STATUS "${_desc}")
|
message(STATUS "${_desc}")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
SET(CMAKE_${lang}_IMPLICIT_LINK_LIBRARIES "${implicit_libs}" PARENT_SCOPE)
|
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_DIRECTORIES "${implicit_dirs}" PARENT_SCOPE)
|
||||||
|
|
||||||
# Detect library architecture directory name.
|
# Detect library architecture directory name.
|
||||||
IF(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
|
if(CMAKE_LIBRARY_ARCHITECTURE_REGEX)
|
||||||
FOREACH(dir ${implicit_dirs})
|
foreach(dir ${implicit_dirs})
|
||||||
IF("${dir}" MATCHES "/lib/${CMAKE_LIBRARY_ARCHITECTURE_REGEX}$")
|
if("${dir}" MATCHES "/lib/${CMAKE_LIBRARY_ARCHITECTURE_REGEX}$")
|
||||||
GET_FILENAME_COMPONENT(arch "${dir}" NAME)
|
get_filename_component(arch "${dir}" NAME)
|
||||||
SET(CMAKE_${lang}_LIBRARY_ARCHITECTURE "${arch}" PARENT_SCOPE)
|
set(CMAKE_${lang}_LIBRARY_ARCHITECTURE "${arch}" PARENT_SCOPE)
|
||||||
BREAK()
|
break()
|
||||||
ENDIF()
|
endif()
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
ELSE(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
|
else(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
|
||||||
MESSAGE(STATUS "Detecting ${lang} compiler ABI info - failed")
|
message(STATUS "Detecting ${lang} compiler ABI info - failed")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
"Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n\n")
|
"Detecting ${lang} compiler ABI info failed to compile with the following output:\n${OUTPUT}\n\n")
|
||||||
ENDIF(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
|
endif(CMAKE_DETERMINE_${lang}_ABI_COMPILED)
|
||||||
ENDIF(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED)
|
endif(NOT DEFINED CMAKE_DETERMINE_${lang}_ABI_COMPILED)
|
||||||
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ABI)
|
endfunction(CMAKE_DETERMINE_COMPILER_ABI)
|
||||||
|
|
|
@ -16,90 +16,90 @@
|
||||||
# used internally by CMake and should not be included by user code.
|
# used internally by CMake and should not be included by user code.
|
||||||
# If successful, sets CMAKE_<lang>_COMPILER_ID and CMAKE_<lang>_PLATFORM_ID
|
# If successful, sets CMAKE_<lang>_COMPILER_ID and CMAKE_<lang>_PLATFORM_ID
|
||||||
|
|
||||||
FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
|
function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
|
||||||
# Make sure the compiler arguments are clean.
|
# Make sure the compiler arguments are clean.
|
||||||
STRING(STRIP "${CMAKE_${lang}_COMPILER_ARG1}" CMAKE_${lang}_COMPILER_ID_ARG1)
|
string(STRIP "${CMAKE_${lang}_COMPILER_ARG1}" CMAKE_${lang}_COMPILER_ID_ARG1)
|
||||||
STRING(REGEX REPLACE " +" ";" CMAKE_${lang}_COMPILER_ID_ARG1 "${CMAKE_${lang}_COMPILER_ID_ARG1}")
|
string(REGEX REPLACE " +" ";" CMAKE_${lang}_COMPILER_ID_ARG1 "${CMAKE_${lang}_COMPILER_ID_ARG1}")
|
||||||
|
|
||||||
# Make sure user-specified compiler flags are used.
|
# Make sure user-specified compiler flags are used.
|
||||||
IF(CMAKE_${lang}_FLAGS)
|
if(CMAKE_${lang}_FLAGS)
|
||||||
SET(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS})
|
set(CMAKE_${lang}_COMPILER_ID_FLAGS ${CMAKE_${lang}_FLAGS})
|
||||||
ELSE(CMAKE_${lang}_FLAGS)
|
else(CMAKE_${lang}_FLAGS)
|
||||||
SET(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}})
|
set(CMAKE_${lang}_COMPILER_ID_FLAGS $ENV{${flagvar}})
|
||||||
ENDIF(CMAKE_${lang}_FLAGS)
|
endif(CMAKE_${lang}_FLAGS)
|
||||||
STRING(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
|
string(REGEX REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}")
|
||||||
|
|
||||||
# Compute the directory in which to run the test.
|
# Compute the directory in which to run the test.
|
||||||
SET(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang})
|
set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang})
|
||||||
|
|
||||||
# Try building with no extra flags and then try each set
|
# Try building with no extra flags and then try each set
|
||||||
# of helper flags. Stop when the compiler is identified.
|
# of helper flags. Stop when the compiler is identified.
|
||||||
FOREACH(flags "" ${CMAKE_${lang}_COMPILER_ID_TEST_FLAGS})
|
foreach(flags "" ${CMAKE_${lang}_COMPILER_ID_TEST_FLAGS})
|
||||||
IF(NOT CMAKE_${lang}_COMPILER_ID)
|
if(NOT CMAKE_${lang}_COMPILER_ID)
|
||||||
CMAKE_DETERMINE_COMPILER_ID_BUILD("${lang}" "${flags}" "${src}")
|
CMAKE_DETERMINE_COMPILER_ID_BUILD("${lang}" "${flags}" "${src}")
|
||||||
FOREACH(file ${COMPILER_${lang}_PRODUCED_FILES})
|
foreach(file ${COMPILER_${lang}_PRODUCED_FILES})
|
||||||
CMAKE_DETERMINE_COMPILER_ID_CHECK("${lang}" "${CMAKE_${lang}_COMPILER_ID_DIR}/${file}" "${src}")
|
CMAKE_DETERMINE_COMPILER_ID_CHECK("${lang}" "${CMAKE_${lang}_COMPILER_ID_DIR}/${file}" "${src}")
|
||||||
ENDFOREACH(file)
|
endforeach(file)
|
||||||
ENDIF(NOT CMAKE_${lang}_COMPILER_ID)
|
endif(NOT CMAKE_${lang}_COMPILER_ID)
|
||||||
ENDFOREACH(flags)
|
endforeach(flags)
|
||||||
|
|
||||||
# If the compiler is still unknown, try to query its vendor.
|
# If the compiler is still unknown, try to query its vendor.
|
||||||
IF(NOT CMAKE_${lang}_COMPILER_ID)
|
if(NOT CMAKE_${lang}_COMPILER_ID)
|
||||||
CMAKE_DETERMINE_COMPILER_ID_VENDOR(${lang})
|
CMAKE_DETERMINE_COMPILER_ID_VENDOR(${lang})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# if the format is unknown after all files have been checked, put "Unknown" in the cache
|
# if the format is unknown after all files have been checked, put "Unknown" in the cache
|
||||||
IF(NOT CMAKE_EXECUTABLE_FORMAT)
|
if(NOT CMAKE_EXECUTABLE_FORMAT)
|
||||||
SET(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
|
set(CMAKE_EXECUTABLE_FORMAT "Unknown" CACHE INTERNAL "Executable file format")
|
||||||
ENDIF(NOT CMAKE_EXECUTABLE_FORMAT)
|
endif(NOT CMAKE_EXECUTABLE_FORMAT)
|
||||||
|
|
||||||
# Display the final identification result.
|
# Display the final identification result.
|
||||||
IF(CMAKE_${lang}_COMPILER_ID)
|
if(CMAKE_${lang}_COMPILER_ID)
|
||||||
IF(CMAKE_${lang}_COMPILER_VERSION)
|
if(CMAKE_${lang}_COMPILER_VERSION)
|
||||||
SET(_version " ${CMAKE_${lang}_COMPILER_VERSION}")
|
set(_version " ${CMAKE_${lang}_COMPILER_VERSION}")
|
||||||
ELSE()
|
else()
|
||||||
SET(_version "")
|
set(_version "")
|
||||||
ENDIF()
|
endif()
|
||||||
MESSAGE(STATUS "The ${lang} compiler identification is "
|
message(STATUS "The ${lang} compiler identification is "
|
||||||
"${CMAKE_${lang}_COMPILER_ID}${_version}")
|
"${CMAKE_${lang}_COMPILER_ID}${_version}")
|
||||||
ELSE(CMAKE_${lang}_COMPILER_ID)
|
else(CMAKE_${lang}_COMPILER_ID)
|
||||||
MESSAGE(STATUS "The ${lang} compiler identification is unknown")
|
message(STATUS "The ${lang} compiler identification is unknown")
|
||||||
ENDIF(CMAKE_${lang}_COMPILER_ID)
|
endif(CMAKE_${lang}_COMPILER_ID)
|
||||||
|
|
||||||
SET(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
|
set(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
|
||||||
SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
|
set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
|
||||||
SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
|
set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
|
||||||
PARENT_SCOPE)
|
PARENT_SCOPE)
|
||||||
SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
|
set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
|
||||||
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID)
|
endfunction(CMAKE_DETERMINE_COMPILER_ID)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Function to write the compiler id source file.
|
# Function to write the compiler id source file.
|
||||||
FUNCTION(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src)
|
function(CMAKE_DETERMINE_COMPILER_ID_WRITE lang src)
|
||||||
FILE(READ ${CMAKE_ROOT}/Modules/${src}.in ID_CONTENT_IN)
|
file(READ ${CMAKE_ROOT}/Modules/${src}.in ID_CONTENT_IN)
|
||||||
STRING(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY)
|
string(CONFIGURE "${ID_CONTENT_IN}" ID_CONTENT_OUT @ONLY)
|
||||||
FILE(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}")
|
file(WRITE ${CMAKE_${lang}_COMPILER_ID_DIR}/${src} "${ID_CONTENT_OUT}")
|
||||||
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_WRITE)
|
endfunction(CMAKE_DETERMINE_COMPILER_ID_WRITE)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Function to build the compiler id source file and look for output
|
# Function to build the compiler id source file and look for output
|
||||||
# files.
|
# files.
|
||||||
FUNCTION(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
|
function(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
|
||||||
# Create a clean working directory.
|
# Create a clean working directory.
|
||||||
FILE(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
|
file(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
|
||||||
FILE(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
|
file(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
|
||||||
CMAKE_DETERMINE_COMPILER_ID_WRITE("${lang}" "${src}")
|
CMAKE_DETERMINE_COMPILER_ID_WRITE("${lang}" "${src}")
|
||||||
|
|
||||||
# Construct a description of this test case.
|
# Construct a description of this test case.
|
||||||
SET(COMPILER_DESCRIPTION
|
set(COMPILER_DESCRIPTION
|
||||||
"Compiler: ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_ARG1}
|
"Compiler: ${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_ARG1}
|
||||||
Build flags: ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
|
Build flags: ${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
|
||||||
Id flags: ${testflags}
|
Id flags: ${testflags}
|
||||||
")
|
")
|
||||||
|
|
||||||
# Compile the compiler identification source.
|
# Compile the compiler identification source.
|
||||||
IF(COMMAND EXECUTE_PROCESS)
|
if(COMMAND EXECUTE_PROCESS)
|
||||||
EXECUTE_PROCESS(
|
execute_process(
|
||||||
COMMAND ${CMAKE_${lang}_COMPILER}
|
COMMAND ${CMAKE_${lang}_COMPILER}
|
||||||
${CMAKE_${lang}_COMPILER_ID_ARG1}
|
${CMAKE_${lang}_COMPILER_ID_ARG1}
|
||||||
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
|
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
|
||||||
|
@ -110,8 +110,8 @@ Id flags: ${testflags}
|
||||||
ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
|
ERROR_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
|
||||||
RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
|
RESULT_VARIABLE CMAKE_${lang}_COMPILER_ID_RESULT
|
||||||
)
|
)
|
||||||
ELSE(COMMAND EXECUTE_PROCESS)
|
else(COMMAND EXECUTE_PROCESS)
|
||||||
EXEC_PROGRAM(
|
exec_program(
|
||||||
${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_DIR}
|
${CMAKE_${lang}_COMPILER} ${CMAKE_${lang}_COMPILER_ID_DIR}
|
||||||
ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1}
|
ARGS ${CMAKE_${lang}_COMPILER_ID_ARG1}
|
||||||
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
|
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
|
||||||
|
@ -120,12 +120,12 @@ Id flags: ${testflags}
|
||||||
OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
|
OUTPUT_VARIABLE CMAKE_${lang}_COMPILER_ID_OUTPUT
|
||||||
RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT
|
RETURN_VALUE CMAKE_${lang}_COMPILER_ID_RESULT
|
||||||
)
|
)
|
||||||
ENDIF(COMMAND EXECUTE_PROCESS)
|
endif(COMMAND EXECUTE_PROCESS)
|
||||||
|
|
||||||
# Check the result of compilation.
|
# Check the result of compilation.
|
||||||
IF(CMAKE_${lang}_COMPILER_ID_RESULT)
|
if(CMAKE_${lang}_COMPILER_ID_RESULT)
|
||||||
# Compilation failed.
|
# Compilation failed.
|
||||||
SET(MSG
|
set(MSG
|
||||||
"Compiling the ${lang} compiler identification source file \"${src}\" failed.
|
"Compiling the ${lang} compiler identification source file \"${src}\" failed.
|
||||||
${COMPILER_DESCRIPTION}
|
${COMPILER_DESCRIPTION}
|
||||||
The output was:
|
The output was:
|
||||||
|
@ -133,16 +133,16 @@ ${CMAKE_${lang}_COMPILER_ID_RESULT}
|
||||||
${CMAKE_${lang}_COMPILER_ID_OUTPUT}
|
${CMAKE_${lang}_COMPILER_ID_OUTPUT}
|
||||||
|
|
||||||
")
|
")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}")
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log "${MSG}")
|
||||||
#IF(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
|
#if(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
|
||||||
# MESSAGE(FATAL_ERROR "${MSG}")
|
# message(FATAL_ERROR "${MSG}")
|
||||||
#ENDIF(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
|
#endif(NOT CMAKE_${lang}_COMPILER_ID_ALLOW_FAIL)
|
||||||
|
|
||||||
# No output files should be inspected.
|
# No output files should be inspected.
|
||||||
SET(COMPILER_${lang}_PRODUCED_FILES)
|
set(COMPILER_${lang}_PRODUCED_FILES)
|
||||||
ELSE(CMAKE_${lang}_COMPILER_ID_RESULT)
|
else(CMAKE_${lang}_COMPILER_ID_RESULT)
|
||||||
# Compilation succeeded.
|
# Compilation succeeded.
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Compiling the ${lang} compiler identification source file \"${src}\" succeeded.
|
"Compiling the ${lang} compiler identification source file \"${src}\" succeeded.
|
||||||
${COMPILER_DESCRIPTION}
|
${COMPILER_DESCRIPTION}
|
||||||
The output was:
|
The output was:
|
||||||
|
@ -153,120 +153,120 @@ ${CMAKE_${lang}_COMPILER_ID_OUTPUT}
|
||||||
|
|
||||||
# Find the executable produced by the compiler, try all files in the
|
# Find the executable produced by the compiler, try all files in the
|
||||||
# binary dir.
|
# binary dir.
|
||||||
FILE(GLOB COMPILER_${lang}_PRODUCED_FILES
|
file(GLOB COMPILER_${lang}_PRODUCED_FILES
|
||||||
RELATIVE ${CMAKE_${lang}_COMPILER_ID_DIR}
|
RELATIVE ${CMAKE_${lang}_COMPILER_ID_DIR}
|
||||||
${CMAKE_${lang}_COMPILER_ID_DIR}/*)
|
${CMAKE_${lang}_COMPILER_ID_DIR}/*)
|
||||||
LIST(REMOVE_ITEM COMPILER_${lang}_PRODUCED_FILES "${src}")
|
list(REMOVE_ITEM COMPILER_${lang}_PRODUCED_FILES "${src}")
|
||||||
FOREACH(file ${COMPILER_${lang}_PRODUCED_FILES})
|
foreach(file ${COMPILER_${lang}_PRODUCED_FILES})
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Compilation of the ${lang} compiler identification source \""
|
"Compilation of the ${lang} compiler identification source \""
|
||||||
"${src}\" produced \"${file}\"\n\n")
|
"${src}\" produced \"${file}\"\n\n")
|
||||||
ENDFOREACH(file)
|
endforeach(file)
|
||||||
|
|
||||||
IF(NOT COMPILER_${lang}_PRODUCED_FILES)
|
if(NOT COMPILER_${lang}_PRODUCED_FILES)
|
||||||
# No executable was found.
|
# No executable was found.
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
"Compilation of the ${lang} compiler identification source \""
|
"Compilation of the ${lang} compiler identification source \""
|
||||||
"${src}\" did not produce an executable in \""
|
"${src}\" did not produce an executable in \""
|
||||||
"${CMAKE_${lang}_COMPILER_ID_DIR}\".\n\n")
|
"${CMAKE_${lang}_COMPILER_ID_DIR}\".\n\n")
|
||||||
ENDIF(NOT COMPILER_${lang}_PRODUCED_FILES)
|
endif(NOT COMPILER_${lang}_PRODUCED_FILES)
|
||||||
ENDIF(CMAKE_${lang}_COMPILER_ID_RESULT)
|
endif(CMAKE_${lang}_COMPILER_ID_RESULT)
|
||||||
|
|
||||||
# Return the files produced by the compilation.
|
# Return the files produced by the compilation.
|
||||||
SET(COMPILER_${lang}_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE)
|
set(COMPILER_${lang}_PRODUCED_FILES "${COMPILER_${lang}_PRODUCED_FILES}" PARENT_SCOPE)
|
||||||
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
|
endfunction(CMAKE_DETERMINE_COMPILER_ID_BUILD lang testflags src)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Function to extract the compiler id from an executable.
|
# Function to extract the compiler id from an executable.
|
||||||
FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
|
function(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
|
||||||
# Look for a compiler id if not yet known.
|
# Look for a compiler id if not yet known.
|
||||||
IF(NOT CMAKE_${lang}_COMPILER_ID)
|
if(NOT CMAKE_${lang}_COMPILER_ID)
|
||||||
# Read the compiler identification string from the executable file.
|
# Read the compiler identification string from the executable file.
|
||||||
SET(COMPILER_ID)
|
set(COMPILER_ID)
|
||||||
SET(COMPILER_VERSION)
|
set(COMPILER_VERSION)
|
||||||
SET(PLATFORM_ID)
|
set(PLATFORM_ID)
|
||||||
FILE(STRINGS ${file}
|
file(STRINGS ${file}
|
||||||
CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 4 REGEX "INFO:")
|
CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 4 REGEX "INFO:")
|
||||||
SET(HAVE_COMPILER_TWICE 0)
|
set(HAVE_COMPILER_TWICE 0)
|
||||||
FOREACH(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
|
foreach(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
|
||||||
IF("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
|
if("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
|
||||||
IF(COMPILER_ID)
|
if(COMPILER_ID)
|
||||||
SET(COMPILER_ID_TWICE 1)
|
set(COMPILER_ID_TWICE 1)
|
||||||
ENDIF(COMPILER_ID)
|
endif(COMPILER_ID)
|
||||||
STRING(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1"
|
string(REGEX REPLACE ".*INFO:compiler\\[([^]]*)\\].*" "\\1"
|
||||||
COMPILER_ID "${info}")
|
COMPILER_ID "${info}")
|
||||||
ENDIF("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
|
endif("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
|
||||||
IF("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
|
if("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
|
||||||
STRING(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1"
|
string(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1"
|
||||||
PLATFORM_ID "${info}")
|
PLATFORM_ID "${info}")
|
||||||
ENDIF("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
|
endif("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
|
||||||
IF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
|
if("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
|
||||||
STRING(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
|
string(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
|
||||||
ARCHITECTURE_ID "${info}")
|
ARCHITECTURE_ID "${info}")
|
||||||
ENDIF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
|
endif("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
|
||||||
IF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
|
if("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
|
||||||
STRING(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}")
|
string(REGEX REPLACE ".*INFO:compiler_version\\[([^]]*)\\].*" "\\1" COMPILER_VERSION "${info}")
|
||||||
STRING(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}")
|
string(REGEX REPLACE "^0+([0-9])" "\\1" COMPILER_VERSION "${COMPILER_VERSION}")
|
||||||
STRING(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
|
string(REGEX REPLACE "\\.0+([0-9])" ".\\1" COMPILER_VERSION "${COMPILER_VERSION}")
|
||||||
ENDIF("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
|
endif("${info}" MATCHES ".*INFO:compiler_version\\[([^]\"]*)\\].*")
|
||||||
ENDFOREACH(info)
|
endforeach(info)
|
||||||
|
|
||||||
# Check if a valid compiler and platform were found.
|
# Check if a valid compiler and platform were found.
|
||||||
IF(COMPILER_ID AND NOT COMPILER_ID_TWICE)
|
if(COMPILER_ID AND NOT COMPILER_ID_TWICE)
|
||||||
SET(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}")
|
set(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}")
|
||||||
SET(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}")
|
set(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}")
|
||||||
SET(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
|
set(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
|
||||||
SET(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}")
|
set(CMAKE_${lang}_COMPILER_VERSION "${COMPILER_VERSION}")
|
||||||
ENDIF(COMPILER_ID AND NOT COMPILER_ID_TWICE)
|
endif(COMPILER_ID AND NOT COMPILER_ID_TWICE)
|
||||||
|
|
||||||
# Check the compiler identification string.
|
# Check the compiler identification string.
|
||||||
IF(CMAKE_${lang}_COMPILER_ID)
|
if(CMAKE_${lang}_COMPILER_ID)
|
||||||
# The compiler identification was found.
|
# The compiler identification was found.
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"The ${lang} compiler identification is ${CMAKE_${lang}_COMPILER_ID}, found in \""
|
"The ${lang} compiler identification is ${CMAKE_${lang}_COMPILER_ID}, found in \""
|
||||||
"${file}\"\n\n")
|
"${file}\"\n\n")
|
||||||
ELSE(CMAKE_${lang}_COMPILER_ID)
|
else(CMAKE_${lang}_COMPILER_ID)
|
||||||
# The compiler identification could not be found.
|
# The compiler identification could not be found.
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
"The ${lang} compiler identification could not be found in \""
|
"The ${lang} compiler identification could not be found in \""
|
||||||
"${file}\"\n\n")
|
"${file}\"\n\n")
|
||||||
ENDIF(CMAKE_${lang}_COMPILER_ID)
|
endif(CMAKE_${lang}_COMPILER_ID)
|
||||||
ENDIF(NOT CMAKE_${lang}_COMPILER_ID)
|
endif(NOT CMAKE_${lang}_COMPILER_ID)
|
||||||
|
|
||||||
# try to figure out the executable format: ELF, COFF, Mach-O
|
# try to figure out the executable format: ELF, COFF, Mach-O
|
||||||
IF(NOT CMAKE_EXECUTABLE_FORMAT)
|
if(NOT CMAKE_EXECUTABLE_FORMAT)
|
||||||
FILE(READ ${file} CMAKE_EXECUTABLE_MAGIC LIMIT 4 HEX)
|
file(READ ${file} CMAKE_EXECUTABLE_MAGIC LIMIT 4 HEX)
|
||||||
|
|
||||||
# ELF files start with 0x7f"ELF"
|
# ELF files start with 0x7f"ELF"
|
||||||
IF("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
|
if("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
|
||||||
SET(CMAKE_EXECUTABLE_FORMAT "ELF" CACHE INTERNAL "Executable file format")
|
set(CMAKE_EXECUTABLE_FORMAT "ELF" CACHE INTERNAL "Executable file format")
|
||||||
ENDIF("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
|
endif("${CMAKE_EXECUTABLE_MAGIC}" STREQUAL "7f454c46")
|
||||||
|
|
||||||
# # COFF (.exe) files start with "MZ"
|
# # COFF (.exe) files start with "MZ"
|
||||||
# IF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
|
# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
|
||||||
# SET(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format")
|
# set(CMAKE_EXECUTABLE_FORMAT "COFF" CACHE STRING "Executable file format")
|
||||||
# ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
|
# endif("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "4d5a....")
|
||||||
#
|
#
|
||||||
# # Mach-O files start with CAFEBABE or FEEDFACE, according to http://radio.weblogs.com/0100490/2003/01/28.html
|
# # Mach-O files start with CAFEBABE or FEEDFACE, according to http://radio.weblogs.com/0100490/2003/01/28.html
|
||||||
# IF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
|
# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
|
||||||
# SET(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
|
# set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
|
||||||
# ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
|
# endif("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "cafebabe")
|
||||||
# IF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
|
# if("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
|
||||||
# SET(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
|
# set(CMAKE_EXECUTABLE_FORMAT "MACHO" CACHE STRING "Executable file format")
|
||||||
# ENDIF("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
|
# endif("${CMAKE_EXECUTABLE_MAGIC}" MATCHES "feedface")
|
||||||
|
|
||||||
ENDIF(NOT CMAKE_EXECUTABLE_FORMAT)
|
endif(NOT CMAKE_EXECUTABLE_FORMAT)
|
||||||
IF(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)
|
if(NOT DEFINED CMAKE_EXECUTABLE_FORMAT)
|
||||||
SET(CMAKE_EXECUTABLE_FORMAT)
|
set(CMAKE_EXECUTABLE_FORMAT)
|
||||||
ENDIF()
|
endif()
|
||||||
# Return the information extracted.
|
# Return the information extracted.
|
||||||
SET(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
|
set(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
|
||||||
SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
|
set(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
|
||||||
SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
|
set(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
|
||||||
PARENT_SCOPE)
|
PARENT_SCOPE)
|
||||||
SET(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
|
set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_${lang}_COMPILER_VERSION}" PARENT_SCOPE)
|
||||||
SET(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
|
set(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
|
||||||
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
|
endfunction(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Function to query the compiler vendor.
|
# 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")
|
# set(CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor} "Some Vendor Output")
|
||||||
# We try running the compiler with the flag for each vendor and
|
# We try running the compiler with the flag for each vendor and
|
||||||
# matching its regular expression in the output.
|
# matching its regular expression in the output.
|
||||||
FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
|
function(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
|
||||||
|
|
||||||
IF(NOT CMAKE_${lang}_COMPILER_ID_DIR)
|
if(NOT CMAKE_${lang}_COMPILER_ID_DIR)
|
||||||
# We get here when this function is called not from within CMAKE_DETERMINE_COMPILER_ID()
|
# We get here when this function is called not from within CMAKE_DETERMINE_COMPILER_ID()
|
||||||
# This is done e.g. for detecting the compiler ID for assemblers.
|
# This is done e.g. for detecting the compiler ID for assemblers.
|
||||||
# Compute the directory in which to run the test and Create a clean working directory.
|
# Compute the directory in which to run the test and Create a clean working directory.
|
||||||
SET(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang})
|
set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CompilerId${lang})
|
||||||
FILE(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
|
file(REMOVE_RECURSE ${CMAKE_${lang}_COMPILER_ID_DIR})
|
||||||
FILE(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
|
file(MAKE_DIRECTORY ${CMAKE_${lang}_COMPILER_ID_DIR})
|
||||||
ENDIF(NOT CMAKE_${lang}_COMPILER_ID_DIR)
|
endif(NOT CMAKE_${lang}_COMPILER_ID_DIR)
|
||||||
|
|
||||||
|
|
||||||
FOREACH(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS})
|
foreach(vendor ${CMAKE_${lang}_COMPILER_ID_VENDORS})
|
||||||
SET(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}})
|
set(flags ${CMAKE_${lang}_COMPILER_ID_VENDOR_FLAGS_${vendor}})
|
||||||
SET(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}})
|
set(regex ${CMAKE_${lang}_COMPILER_ID_VENDOR_REGEX_${vendor}})
|
||||||
EXECUTE_PROCESS(
|
execute_process(
|
||||||
COMMAND ${CMAKE_${lang}_COMPILER}
|
COMMAND ${CMAKE_${lang}_COMPILER}
|
||||||
${CMAKE_${lang}_COMPILER_ID_ARG1}
|
${CMAKE_${lang}_COMPILER_ID_ARG1}
|
||||||
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
|
${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}
|
||||||
|
@ -302,22 +302,22 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR lang)
|
||||||
TIMEOUT 10
|
TIMEOUT 10
|
||||||
)
|
)
|
||||||
|
|
||||||
IF("${output}" MATCHES "${regex}")
|
if("${output}" MATCHES "${regex}")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
|
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
|
||||||
"matched \"${regex}\":\n${output}")
|
"matched \"${regex}\":\n${output}")
|
||||||
SET(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE)
|
set(CMAKE_${lang}_COMPILER_ID "${vendor}" PARENT_SCOPE)
|
||||||
BREAK()
|
break()
|
||||||
ELSE()
|
else()
|
||||||
IF("${result}" MATCHES "timeout")
|
if("${result}" MATCHES "timeout")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
|
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
|
||||||
"terminated after 10 s due to timeout.")
|
"terminated after 10 s due to timeout.")
|
||||||
ELSE()
|
else()
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
|
"Checking whether the ${lang} compiler is ${vendor} using \"${flags}\" "
|
||||||
"did not match \"${regex}\":\n${output}")
|
"did not match \"${regex}\":\n${output}")
|
||||||
ENDIF()
|
endif()
|
||||||
ENDIF()
|
endif()
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_VENDOR)
|
endfunction(CMAKE_DETERMINE_COMPILER_ID_VENDOR)
|
||||||
|
|
|
@ -19,34 +19,34 @@
|
||||||
# the cmake variable CMAKE_GENERATOR_FC which can be defined by a generator
|
# the cmake variable CMAKE_GENERATOR_FC which can be defined by a generator
|
||||||
# as a default compiler
|
# as a default compiler
|
||||||
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
|
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-Fortran OPTIONAL)
|
include(Platform/${CMAKE_SYSTEM_NAME}-Fortran OPTIONAL)
|
||||||
IF(NOT CMAKE_Fortran_COMPILER_NAMES)
|
if(NOT CMAKE_Fortran_COMPILER_NAMES)
|
||||||
SET(CMAKE_Fortran_COMPILER_NAMES f95)
|
set(CMAKE_Fortran_COMPILER_NAMES f95)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT CMAKE_Fortran_COMPILER)
|
if(NOT CMAKE_Fortran_COMPILER)
|
||||||
# prefer the environment variable CC
|
# prefer the environment variable CC
|
||||||
IF($ENV{FC} MATCHES ".+")
|
if($ENV{FC} MATCHES ".+")
|
||||||
GET_FILENAME_COMPONENT(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
|
get_filename_component(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
|
||||||
IF(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")
|
set(CMAKE_Fortran_COMPILER_ARG1 "${CMAKE_Fortran_FLAGS_ENV_INIT}" CACHE STRING "First argument to Fortran compiler")
|
||||||
ENDIF(CMAKE_Fortran_FLAGS_ENV_INIT)
|
endif(CMAKE_Fortran_FLAGS_ENV_INIT)
|
||||||
IF(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
|
if(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
|
||||||
ELSE(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}.")
|
message(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.")
|
||||||
ENDIF(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
|
endif(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
|
||||||
ENDIF($ENV{FC} MATCHES ".+")
|
endif($ENV{FC} MATCHES ".+")
|
||||||
|
|
||||||
# next try prefer the compiler specified by the generator
|
# next try prefer the compiler specified by the generator
|
||||||
IF(CMAKE_GENERATOR_FC)
|
if(CMAKE_GENERATOR_FC)
|
||||||
IF(NOT CMAKE_Fortran_COMPILER_INIT)
|
if(NOT CMAKE_Fortran_COMPILER_INIT)
|
||||||
SET(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
|
set(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
|
||||||
ENDIF(NOT CMAKE_Fortran_COMPILER_INIT)
|
endif(NOT CMAKE_Fortran_COMPILER_INIT)
|
||||||
ENDIF(CMAKE_GENERATOR_FC)
|
endif(CMAKE_GENERATOR_FC)
|
||||||
|
|
||||||
# finally list compilers to try
|
# finally list compilers to try
|
||||||
IF(NOT CMAKE_Fortran_COMPILER_INIT)
|
if(NOT CMAKE_Fortran_COMPILER_INIT)
|
||||||
# Known compilers:
|
# Known compilers:
|
||||||
# f77/f90/f95: generic compiler names
|
# f77/f90/f95: generic compiler names
|
||||||
# g77: GNU Fortran 77 compiler
|
# g77: GNU Fortran 77 compiler
|
||||||
|
@ -67,68 +67,68 @@ IF(NOT CMAKE_Fortran_COMPILER)
|
||||||
# The order is 95 or newer compilers first, then 90,
|
# The order is 95 or newer compilers first, then 90,
|
||||||
# then 77 or older compilers, gnu is always last in the group,
|
# then 77 or older compilers, gnu is always last in the group,
|
||||||
# so if you paid for a compiler it is picked by default.
|
# so if you paid for a compiler it is picked by default.
|
||||||
SET(CMAKE_Fortran_COMPILER_LIST
|
set(CMAKE_Fortran_COMPILER_LIST
|
||||||
ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 pgfortran lf95 xlf95
|
ifort ifc af95 af90 efc f95 pathf2003 pathf95 pgf95 pgfortran lf95 xlf95
|
||||||
fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77
|
fort gfortran gfortran-4 g95 f90 pathf90 pgf90 xlf90 epcf90 fort77
|
||||||
frt pgf77 xlf fl32 af77 g77 f77
|
frt pgf77 xlf fl32 af77 g77 f77
|
||||||
)
|
)
|
||||||
|
|
||||||
# Vendor-specific compiler names.
|
# Vendor-specific compiler names.
|
||||||
SET(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77)
|
set(_Fortran_COMPILER_NAMES_GNU gfortran gfortran-4 g95 g77)
|
||||||
SET(_Fortran_COMPILER_NAMES_Intel ifort ifc efc)
|
set(_Fortran_COMPILER_NAMES_Intel ifort ifc efc)
|
||||||
SET(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77)
|
set(_Fortran_COMPILER_NAMES_Absoft af95 af90 af77)
|
||||||
SET(_Fortran_COMPILER_NAMES_PGI pgf95 pgfortran pgf90 pgf77)
|
set(_Fortran_COMPILER_NAMES_PGI pgf95 pgfortran pgf90 pgf77)
|
||||||
SET(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90)
|
set(_Fortran_COMPILER_NAMES_PathScale pathf2003 pathf95 pathf90)
|
||||||
SET(_Fortran_COMPILER_NAMES_XL xlf)
|
set(_Fortran_COMPILER_NAMES_XL xlf)
|
||||||
SET(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf)
|
set(_Fortran_COMPILER_NAMES_VisualAge xlf95 xlf90 xlf)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
_cmake_find_compiler(Fortran)
|
_cmake_find_compiler(Fortran)
|
||||||
|
|
||||||
ELSE(NOT CMAKE_Fortran_COMPILER)
|
else(NOT CMAKE_Fortran_COMPILER)
|
||||||
# we only get here if CMAKE_Fortran_COMPILER was specified using -D or a pre-made CMakeCache.txt
|
# 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
|
# (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
|
# 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
|
# CMAKE_Fortran_COMPILER and the 2nd one as CMAKE_Fortran_COMPILER_ARG1
|
||||||
|
|
||||||
LIST(LENGTH CMAKE_Fortran_COMPILER _CMAKE_Fortran_COMPILER_LIST_LENGTH)
|
list(LENGTH CMAKE_Fortran_COMPILER _CMAKE_Fortran_COMPILER_LIST_LENGTH)
|
||||||
IF("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
|
if("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
|
||||||
LIST(GET CMAKE_Fortran_COMPILER 1 CMAKE_Fortran_COMPILER_ARG1)
|
list(GET CMAKE_Fortran_COMPILER 1 CMAKE_Fortran_COMPILER_ARG1)
|
||||||
LIST(GET CMAKE_Fortran_COMPILER 0 CMAKE_Fortran_COMPILER)
|
list(GET CMAKE_Fortran_COMPILER 0 CMAKE_Fortran_COMPILER)
|
||||||
ENDIF("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
|
endif("${_CMAKE_Fortran_COMPILER_LIST_LENGTH}" EQUAL 2)
|
||||||
|
|
||||||
# if a compiler was specified by the user but without path,
|
# if a compiler was specified by the user but without path,
|
||||||
# now try to find it with the full path
|
# now try to find it with the full path
|
||||||
# if it is found, force it into the cache,
|
# if it is found, force it into the cache,
|
||||||
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
|
# if not, don't overwrite the setting (which was given by the user) with "NOTFOUND"
|
||||||
# if the C compiler already had a path, reuse it for searching the CXX compiler
|
# 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)
|
get_filename_component(_CMAKE_USER_Fortran_COMPILER_PATH "${CMAKE_Fortran_COMPILER}" PATH)
|
||||||
IF(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
|
if(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
|
||||||
FIND_PROGRAM(CMAKE_Fortran_COMPILER_WITH_PATH NAMES ${CMAKE_Fortran_COMPILER})
|
find_program(CMAKE_Fortran_COMPILER_WITH_PATH NAMES ${CMAKE_Fortran_COMPILER})
|
||||||
MARK_AS_ADVANCED(CMAKE_Fortran_COMPILER_WITH_PATH)
|
mark_as_advanced(CMAKE_Fortran_COMPILER_WITH_PATH)
|
||||||
IF(CMAKE_Fortran_COMPILER_WITH_PATH)
|
if(CMAKE_Fortran_COMPILER_WITH_PATH)
|
||||||
SET(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_WITH_PATH}
|
set(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_WITH_PATH}
|
||||||
CACHE STRING "Fortran compiler" FORCE)
|
CACHE STRING "Fortran compiler" FORCE)
|
||||||
ENDIF(CMAKE_Fortran_COMPILER_WITH_PATH)
|
endif(CMAKE_Fortran_COMPILER_WITH_PATH)
|
||||||
ENDIF(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
|
endif(NOT _CMAKE_USER_Fortran_COMPILER_PATH)
|
||||||
ENDIF(NOT CMAKE_Fortran_COMPILER)
|
endif(NOT CMAKE_Fortran_COMPILER)
|
||||||
|
|
||||||
MARK_AS_ADVANCED(CMAKE_Fortran_COMPILER)
|
mark_as_advanced(CMAKE_Fortran_COMPILER)
|
||||||
|
|
||||||
# Build a small source file to identify the compiler.
|
# Build a small source file to identify the compiler.
|
||||||
IF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
if(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
||||||
SET(CMAKE_Fortran_COMPILER_ID_RUN 1)
|
set(CMAKE_Fortran_COMPILER_ID_RUN 1)
|
||||||
SET(CMAKE_Fortran_PLATFORM_ID "Windows")
|
set(CMAKE_Fortran_PLATFORM_ID "Windows")
|
||||||
SET(CMAKE_Fortran_COMPILER_ID "Intel")
|
set(CMAKE_Fortran_COMPILER_ID "Intel")
|
||||||
ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
endif(${CMAKE_GENERATOR} MATCHES "Visual Studio")
|
||||||
|
|
||||||
IF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
|
if(NOT CMAKE_Fortran_COMPILER_ID_RUN)
|
||||||
SET(CMAKE_Fortran_COMPILER_ID_RUN 1)
|
set(CMAKE_Fortran_COMPILER_ID_RUN 1)
|
||||||
|
|
||||||
# Each entry in this list is a set of extra flags to try
|
# Each entry in this list is a set of extra flags to try
|
||||||
# adding to the compile line to see if it helps produce
|
# adding to the compile line to see if it helps produce
|
||||||
# a valid identification executable.
|
# a valid identification executable.
|
||||||
SET(CMAKE_Fortran_COMPILER_ID_TEST_FLAGS
|
set(CMAKE_Fortran_COMPILER_ID_TEST_FLAGS
|
||||||
# Try compiling to an object file only.
|
# Try compiling to an object file only.
|
||||||
"-c"
|
"-c"
|
||||||
|
|
||||||
|
@ -137,65 +137,65 @@ IF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
|
||||||
)
|
)
|
||||||
|
|
||||||
# Table of per-vendor compiler id flags with expected output.
|
# Table of per-vendor compiler id flags with expected output.
|
||||||
LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS Compaq)
|
list(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS Compaq)
|
||||||
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_Compaq "-what")
|
set(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_Compaq "-what")
|
||||||
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_Compaq "Compaq Visual Fortran")
|
set(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_Compaq "Compaq Visual Fortran")
|
||||||
LIST(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS NAG) # Numerical Algorithms Group
|
list(APPEND CMAKE_Fortran_COMPILER_ID_VENDORS NAG) # Numerical Algorithms Group
|
||||||
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_NAG "-V")
|
set(CMAKE_Fortran_COMPILER_ID_VENDOR_FLAGS_NAG "-V")
|
||||||
SET(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_NAG "NAG Fortran Compiler")
|
set(CMAKE_Fortran_COMPILER_ID_VENDOR_REGEX_NAG "NAG Fortran Compiler")
|
||||||
|
|
||||||
# Try to identify the compiler.
|
# Try to identify the compiler.
|
||||||
SET(CMAKE_Fortran_COMPILER_ID)
|
set(CMAKE_Fortran_COMPILER_ID)
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
|
include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake)
|
||||||
CMAKE_DETERMINE_COMPILER_ID(Fortran FFLAGS CMakeFortranCompilerId.F)
|
CMAKE_DETERMINE_COMPILER_ID(Fortran FFLAGS CMakeFortranCompilerId.F)
|
||||||
|
|
||||||
# Fall back to old is-GNU test.
|
# Fall back to old is-GNU test.
|
||||||
IF(NOT CMAKE_Fortran_COMPILER_ID)
|
if(NOT CMAKE_Fortran_COMPILER_ID)
|
||||||
EXEC_PROGRAM(${CMAKE_Fortran_COMPILER}
|
exec_program(${CMAKE_Fortran_COMPILER}
|
||||||
ARGS ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\""
|
ARGS ${CMAKE_Fortran_COMPILER_ID_FLAGS_LIST} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\""
|
||||||
OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN)
|
OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN)
|
||||||
IF(NOT CMAKE_COMPILER_RETURN)
|
if(NOT CMAKE_COMPILER_RETURN)
|
||||||
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
|
if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
|
||||||
SET(CMAKE_Fortran_COMPILER_ID "GNU")
|
set(CMAKE_Fortran_COMPILER_ID "GNU")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Determining if the Fortran compiler is GNU succeeded with "
|
"Determining if the Fortran compiler is GNU succeeded with "
|
||||||
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
|
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
|
||||||
ELSE("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
|
else("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Determining if the Fortran compiler is GNU failed with "
|
"Determining if the Fortran compiler is GNU failed with "
|
||||||
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
|
"the following output:\n${CMAKE_COMPILER_OUTPUT}\n\n")
|
||||||
ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
|
endif("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
|
||||||
IF(NOT CMAKE_Fortran_PLATFORM_ID)
|
if(NOT CMAKE_Fortran_PLATFORM_ID)
|
||||||
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
|
if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
|
||||||
SET(CMAKE_Fortran_PLATFORM_ID "MinGW")
|
set(CMAKE_Fortran_PLATFORM_ID "MinGW")
|
||||||
ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
|
endif("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_MINGW.*" )
|
||||||
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
|
if("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
|
||||||
SET(CMAKE_Fortran_PLATFORM_ID "Cygwin")
|
set(CMAKE_Fortran_PLATFORM_ID "Cygwin")
|
||||||
ENDIF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
|
endif("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_CYGWIN.*" )
|
||||||
ENDIF(NOT CMAKE_Fortran_PLATFORM_ID)
|
endif(NOT CMAKE_Fortran_PLATFORM_ID)
|
||||||
ENDIF(NOT CMAKE_COMPILER_RETURN)
|
endif(NOT CMAKE_COMPILER_RETURN)
|
||||||
ENDIF(NOT CMAKE_Fortran_COMPILER_ID)
|
endif(NOT CMAKE_Fortran_COMPILER_ID)
|
||||||
|
|
||||||
# Set old compiler and platform id variables.
|
# Set old compiler and platform id variables.
|
||||||
IF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
|
if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
|
||||||
SET(CMAKE_COMPILER_IS_GNUG77 1)
|
set(CMAKE_COMPILER_IS_GNUG77 1)
|
||||||
ENDIF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
|
endif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
|
||||||
IF("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
|
if("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
|
||||||
SET(CMAKE_COMPILER_IS_MINGW 1)
|
set(CMAKE_COMPILER_IS_MINGW 1)
|
||||||
ELSEIF("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin")
|
elseif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "Cygwin")
|
||||||
SET(CMAKE_COMPILER_IS_CYGWIN 1)
|
set(CMAKE_COMPILER_IS_CYGWIN 1)
|
||||||
ENDIF("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
|
endif("${CMAKE_Fortran_PLATFORM_ID}" MATCHES "MinGW")
|
||||||
ENDIF(NOT CMAKE_Fortran_COMPILER_ID_RUN)
|
endif(NOT CMAKE_Fortran_COMPILER_ID_RUN)
|
||||||
|
|
||||||
INCLUDE(CMakeFindBinUtils)
|
include(CMakeFindBinUtils)
|
||||||
|
|
||||||
IF(MSVC_Fortran_ARCHITECTURE_ID)
|
if(MSVC_Fortran_ARCHITECTURE_ID)
|
||||||
SET(SET_MSVC_Fortran_ARCHITECTURE_ID
|
set(SET_MSVC_Fortran_ARCHITECTURE_ID
|
||||||
"SET(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})")
|
"set(MSVC_Fortran_ARCHITECTURE_ID ${MSVC_Fortran_ARCHITECTURE_ID})")
|
||||||
ENDIF()
|
endif()
|
||||||
# configure variables set in this file for fast reload later on
|
# configure variables set in this file for fast reload later on
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
|
configure_file(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake
|
||||||
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
|
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
|
||||||
)
|
)
|
||||||
SET(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
|
set(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
|
||||||
|
|
|
@ -16,33 +16,33 @@
|
||||||
# NOTE, a generator may set CMAKE_Java_COMPILER before
|
# NOTE, a generator may set CMAKE_Java_COMPILER before
|
||||||
# loading this file to force a compiler.
|
# loading this file to force a compiler.
|
||||||
|
|
||||||
IF(NOT CMAKE_Java_COMPILER)
|
if(NOT CMAKE_Java_COMPILER)
|
||||||
# prefer the environment variable CC
|
# prefer the environment variable CC
|
||||||
IF($ENV{JAVA_COMPILER} MATCHES ".+")
|
if($ENV{JAVA_COMPILER} MATCHES ".+")
|
||||||
GET_FILENAME_COMPONENT(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
|
get_filename_component(CMAKE_Java_COMPILER_INIT $ENV{JAVA_COMPILER} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
|
||||||
IF(CMAKE_Java_FLAGS_ENV_INIT)
|
if(CMAKE_Java_FLAGS_ENV_INIT)
|
||||||
SET(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler")
|
set(CMAKE_Java_COMPILER_ARG1 "${CMAKE_Java_FLAGS_ENV_INIT}" CACHE STRING "First argument to Java compiler")
|
||||||
ENDIF(CMAKE_Java_FLAGS_ENV_INIT)
|
endif(CMAKE_Java_FLAGS_ENV_INIT)
|
||||||
IF(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
|
if(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
|
||||||
MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.")
|
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_COMPILER:\n$ENV{JAVA_COMPILER}.")
|
||||||
ENDIF(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
|
endif(NOT EXISTS ${CMAKE_Java_COMPILER_INIT})
|
||||||
ENDIF($ENV{JAVA_COMPILER} MATCHES ".+")
|
endif($ENV{JAVA_COMPILER} MATCHES ".+")
|
||||||
|
|
||||||
IF($ENV{JAVA_RUNTIME} MATCHES ".+")
|
if($ENV{JAVA_RUNTIME} MATCHES ".+")
|
||||||
GET_FILENAME_COMPONENT(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
|
get_filename_component(CMAKE_Java_RUNTIME_INIT $ENV{JAVA_RUNTIME} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
|
||||||
IF(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
|
if(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
|
||||||
MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
|
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_RUNTIME:\n$ENV{JAVA_RUNTIME}.")
|
||||||
ENDIF(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
|
endif(NOT EXISTS ${CMAKE_Java_RUNTIME_INIT})
|
||||||
ENDIF($ENV{JAVA_RUNTIME} MATCHES ".+")
|
endif($ENV{JAVA_RUNTIME} MATCHES ".+")
|
||||||
|
|
||||||
IF($ENV{JAVA_ARCHIVE} MATCHES ".+")
|
if($ENV{JAVA_ARCHIVE} MATCHES ".+")
|
||||||
GET_FILENAME_COMPONENT(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
|
get_filename_component(CMAKE_Java_ARCHIVE_INIT $ENV{JAVA_ARCHIVE} PROGRAM PROGRAM_ARGS CMAKE_Java_FLAGS_ENV_INIT)
|
||||||
IF(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
|
if(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
|
||||||
MESSAGE(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")
|
message(SEND_ERROR "Could not find compiler set in environment variable JAVA_ARCHIVE:\n$ENV{JAVA_ARCHIVE}.")
|
||||||
ENDIF(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
|
endif(NOT EXISTS ${CMAKE_Java_ARCHIVE_INIT})
|
||||||
ENDIF($ENV{JAVA_ARCHIVE} MATCHES ".+")
|
endif($ENV{JAVA_ARCHIVE} MATCHES ".+")
|
||||||
|
|
||||||
SET(Java_BIN_PATH
|
set(Java_BIN_PATH
|
||||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin"
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\2.0;JavaHome]/bin"
|
||||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/bin"
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.9;JavaHome]/bin"
|
||||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/bin"
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\JavaSoft\\Java Development Kit\\1.8;JavaHome]/bin"
|
||||||
|
@ -65,38 +65,38 @@ IF(NOT CMAKE_Java_COMPILER)
|
||||||
/opt/sun-jdk-1.5.0.04/bin
|
/opt/sun-jdk-1.5.0.04/bin
|
||||||
)
|
)
|
||||||
# if no compiler has been specified yet, then look for one
|
# if no compiler has been specified yet, then look for one
|
||||||
IF(CMAKE_Java_COMPILER_INIT)
|
if(CMAKE_Java_COMPILER_INIT)
|
||||||
SET(CMAKE_Java_COMPILER ${CMAKE_Java_COMPILER_INIT} CACHE PATH "Java Compiler")
|
set(CMAKE_Java_COMPILER ${CMAKE_Java_COMPILER_INIT} CACHE PATH "Java Compiler")
|
||||||
ELSE(CMAKE_Java_COMPILER_INIT)
|
else(CMAKE_Java_COMPILER_INIT)
|
||||||
FIND_PROGRAM(CMAKE_Java_COMPILER
|
find_program(CMAKE_Java_COMPILER
|
||||||
NAMES javac
|
NAMES javac
|
||||||
PATHS ${Java_BIN_PATH}
|
PATHS ${Java_BIN_PATH}
|
||||||
)
|
)
|
||||||
ENDIF(CMAKE_Java_COMPILER_INIT)
|
endif(CMAKE_Java_COMPILER_INIT)
|
||||||
|
|
||||||
# if no runtime has been specified yet, then look for one
|
# if no runtime has been specified yet, then look for one
|
||||||
IF(CMAKE_Java_RUNTIME_INIT)
|
if(CMAKE_Java_RUNTIME_INIT)
|
||||||
SET(CMAKE_Java_RUNTIME ${CMAKE_Java_RUNTIME_INIT} CACHE PATH "Java Compiler")
|
set(CMAKE_Java_RUNTIME ${CMAKE_Java_RUNTIME_INIT} CACHE PATH "Java Compiler")
|
||||||
ELSE(CMAKE_Java_RUNTIME_INIT)
|
else(CMAKE_Java_RUNTIME_INIT)
|
||||||
FIND_PROGRAM(CMAKE_Java_RUNTIME
|
find_program(CMAKE_Java_RUNTIME
|
||||||
NAMES java
|
NAMES java
|
||||||
PATHS ${Java_BIN_PATH}
|
PATHS ${Java_BIN_PATH}
|
||||||
)
|
)
|
||||||
ENDIF(CMAKE_Java_RUNTIME_INIT)
|
endif(CMAKE_Java_RUNTIME_INIT)
|
||||||
|
|
||||||
# if no archive has been specified yet, then look for one
|
# if no archive has been specified yet, then look for one
|
||||||
IF(CMAKE_Java_ARCHIVE_INIT)
|
if(CMAKE_Java_ARCHIVE_INIT)
|
||||||
SET(CMAKE_Java_ARCHIVE ${CMAKE_Java_ARCHIVE_INIT} CACHE PATH "Java Compiler")
|
set(CMAKE_Java_ARCHIVE ${CMAKE_Java_ARCHIVE_INIT} CACHE PATH "Java Compiler")
|
||||||
ELSE(CMAKE_Java_ARCHIVE_INIT)
|
else(CMAKE_Java_ARCHIVE_INIT)
|
||||||
FIND_PROGRAM(CMAKE_Java_ARCHIVE
|
find_program(CMAKE_Java_ARCHIVE
|
||||||
NAMES jar
|
NAMES jar
|
||||||
PATHS ${Java_BIN_PATH}
|
PATHS ${Java_BIN_PATH}
|
||||||
)
|
)
|
||||||
ENDIF(CMAKE_Java_ARCHIVE_INIT)
|
endif(CMAKE_Java_ARCHIVE_INIT)
|
||||||
ENDIF(NOT CMAKE_Java_COMPILER)
|
endif(NOT CMAKE_Java_COMPILER)
|
||||||
MARK_AS_ADVANCED(CMAKE_Java_COMPILER)
|
mark_as_advanced(CMAKE_Java_COMPILER)
|
||||||
|
|
||||||
# configure variables set in this file for fast reload later on
|
# configure variables set in this file for fast reload later on
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in
|
configure_file(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeJavaCompiler.cmake IMMEDIATE @ONLY)
|
${CMAKE_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")
|
||||||
|
|
|
@ -18,50 +18,50 @@
|
||||||
# use environment variable CCC first if defined by user, next use
|
# use environment variable CCC first if defined by user, next use
|
||||||
# the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
|
# the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
|
||||||
# as a default compiler
|
# as a default compiler
|
||||||
IF(NOT CMAKE_RC_COMPILER)
|
if(NOT CMAKE_RC_COMPILER)
|
||||||
# prefer the environment variable CC
|
# prefer the environment variable CC
|
||||||
IF($ENV{RC} MATCHES ".+")
|
if($ENV{RC} MATCHES ".+")
|
||||||
GET_FILENAME_COMPONENT(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT)
|
get_filename_component(CMAKE_RC_COMPILER_INIT $ENV{RC} PROGRAM PROGRAM_ARGS CMAKE_RC_FLAGS_ENV_INIT)
|
||||||
IF(CMAKE_RC_FLAGS_ENV_INIT)
|
if(CMAKE_RC_FLAGS_ENV_INIT)
|
||||||
SET(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler")
|
set(CMAKE_RC_COMPILER_ARG1 "${CMAKE_RC_FLAGS_ENV_INIT}" CACHE STRING "First argument to RC compiler")
|
||||||
ENDIF(CMAKE_RC_FLAGS_ENV_INIT)
|
endif(CMAKE_RC_FLAGS_ENV_INIT)
|
||||||
IF(EXISTS ${CMAKE_RC_COMPILER_INIT})
|
if(EXISTS ${CMAKE_RC_COMPILER_INIT})
|
||||||
ELSE(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}.")
|
message(FATAL_ERROR "Could not find compiler set in environment variable RC:\n$ENV{RC}.")
|
||||||
ENDIF(EXISTS ${CMAKE_RC_COMPILER_INIT})
|
endif(EXISTS ${CMAKE_RC_COMPILER_INIT})
|
||||||
ENDIF($ENV{RC} MATCHES ".+")
|
endif($ENV{RC} MATCHES ".+")
|
||||||
|
|
||||||
# next try prefer the compiler specified by the generator
|
# next try prefer the compiler specified by the generator
|
||||||
IF(CMAKE_GENERATOR_RC)
|
if(CMAKE_GENERATOR_RC)
|
||||||
IF(NOT CMAKE_RC_COMPILER_INIT)
|
if(NOT CMAKE_RC_COMPILER_INIT)
|
||||||
SET(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC})
|
set(CMAKE_RC_COMPILER_INIT ${CMAKE_GENERATOR_RC})
|
||||||
ENDIF(NOT CMAKE_RC_COMPILER_INIT)
|
endif(NOT CMAKE_RC_COMPILER_INIT)
|
||||||
ENDIF(CMAKE_GENERATOR_RC)
|
endif(CMAKE_GENERATOR_RC)
|
||||||
|
|
||||||
# finally list compilers to try
|
# finally list compilers to try
|
||||||
IF(CMAKE_RC_COMPILER_INIT)
|
if(CMAKE_RC_COMPILER_INIT)
|
||||||
SET(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
|
set(CMAKE_RC_COMPILER_LIST ${CMAKE_RC_COMPILER_INIT})
|
||||||
ELSE(CMAKE_RC_COMPILER_INIT)
|
else(CMAKE_RC_COMPILER_INIT)
|
||||||
SET(CMAKE_RC_COMPILER_LIST rc)
|
set(CMAKE_RC_COMPILER_LIST rc)
|
||||||
ENDIF(CMAKE_RC_COMPILER_INIT)
|
endif(CMAKE_RC_COMPILER_INIT)
|
||||||
|
|
||||||
# Find the compiler.
|
# Find the compiler.
|
||||||
FIND_PROGRAM(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "RC compiler")
|
find_program(CMAKE_RC_COMPILER NAMES ${CMAKE_RC_COMPILER_LIST} DOC "RC compiler")
|
||||||
IF(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
|
if(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
|
||||||
SET(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE)
|
set(CMAKE_RC_COMPILER "${CMAKE_RC_COMPILER_INIT}" CACHE FILEPATH "RC compiler" FORCE)
|
||||||
ENDIF(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
|
endif(CMAKE_RC_COMPILER_INIT AND NOT CMAKE_RC_COMPILER)
|
||||||
ENDIF(NOT CMAKE_RC_COMPILER)
|
endif(NOT CMAKE_RC_COMPILER)
|
||||||
|
|
||||||
MARK_AS_ADVANCED(CMAKE_RC_COMPILER)
|
mark_as_advanced(CMAKE_RC_COMPILER)
|
||||||
|
|
||||||
GET_FILENAME_COMPONENT(_CMAKE_RC_COMPILER_NAME_WE ${CMAKE_RC_COMPILER} NAME_WE)
|
get_filename_component(_CMAKE_RC_COMPILER_NAME_WE ${CMAKE_RC_COMPILER} NAME_WE)
|
||||||
IF(_CMAKE_RC_COMPILER_NAME_WE STREQUAL "windres")
|
if(_CMAKE_RC_COMPILER_NAME_WE STREQUAL "windres")
|
||||||
SET(CMAKE_RC_OUTPUT_EXTENSION .obj)
|
set(CMAKE_RC_OUTPUT_EXTENSION .obj)
|
||||||
ELSE()
|
else()
|
||||||
SET(CMAKE_RC_OUTPUT_EXTENSION .res)
|
set(CMAKE_RC_OUTPUT_EXTENSION .res)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# configure variables set in this file for fast reload later on
|
# configure variables set in this file for fast reload later on
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in
|
configure_file(${CMAKE_ROOT}/Modules/CMakeRCCompiler.cmake.in
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeRCCompiler.cmake IMMEDIATE)
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeRCCompiler.cmake IMMEDIATE)
|
||||||
SET(CMAKE_RC_COMPILER_ENV_VAR "RC")
|
set(CMAKE_RC_COMPILER_ENV_VAR "RC")
|
||||||
|
|
|
@ -42,135 +42,135 @@
|
||||||
|
|
||||||
|
|
||||||
# find out on which system cmake runs
|
# find out on which system cmake runs
|
||||||
IF(CMAKE_HOST_UNIX)
|
if(CMAKE_HOST_UNIX)
|
||||||
FIND_PROGRAM(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
|
find_program(CMAKE_UNAME uname /bin /usr/bin /usr/local/bin )
|
||||||
IF(CMAKE_UNAME)
|
if(CMAKE_UNAME)
|
||||||
EXEC_PROGRAM(uname ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_NAME)
|
exec_program(uname ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_NAME)
|
||||||
EXEC_PROGRAM(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
|
exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
|
||||||
IF(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*")
|
if(CMAKE_HOST_SYSTEM_NAME MATCHES "Linux|CYGWIN.*")
|
||||||
EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
|
exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
|
||||||
RETURN_VALUE val)
|
RETURN_VALUE val)
|
||||||
ELSEIF(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD")
|
elseif(CMAKE_HOST_SYSTEM_NAME MATCHES "OpenBSD")
|
||||||
EXEC_PROGRAM(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
|
exec_program(arch ARGS -s OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
|
||||||
RETURN_VALUE val)
|
RETURN_VALUE val)
|
||||||
ELSE()
|
else()
|
||||||
EXEC_PROGRAM(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
|
exec_program(uname ARGS -p OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
|
||||||
RETURN_VALUE val)
|
RETURN_VALUE val)
|
||||||
IF("${val}" GREATER 0)
|
if("${val}" GREATER 0)
|
||||||
EXEC_PROGRAM(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
|
exec_program(uname ARGS -m OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_PROCESSOR
|
||||||
RETURN_VALUE val)
|
RETURN_VALUE val)
|
||||||
ENDIF("${val}" GREATER 0)
|
endif("${val}" GREATER 0)
|
||||||
ENDIF()
|
endif()
|
||||||
# check the return of the last uname -m or -p
|
# check the return of the last uname -m or -p
|
||||||
IF("${val}" GREATER 0)
|
if("${val}" GREATER 0)
|
||||||
SET(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")
|
set(CMAKE_HOST_SYSTEM_PROCESSOR "unknown")
|
||||||
ENDIF("${val}" GREATER 0)
|
endif("${val}" GREATER 0)
|
||||||
SET(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command")
|
set(CMAKE_UNAME ${CMAKE_UNAME} CACHE INTERNAL "uname command")
|
||||||
# processor may have double quote in the name, and that needs to be removed
|
# processor may have double quote in the name, and that needs to be removed
|
||||||
STRING(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
string(REGEX REPLACE "\"" "" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||||
STRING(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
string(REGEX REPLACE "/" "_" CMAKE_HOST_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||||
ENDIF(CMAKE_UNAME)
|
endif(CMAKE_UNAME)
|
||||||
ELSE(CMAKE_HOST_UNIX)
|
else(CMAKE_HOST_UNIX)
|
||||||
IF(CMAKE_HOST_WIN32)
|
if(CMAKE_HOST_WIN32)
|
||||||
SET (CMAKE_HOST_SYSTEM_NAME "Windows")
|
set (CMAKE_HOST_SYSTEM_NAME "Windows")
|
||||||
SET (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
|
set (CMAKE_HOST_SYSTEM_PROCESSOR "$ENV{PROCESSOR_ARCHITECTURE}")
|
||||||
ENDIF(CMAKE_HOST_WIN32)
|
endif(CMAKE_HOST_WIN32)
|
||||||
ENDIF(CMAKE_HOST_UNIX)
|
endif(CMAKE_HOST_UNIX)
|
||||||
|
|
||||||
# if a toolchain file is used, the user wants to cross compile.
|
# if a toolchain file is used, the user wants to cross compile.
|
||||||
# in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_*
|
# in this case read the toolchain file and keep the CMAKE_HOST_SYSTEM_*
|
||||||
# variables around so they can be used in CMakeLists.txt.
|
# variables around so they can be used in CMakeLists.txt.
|
||||||
# In all other cases, the host and target platform are the same.
|
# In all other cases, the host and target platform are the same.
|
||||||
IF(CMAKE_TOOLCHAIN_FILE)
|
if(CMAKE_TOOLCHAIN_FILE)
|
||||||
# at first try to load it as path relative to the directory from which cmake has been run
|
# at first try to load it as path relative to the directory from which cmake has been run
|
||||||
INCLUDE("${CMAKE_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
|
include("${CMAKE_BINARY_DIR}/${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
|
||||||
IF(NOT _INCLUDED_TOOLCHAIN_FILE)
|
if(NOT _INCLUDED_TOOLCHAIN_FILE)
|
||||||
# if the file isn't found there, check the default locations
|
# if the file isn't found there, check the default locations
|
||||||
INCLUDE("${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
|
include("${CMAKE_TOOLCHAIN_FILE}" OPTIONAL RESULT_VARIABLE _INCLUDED_TOOLCHAIN_FILE)
|
||||||
ENDIF(NOT _INCLUDED_TOOLCHAIN_FILE)
|
endif(NOT _INCLUDED_TOOLCHAIN_FILE)
|
||||||
|
|
||||||
IF(_INCLUDED_TOOLCHAIN_FILE)
|
if(_INCLUDED_TOOLCHAIN_FILE)
|
||||||
SET(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE)
|
set(CMAKE_TOOLCHAIN_FILE "${_INCLUDED_TOOLCHAIN_FILE}" CACHE FILEPATH "The CMake toolchain file" FORCE)
|
||||||
ELSE(_INCLUDED_TOOLCHAIN_FILE)
|
else(_INCLUDED_TOOLCHAIN_FILE)
|
||||||
MESSAGE(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
|
message(FATAL_ERROR "Could not find toolchain file: ${CMAKE_TOOLCHAIN_FILE}")
|
||||||
SET(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE)
|
set(CMAKE_TOOLCHAIN_FILE "NOTFOUND" CACHE FILEPATH "The CMake toolchain file" FORCE)
|
||||||
ENDIF(_INCLUDED_TOOLCHAIN_FILE)
|
endif(_INCLUDED_TOOLCHAIN_FILE)
|
||||||
ENDIF(CMAKE_TOOLCHAIN_FILE)
|
endif(CMAKE_TOOLCHAIN_FILE)
|
||||||
|
|
||||||
|
|
||||||
# if CMAKE_SYSTEM_NAME is here already set, either it comes from a toolchain file
|
# if CMAKE_SYSTEM_NAME is here already set, either it comes from a toolchain file
|
||||||
# or it was set via -DCMAKE_SYSTEM_NAME=...
|
# or it was set via -DCMAKE_SYSTEM_NAME=...
|
||||||
# if that's the case, assume we are crosscompiling
|
# if that's the case, assume we are crosscompiling
|
||||||
IF(CMAKE_SYSTEM_NAME)
|
if(CMAKE_SYSTEM_NAME)
|
||||||
IF(NOT DEFINED CMAKE_CROSSCOMPILING)
|
if(NOT DEFINED CMAKE_CROSSCOMPILING)
|
||||||
SET(CMAKE_CROSSCOMPILING TRUE)
|
set(CMAKE_CROSSCOMPILING TRUE)
|
||||||
ENDIF(NOT DEFINED CMAKE_CROSSCOMPILING)
|
endif(NOT DEFINED CMAKE_CROSSCOMPILING)
|
||||||
SET(PRESET_CMAKE_SYSTEM_NAME TRUE)
|
set(PRESET_CMAKE_SYSTEM_NAME TRUE)
|
||||||
ELSE(CMAKE_SYSTEM_NAME)
|
else(CMAKE_SYSTEM_NAME)
|
||||||
SET(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
|
set(CMAKE_SYSTEM_NAME "${CMAKE_HOST_SYSTEM_NAME}")
|
||||||
SET(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
|
set(CMAKE_SYSTEM_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
|
||||||
SET(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
set(CMAKE_SYSTEM_PROCESSOR "${CMAKE_HOST_SYSTEM_PROCESSOR}")
|
||||||
SET(CMAKE_CROSSCOMPILING FALSE)
|
set(CMAKE_CROSSCOMPILING FALSE)
|
||||||
SET(PRESET_CMAKE_SYSTEM_NAME FALSE)
|
set(PRESET_CMAKE_SYSTEM_NAME FALSE)
|
||||||
ENDIF(CMAKE_SYSTEM_NAME)
|
endif(CMAKE_SYSTEM_NAME)
|
||||||
|
|
||||||
|
|
||||||
MACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
|
macro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
|
||||||
IF(NOT ${_PREFIX}_NAME)
|
if(NOT ${_PREFIX}_NAME)
|
||||||
SET(${_PREFIX}_NAME "UnknownOS")
|
set(${_PREFIX}_NAME "UnknownOS")
|
||||||
ENDIF(NOT ${_PREFIX}_NAME)
|
endif(NOT ${_PREFIX}_NAME)
|
||||||
|
|
||||||
# fix for BSD/OS , remove the /
|
# fix for BSD/OS , remove the /
|
||||||
IF(${_PREFIX}_NAME MATCHES BSD.OS)
|
if(${_PREFIX}_NAME MATCHES BSD.OS)
|
||||||
SET(${_PREFIX}_NAME BSDOS)
|
set(${_PREFIX}_NAME BSDOS)
|
||||||
ENDIF(${_PREFIX}_NAME MATCHES BSD.OS)
|
endif(${_PREFIX}_NAME MATCHES BSD.OS)
|
||||||
|
|
||||||
# fix for GNU/kFreeBSD, remove the GNU/
|
# fix for GNU/kFreeBSD, remove the GNU/
|
||||||
IF(${_PREFIX}_NAME MATCHES kFreeBSD)
|
if(${_PREFIX}_NAME MATCHES kFreeBSD)
|
||||||
SET(${_PREFIX}_NAME kFreeBSD)
|
set(${_PREFIX}_NAME kFreeBSD)
|
||||||
ENDIF(${_PREFIX}_NAME MATCHES kFreeBSD)
|
endif(${_PREFIX}_NAME MATCHES kFreeBSD)
|
||||||
|
|
||||||
# fix for CYGWIN which has windows version in it
|
# fix for CYGWIN which has windows version in it
|
||||||
IF(${_PREFIX}_NAME MATCHES CYGWIN)
|
if(${_PREFIX}_NAME MATCHES CYGWIN)
|
||||||
SET(${_PREFIX}_NAME CYGWIN)
|
set(${_PREFIX}_NAME CYGWIN)
|
||||||
ENDIF(${_PREFIX}_NAME MATCHES CYGWIN)
|
endif(${_PREFIX}_NAME MATCHES CYGWIN)
|
||||||
|
|
||||||
# set CMAKE_SYSTEM to the CMAKE_SYSTEM_NAME
|
# set CMAKE_SYSTEM to the CMAKE_SYSTEM_NAME
|
||||||
SET(${_PREFIX} ${${_PREFIX}_NAME})
|
set(${_PREFIX} ${${_PREFIX}_NAME})
|
||||||
# if there is a CMAKE_SYSTEM_VERSION then add a -${CMAKE_SYSTEM_VERSION}
|
# if there is a CMAKE_SYSTEM_VERSION then add a -${CMAKE_SYSTEM_VERSION}
|
||||||
IF(${_PREFIX}_VERSION)
|
if(${_PREFIX}_VERSION)
|
||||||
SET(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION})
|
set(${_PREFIX} ${${_PREFIX}}-${${_PREFIX}_VERSION})
|
||||||
ENDIF(${_PREFIX}_VERSION)
|
endif(${_PREFIX}_VERSION)
|
||||||
|
|
||||||
ENDMACRO(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
|
endmacro(ADJUST_CMAKE_SYSTEM_VARIABLES _PREFIX)
|
||||||
|
|
||||||
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM)
|
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_SYSTEM)
|
||||||
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM)
|
ADJUST_CMAKE_SYSTEM_VARIABLES(CMAKE_HOST_SYSTEM)
|
||||||
|
|
||||||
# this file is also executed from cpack, then we don't need to generate these files
|
# this file is also executed from cpack, then we don't need to generate these files
|
||||||
# in this case there is no CMAKE_BINARY_DIR
|
# in this case there is no CMAKE_BINARY_DIR
|
||||||
IF(CMAKE_BINARY_DIR)
|
if(CMAKE_BINARY_DIR)
|
||||||
# write entry to the log file
|
# write entry to the log file
|
||||||
IF(PRESET_CMAKE_SYSTEM_NAME)
|
if(PRESET_CMAKE_SYSTEM_NAME)
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
|
"The target system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n")
|
"The host system is: ${CMAKE_HOST_SYSTEM_NAME} - ${CMAKE_HOST_SYSTEM_VERSION} - ${CMAKE_HOST_SYSTEM_PROCESSOR}\n")
|
||||||
ELSE(PRESET_CMAKE_SYSTEM_NAME)
|
else(PRESET_CMAKE_SYSTEM_NAME)
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
|
"The system is: ${CMAKE_SYSTEM_NAME} - ${CMAKE_SYSTEM_VERSION} - ${CMAKE_SYSTEM_PROCESSOR}\n")
|
||||||
ENDIF(PRESET_CMAKE_SYSTEM_NAME)
|
endif(PRESET_CMAKE_SYSTEM_NAME)
|
||||||
|
|
||||||
# if a toolchain file is used, it needs to be included in the configured file,
|
# if a toolchain file is used, it needs to be included in the configured file,
|
||||||
# so settings done there are also available if they don't go in the cache and in TRY_COMPILE()
|
# so settings done there are also available if they don't go in the cache and in try_compile()
|
||||||
SET(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED)
|
set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED)
|
||||||
IF(DEFINED CMAKE_TOOLCHAIN_FILE)
|
if(DEFINED CMAKE_TOOLCHAIN_FILE)
|
||||||
SET(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED "INCLUDE(\"${CMAKE_TOOLCHAIN_FILE}\")")
|
set(INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED "include(\"${CMAKE_TOOLCHAIN_FILE}\")")
|
||||||
ENDIF(DEFINED CMAKE_TOOLCHAIN_FILE)
|
endif(DEFINED CMAKE_TOOLCHAIN_FILE)
|
||||||
|
|
||||||
# configure variables set in this file for fast reload, the template file is defined at the top of this file
|
# configure variables set in this file for fast reload, the template file is defined at the top of this file
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
|
configure_file(${CMAKE_ROOT}/Modules/CMakeSystem.cmake.in
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeSystem.cmake
|
||||||
IMMEDIATE @ONLY)
|
IMMEDIATE @ONLY)
|
||||||
|
|
||||||
ENDIF(CMAKE_BINARY_DIR)
|
endif(CMAKE_BINARY_DIR)
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
# the first configuration from ${CMAKE_CONFIGURATION_TYPES} if set, otherwise
|
# the first configuration from ${CMAKE_CONFIGURATION_TYPES} if set, otherwise
|
||||||
# ${CMAKE_BUILD_TYPE}.
|
# ${CMAKE_BUILD_TYPE}.
|
||||||
# This macro is used by all Check*.cmake files which use
|
# This macro is used by all Check*.cmake files which use
|
||||||
# TRY_COMPILE() or TRY_RUN() and support CMAKE_REQUIRED_LIBRARIES , so that
|
# try_compile() or try_run() and support CMAKE_REQUIRED_LIBRARIES , so that
|
||||||
# these checks support imported targets in CMAKE_REQUIRED_LIBRARIES:
|
# these checks support imported targets in CMAKE_REQUIRED_LIBRARIES:
|
||||||
# cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
|
# cmake_expand_imported_targets(expandedLibs LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}
|
||||||
# CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
|
# CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}" )
|
||||||
|
|
|
@ -13,24 +13,24 @@
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
# This module is purposely no longer documented. It does nothing useful.
|
# This module is purposely no longer documented. It does nothing useful.
|
||||||
IF(NOT "${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS 2.7)
|
if(NOT "${CMAKE_MINIMUM_REQUIRED_VERSION}" VERSION_LESS 2.7)
|
||||||
MESSAGE(FATAL_ERROR
|
message(FATAL_ERROR
|
||||||
"The functionality of this module has been dropped as of CMake 2.8. "
|
"The functionality of this module has been dropped as of CMake 2.8. "
|
||||||
"It was deemed harmful (confusing users by changing their compiler). "
|
"It was deemed harmful (confusing users by changing their compiler). "
|
||||||
"Please remove calls to the CMAKE_EXPORT_BUILD_SETTINGS macro and "
|
"Please remove calls to the CMAKE_EXPORT_BUILD_SETTINGS macro and "
|
||||||
"stop including this module. "
|
"stop including this module. "
|
||||||
"If this project generates any files for use by external projects, "
|
"If this project generates any files for use by external projects, "
|
||||||
"remove any use of the CMakeImportBuildSettings module from them.")
|
"remove any use of the CMakeImportBuildSettings module from them.")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# This macro used to store build settings of a project in a file to be
|
# This macro used to store build settings of a project in a file to be
|
||||||
# loaded by another project using CMAKE_IMPORT_BUILD_SETTINGS. Now it
|
# loaded by another project using CMAKE_IMPORT_BUILD_SETTINGS. Now it
|
||||||
# creates a file that refuses to load (with comment explaining why).
|
# creates a file that refuses to load (with comment explaining why).
|
||||||
MACRO(CMAKE_EXPORT_BUILD_SETTINGS SETTINGS_FILE)
|
macro(CMAKE_EXPORT_BUILD_SETTINGS SETTINGS_FILE)
|
||||||
IF(${SETTINGS_FILE} MATCHES ".+")
|
if(${SETTINGS_FILE} MATCHES ".+")
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in
|
configure_file(${CMAKE_ROOT}/Modules/CMakeBuildSettings.cmake.in
|
||||||
${SETTINGS_FILE} @ONLY IMMEDIATE)
|
${SETTINGS_FILE} @ONLY IMMEDIATE)
|
||||||
ELSE(${SETTINGS_FILE} MATCHES ".+")
|
else(${SETTINGS_FILE} MATCHES ".+")
|
||||||
MESSAGE(SEND_ERROR "CMAKE_EXPORT_BUILD_SETTINGS called with no argument.")
|
message(SEND_ERROR "CMAKE_EXPORT_BUILD_SETTINGS called with no argument.")
|
||||||
ENDIF(${SETTINGS_FILE} MATCHES ".+")
|
endif(${SETTINGS_FILE} MATCHES ".+")
|
||||||
ENDMACRO(CMAKE_EXPORT_BUILD_SETTINGS)
|
endmacro(CMAKE_EXPORT_BUILD_SETTINGS)
|
||||||
|
|
|
@ -18,39 +18,39 @@
|
||||||
# so that they can find the headers at runtime and parsing etc. works better
|
# so that they can find the headers at runtime and parsing etc. works better
|
||||||
# This is done here by actually running gcc with the options so it prints its
|
# This is done here by actually running gcc with the options so it prints its
|
||||||
# system include directories, which are parsed then and stored in the cache.
|
# system include directories, which are parsed then and stored in the cache.
|
||||||
MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines)
|
macro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines)
|
||||||
SET(${_resultIncludeDirs})
|
set(${_resultIncludeDirs})
|
||||||
SET(_gccOutput)
|
set(_gccOutput)
|
||||||
FILE(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
|
file(WRITE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy" "\n" )
|
||||||
|
|
||||||
IF (${_lang} STREQUAL "c++")
|
if (${_lang} STREQUAL "c++")
|
||||||
SET(_compilerExecutable "${CMAKE_CXX_COMPILER}")
|
set(_compilerExecutable "${CMAKE_CXX_COMPILER}")
|
||||||
SET(_arg1 "${CMAKE_CXX_COMPILER_ARG1}")
|
set(_arg1 "${CMAKE_CXX_COMPILER_ARG1}")
|
||||||
ELSE ()
|
else ()
|
||||||
SET(_compilerExecutable "${CMAKE_C_COMPILER}")
|
set(_compilerExecutable "${CMAKE_C_COMPILER}")
|
||||||
SET(_arg1 "${CMAKE_C_COMPILER_ARG1}")
|
set(_arg1 "${CMAKE_C_COMPILER_ARG1}")
|
||||||
ENDIF ()
|
endif ()
|
||||||
EXECUTE_PROCESS(COMMAND ${_compilerExecutable} ${_arg1} -v -E -x ${_lang} -dD dummy
|
execute_process(COMMAND ${_compilerExecutable} ${_arg1} -v -E -x ${_lang} -dD dummy
|
||||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
|
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/CMakeFiles
|
||||||
ERROR_VARIABLE _gccOutput
|
ERROR_VARIABLE _gccOutput
|
||||||
OUTPUT_VARIABLE _gccStdout )
|
OUTPUT_VARIABLE _gccStdout )
|
||||||
FILE(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
|
file(REMOVE "${CMAKE_BINARY_DIR}/CMakeFiles/dummy")
|
||||||
|
|
||||||
# First find the system include dirs:
|
# First find the system include dirs:
|
||||||
IF( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+ *\n) *End of (search) list" )
|
if( "${_gccOutput}" MATCHES "> search starts here[^\n]+\n *(.+ *\n) *End of (search) list" )
|
||||||
|
|
||||||
# split the output into lines and then remove leading and trailing spaces from each of them:
|
# split the output into lines and then remove leading and trailing spaces from each of them:
|
||||||
STRING(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
|
string(REGEX MATCHALL "[^\n]+\n" _includeLines "${CMAKE_MATCH_1}")
|
||||||
FOREACH(nextLine ${_includeLines})
|
foreach(nextLine ${_includeLines})
|
||||||
STRING(STRIP "${nextLine}" _includePath)
|
string(STRIP "${nextLine}" _includePath)
|
||||||
LIST(APPEND ${_resultIncludeDirs} "${_includePath}")
|
list(APPEND ${_resultIncludeDirs} "${_includePath}")
|
||||||
ENDFOREACH(nextLine)
|
endforeach(nextLine)
|
||||||
|
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# now find the builtin macros:
|
# now find the builtin macros:
|
||||||
STRING(REGEX MATCHALL "#define[^\n]+\n" _defineLines "${_gccStdout}")
|
string(REGEX MATCHALL "#define[^\n]+\n" _defineLines "${_gccStdout}")
|
||||||
# A few example lines which the regexp below has to match properly:
|
# A few example lines which the regexp below has to match properly:
|
||||||
# #define MAX(a,b) ((a) > (b) ? (a) : (b))
|
# #define MAX(a,b) ((a) > (b) ? (a) : (b))
|
||||||
# #define __fastcall __attribute__((__fastcall__))
|
# #define __fastcall __attribute__((__fastcall__))
|
||||||
|
@ -59,51 +59,51 @@ MACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang _resultIncludeDirs _resultDefines
|
||||||
# #define __UINTMAX_TYPE__ long long unsigned int
|
# #define __UINTMAX_TYPE__ long long unsigned int
|
||||||
# #define __i386__ 1
|
# #define __i386__ 1
|
||||||
|
|
||||||
FOREACH(nextLine ${_defineLines})
|
foreach(nextLine ${_defineLines})
|
||||||
STRING(REGEX MATCH "^#define +([A-Za-z_][A-Za-z0-9_]*)(\\([^\\)]+\\))? +(.+) *$" _dummy "${nextLine}")
|
string(REGEX MATCH "^#define +([A-Za-z_][A-Za-z0-9_]*)(\\([^\\)]+\\))? +(.+) *$" _dummy "${nextLine}")
|
||||||
SET(_name "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
|
set(_name "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
|
||||||
STRING(STRIP "${CMAKE_MATCH_3}" _value)
|
string(STRIP "${CMAKE_MATCH_3}" _value)
|
||||||
#MESSAGE(STATUS "m1: -${CMAKE_MATCH_1}- m2: -${CMAKE_MATCH_2}- m3: -${CMAKE_MATCH_3}-")
|
#message(STATUS "m1: -${CMAKE_MATCH_1}- m2: -${CMAKE_MATCH_2}- m3: -${CMAKE_MATCH_3}-")
|
||||||
|
|
||||||
LIST(APPEND ${_resultDefines} "${_name}")
|
list(APPEND ${_resultDefines} "${_name}")
|
||||||
IF(_value)
|
if(_value)
|
||||||
LIST(APPEND ${_resultDefines} "${_value}")
|
list(APPEND ${_resultDefines} "${_value}")
|
||||||
ELSE()
|
else()
|
||||||
LIST(APPEND ${_resultDefines} " ")
|
list(APPEND ${_resultDefines} " ")
|
||||||
ENDIF()
|
endif()
|
||||||
ENDFOREACH(nextLine)
|
endforeach(nextLine)
|
||||||
|
|
||||||
ENDMACRO(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang)
|
endmacro(_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS _lang)
|
||||||
|
|
||||||
# Save the current LC_ALL, LC_MESSAGES, and LANG environment variables and set them
|
# Save the current LC_ALL, LC_MESSAGES, and LANG environment variables and set them
|
||||||
# to "C" that way GCC's "search starts here" text is in English and we can grok it.
|
# to "C" that way GCC's "search starts here" text is in English and we can grok it.
|
||||||
SET(_orig_lc_all $ENV{LC_ALL})
|
set(_orig_lc_all $ENV{LC_ALL})
|
||||||
SET(_orig_lc_messages $ENV{LC_MESSAGES})
|
set(_orig_lc_messages $ENV{LC_MESSAGES})
|
||||||
SET(_orig_lang $ENV{LANG})
|
set(_orig_lang $ENV{LANG})
|
||||||
|
|
||||||
SET(ENV{LC_ALL} C)
|
set(ENV{LC_ALL} C)
|
||||||
SET(ENV{LC_MESSAGES} C)
|
set(ENV{LC_MESSAGES} C)
|
||||||
SET(ENV{LANG} C)
|
set(ENV{LANG} C)
|
||||||
|
|
||||||
# Now check for C, works for gcc and Intel compiler at least
|
# Now check for C, works for gcc and Intel compiler at least
|
||||||
IF (NOT CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS)
|
if (NOT CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS)
|
||||||
IF ("${CMAKE_C_COMPILER_ID}" MATCHES GNU OR "${CMAKE_C_COMPILER_ID}" MATCHES Intel)
|
if ("${CMAKE_C_COMPILER_ID}" MATCHES GNU OR "${CMAKE_C_COMPILER_ID}" MATCHES Intel)
|
||||||
_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c _dirs _defines)
|
_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c _dirs _defines)
|
||||||
SET(CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "C compiler system include directories")
|
set(CMAKE_EXTRA_GENERATOR_C_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "C compiler system include directories")
|
||||||
SET(CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "C compiler system defined macros")
|
set(CMAKE_EXTRA_GENERATOR_C_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "C compiler system defined macros")
|
||||||
ENDIF ()
|
endif ()
|
||||||
ENDIF ()
|
endif ()
|
||||||
|
|
||||||
# And now the same for C++
|
# And now the same for C++
|
||||||
IF (NOT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS)
|
if (NOT CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS)
|
||||||
IF ("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Intel)
|
if ("${CMAKE_CXX_COMPILER_ID}" MATCHES GNU OR "${CMAKE_CXX_COMPILER_ID}" MATCHES Intel)
|
||||||
_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c++ _dirs _defines)
|
_DETERMINE_GCC_SYSTEM_INCLUDE_DIRS(c++ _dirs _defines)
|
||||||
SET(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "CXX compiler system include directories")
|
set(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_INCLUDE_DIRS "${_dirs}" CACHE INTERNAL "CXX compiler system include directories")
|
||||||
SET(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "CXX compiler system defined macros")
|
set(CMAKE_EXTRA_GENERATOR_CXX_SYSTEM_DEFINED_MACROS "${_defines}" CACHE INTERNAL "CXX compiler system defined macros")
|
||||||
ENDIF ()
|
endif ()
|
||||||
ENDIF ()
|
endif ()
|
||||||
|
|
||||||
# Restore original LC_ALL, LC_MESSAGES, and LANG
|
# Restore original LC_ALL, LC_MESSAGES, and LANG
|
||||||
SET(ENV{LC_ALL} ${_orig_lc_all})
|
set(ENV{LC_ALL} ${_orig_lc_all})
|
||||||
SET(ENV{LC_MESSAGES} ${_orig_lc_messages})
|
set(ENV{LC_MESSAGES} ${_orig_lc_messages})
|
||||||
SET(ENV{LANG} ${_orig_lang})
|
set(ENV{LANG} ${_orig_lang})
|
||||||
|
|
|
@ -30,46 +30,46 @@
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
# if it's the MS C/CXX compiler, search for link
|
# if it's the MS C/CXX compiler, search for link
|
||||||
IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
|
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
|
||||||
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
|
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
|
||||||
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
|
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
find_program(CMAKE_LINKER NAMES link HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
||||||
|
|
||||||
MARK_AS_ADVANCED(CMAKE_LINKER)
|
mark_as_advanced(CMAKE_LINKER)
|
||||||
|
|
||||||
# in all other cases search for ar, ranlib, etc.
|
# in all other cases search for ar, ranlib, etc.
|
||||||
ELSE("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
|
else("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
|
||||||
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
|
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
|
||||||
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
|
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
find_program(CMAKE_AR NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ar HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
find_program(CMAKE_RANLIB NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ranlib HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
||||||
IF(NOT CMAKE_RANLIB)
|
if(NOT CMAKE_RANLIB)
|
||||||
SET(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib")
|
set(CMAKE_RANLIB : CACHE INTERNAL "noop for ranlib")
|
||||||
ENDIF(NOT CMAKE_RANLIB)
|
endif(NOT CMAKE_RANLIB)
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
find_program(CMAKE_STRIP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}strip HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
||||||
FIND_PROGRAM(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
find_program(CMAKE_LINKER NAMES ${_CMAKE_TOOLCHAIN_PREFIX}ld HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
||||||
FIND_PROGRAM(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
find_program(CMAKE_NM NAMES ${_CMAKE_TOOLCHAIN_PREFIX}nm HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
||||||
FIND_PROGRAM(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
find_program(CMAKE_OBJDUMP NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objdump HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
||||||
FIND_PROGRAM(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
find_program(CMAKE_OBJCOPY NAMES ${_CMAKE_TOOLCHAIN_PREFIX}objcopy HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
||||||
|
|
||||||
MARK_AS_ADVANCED(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY)
|
mark_as_advanced(CMAKE_AR CMAKE_RANLIB CMAKE_STRIP CMAKE_LINKER CMAKE_NM CMAKE_OBJDUMP CMAKE_OBJCOPY)
|
||||||
|
|
||||||
ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
|
endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "MSVC"
|
||||||
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
|
OR "${CMAKE_C_COMPILER_ID}" MATCHES "MSVC"
|
||||||
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
|
OR "${CMAKE_GENERATOR}" MATCHES "Visual Studio")
|
||||||
|
|
||||||
|
|
||||||
# on Apple there really should be install_name_tool
|
# on Apple there really should be install_name_tool
|
||||||
IF(APPLE)
|
if(APPLE)
|
||||||
FIND_PROGRAM(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
find_program(CMAKE_INSTALL_NAME_TOOL NAMES install_name_tool HINTS ${_CMAKE_TOOLCHAIN_LOCATION})
|
||||||
|
|
||||||
IF(NOT CMAKE_INSTALL_NAME_TOOL)
|
if(NOT CMAKE_INSTALL_NAME_TOOL)
|
||||||
MESSAGE(FATAL_ERROR "Could not find install_name_tool, please check your installation.")
|
message(FATAL_ERROR "Could not find install_name_tool, please check your installation.")
|
||||||
ENDIF(NOT CMAKE_INSTALL_NAME_TOOL)
|
endif(NOT CMAKE_INSTALL_NAME_TOOL)
|
||||||
|
|
||||||
MARK_AS_ADVANCED(CMAKE_INSTALL_NAME_TOOL)
|
mark_as_advanced(CMAKE_INSTALL_NAME_TOOL)
|
||||||
ENDIF(APPLE)
|
endif(APPLE)
|
||||||
|
|
|
@ -15,11 +15,11 @@
|
||||||
# This file is included in CMakeSystemSpecificInformation.cmake if
|
# This file is included in CMakeSystemSpecificInformation.cmake if
|
||||||
# the CodeBlocks extra generator has been selected.
|
# the CodeBlocks extra generator has been selected.
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_CODEBLOCKS_EXECUTABLE NAMES codeblocks DOC "The CodeBlocks executable")
|
find_program(CMAKE_CODEBLOCKS_EXECUTABLE NAMES codeblocks DOC "The CodeBlocks executable")
|
||||||
|
|
||||||
IF(CMAKE_CODEBLOCKS_EXECUTABLE)
|
if(CMAKE_CODEBLOCKS_EXECUTABLE)
|
||||||
SET(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_CODEBLOCKS_EXECUTABLE} <PROJECT_FILE>" )
|
set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_CODEBLOCKS_EXECUTABLE} <PROJECT_FILE>" )
|
||||||
ENDIF(CMAKE_CODEBLOCKS_EXECUTABLE)
|
endif(CMAKE_CODEBLOCKS_EXECUTABLE)
|
||||||
|
|
||||||
# Determine builtin macros and include dirs:
|
# Determine builtin macros and include dirs:
|
||||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)
|
||||||
|
|
|
@ -15,42 +15,42 @@
|
||||||
# This file is included in CMakeSystemSpecificInformation.cmake if
|
# This file is included in CMakeSystemSpecificInformation.cmake if
|
||||||
# the Eclipse CDT4 extra generator has been selected.
|
# the Eclipse CDT4 extra generator has been selected.
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_ECLIPSE_EXECUTABLE NAMES eclipse DOC "The Eclipse executable")
|
find_program(CMAKE_ECLIPSE_EXECUTABLE NAMES eclipse DOC "The Eclipse executable")
|
||||||
|
|
||||||
FUNCTION(_FIND_ECLIPSE_VERSION)
|
function(_FIND_ECLIPSE_VERSION)
|
||||||
# This code is in a function so the variables used here have only local scope
|
# This code is in a function so the variables used here have only local scope
|
||||||
IF(CMAKE_ECLIPSE_EXECUTABLE)
|
if(CMAKE_ECLIPSE_EXECUTABLE)
|
||||||
# use REALPATH to resolve symlinks (http://public.kitware.com/Bug/view.php?id=13036)
|
# use REALPATH to resolve symlinks (http://public.kitware.com/Bug/view.php?id=13036)
|
||||||
GET_FILENAME_COMPONENT(_REALPATH_CMAKE_ECLIPSE_EXECUTABLE "${CMAKE_ECLIPSE_EXECUTABLE}" REALPATH)
|
get_filename_component(_REALPATH_CMAKE_ECLIPSE_EXECUTABLE "${CMAKE_ECLIPSE_EXECUTABLE}" REALPATH)
|
||||||
GET_FILENAME_COMPONENT(_ECLIPSE_DIR "${_REALPATH_CMAKE_ECLIPSE_EXECUTABLE}" PATH)
|
get_filename_component(_ECLIPSE_DIR "${_REALPATH_CMAKE_ECLIPSE_EXECUTABLE}" PATH)
|
||||||
FILE(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/features/org.eclipse.platform*")
|
file(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/features/org.eclipse.platform*")
|
||||||
IF(APPLE AND NOT _ECLIPSE_FEATURE_DIR)
|
if(APPLE AND NOT _ECLIPSE_FEATURE_DIR)
|
||||||
FILE(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/../../../features/org.eclipse.platform*")
|
file(GLOB _ECLIPSE_FEATURE_DIR "${_ECLIPSE_DIR}/../../../features/org.eclipse.platform*")
|
||||||
ENDIF()
|
endif()
|
||||||
IF("${_ECLIPSE_FEATURE_DIR}" MATCHES ".+org.eclipse.platform_([0-9]+\\.[0-9]+).+")
|
if("${_ECLIPSE_FEATURE_DIR}" MATCHES ".+org.eclipse.platform_([0-9]+\\.[0-9]+).+")
|
||||||
SET(_ECLIPSE_VERSION ${CMAKE_MATCH_1})
|
set(_ECLIPSE_VERSION ${CMAKE_MATCH_1})
|
||||||
ENDIF()
|
endif()
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# Set up a map with the names of the Eclipse releases:
|
# Set up a map with the names of the Eclipse releases:
|
||||||
SET(_ECLIPSE_VERSION_NAME_ "Unknown" )
|
set(_ECLIPSE_VERSION_NAME_ "Unknown" )
|
||||||
SET(_ECLIPSE_VERSION_NAME_3.2 "Callisto" )
|
set(_ECLIPSE_VERSION_NAME_3.2 "Callisto" )
|
||||||
SET(_ECLIPSE_VERSION_NAME_3.3 "Europa" )
|
set(_ECLIPSE_VERSION_NAME_3.3 "Europa" )
|
||||||
SET(_ECLIPSE_VERSION_NAME_3.4 "Ganymede" )
|
set(_ECLIPSE_VERSION_NAME_3.4 "Ganymede" )
|
||||||
SET(_ECLIPSE_VERSION_NAME_3.5 "Galileo" )
|
set(_ECLIPSE_VERSION_NAME_3.5 "Galileo" )
|
||||||
SET(_ECLIPSE_VERSION_NAME_3.6 "Helios" )
|
set(_ECLIPSE_VERSION_NAME_3.6 "Helios" )
|
||||||
SET(_ECLIPSE_VERSION_NAME_3.7 "Indigo" )
|
set(_ECLIPSE_VERSION_NAME_3.7 "Indigo" )
|
||||||
SET(_ECLIPSE_VERSION_NAME_4.2 "Juno" )
|
set(_ECLIPSE_VERSION_NAME_4.2 "Juno" )
|
||||||
|
|
||||||
IF(_ECLIPSE_VERSION)
|
if(_ECLIPSE_VERSION)
|
||||||
MESSAGE(STATUS "Found Eclipse version ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})")
|
message(STATUS "Found Eclipse version ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})")
|
||||||
ELSE()
|
else()
|
||||||
SET(_ECLIPSE_VERSION "3.6" )
|
set(_ECLIPSE_VERSION "3.6" )
|
||||||
MESSAGE(STATUS "Could not determine Eclipse version, assuming at least ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}}). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.")
|
message(STATUS "Could not determine Eclipse version, assuming at least ${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}}). Adjust CMAKE_ECLIPSE_VERSION if this is wrong.")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
SET(CMAKE_ECLIPSE_VERSION "${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})" CACHE STRING "The version of Eclipse. If Eclipse has not been found, 3.6 (Helios) is assumed.")
|
set(CMAKE_ECLIPSE_VERSION "${_ECLIPSE_VERSION} (${_ECLIPSE_VERSION_NAME_${_ECLIPSE_VERSION}})" CACHE STRING "The version of Eclipse. If Eclipse has not been found, 3.6 (Helios) is assumed.")
|
||||||
SET_PROPERTY(CACHE CMAKE_ECLIPSE_VERSION PROPERTY STRINGS "3.2 (${_ECLIPSE_VERSION_NAME_3.2})"
|
set_property(CACHE CMAKE_ECLIPSE_VERSION PROPERTY STRINGS "3.2 (${_ECLIPSE_VERSION_NAME_3.2})"
|
||||||
"3.3 (${_ECLIPSE_VERSION_NAME_3.3})"
|
"3.3 (${_ECLIPSE_VERSION_NAME_3.3})"
|
||||||
"3.4 (${_ECLIPSE_VERSION_NAME_3.4})"
|
"3.4 (${_ECLIPSE_VERSION_NAME_3.4})"
|
||||||
"3.5 (${_ECLIPSE_VERSION_NAME_3.5})"
|
"3.5 (${_ECLIPSE_VERSION_NAME_3.5})"
|
||||||
|
@ -58,28 +58,28 @@ FUNCTION(_FIND_ECLIPSE_VERSION)
|
||||||
"3.7 (${_ECLIPSE_VERSION_NAME_3.7})"
|
"3.7 (${_ECLIPSE_VERSION_NAME_3.7})"
|
||||||
"4.2 (${_ECLIPSE_VERSION_NAME_4.2})"
|
"4.2 (${_ECLIPSE_VERSION_NAME_4.2})"
|
||||||
)
|
)
|
||||||
ENDFUNCTION()
|
endfunction()
|
||||||
|
|
||||||
_FIND_ECLIPSE_VERSION()
|
_FIND_ECLIPSE_VERSION()
|
||||||
|
|
||||||
# Try to find out how many CPUs we have and set the -j argument for make accordingly
|
# Try to find out how many CPUs we have and set the -j argument for make accordingly
|
||||||
SET(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "")
|
set(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "")
|
||||||
|
|
||||||
INCLUDE(ProcessorCount)
|
include(ProcessorCount)
|
||||||
PROCESSORCOUNT(_CMAKE_ECLIPSE_PROCESSOR_COUNT)
|
PROCESSORCOUNT(_CMAKE_ECLIPSE_PROCESSOR_COUNT)
|
||||||
|
|
||||||
# Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name
|
# Only set -j if we are under UNIX and if the make-tool used actually has "make" in the name
|
||||||
# (we may also get here in the future e.g. for ninja)
|
# (we may also get here in the future e.g. for ninja)
|
||||||
IF("${_CMAKE_ECLIPSE_PROCESSOR_COUNT}" GREATER 1 AND UNIX AND "${CMAKE_MAKE_PROGRAM}" MATCHES make)
|
if("${_CMAKE_ECLIPSE_PROCESSOR_COUNT}" GREATER 1 AND UNIX AND "${CMAKE_MAKE_PROGRAM}" MATCHES make)
|
||||||
SET(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "-j${_CMAKE_ECLIPSE_PROCESSOR_COUNT}")
|
set(_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS "-j${_CMAKE_ECLIPSE_PROCESSOR_COUNT}")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# This variable is used by the Eclipse generator and appended to the make invocation commands.
|
# This variable is used by the Eclipse generator and appended to the make invocation commands.
|
||||||
SET(CMAKE_ECLIPSE_MAKE_ARGUMENTS "${_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS}" CACHE STRING "Additional command line arguments when Eclipse invokes make. Enter e.g. -j<some_number> to get parallel builds")
|
set(CMAKE_ECLIPSE_MAKE_ARGUMENTS "${_CMAKE_ECLIPSE_INITIAL_MAKE_ARGS}" CACHE STRING "Additional command line arguments when Eclipse invokes make. Enter e.g. -j<some_number> to get parallel builds")
|
||||||
|
|
||||||
# This variable is used by the Eclipse generator in out-of-source builds only.
|
# This variable is used by the Eclipse generator in out-of-source builds only.
|
||||||
SET(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT FALSE CACHE BOOL "If enabled, CMake will generate a source project for Eclipse in CMAKE_SOURCE_DIR")
|
set(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT FALSE CACHE BOOL "If enabled, CMake will generate a source project for Eclipse in CMAKE_SOURCE_DIR")
|
||||||
MARK_AS_ADVANCED(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT)
|
mark_as_advanced(CMAKE_ECLIPSE_GENERATE_SOURCE_PROJECT)
|
||||||
|
|
||||||
# Determine builtin macros and include dirs:
|
# Determine builtin macros and include dirs:
|
||||||
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)
|
include(${CMAKE_CURRENT_LIST_DIR}/CMakeExtraGeneratorDetermineCompilerMacrosAndIncludeDirs.cmake)
|
||||||
|
|
|
@ -13,20 +13,20 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
IF(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
|
if(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
|
||||||
SET(CMAKE_FIND_FRAMEWORKS_INCLUDED 1)
|
set(CMAKE_FIND_FRAMEWORKS_INCLUDED 1)
|
||||||
MACRO(CMAKE_FIND_FRAMEWORKS fwk)
|
macro(CMAKE_FIND_FRAMEWORKS fwk)
|
||||||
SET(${fwk}_FRAMEWORKS)
|
set(${fwk}_FRAMEWORKS)
|
||||||
IF(APPLE)
|
if(APPLE)
|
||||||
FOREACH(dir
|
foreach(dir
|
||||||
~/Library/Frameworks/${fwk}.framework
|
~/Library/Frameworks/${fwk}.framework
|
||||||
/Library/Frameworks/${fwk}.framework
|
/Library/Frameworks/${fwk}.framework
|
||||||
/System/Library/Frameworks/${fwk}.framework
|
/System/Library/Frameworks/${fwk}.framework
|
||||||
/Network/Library/Frameworks/${fwk}.framework)
|
/Network/Library/Frameworks/${fwk}.framework)
|
||||||
IF(EXISTS ${dir})
|
if(EXISTS ${dir})
|
||||||
SET(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
|
set(${fwk}_FRAMEWORKS ${${fwk}_FRAMEWORKS} ${dir})
|
||||||
ENDIF(EXISTS ${dir})
|
endif(EXISTS ${dir})
|
||||||
ENDFOREACH(dir)
|
endforeach(dir)
|
||||||
ENDIF(APPLE)
|
endif(APPLE)
|
||||||
ENDMACRO(CMAKE_FIND_FRAMEWORKS)
|
endmacro(CMAKE_FIND_FRAMEWORKS)
|
||||||
ENDIF(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
|
endif(NOT CMAKE_FIND_FRAMEWORKS_INCLUDED)
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
# This file is included in CMakeSystemSpecificInformation.cmake if
|
# This file is included in CMakeSystemSpecificInformation.cmake if
|
||||||
# the KDevelop3 extra generator has been selected.
|
# the KDevelop3 extra generator has been selected.
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_KDEVELOP3_EXECUTABLE NAMES kdevelop DOC "The KDevelop3 executable")
|
find_program(CMAKE_KDEVELOP3_EXECUTABLE NAMES kdevelop DOC "The KDevelop3 executable")
|
||||||
|
|
||||||
IF(CMAKE_KDEVELOP3_EXECUTABLE)
|
if(CMAKE_KDEVELOP3_EXECUTABLE)
|
||||||
SET(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} <PROJECT_FILE>" )
|
set(CMAKE_OPEN_PROJECT_COMMAND "${CMAKE_KDEVELOP3_EXECUTABLE} <PROJECT_FILE>" )
|
||||||
ENDIF(CMAKE_KDEVELOP3_EXECUTABLE)
|
endif(CMAKE_KDEVELOP3_EXECUTABLE)
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,6 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
SET (CMAKE_MAKE_PROGRAM "wmake" CACHE STRING
|
set (CMAKE_MAKE_PROGRAM "wmake" CACHE STRING
|
||||||
"Program used to build from makefiles.")
|
"Program used to build from makefiles.")
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM)
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
find_program(CMAKE_MAKE_PROGRAM
|
||||||
NAMES xcodebuild
|
NAMES xcodebuild
|
||||||
PATHS
|
PATHS
|
||||||
/usr/bin
|
/usr/bin
|
||||||
)
|
)
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM)
|
||||||
|
|
|
@ -24,8 +24,8 @@
|
||||||
# information tests.
|
# information tests.
|
||||||
#
|
#
|
||||||
# So a simple toolchain file could look like this:
|
# So a simple toolchain file could look like this:
|
||||||
# INCLUDE (CMakeForceCompiler)
|
# include (CMakeForceCompiler)
|
||||||
# SET(CMAKE_SYSTEM_NAME Generic)
|
# set(CMAKE_SYSTEM_NAME Generic)
|
||||||
# CMAKE_FORCE_C_COMPILER (chc12 MetrowerksHicross)
|
# CMAKE_FORCE_C_COMPILER (chc12 MetrowerksHicross)
|
||||||
# CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross)
|
# CMAKE_FORCE_CXX_COMPILER (chc12 MetrowerksHicross)
|
||||||
|
|
||||||
|
@ -42,41 +42,41 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
MACRO(CMAKE_FORCE_C_COMPILER compiler id)
|
macro(CMAKE_FORCE_C_COMPILER compiler id)
|
||||||
SET(CMAKE_C_COMPILER "${compiler}")
|
set(CMAKE_C_COMPILER "${compiler}")
|
||||||
SET(CMAKE_C_COMPILER_ID_RUN TRUE)
|
set(CMAKE_C_COMPILER_ID_RUN TRUE)
|
||||||
SET(CMAKE_C_COMPILER_ID ${id})
|
set(CMAKE_C_COMPILER_ID ${id})
|
||||||
SET(CMAKE_C_COMPILER_WORKS TRUE)
|
set(CMAKE_C_COMPILER_WORKS TRUE)
|
||||||
SET(CMAKE_C_COMPILER_FORCED TRUE)
|
set(CMAKE_C_COMPILER_FORCED TRUE)
|
||||||
|
|
||||||
# Set old compiler id variables.
|
# Set old compiler id variables.
|
||||||
IF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
|
if("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
|
||||||
SET(CMAKE_COMPILER_IS_GNUCC 1)
|
set(CMAKE_COMPILER_IS_GNUCC 1)
|
||||||
ENDIF("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
|
endif("${CMAKE_C_COMPILER_ID}" MATCHES "GNU")
|
||||||
ENDMACRO(CMAKE_FORCE_C_COMPILER)
|
endmacro(CMAKE_FORCE_C_COMPILER)
|
||||||
|
|
||||||
MACRO(CMAKE_FORCE_CXX_COMPILER compiler id)
|
macro(CMAKE_FORCE_CXX_COMPILER compiler id)
|
||||||
SET(CMAKE_CXX_COMPILER "${compiler}")
|
set(CMAKE_CXX_COMPILER "${compiler}")
|
||||||
SET(CMAKE_CXX_COMPILER_ID_RUN TRUE)
|
set(CMAKE_CXX_COMPILER_ID_RUN TRUE)
|
||||||
SET(CMAKE_CXX_COMPILER_ID ${id})
|
set(CMAKE_CXX_COMPILER_ID ${id})
|
||||||
SET(CMAKE_CXX_COMPILER_WORKS TRUE)
|
set(CMAKE_CXX_COMPILER_WORKS TRUE)
|
||||||
SET(CMAKE_CXX_COMPILER_FORCED TRUE)
|
set(CMAKE_CXX_COMPILER_FORCED TRUE)
|
||||||
|
|
||||||
# Set old compiler id variables.
|
# Set old compiler id variables.
|
||||||
IF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
||||||
SET(CMAKE_COMPILER_IS_GNUCXX 1)
|
set(CMAKE_COMPILER_IS_GNUCXX 1)
|
||||||
ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
endif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
||||||
ENDMACRO(CMAKE_FORCE_CXX_COMPILER)
|
endmacro(CMAKE_FORCE_CXX_COMPILER)
|
||||||
|
|
||||||
MACRO(CMAKE_FORCE_Fortran_COMPILER compiler id)
|
macro(CMAKE_FORCE_Fortran_COMPILER compiler id)
|
||||||
SET(CMAKE_Fortran_COMPILER "${compiler}")
|
set(CMAKE_Fortran_COMPILER "${compiler}")
|
||||||
SET(CMAKE_Fortran_COMPILER_ID_RUN TRUE)
|
set(CMAKE_Fortran_COMPILER_ID_RUN TRUE)
|
||||||
SET(CMAKE_Fortran_COMPILER_ID ${id})
|
set(CMAKE_Fortran_COMPILER_ID ${id})
|
||||||
SET(CMAKE_Fortran_COMPILER_WORKS TRUE)
|
set(CMAKE_Fortran_COMPILER_WORKS TRUE)
|
||||||
SET(CMAKE_Fortran_COMPILER_FORCED TRUE)
|
set(CMAKE_Fortran_COMPILER_FORCED TRUE)
|
||||||
|
|
||||||
# Set old compiler id variables.
|
# Set old compiler id variables.
|
||||||
IF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
|
if("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
|
||||||
SET(CMAKE_COMPILER_IS_GNUG77 1)
|
set(CMAKE_COMPILER_IS_GNUG77 1)
|
||||||
ENDIF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
|
endif("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
|
||||||
ENDMACRO(CMAKE_FORCE_Fortran_COMPILER)
|
endmacro(CMAKE_FORCE_Fortran_COMPILER)
|
||||||
|
|
|
@ -1,52 +1,52 @@
|
||||||
SET(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@")
|
set(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@")
|
||||||
SET(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@")
|
set(CMAKE_Fortran_COMPILER_ARG1 "@CMAKE_Fortran_COMPILER_ARG1@")
|
||||||
SET(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
|
set(CMAKE_Fortran_COMPILER_ID "@CMAKE_Fortran_COMPILER_ID@")
|
||||||
SET(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
|
set(CMAKE_Fortran_PLATFORM_ID "@CMAKE_Fortran_PLATFORM_ID@")
|
||||||
@SET_MSVC_Fortran_ARCHITECTURE_ID@
|
@SET_MSVC_Fortran_ARCHITECTURE_ID@
|
||||||
SET(CMAKE_AR "@CMAKE_AR@")
|
set(CMAKE_AR "@CMAKE_AR@")
|
||||||
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
set(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
||||||
SET(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@)
|
set(CMAKE_COMPILER_IS_GNUG77 @CMAKE_COMPILER_IS_GNUG77@)
|
||||||
SET(CMAKE_Fortran_COMPILER_LOADED 1)
|
set(CMAKE_Fortran_COMPILER_LOADED 1)
|
||||||
SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
|
set(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
|
||||||
SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
|
set(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
|
||||||
IF(CMAKE_COMPILER_IS_CYGWIN)
|
if(CMAKE_COMPILER_IS_CYGWIN)
|
||||||
SET(CYGWIN 1)
|
set(CYGWIN 1)
|
||||||
SET(UNIX 1)
|
set(UNIX 1)
|
||||||
ENDIF(CMAKE_COMPILER_IS_CYGWIN)
|
endif(CMAKE_COMPILER_IS_CYGWIN)
|
||||||
|
|
||||||
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)
|
if(CMAKE_COMPILER_IS_MINGW)
|
||||||
SET(MINGW 1)
|
set(MINGW 1)
|
||||||
ENDIF(CMAKE_COMPILER_IS_MINGW)
|
endif(CMAKE_COMPILER_IS_MINGW)
|
||||||
SET(CMAKE_Fortran_COMPILER_ID_RUN 1)
|
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_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_IGNORE_EXTENSIONS h;H;o;O;obj;OBJ;def;DEF;rc;RC)
|
||||||
SET(CMAKE_Fortran_LINKER_PREFERENCE 20)
|
set(CMAKE_Fortran_LINKER_PREFERENCE 20)
|
||||||
IF(UNIX)
|
if(UNIX)
|
||||||
SET(CMAKE_Fortran_OUTPUT_EXTENSION .o)
|
set(CMAKE_Fortran_OUTPUT_EXTENSION .o)
|
||||||
ELSE(UNIX)
|
else(UNIX)
|
||||||
SET(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
|
set(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
|
||||||
ENDIF(UNIX)
|
endif(UNIX)
|
||||||
|
|
||||||
# Save compiler ABI information.
|
# Save compiler ABI information.
|
||||||
SET(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
|
set(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
|
||||||
SET(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@")
|
set(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@")
|
||||||
SET(CMAKE_Fortran_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
|
set(CMAKE_Fortran_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
|
||||||
|
|
||||||
IF(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P)
|
if(CMAKE_Fortran_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P)
|
||||||
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
|
set(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(CMAKE_Fortran_COMPILER_ABI)
|
if(CMAKE_Fortran_COMPILER_ABI)
|
||||||
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
|
set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
|
||||||
ENDIF(CMAKE_Fortran_COMPILER_ABI)
|
endif(CMAKE_Fortran_COMPILER_ABI)
|
||||||
|
|
||||||
IF(CMAKE_Fortran_LIBRARY_ARCHITECTURE)
|
if(CMAKE_Fortran_LIBRARY_ARCHITECTURE)
|
||||||
SET(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
|
set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_Fortran_LIBRARY_ARCHITECTURE@")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
SET(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "@CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES@")
|
set(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "@CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES@")
|
||||||
SET(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES@")
|
set(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES@")
|
||||||
|
|
|
@ -16,40 +16,40 @@
|
||||||
# It also loads the available platform file for the system-compiler
|
# It also loads the available platform file for the system-compiler
|
||||||
# if it exists.
|
# if it exists.
|
||||||
|
|
||||||
SET(_INCLUDED_FILE 0)
|
set(_INCLUDED_FILE 0)
|
||||||
|
|
||||||
# Load compiler-specific information.
|
# Load compiler-specific information.
|
||||||
IF(CMAKE_Fortran_COMPILER_ID)
|
if(CMAKE_Fortran_COMPILER_ID)
|
||||||
INCLUDE(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL)
|
include(Compiler/${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL)
|
||||||
ENDIF(CMAKE_Fortran_COMPILER_ID)
|
endif(CMAKE_Fortran_COMPILER_ID)
|
||||||
|
|
||||||
SET(CMAKE_BASE_NAME)
|
set(CMAKE_BASE_NAME)
|
||||||
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE)
|
get_filename_component(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE)
|
||||||
# since the gnu compiler has several names force g++
|
# since the gnu compiler has several names force g++
|
||||||
IF(CMAKE_COMPILER_IS_GNUG77)
|
if(CMAKE_COMPILER_IS_GNUG77)
|
||||||
SET(CMAKE_BASE_NAME g77)
|
set(CMAKE_BASE_NAME g77)
|
||||||
ENDIF(CMAKE_COMPILER_IS_GNUG77)
|
endif(CMAKE_COMPILER_IS_GNUG77)
|
||||||
IF(CMAKE_Fortran_COMPILER_ID)
|
if(CMAKE_Fortran_COMPILER_ID)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_Fortran_COMPILER_ID}-Fortran OPTIONAL RESULT_VARIABLE _INCLUDED_FILE)
|
||||||
ENDIF(CMAKE_Fortran_COMPILER_ID)
|
endif(CMAKE_Fortran_COMPILER_ID)
|
||||||
IF (NOT _INCLUDED_FILE)
|
if (NOT _INCLUDED_FILE)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL
|
||||||
RESULT_VARIABLE _INCLUDED_FILE)
|
RESULT_VARIABLE _INCLUDED_FILE)
|
||||||
ENDIF (NOT _INCLUDED_FILE)
|
endif (NOT _INCLUDED_FILE)
|
||||||
# We specify the compiler information in the system file for some
|
# We specify the compiler information in the system file for some
|
||||||
# platforms, but this language may not have been enabled when the file
|
# platforms, but this language may not have been enabled when the file
|
||||||
# was first included. Include it again to get the language info.
|
# was first included. Include it again to get the language info.
|
||||||
# Remove this when all compiler info is removed from system files.
|
# Remove this when all compiler info is removed from system files.
|
||||||
IF (NOT _INCLUDED_FILE)
|
if (NOT _INCLUDED_FILE)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
|
include(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
|
||||||
ENDIF (NOT _INCLUDED_FILE)
|
endif (NOT _INCLUDED_FILE)
|
||||||
|
|
||||||
IF(CMAKE_Fortran_SIZEOF_DATA_PTR)
|
if(CMAKE_Fortran_SIZEOF_DATA_PTR)
|
||||||
FOREACH(f ${CMAKE_Fortran_ABI_FILES})
|
foreach(f ${CMAKE_Fortran_ABI_FILES})
|
||||||
INCLUDE(${f})
|
include(${f})
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
UNSET(CMAKE_Fortran_ABI_FILES)
|
unset(CMAKE_Fortran_ABI_FILES)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# This should be included before the _INIT variables are
|
# This should be included before the _INIT variables are
|
||||||
# used to initialize the cache. Since the rule variables
|
# used to initialize the cache. Since the rule variables
|
||||||
|
@ -57,122 +57,122 @@ ENDIF()
|
||||||
# But, it should still be after the platform file so changes can
|
# But, it should still be after the platform file so changes can
|
||||||
# be made to those values.
|
# be made to those values.
|
||||||
|
|
||||||
IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
if(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
||||||
# Save the full path of the file so try_compile can use it.
|
# Save the full path of the file so try_compile can use it.
|
||||||
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
|
include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
|
||||||
SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
|
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran)
|
if(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran)
|
||||||
# Save the full path of the file so try_compile can use it.
|
# Save the full path of the file so try_compile can use it.
|
||||||
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran} RESULT_VARIABLE _override)
|
include(${CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran} RESULT_VARIABLE _override)
|
||||||
SET(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran "${_override}")
|
set(CMAKE_USER_MAKE_RULES_OVERRIDE_Fortran "${_override}")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
# Fortran needs cmake to do a requires step during its build process to
|
# Fortran needs cmake to do a requires step during its build process to
|
||||||
# catch any modules
|
# catch any modules
|
||||||
SET(CMAKE_NEEDS_REQUIRES_STEP_Fortran_FLAG 1)
|
set(CMAKE_NEEDS_REQUIRES_STEP_Fortran_FLAG 1)
|
||||||
|
|
||||||
IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
|
if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
|
||||||
SET(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
|
set(CMAKE_Fortran_COMPILE_OPTIONS_PIC ${CMAKE_C_COMPILE_OPTIONS_PIC})
|
||||||
ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
|
endif(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIC)
|
||||||
|
|
||||||
IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
|
if(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
|
||||||
SET(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
|
set(CMAKE_Fortran_COMPILE_OPTIONS_PIE ${CMAKE_C_COMPILE_OPTIONS_PIE})
|
||||||
ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
|
endif(NOT CMAKE_Fortran_COMPILE_OPTIONS_PIE)
|
||||||
|
|
||||||
IF(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
|
if(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
|
||||||
SET(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
|
set(CMAKE_Fortran_COMPILE_OPTIONS_DLL ${CMAKE_C_COMPILE_OPTIONS_DLL})
|
||||||
ENDIF(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
|
endif(NOT CMAKE_Fortran_COMPILE_OPTIONS_DLL)
|
||||||
|
|
||||||
# Create a set of shared library variable specific to Fortran
|
# Create a set of shared library variable specific to Fortran
|
||||||
# For 90% of the systems, these are the same flags as the C versions
|
# For 90% of the systems, these are the same flags as the C versions
|
||||||
# so if these are not set just copy the flags from the c version
|
# so if these are not set just copy the flags from the c version
|
||||||
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
|
if(NOT DEFINED CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS)
|
||||||
SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
|
set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
|
if(NOT DEFINED CMAKE_SHARED_LIBRARY_Fortran_FLAGS)
|
||||||
SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
|
set(CMAKE_SHARED_LIBRARY_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
|
if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS)
|
||||||
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
|
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
|
if(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG)
|
||||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
|
set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP)
|
if(NOT DEFINED CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP)
|
||||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
|
set(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
|
if(NOT DEFINED CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
|
||||||
SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
|
set(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_EXE_EXPORTS_Fortran_FLAG)
|
if(NOT DEFINED CMAKE_EXE_EXPORTS_Fortran_FLAG)
|
||||||
SET(CMAKE_EXE_EXPORTS_Fortran_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
|
set(CMAKE_EXE_EXPORTS_Fortran_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
|
if(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
|
||||||
SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
|
set(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# for most systems a module is the same as a shared library
|
# for most systems a module is the same as a shared library
|
||||||
# so unless the variable CMAKE_MODULE_EXISTS is set just
|
# so unless the variable CMAKE_MODULE_EXISTS is set just
|
||||||
# copy the values from the LIBRARY variables
|
# copy the values from the LIBRARY variables
|
||||||
IF(NOT CMAKE_MODULE_EXISTS)
|
if(NOT CMAKE_MODULE_EXISTS)
|
||||||
SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
|
set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_Fortran_FLAGS})
|
||||||
SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
|
set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS})
|
||||||
ENDIF(NOT CMAKE_MODULE_EXISTS)
|
endif(NOT CMAKE_MODULE_EXISTS)
|
||||||
|
|
||||||
# repeat for modules
|
# repeat for modules
|
||||||
IF(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
|
if(NOT DEFINED CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
|
||||||
SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
|
set(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_SHARED_MODULE_Fortran_FLAGS)
|
if(NOT DEFINED CMAKE_SHARED_MODULE_Fortran_FLAGS)
|
||||||
SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
|
set(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
|
if(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
|
||||||
SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG})
|
set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
|
if(NOT DEFINED CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP)
|
||||||
SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP})
|
set(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
|
if(NOT DEFINED CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG)
|
||||||
SET(CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG})
|
set(CMAKE_EXECUTABLE_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG})
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
|
if(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
|
||||||
SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
|
set(CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH ${CMAKE_SHARED_LIBRARY_LINK_C_WITH_RUNTIME_PATH})
|
||||||
ENDIF(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
|
endif(NOT DEFINED CMAKE_SHARED_LIBRARY_LINK_Fortran_WITH_RUNTIME_PATH)
|
||||||
|
|
||||||
IF(NOT CMAKE_INCLUDE_FLAG_Fortran)
|
if(NOT CMAKE_INCLUDE_FLAG_Fortran)
|
||||||
SET(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C})
|
set(CMAKE_INCLUDE_FLAG_Fortran ${CMAKE_INCLUDE_FLAG_C})
|
||||||
ENDIF(NOT CMAKE_INCLUDE_FLAG_Fortran)
|
endif(NOT CMAKE_INCLUDE_FLAG_Fortran)
|
||||||
|
|
||||||
IF(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
|
if(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
|
||||||
SET(CMAKE_INCLUDE_FLAG_SEP_Fortran ${CMAKE_INCLUDE_FLAG_SEP_C})
|
set(CMAKE_INCLUDE_FLAG_SEP_Fortran ${CMAKE_INCLUDE_FLAG_SEP_C})
|
||||||
ENDIF(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
|
endif(NOT CMAKE_INCLUDE_FLAG_SEP_Fortran)
|
||||||
|
|
||||||
SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
|
set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
|
||||||
|
|
||||||
SET(CMAKE_Fortran_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}")
|
set(CMAKE_Fortran_FLAGS_INIT "$ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}")
|
||||||
# avoid just having a space as the initial value for the cache
|
# avoid just having a space as the initial value for the cache
|
||||||
IF(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
|
if(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
|
||||||
SET(CMAKE_Fortran_FLAGS_INIT)
|
set(CMAKE_Fortran_FLAGS_INIT)
|
||||||
ENDIF(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
|
endif(CMAKE_Fortran_FLAGS_INIT STREQUAL " ")
|
||||||
SET (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING
|
set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING
|
||||||
"Flags for Fortran compiler.")
|
"Flags for Fortran compiler.")
|
||||||
|
|
||||||
INCLUDE(CMakeCommonLanguageInclude)
|
include(CMakeCommonLanguageInclude)
|
||||||
|
|
||||||
# now define the following rule variables
|
# now define the following rule variables
|
||||||
# CMAKE_Fortran_CREATE_SHARED_LIBRARY
|
# CMAKE_Fortran_CREATE_SHARED_LIBRARY
|
||||||
|
@ -181,60 +181,60 @@ INCLUDE(CMakeCommonLanguageInclude)
|
||||||
# CMAKE_Fortran_LINK_EXECUTABLE
|
# CMAKE_Fortran_LINK_EXECUTABLE
|
||||||
|
|
||||||
# create a Fortran shared library
|
# create a Fortran shared library
|
||||||
IF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
|
if(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
|
||||||
SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
|
set(CMAKE_Fortran_CREATE_SHARED_LIBRARY
|
||||||
"<CMAKE_Fortran_COMPILER> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
"<CMAKE_Fortran_COMPILER> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LANGUAGE_COMPILE_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <SONAME_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||||
ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
|
endif(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY)
|
||||||
|
|
||||||
# create a Fortran shared module just copy the shared library rule
|
# create a Fortran shared module just copy the shared library rule
|
||||||
IF(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
|
if(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
|
||||||
SET(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
|
set(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY})
|
||||||
ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
|
endif(NOT CMAKE_Fortran_CREATE_SHARED_MODULE)
|
||||||
|
|
||||||
# Create a static archive incrementally for large object file counts.
|
# Create a static archive incrementally for large object file counts.
|
||||||
# If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these.
|
# If CMAKE_Fortran_CREATE_STATIC_LIBRARY is set it will override these.
|
||||||
IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_CREATE)
|
if(NOT DEFINED CMAKE_Fortran_ARCHIVE_CREATE)
|
||||||
SET(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
set(CMAKE_Fortran_ARCHIVE_CREATE "<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||||
ENDIF()
|
endif()
|
||||||
IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND)
|
if(NOT DEFINED CMAKE_Fortran_ARCHIVE_APPEND)
|
||||||
SET(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
|
set(CMAKE_Fortran_ARCHIVE_APPEND "<CMAKE_AR> r <TARGET> <LINK_FLAGS> <OBJECTS>")
|
||||||
ENDIF()
|
endif()
|
||||||
IF(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH)
|
if(NOT DEFINED CMAKE_Fortran_ARCHIVE_FINISH)
|
||||||
SET(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
|
set(CMAKE_Fortran_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# compile a Fortran file into an object file
|
# compile a Fortran file into an object file
|
||||||
# (put -o after -c to workaround bug in at least one mpif77 wrapper)
|
# (put -o after -c to workaround bug in at least one mpif77 wrapper)
|
||||||
IF(NOT CMAKE_Fortran_COMPILE_OBJECT)
|
if(NOT CMAKE_Fortran_COMPILE_OBJECT)
|
||||||
SET(CMAKE_Fortran_COMPILE_OBJECT
|
set(CMAKE_Fortran_COMPILE_OBJECT
|
||||||
"<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -c <SOURCE> -o <OBJECT>")
|
"<CMAKE_Fortran_COMPILER> <DEFINES> <FLAGS> -c <SOURCE> -o <OBJECT>")
|
||||||
ENDIF(NOT CMAKE_Fortran_COMPILE_OBJECT)
|
endif(NOT CMAKE_Fortran_COMPILE_OBJECT)
|
||||||
|
|
||||||
# link a fortran program
|
# link a fortran program
|
||||||
IF(NOT CMAKE_Fortran_LINK_EXECUTABLE)
|
if(NOT CMAKE_Fortran_LINK_EXECUTABLE)
|
||||||
SET(CMAKE_Fortran_LINK_EXECUTABLE
|
set(CMAKE_Fortran_LINK_EXECUTABLE
|
||||||
"<CMAKE_Fortran_COMPILER> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
"<CMAKE_Fortran_COMPILER> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||||
ENDIF(NOT CMAKE_Fortran_LINK_EXECUTABLE)
|
endif(NOT CMAKE_Fortran_LINK_EXECUTABLE)
|
||||||
|
|
||||||
IF(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
|
if(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
|
||||||
SET(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}"
|
set(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}"
|
||||||
CACHE STRING "Libraries linked by defalut with all Fortran applications.")
|
CACHE STRING "Libraries linked by defalut with all Fortran applications.")
|
||||||
MARK_AS_ADVANCED(CMAKE_Fortran_STANDARD_LIBRARIES)
|
mark_as_advanced(CMAKE_Fortran_STANDARD_LIBRARIES)
|
||||||
ENDIF(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
|
endif(CMAKE_Fortran_STANDARD_LIBRARIES_INIT)
|
||||||
|
|
||||||
IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
if(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||||
SET (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG_INIT}" CACHE STRING
|
set (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG_INIT}" CACHE STRING
|
||||||
"Flags used by the compiler during debug builds.")
|
"Flags used by the compiler during debug builds.")
|
||||||
SET (CMAKE_Fortran_FLAGS_MINSIZEREL "${CMAKE_Fortran_FLAGS_MINSIZEREL_INIT}" CACHE STRING
|
set (CMAKE_Fortran_FLAGS_MINSIZEREL "${CMAKE_Fortran_FLAGS_MINSIZEREL_INIT}" CACHE STRING
|
||||||
"Flags used by the compiler during release minsize builds.")
|
"Flags used by the compiler during release minsize builds.")
|
||||||
SET (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE_INIT}" CACHE STRING
|
set (CMAKE_Fortran_FLAGS_RELEASE "${CMAKE_Fortran_FLAGS_RELEASE_INIT}" CACHE STRING
|
||||||
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
|
"Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).")
|
||||||
SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
|
set (CMAKE_Fortran_FLAGS_RELWITHDEBINFO "${CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING
|
||||||
"Flags used by the compiler during Release with Debug Info builds.")
|
"Flags used by the compiler during Release with Debug Info builds.")
|
||||||
|
|
||||||
ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
endif(NOT CMAKE_NOT_USING_CONFIG_FLAGS)
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
mark_as_advanced(
|
||||||
CMAKE_Fortran_FLAGS
|
CMAKE_Fortran_FLAGS
|
||||||
CMAKE_Fortran_FLAGS_DEBUG
|
CMAKE_Fortran_FLAGS_DEBUG
|
||||||
CMAKE_Fortran_FLAGS_MINSIZEREL
|
CMAKE_Fortran_FLAGS_MINSIZEREL
|
||||||
|
@ -242,4 +242,4 @@ CMAKE_Fortran_FLAGS_RELEASE
|
||||||
CMAKE_Fortran_FLAGS_RELWITHDEBINFO)
|
CMAKE_Fortran_FLAGS_RELWITHDEBINFO)
|
||||||
|
|
||||||
# set this variable so we can avoid loading this more than once.
|
# set this variable so we can avoid loading this more than once.
|
||||||
SET(CMAKE_Fortran_INFORMATION_LOADED 1)
|
set(CMAKE_Fortran_INFORMATION_LOADED 1)
|
||||||
|
|
|
@ -12,60 +12,60 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
|
set(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
|
||||||
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
|
set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared
|
||||||
SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib
|
set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "") # +s, flag for exe link to use shared lib
|
||||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") # -rpath
|
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "") # -rpath
|
||||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
|
set(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP "") # : or empty
|
||||||
SET(CMAKE_INCLUDE_FLAG_C "-I") # -I
|
set(CMAKE_INCLUDE_FLAG_C "-I") # -I
|
||||||
SET(CMAKE_INCLUDE_FLAG_C_SEP "") # , or empty
|
set(CMAKE_INCLUDE_FLAG_C_SEP "") # , or empty
|
||||||
SET(CMAKE_LIBRARY_PATH_FLAG "-L")
|
set(CMAKE_LIBRARY_PATH_FLAG "-L")
|
||||||
SET(CMAKE_LIBRARY_PATH_TERMINATOR "") # for the Digital Mars D compiler the link paths have to be terminated with a "/"
|
set(CMAKE_LIBRARY_PATH_TERMINATOR "") # for the Digital Mars D compiler the link paths have to be terminated with a "/"
|
||||||
SET(CMAKE_LINK_LIBRARY_FLAG "-l")
|
set(CMAKE_LINK_LIBRARY_FLAG "-l")
|
||||||
|
|
||||||
SET(CMAKE_LINK_LIBRARY_SUFFIX "")
|
set(CMAKE_LINK_LIBRARY_SUFFIX "")
|
||||||
SET(CMAKE_STATIC_LIBRARY_PREFIX "lib")
|
set(CMAKE_STATIC_LIBRARY_PREFIX "lib")
|
||||||
SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
|
set(CMAKE_STATIC_LIBRARY_SUFFIX ".a")
|
||||||
SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
|
set(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
|
||||||
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
|
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
|
||||||
SET(CMAKE_EXECUTABLE_SUFFIX "") # .exe
|
set(CMAKE_EXECUTABLE_SUFFIX "") # .exe
|
||||||
SET(CMAKE_DL_LIBS "dl")
|
set(CMAKE_DL_LIBS "dl")
|
||||||
|
|
||||||
SET(CMAKE_FIND_LIBRARY_PREFIXES "lib")
|
set(CMAKE_FIND_LIBRARY_PREFIXES "lib")
|
||||||
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
|
set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".a")
|
||||||
|
|
||||||
# basically all general purpose OSs support shared libs
|
# basically all general purpose OSs support shared libs
|
||||||
SET_PROPERTY(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
|
set_property(GLOBAL PROPERTY TARGET_SUPPORTS_SHARED_LIBS TRUE)
|
||||||
|
|
||||||
SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL
|
set (CMAKE_SKIP_RPATH "NO" CACHE BOOL
|
||||||
"If set, runtime paths are not added when using shared libraries.")
|
"If set, runtime paths are not added when using shared libraries.")
|
||||||
SET (CMAKE_SKIP_INSTALL_RPATH "NO" CACHE BOOL
|
set (CMAKE_SKIP_INSTALL_RPATH "NO" CACHE BOOL
|
||||||
"If set, runtime paths are not added when installing shared libraries, but are added when building.")
|
"If set, runtime paths are not added when installing shared libraries, but are added when building.")
|
||||||
|
|
||||||
SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
|
set(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only. With Visual Studio IDE projects all commands are done without /nologo.")
|
||||||
|
|
||||||
IF(CMAKE_GENERATOR MATCHES "Makefiles")
|
if(CMAKE_GENERATOR MATCHES "Makefiles")
|
||||||
SET(CMAKE_COLOR_MAKEFILE ON CACHE BOOL
|
set(CMAKE_COLOR_MAKEFILE ON CACHE BOOL
|
||||||
"Enable/Disable color output during build."
|
"Enable/Disable color output during build."
|
||||||
)
|
)
|
||||||
MARK_AS_ADVANCED(CMAKE_COLOR_MAKEFILE)
|
mark_as_advanced(CMAKE_COLOR_MAKEFILE)
|
||||||
IF(DEFINED CMAKE_RULE_MESSAGES)
|
if(DEFINED CMAKE_RULE_MESSAGES)
|
||||||
SET_PROPERTY(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
|
set_property(GLOBAL PROPERTY RULE_MESSAGES ${CMAKE_RULE_MESSAGES})
|
||||||
ENDIF(DEFINED CMAKE_RULE_MESSAGES)
|
endif(DEFINED CMAKE_RULE_MESSAGES)
|
||||||
IF(CMAKE_GENERATOR MATCHES "Unix Makefiles")
|
if(CMAKE_GENERATOR MATCHES "Unix Makefiles")
|
||||||
SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
|
set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
|
||||||
"Enable/Disable output of compile commands during generation."
|
"Enable/Disable output of compile commands during generation."
|
||||||
)
|
)
|
||||||
MARK_AS_ADVANCED(CMAKE_EXPORT_COMPILE_COMMANDS)
|
mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||||
ENDIF(CMAKE_GENERATOR MATCHES "Unix Makefiles")
|
endif(CMAKE_GENERATOR MATCHES "Unix Makefiles")
|
||||||
ENDIF(CMAKE_GENERATOR MATCHES "Makefiles")
|
endif(CMAKE_GENERATOR MATCHES "Makefiles")
|
||||||
|
|
||||||
IF(CMAKE_GENERATOR MATCHES "Ninja")
|
if(CMAKE_GENERATOR MATCHES "Ninja")
|
||||||
SET(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
|
set(CMAKE_EXPORT_COMPILE_COMMANDS OFF CACHE BOOL
|
||||||
"Enable/Disable output of compile commands during generation."
|
"Enable/Disable output of compile commands during generation."
|
||||||
)
|
)
|
||||||
MARK_AS_ADVANCED(CMAKE_EXPORT_COMPILE_COMMANDS)
|
mark_as_advanced(CMAKE_EXPORT_COMPILE_COMMANDS)
|
||||||
ENDIF(CMAKE_GENERATOR MATCHES "Ninja")
|
endif(CMAKE_GENERATOR MATCHES "Ninja")
|
||||||
|
|
||||||
# GetDefaultWindowsPrefixBase
|
# GetDefaultWindowsPrefixBase
|
||||||
#
|
#
|
||||||
|
@ -160,27 +160,27 @@ endfunction()
|
||||||
# was initialized by the block below. This is useful for user
|
# was initialized by the block below. This is useful for user
|
||||||
# projects to change the default prefix while still allowing the
|
# projects to change the default prefix while still allowing the
|
||||||
# command line to override it.
|
# command line to override it.
|
||||||
IF(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
if(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||||
SET(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
|
set(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT 1)
|
||||||
ENDIF(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
endif(NOT DEFINED CMAKE_INSTALL_PREFIX)
|
||||||
|
|
||||||
# Choose a default install prefix for this platform.
|
# Choose a default install prefix for this platform.
|
||||||
IF(CMAKE_HOST_UNIX)
|
if(CMAKE_HOST_UNIX)
|
||||||
SET(CMAKE_INSTALL_PREFIX "/usr/local"
|
set(CMAKE_INSTALL_PREFIX "/usr/local"
|
||||||
CACHE PATH "Install path prefix, prepended onto install directories.")
|
CACHE PATH "Install path prefix, prepended onto install directories.")
|
||||||
ELSE(CMAKE_HOST_UNIX)
|
else(CMAKE_HOST_UNIX)
|
||||||
GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
|
GetDefaultWindowsPrefixBase(CMAKE_GENERIC_PROGRAM_FILES)
|
||||||
SET(CMAKE_INSTALL_PREFIX
|
set(CMAKE_INSTALL_PREFIX
|
||||||
"${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
|
"${CMAKE_GENERIC_PROGRAM_FILES}/${PROJECT_NAME}"
|
||||||
CACHE PATH "Install path prefix, prepended onto install directories.")
|
CACHE PATH "Install path prefix, prepended onto install directories.")
|
||||||
SET(CMAKE_GENERIC_PROGRAM_FILES)
|
set(CMAKE_GENERIC_PROGRAM_FILES)
|
||||||
ENDIF(CMAKE_HOST_UNIX)
|
endif(CMAKE_HOST_UNIX)
|
||||||
|
|
||||||
# Set a variable which will be used as component name in install() commands
|
# Set a variable which will be used as component name in install() commands
|
||||||
# where no COMPONENT has been given:
|
# where no COMPONENT has been given:
|
||||||
SET(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "Unspecified")
|
set(CMAKE_INSTALL_DEFAULT_COMPONENT_NAME "Unspecified")
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
mark_as_advanced(
|
||||||
CMAKE_SKIP_RPATH
|
CMAKE_SKIP_RPATH
|
||||||
CMAKE_SKIP_INSTALL_RPATH
|
CMAKE_SKIP_INSTALL_RPATH
|
||||||
CMAKE_VERBOSE_MAKEFILE
|
CMAKE_VERBOSE_MAKEFILE
|
||||||
|
|
|
@ -16,9 +16,9 @@
|
||||||
|
|
||||||
# This macro used to load build settings from another project that
|
# This macro used to load build settings from another project that
|
||||||
# stored settings using the CMAKE_EXPORT_BUILD_SETTINGS macro.
|
# stored settings using the CMAKE_EXPORT_BUILD_SETTINGS macro.
|
||||||
MACRO(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
|
macro(CMAKE_IMPORT_BUILD_SETTINGS SETTINGS_FILE)
|
||||||
IF(${SETTINGS_FILE} MATCHES ".+")
|
if(${SETTINGS_FILE} MATCHES ".+")
|
||||||
ELSE(${SETTINGS_FILE} MATCHES ".+")
|
else(${SETTINGS_FILE} MATCHES ".+")
|
||||||
MESSAGE(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.")
|
message(SEND_ERROR "CMAKE_IMPORT_BUILD_SETTINGS called with no argument.")
|
||||||
ENDIF(${SETTINGS_FILE} MATCHES ".+")
|
endif(${SETTINGS_FILE} MATCHES ".+")
|
||||||
ENDMACRO(CMAKE_IMPORT_BUILD_SETTINGS)
|
endmacro(CMAKE_IMPORT_BUILD_SETTINGS)
|
||||||
|
|
|
@ -13,6 +13,6 @@
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
|
||||||
SET (CMAKE_MAKE_PROGRAM "jom" CACHE STRING
|
set (CMAKE_MAKE_PROGRAM "jom" CACHE STRING
|
||||||
"Program used to build from makefiles.")
|
"Program used to build from makefiles.")
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM)
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
SET(CMAKE_Java_COMPILER "@CMAKE_Java_COMPILER@")
|
set(CMAKE_Java_COMPILER "@CMAKE_Java_COMPILER@")
|
||||||
SET(CMAKE_Java_COMPILER_ARG1 "@CMAKE_Java_COMPILER_ARG1@")
|
set(CMAKE_Java_COMPILER_ARG1 "@CMAKE_Java_COMPILER_ARG1@")
|
||||||
SET(CMAKE_Java_RUNTIME "@CMAKE_Java_RUNTIME@")
|
set(CMAKE_Java_RUNTIME "@CMAKE_Java_RUNTIME@")
|
||||||
SET(CMAKE_Java_ARCHIVE "@CMAKE_Java_ARCHIVE@")
|
set(CMAKE_Java_ARCHIVE "@CMAKE_Java_ARCHIVE@")
|
||||||
SET(CMAKE_Java_COMPILER_LOADED 1)
|
set(CMAKE_Java_COMPILER_LOADED 1)
|
||||||
|
|
||||||
SET(CMAKE_Java_SOURCE_FILE_EXTENSIONS java)
|
set(CMAKE_Java_SOURCE_FILE_EXTENSIONS java)
|
||||||
SET(CMAKE_Java_LINKER_PREFERENCE 40)
|
set(CMAKE_Java_LINKER_PREFERENCE 40)
|
||||||
SET(CMAKE_Java_OUTPUT_EXTENSION .class)
|
set(CMAKE_Java_OUTPUT_EXTENSION .class)
|
||||||
SET(CMAKE_Java_OUTPUT_EXTENSION_REPLACE 1)
|
set(CMAKE_Java_OUTPUT_EXTENSION_REPLACE 1)
|
||||||
SET(CMAKE_STATIC_LIBRARY_PREFIX_Java "")
|
set(CMAKE_STATIC_LIBRARY_PREFIX_Java "")
|
||||||
SET(CMAKE_STATIC_LIBRARY_SUFFIX_Java ".jar")
|
set(CMAKE_STATIC_LIBRARY_SUFFIX_Java ".jar")
|
||||||
SET(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")
|
set(CMAKE_Java_COMPILER_ENV_VAR "JAVA_COMPILER")
|
||||||
|
|
|
@ -18,42 +18,42 @@
|
||||||
# But, it should still be after the platform file so changes can
|
# But, it should still be after the platform file so changes can
|
||||||
# be made to those values.
|
# be made to those values.
|
||||||
|
|
||||||
IF(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
if(CMAKE_USER_MAKE_RULES_OVERRIDE)
|
||||||
# Save the full path of the file so try_compile can use it.
|
# Save the full path of the file so try_compile can use it.
|
||||||
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
|
include(${CMAKE_USER_MAKE_RULES_OVERRIDE} RESULT_VARIABLE _override)
|
||||||
SET(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
|
set(CMAKE_USER_MAKE_RULES_OVERRIDE "${_override}")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
IF(CMAKE_USER_MAKE_RULES_OVERRIDE_Java)
|
if(CMAKE_USER_MAKE_RULES_OVERRIDE_Java)
|
||||||
# Save the full path of the file so try_compile can use it.
|
# Save the full path of the file so try_compile can use it.
|
||||||
INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE_Java} RESULT_VARIABLE _override)
|
include(${CMAKE_USER_MAKE_RULES_OVERRIDE_Java} RESULT_VARIABLE _override)
|
||||||
SET(CMAKE_USER_MAKE_RULES_OVERRIDE_Java "${_override}")
|
set(CMAKE_USER_MAKE_RULES_OVERRIDE_Java "${_override}")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# this is a place holder if java needed flags for javac they would go here.
|
# this is a place holder if java needed flags for javac they would go here.
|
||||||
IF(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
|
if(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
|
||||||
# IF(WIN32)
|
# if(WIN32)
|
||||||
# SET(class_files_mask "*.class")
|
# set(class_files_mask "*.class")
|
||||||
# ELSE(WIN32)
|
# else(WIN32)
|
||||||
SET(class_files_mask ".")
|
set(class_files_mask ".")
|
||||||
# ENDIF(WIN32)
|
# endif(WIN32)
|
||||||
|
|
||||||
SET(CMAKE_Java_CREATE_STATIC_LIBRARY
|
set(CMAKE_Java_CREATE_STATIC_LIBRARY
|
||||||
"<CMAKE_Java_ARCHIVE> -cf <TARGET> -C <OBJECT_DIR> ${class_files_mask}")
|
"<CMAKE_Java_ARCHIVE> -cf <TARGET> -C <OBJECT_DIR> ${class_files_mask}")
|
||||||
# "${class_files_mask}" should really be "<OBJECTS>" but compling a *.java
|
# "${class_files_mask}" should really be "<OBJECTS>" but compling a *.java
|
||||||
# file can create more than one *.class file...
|
# file can create more than one *.class file...
|
||||||
ENDIF(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
|
endif(NOT CMAKE_Java_CREATE_STATIC_LIBRARY)
|
||||||
|
|
||||||
# compile a Java file into an object file
|
# compile a Java file into an object file
|
||||||
IF(NOT CMAKE_Java_COMPILE_OBJECT)
|
if(NOT CMAKE_Java_COMPILE_OBJECT)
|
||||||
SET(CMAKE_Java_COMPILE_OBJECT
|
set(CMAKE_Java_COMPILE_OBJECT
|
||||||
"<CMAKE_Java_COMPILER> <FLAGS> <SOURCE> -d <OBJECT_DIR>")
|
"<CMAKE_Java_COMPILER> <FLAGS> <SOURCE> -d <OBJECT_DIR>")
|
||||||
ENDIF(NOT CMAKE_Java_COMPILE_OBJECT)
|
endif(NOT CMAKE_Java_COMPILE_OBJECT)
|
||||||
|
|
||||||
# set java include flag option and the separator for multiple include paths
|
# set java include flag option and the separator for multiple include paths
|
||||||
SET(CMAKE_INCLUDE_FLAG_Java "-classpath ")
|
set(CMAKE_INCLUDE_FLAG_Java "-classpath ")
|
||||||
IF(WIN32 AND NOT CYGWIN)
|
if(WIN32 AND NOT CYGWIN)
|
||||||
SET(CMAKE_INCLUDE_FLAG_SEP_Java ";")
|
set(CMAKE_INCLUDE_FLAG_SEP_Java ";")
|
||||||
ELSE(WIN32 AND NOT CYGWIN)
|
else(WIN32 AND NOT CYGWIN)
|
||||||
SET(CMAKE_INCLUDE_FLAG_SEP_Java ":")
|
set(CMAKE_INCLUDE_FLAG_SEP_Java ":")
|
||||||
ENDIF(WIN32 AND NOT CYGWIN)
|
endif(WIN32 AND NOT CYGWIN)
|
||||||
|
|
|
@ -12,9 +12,9 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_MAKE_PROGRAM make
|
find_program(CMAKE_MAKE_PROGRAM make
|
||||||
PATHS
|
PATHS
|
||||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS-1.0_is1;Inno Setup: App Path]/bin"
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MSYS-1.0_is1;Inno Setup: App Path]/bin"
|
||||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
|
||||||
c:/msys/1.0/bin /msys/1.0/bin)
|
c:/msys/1.0/bin /msys/1.0/bin)
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM)
|
||||||
|
|
|
@ -12,13 +12,13 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_MAKE_PROGRAM mingw32-make.exe PATHS
|
find_program(CMAKE_MAKE_PROGRAM mingw32-make.exe PATHS
|
||||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\MinGW;InstallLocation]/bin"
|
||||||
c:/MinGW/bin /MinGW/bin)
|
c:/MinGW/bin /MinGW/bin)
|
||||||
FIND_PROGRAM(CMAKE_SH sh.exe )
|
find_program(CMAKE_SH sh.exe )
|
||||||
IF(CMAKE_SH)
|
if(CMAKE_SH)
|
||||||
MESSAGE(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n")
|
message(FATAL_ERROR "sh.exe was found in your PATH, here:\n${CMAKE_SH}\nFor MinGW make to work correctly sh.exe must NOT be in your path.\nRun cmake from a shell that does not have sh.exe in your PATH.\nIf you want to use a UNIX shell, then use MSYS Makefiles.\n")
|
||||||
SET(CMAKE_MAKE_PROGRAM NOTFOUND)
|
set(CMAKE_MAKE_PROGRAM NOTFOUND)
|
||||||
ENDIF(CMAKE_SH)
|
endif(CMAKE_SH)
|
||||||
|
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM CMAKE_SH)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM CMAKE_SH)
|
||||||
|
|
|
@ -13,6 +13,6 @@
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
|
||||||
SET (CMAKE_MAKE_PROGRAM "nmake" CACHE STRING
|
set (CMAKE_MAKE_PROGRAM "nmake" CACHE STRING
|
||||||
"Program used to build from makefiles.")
|
"Program used to build from makefiles.")
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM)
|
||||||
|
|
|
@ -12,6 +12,6 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_MAKE_PROGRAM ninja
|
find_program(CMAKE_MAKE_PROGRAM ninja
|
||||||
DOC "Program used to build from build.ninja files.")
|
DOC "Program used to build from build.ninja files.")
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM)
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
# [NO_CHECK_REQUIRED_COMPONENTS_MACRO])
|
# [NO_CHECK_REQUIRED_COMPONENTS_MACRO])
|
||||||
#
|
#
|
||||||
# CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the plain
|
# CONFIGURE_PACKAGE_CONFIG_FILE() should be used instead of the plain
|
||||||
# CONFIGURE_FILE() command when creating the <Name>Config.cmake or <Name>-config.cmake
|
# configure_file() command when creating the <Name>Config.cmake or <Name>-config.cmake
|
||||||
# file for installing a project or library. It helps making the resulting package
|
# file for installing a project or library. It helps making the resulting package
|
||||||
# relocatable by avoiding hardcoded paths in the installed Config.cmake file.
|
# relocatable by avoiding hardcoded paths in the installed Config.cmake file.
|
||||||
#
|
#
|
||||||
|
@ -31,12 +31,12 @@
|
||||||
# Usage:
|
# Usage:
|
||||||
# 1. write a FooConfig.cmake.in file as you are used to
|
# 1. write a FooConfig.cmake.in file as you are used to
|
||||||
# 2. insert a line containing only the string "@PACKAGE_INIT@"
|
# 2. insert a line containing only the string "@PACKAGE_INIT@"
|
||||||
# 3. instead of SET(FOO_DIR "@SOME_INSTALL_DIR@"), use SET(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")
|
# 3. instead of set(FOO_DIR "@SOME_INSTALL_DIR@"), use set(FOO_DIR "@PACKAGE_SOME_INSTALL_DIR@")
|
||||||
# (this must be after the @PACKAGE_INIT@ line)
|
# (this must be after the @PACKAGE_INIT@ line)
|
||||||
# 4. instead of using the normal CONFIGURE_FILE(), use CONFIGURE_PACKAGE_CONFIG_FILE()
|
# 4. instead of using the normal configure_file(), use CONFIGURE_PACKAGE_CONFIG_FILE()
|
||||||
#
|
#
|
||||||
# The <input> and <output> arguments are the input and output file, the same way
|
# The <input> and <output> arguments are the input and output file, the same way
|
||||||
# as in CONFIGURE_FILE().
|
# as in configure_file().
|
||||||
#
|
#
|
||||||
# The <path> given to INSTALL_DESTINATION must be the destination where the FooConfig.cmake
|
# The <path> given to INSTALL_DESTINATION must be the destination where the FooConfig.cmake
|
||||||
# file will be installed to. This can either be a relative or absolute path, both work.
|
# file will be installed to. This can either be a relative or absolute path, both work.
|
||||||
|
@ -77,7 +77,7 @@
|
||||||
# WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) )
|
# WRITE_BASIC_PACKAGE_VERSION_FILE( filename VERSION major.minor.patch COMPATIBILITY (AnyNewerVersion|SameMajorVersion|ExactVersion) )
|
||||||
#
|
#
|
||||||
# Writes a file for use as <package>ConfigVersion.cmake file to <filename>.
|
# Writes a file for use as <package>ConfigVersion.cmake file to <filename>.
|
||||||
# See the documentation of FIND_PACKAGE() for details on this.
|
# See the documentation of find_package() for details on this.
|
||||||
# filename is the output filename, it should be in the build tree.
|
# filename is the output filename, it should be in the build tree.
|
||||||
# major.minor.patch is the version number of the project to be installed
|
# major.minor.patch is the version number of the project to be installed
|
||||||
# The COMPATIBILITY mode AnyNewerVersion means that the installed package version
|
# The COMPATIBILITY mode AnyNewerVersion means that the installed package version
|
||||||
|
|
|
@ -16,31 +16,31 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
MESSAGE("CMAKE_SYSTEM is ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}")
|
message("CMAKE_SYSTEM is ${CMAKE_SYSTEM} ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION}")
|
||||||
MESSAGE("CMAKE_SYSTEM file is ${CMAKE_SYSTEM_INFO_FILE}")
|
message("CMAKE_SYSTEM file is ${CMAKE_SYSTEM_INFO_FILE}")
|
||||||
MESSAGE("CMAKE_C_COMPILER is ${CMAKE_C_COMPILER}")
|
message("CMAKE_C_COMPILER is ${CMAKE_C_COMPILER}")
|
||||||
MESSAGE("CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}")
|
message("CMAKE_CXX_COMPILER is ${CMAKE_CXX_COMPILER}")
|
||||||
|
|
||||||
|
|
||||||
MESSAGE("CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
|
message("CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}")
|
||||||
MESSAGE("CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
|
message("CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS is ${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS}")
|
||||||
MESSAGE("CMAKE_DL_LIBS is ${CMAKE_DL_LIBS}")
|
message("CMAKE_DL_LIBS is ${CMAKE_DL_LIBS}")
|
||||||
MESSAGE("CMAKE_SHARED_LIBRARY_PREFIX is ${CMAKE_SHARED_LIBRARY_PREFIX}")
|
message("CMAKE_SHARED_LIBRARY_PREFIX is ${CMAKE_SHARED_LIBRARY_PREFIX}")
|
||||||
MESSAGE("CMAKE_SHARED_LIBRARY_SUFFIX is ${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
message("CMAKE_SHARED_LIBRARY_SUFFIX is ${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
MESSAGE("CMAKE_COMPILER_IS_GNUCC = ${CMAKE_COMPILER_IS_GNUCC}")
|
message("CMAKE_COMPILER_IS_GNUCC = ${CMAKE_COMPILER_IS_GNUCC}")
|
||||||
MESSAGE("CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}")
|
message("CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}")
|
||||||
|
|
||||||
MESSAGE("CMAKE_CXX_CREATE_SHARED_LIBRARY is ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
|
message("CMAKE_CXX_CREATE_SHARED_LIBRARY is ${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
|
||||||
MESSAGE("CMAKE_CXX_CREATE_SHARED_MODULE is ${CMAKE_CXX_CREATE_SHARED_MODULE}")
|
message("CMAKE_CXX_CREATE_SHARED_MODULE is ${CMAKE_CXX_CREATE_SHARED_MODULE}")
|
||||||
MESSAGE("CMAKE_CXX_CREATE_STATIC_LIBRARY is ${CMAKE_CXX_CREATE_STATIC_LIBRARY}")
|
message("CMAKE_CXX_CREATE_STATIC_LIBRARY is ${CMAKE_CXX_CREATE_STATIC_LIBRARY}")
|
||||||
MESSAGE("CMAKE_CXX_COMPILE_OBJECT is ${CMAKE_CXX_COMPILE_OBJECT}")
|
message("CMAKE_CXX_COMPILE_OBJECT is ${CMAKE_CXX_COMPILE_OBJECT}")
|
||||||
MESSAGE("CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_CXX_LINK_EXECUTABLE}")
|
message("CMAKE_CXX_LINK_EXECUTABLE ${CMAKE_CXX_LINK_EXECUTABLE}")
|
||||||
|
|
||||||
MESSAGE("CMAKE_C_CREATE_SHARED_LIBRARY is ${CMAKE_C_CREATE_SHARED_LIBRARY}")
|
message("CMAKE_C_CREATE_SHARED_LIBRARY is ${CMAKE_C_CREATE_SHARED_LIBRARY}")
|
||||||
MESSAGE("CMAKE_C_CREATE_SHARED_MODULE is ${CMAKE_C_CREATE_SHARED_MODULE}")
|
message("CMAKE_C_CREATE_SHARED_MODULE is ${CMAKE_C_CREATE_SHARED_MODULE}")
|
||||||
MESSAGE("CMAKE_C_CREATE_STATIC_LIBRARY is ${CMAKE_C_CREATE_STATIC_LIBRARY}")
|
message("CMAKE_C_CREATE_STATIC_LIBRARY is ${CMAKE_C_CREATE_STATIC_LIBRARY}")
|
||||||
MESSAGE("CMAKE_C_COMPILE_OBJECT is ${CMAKE_C_COMPILE_OBJECT}")
|
message("CMAKE_C_COMPILE_OBJECT is ${CMAKE_C_COMPILE_OBJECT}")
|
||||||
MESSAGE("CMAKE_C_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE}")
|
message("CMAKE_C_LINK_EXECUTABLE ${CMAKE_C_LINK_EXECUTABLE}")
|
||||||
|
|
||||||
MESSAGE("CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE}")
|
message("CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE}")
|
||||||
MESSAGE("CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE}")
|
message("CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE ${CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE}")
|
||||||
|
|
|
@ -31,31 +31,31 @@
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
|
||||||
MACRO(CMAKE_PUSH_CHECK_STATE)
|
macro(CMAKE_PUSH_CHECK_STATE)
|
||||||
|
|
||||||
IF(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER)
|
if(NOT DEFINED _CMAKE_PUSH_CHECK_STATE_COUNTER)
|
||||||
SET(_CMAKE_PUSH_CHECK_STATE_COUNTER 0)
|
set(_CMAKE_PUSH_CHECK_STATE_COUNTER 0)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1")
|
math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}+1")
|
||||||
|
|
||||||
SET(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES})
|
set(_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_INCLUDES})
|
||||||
SET(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
|
set(_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_DEFINITIONS})
|
||||||
SET(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
|
set(_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_LIBRARIES})
|
||||||
SET(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
|
set(_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER} ${CMAKE_REQUIRED_FLAGS})
|
||||||
ENDMACRO(CMAKE_PUSH_CHECK_STATE)
|
endmacro(CMAKE_PUSH_CHECK_STATE)
|
||||||
|
|
||||||
MACRO(CMAKE_POP_CHECK_STATE)
|
macro(CMAKE_POP_CHECK_STATE)
|
||||||
|
|
||||||
# don't pop more than we pushed
|
# don't pop more than we pushed
|
||||||
IF("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0")
|
if("${_CMAKE_PUSH_CHECK_STATE_COUNTER}" GREATER "0")
|
||||||
|
|
||||||
SET(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
set(CMAKE_REQUIRED_INCLUDES ${_CMAKE_REQUIRED_INCLUDES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||||
SET(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
set(CMAKE_REQUIRED_DEFINITIONS ${_CMAKE_REQUIRED_DEFINITIONS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||||
SET(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
set(CMAKE_REQUIRED_LIBRARIES ${_CMAKE_REQUIRED_LIBRARIES_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||||
SET(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
set(CMAKE_REQUIRED_FLAGS ${_CMAKE_REQUIRED_FLAGS_SAVE_${_CMAKE_PUSH_CHECK_STATE_COUNTER}})
|
||||||
|
|
||||||
MATH(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
|
math(EXPR _CMAKE_PUSH_CHECK_STATE_COUNTER "${_CMAKE_PUSH_CHECK_STATE_COUNTER}-1")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
ENDMACRO(CMAKE_POP_CHECK_STATE)
|
endmacro(CMAKE_POP_CHECK_STATE)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
SET(CMAKE_RC_COMPILER "@CMAKE_RC_COMPILER@")
|
set(CMAKE_RC_COMPILER "@CMAKE_RC_COMPILER@")
|
||||||
SET(CMAKE_RC_COMPILER_ARG1 "@CMAKE_RC_COMPILER_ARG1@")
|
set(CMAKE_RC_COMPILER_ARG1 "@CMAKE_RC_COMPILER_ARG1@")
|
||||||
SET(CMAKE_RC_COMPILER_LOADED 1)
|
set(CMAKE_RC_COMPILER_LOADED 1)
|
||||||
SET(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc)
|
set(CMAKE_RC_SOURCE_FILE_EXTENSIONS rc)
|
||||||
SET(CMAKE_RC_OUTPUT_EXTENSION @CMAKE_RC_OUTPUT_EXTENSION@)
|
set(CMAKE_RC_OUTPUT_EXTENSION @CMAKE_RC_OUTPUT_EXTENSION@)
|
||||||
SET(CMAKE_RC_COMPILER_ENV_VAR "RC")
|
set(CMAKE_RC_COMPILER_ENV_VAR "RC")
|
||||||
|
|
|
@ -18,36 +18,36 @@
|
||||||
# if it exists.
|
# if it exists.
|
||||||
|
|
||||||
# make sure we don't use CMAKE_BASE_NAME from somewhere else
|
# make sure we don't use CMAKE_BASE_NAME from somewhere else
|
||||||
SET(CMAKE_BASE_NAME)
|
set(CMAKE_BASE_NAME)
|
||||||
GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE)
|
get_filename_component(CMAKE_BASE_NAME ${CMAKE_RC_COMPILER} NAME_WE)
|
||||||
IF("${CMAKE_BASE_NAME}" MATCHES "windres")
|
if("${CMAKE_BASE_NAME}" MATCHES "windres")
|
||||||
SET(CMAKE_BASE_NAME "windres")
|
set(CMAKE_BASE_NAME "windres")
|
||||||
ENDIF()
|
endif()
|
||||||
SET(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
|
set(CMAKE_SYSTEM_AND_RC_COMPILER_INFO_FILE
|
||||||
${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
|
${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake)
|
||||||
INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
|
include(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
SET (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING
|
set (CMAKE_RC_FLAGS "$ENV{RCFLAGS} ${CMAKE_RC_FLAGS_INIT}" CACHE STRING
|
||||||
"Flags for Fortran compiler.")
|
"Flags for Fortran compiler.")
|
||||||
|
|
||||||
# These are the only types of flags that should be passed to the rc
|
# These are the only types of flags that should be passed to the rc
|
||||||
# command, if COMPILE_FLAGS is used on a target this will be used
|
# command, if COMPILE_FLAGS is used on a target this will be used
|
||||||
# to filter out any other flags
|
# to filter out any other flags
|
||||||
SET(CMAKE_RC_FLAG_REGEX "^[-/](D|I)")
|
set(CMAKE_RC_FLAG_REGEX "^[-/](D|I)")
|
||||||
|
|
||||||
# now define the following rule variables
|
# now define the following rule variables
|
||||||
# CMAKE_RC_COMPILE_OBJECT
|
# CMAKE_RC_COMPILE_OBJECT
|
||||||
SET(CMAKE_INCLUDE_FLAG_RC "-I")
|
set(CMAKE_INCLUDE_FLAG_RC "-I")
|
||||||
# compile a Resource file into an object file
|
# compile a Resource file into an object file
|
||||||
IF(NOT CMAKE_RC_COMPILE_OBJECT)
|
if(NOT CMAKE_RC_COMPILE_OBJECT)
|
||||||
SET(CMAKE_RC_COMPILE_OBJECT
|
set(CMAKE_RC_COMPILE_OBJECT
|
||||||
"<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> /fo<OBJECT> <SOURCE>")
|
"<CMAKE_RC_COMPILER> <FLAGS> <DEFINES> /fo<OBJECT> <SOURCE>")
|
||||||
ENDIF(NOT CMAKE_RC_COMPILE_OBJECT)
|
endif(NOT CMAKE_RC_COMPILE_OBJECT)
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
mark_as_advanced(
|
||||||
CMAKE_RC_FLAGS
|
CMAKE_RC_FLAGS
|
||||||
)
|
)
|
||||||
# set this variable so we can avoid loading this more than once.
|
# set this variable so we can avoid loading this more than once.
|
||||||
SET(CMAKE_RC_INFORMATION_LOADED 1)
|
set(CMAKE_RC_INFORMATION_LOADED 1)
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
@INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED@
|
@INCLUDE_CMAKE_TOOLCHAIN_FILE_IF_REQUIRED@
|
||||||
|
|
||||||
SET(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
|
set(CMAKE_SYSTEM "@CMAKE_SYSTEM@")
|
||||||
SET(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
|
set(CMAKE_SYSTEM_NAME "@CMAKE_SYSTEM_NAME@")
|
||||||
SET(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@")
|
set(CMAKE_SYSTEM_VERSION "@CMAKE_SYSTEM_VERSION@")
|
||||||
SET(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
|
set(CMAKE_SYSTEM_PROCESSOR "@CMAKE_SYSTEM_PROCESSOR@")
|
||||||
|
|
||||||
SET(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
|
set(CMAKE_HOST_SYSTEM "@CMAKE_HOST_SYSTEM@")
|
||||||
SET(CMAKE_HOST_SYSTEM_NAME "@CMAKE_HOST_SYSTEM_NAME@")
|
set(CMAKE_HOST_SYSTEM_NAME "@CMAKE_HOST_SYSTEM_NAME@")
|
||||||
SET(CMAKE_HOST_SYSTEM_VERSION "@CMAKE_HOST_SYSTEM_VERSION@")
|
set(CMAKE_HOST_SYSTEM_VERSION "@CMAKE_HOST_SYSTEM_VERSION@")
|
||||||
SET(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
|
set(CMAKE_HOST_SYSTEM_PROCESSOR "@CMAKE_HOST_SYSTEM_PROCESSOR@")
|
||||||
|
|
||||||
SET(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
|
set(CMAKE_CROSSCOMPILING "@CMAKE_CROSSCOMPILING@")
|
||||||
|
|
||||||
SET(CMAKE_SYSTEM_LOADED 1)
|
set(CMAKE_SYSTEM_LOADED 1)
|
||||||
|
|
|
@ -21,49 +21,49 @@
|
||||||
# But they are reset here and set again in the platform files for the target
|
# But they are reset here and set again in the platform files for the target
|
||||||
# platform, so they can be used for testing the target platform instead
|
# platform, so they can be used for testing the target platform instead
|
||||||
# of testing the host platform.
|
# of testing the host platform.
|
||||||
SET(APPLE )
|
set(APPLE )
|
||||||
SET(UNIX )
|
set(UNIX )
|
||||||
SET(CYGWIN )
|
set(CYGWIN )
|
||||||
SET(WIN32 )
|
set(WIN32 )
|
||||||
|
|
||||||
|
|
||||||
# include Generic system information
|
# include Generic system information
|
||||||
INCLUDE(CMakeGenericSystem)
|
include(CMakeGenericSystem)
|
||||||
|
|
||||||
# 2. now include SystemName.cmake file to set the system specific information
|
# 2. now include SystemName.cmake file to set the system specific information
|
||||||
SET(CMAKE_SYSTEM_INFO_FILE Platform/${CMAKE_SYSTEM_NAME})
|
set(CMAKE_SYSTEM_INFO_FILE Platform/${CMAKE_SYSTEM_NAME})
|
||||||
|
|
||||||
INCLUDE(${CMAKE_SYSTEM_INFO_FILE} OPTIONAL RESULT_VARIABLE _INCLUDED_SYSTEM_INFO_FILE)
|
include(${CMAKE_SYSTEM_INFO_FILE} OPTIONAL RESULT_VARIABLE _INCLUDED_SYSTEM_INFO_FILE)
|
||||||
|
|
||||||
IF(NOT _INCLUDED_SYSTEM_INFO_FILE)
|
if(NOT _INCLUDED_SYSTEM_INFO_FILE)
|
||||||
MESSAGE("System is unknown to cmake, create:\n${CMAKE_SYSTEM_INFO_FILE}"
|
message("System is unknown to cmake, create:\n${CMAKE_SYSTEM_INFO_FILE}"
|
||||||
" to use this system, please send your config file to "
|
" to use this system, please send your config file to "
|
||||||
"cmake@www.cmake.org so it can be added to cmake")
|
"cmake@www.cmake.org so it can be added to cmake")
|
||||||
IF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
|
if(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
|
||||||
CONFIGURE_FILE(${CMAKE_BINARY_DIR}/CMakeCache.txt
|
configure_file(${CMAKE_BINARY_DIR}/CMakeCache.txt
|
||||||
${CMAKE_BINARY_DIR}/CopyOfCMakeCache.txt COPYONLY)
|
${CMAKE_BINARY_DIR}/CopyOfCMakeCache.txt COPYONLY)
|
||||||
MESSAGE("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. "
|
message("Your CMakeCache.txt file was copied to CopyOfCMakeCache.txt. "
|
||||||
"Please send that file to cmake@www.cmake.org.")
|
"Please send that file to cmake@www.cmake.org.")
|
||||||
ENDIF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
|
endif(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
|
||||||
ENDIF(NOT _INCLUDED_SYSTEM_INFO_FILE)
|
endif(NOT _INCLUDED_SYSTEM_INFO_FILE)
|
||||||
|
|
||||||
|
|
||||||
# optionally include a file which can do extra-generator specific things, e.g.
|
# optionally include a file which can do extra-generator specific things, e.g.
|
||||||
# CMakeFindEclipseCDT4.cmake asks gcc for the system include dirs for the Eclipse CDT4 generator
|
# CMakeFindEclipseCDT4.cmake asks gcc for the system include dirs for the Eclipse CDT4 generator
|
||||||
IF(CMAKE_EXTRA_GENERATOR)
|
if(CMAKE_EXTRA_GENERATOR)
|
||||||
STRING(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} )
|
string(REPLACE " " "" _CMAKE_EXTRA_GENERATOR_NO_SPACES ${CMAKE_EXTRA_GENERATOR} )
|
||||||
INCLUDE("CMakeFind${_CMAKE_EXTRA_GENERATOR_NO_SPACES}" OPTIONAL)
|
include("CMakeFind${_CMAKE_EXTRA_GENERATOR_NO_SPACES}" OPTIONAL)
|
||||||
ENDIF(CMAKE_EXTRA_GENERATOR)
|
endif(CMAKE_EXTRA_GENERATOR)
|
||||||
|
|
||||||
|
|
||||||
# for most systems a module is the same as a shared library
|
# for most systems a module is the same as a shared library
|
||||||
# so unless the variable CMAKE_MODULE_EXISTS is set just
|
# so unless the variable CMAKE_MODULE_EXISTS is set just
|
||||||
# copy the values from the LIBRARY variables
|
# copy the values from the LIBRARY variables
|
||||||
# this has to be done after the system information has been loaded
|
# this has to be done after the system information has been loaded
|
||||||
IF(NOT CMAKE_MODULE_EXISTS)
|
if(NOT CMAKE_MODULE_EXISTS)
|
||||||
SET(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
|
set(CMAKE_SHARED_MODULE_PREFIX "${CMAKE_SHARED_LIBRARY_PREFIX}")
|
||||||
SET(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
set(CMAKE_SHARED_MODULE_SUFFIX "${CMAKE_SHARED_LIBRARY_SUFFIX}")
|
||||||
ENDIF(NOT CMAKE_MODULE_EXISTS)
|
endif(NOT CMAKE_MODULE_EXISTS)
|
||||||
|
|
||||||
|
|
||||||
SET(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1)
|
set(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1)
|
||||||
|
|
|
@ -18,6 +18,6 @@
|
||||||
# because otherwise there would have to be a separate assembler source file
|
# because otherwise there would have to be a separate assembler source file
|
||||||
# for each assembler on every architecture.
|
# for each assembler on every architecture.
|
||||||
|
|
||||||
SET(ASM_DIALECT "-ATT")
|
set(ASM_DIALECT "-ATT")
|
||||||
INCLUDE(CMakeTestASMCompiler)
|
include(CMakeTestASMCompiler)
|
||||||
SET(ASM_DIALECT)
|
set(ASM_DIALECT)
|
||||||
|
|
|
@ -19,17 +19,17 @@
|
||||||
# for each assembler on every architecture.
|
# for each assembler on every architecture.
|
||||||
|
|
||||||
|
|
||||||
SET(_ASM_COMPILER_WORKS 0)
|
set(_ASM_COMPILER_WORKS 0)
|
||||||
|
|
||||||
IF(CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
if(CMAKE_ASM${ASM_DIALECT}_COMPILER)
|
||||||
SET(_ASM_COMPILER_WORKS 1)
|
set(_ASM_COMPILER_WORKS 1)
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
# when using generic "ASM" support, we must have detected the compiler ID, fail otherwise:
|
# when using generic "ASM" support, we must have detected the compiler ID, fail otherwise:
|
||||||
IF("ASM${ASM_DIALECT}" STREQUAL "ASM")
|
if("ASM${ASM_DIALECT}" STREQUAL "ASM")
|
||||||
IF(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
if(NOT CMAKE_ASM${ASM_DIALECT}_COMPILER_ID)
|
||||||
SET(_ASM_COMPILER_WORKS 0)
|
set(_ASM_COMPILER_WORKS 0)
|
||||||
ENDIF()
|
endif()
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
SET(CMAKE_ASM${ASM_DIALECT}_COMPILER_WORKS ${_ASM_COMPILER_WORKS} CACHE INTERNAL "")
|
set(CMAKE_ASM${ASM_DIALECT}_COMPILER_WORKS ${_ASM_COMPILER_WORKS} CACHE INTERNAL "")
|
||||||
|
|
|
@ -18,6 +18,6 @@
|
||||||
# because otherwise there would have to be a separate assembler source file
|
# because otherwise there would have to be a separate assembler source file
|
||||||
# for each assembler on every architecture.
|
# for each assembler on every architecture.
|
||||||
|
|
||||||
SET(ASM_DIALECT "_MASM")
|
set(ASM_DIALECT "_MASM")
|
||||||
INCLUDE(CMakeTestASMCompiler)
|
include(CMakeTestASMCompiler)
|
||||||
SET(ASM_DIALECT)
|
set(ASM_DIALECT)
|
||||||
|
|
|
@ -18,6 +18,6 @@
|
||||||
# because otherwise there would have to be a separate assembler source file
|
# because otherwise there would have to be a separate assembler source file
|
||||||
# for each assembler on every architecture.
|
# for each assembler on every architecture.
|
||||||
|
|
||||||
SET(ASM_DIALECT "_NASM")
|
set(ASM_DIALECT "_NASM")
|
||||||
INCLUDE(CMakeTestASMCompiler)
|
include(CMakeTestASMCompiler)
|
||||||
SET(ASM_DIALECT)
|
set(ASM_DIALECT)
|
||||||
|
|
|
@ -12,16 +12,16 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
INCLUDE(CMakeTestCompilerCommon)
|
include(CMakeTestCompilerCommon)
|
||||||
|
|
||||||
# This file is used by EnableLanguage in cmGlobalGenerator to
|
# This file is used by EnableLanguage in cmGlobalGenerator to
|
||||||
# determine that that selected C compiler can actually compile
|
# determine that that selected C compiler can actually compile
|
||||||
# and link the most basic of programs. If not, a fatal error
|
# and link the most basic of programs. If not, a fatal error
|
||||||
# is set and cmake stops processing commands and will not generate
|
# is set and cmake stops processing commands and will not generate
|
||||||
# any makefiles or projects.
|
# any makefiles or projects.
|
||||||
IF(NOT CMAKE_C_COMPILER_WORKS)
|
if(NOT CMAKE_C_COMPILER_WORKS)
|
||||||
PrintTestCompilerStatus("C" "")
|
PrintTestCompilerStatus("C" "")
|
||||||
FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
|
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
|
||||||
"#ifdef __cplusplus\n"
|
"#ifdef __cplusplus\n"
|
||||||
"# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n"
|
"# error \"The CMAKE_C_COMPILER is set to a C++ compiler\"\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
|
@ -33,55 +33,55 @@ IF(NOT CMAKE_C_COMPILER_WORKS)
|
||||||
"int main(int argc, char* argv[])\n"
|
"int main(int argc, char* argv[])\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
"{ (void)argv; return argc-1;}\n")
|
"{ (void)argv; return argc-1;}\n")
|
||||||
TRY_COMPILE(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
|
try_compile(CMAKE_C_COMPILER_WORKS ${CMAKE_BINARY_DIR}
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCCompiler.c
|
||||||
OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT)
|
OUTPUT_VARIABLE __CMAKE_C_COMPILER_OUTPUT)
|
||||||
SET(C_TEST_WAS_RUN 1)
|
set(C_TEST_WAS_RUN 1)
|
||||||
ENDIF(NOT CMAKE_C_COMPILER_WORKS)
|
endif(NOT CMAKE_C_COMPILER_WORKS)
|
||||||
|
|
||||||
IF(NOT CMAKE_C_COMPILER_WORKS)
|
if(NOT CMAKE_C_COMPILER_WORKS)
|
||||||
PrintTestCompilerStatus("C" " -- broken")
|
PrintTestCompilerStatus("C" " -- broken")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
"Determining if the C compiler works failed with "
|
"Determining if the C compiler works failed with "
|
||||||
"the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
|
"the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
|
||||||
# if the compiler is broken make sure to remove the platform file
|
# 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
|
# since Windows-cl configures both c/cxx files both need to be removed
|
||||||
# when c or c++ fails
|
# when c or c++ fails
|
||||||
FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
|
file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
|
||||||
FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
|
file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
|
||||||
MESSAGE(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
|
message(FATAL_ERROR "The C compiler \"${CMAKE_C_COMPILER}\" "
|
||||||
"is not able to compile a simple test program.\nIt fails "
|
"is not able to compile a simple test program.\nIt fails "
|
||||||
"with the following output:\n ${__CMAKE_C_COMPILER_OUTPUT}\n\n"
|
"with the following output:\n ${__CMAKE_C_COMPILER_OUTPUT}\n\n"
|
||||||
"CMake will not be able to correctly generate this project.")
|
"CMake will not be able to correctly generate this project.")
|
||||||
ELSE(NOT CMAKE_C_COMPILER_WORKS)
|
else(NOT CMAKE_C_COMPILER_WORKS)
|
||||||
IF(C_TEST_WAS_RUN)
|
if(C_TEST_WAS_RUN)
|
||||||
PrintTestCompilerStatus("C" " -- works")
|
PrintTestCompilerStatus("C" " -- works")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Determining if the C compiler works passed with "
|
"Determining if the C compiler works passed with "
|
||||||
"the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
|
"the following output:\n${__CMAKE_C_COMPILER_OUTPUT}\n\n")
|
||||||
ENDIF(C_TEST_WAS_RUN)
|
endif(C_TEST_WAS_RUN)
|
||||||
SET(CMAKE_C_COMPILER_WORKS 1 CACHE INTERNAL "")
|
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.
|
# The compiler configuration was forced by the user.
|
||||||
# Assume the user has configured all compiler information.
|
# Assume the user has configured all compiler information.
|
||||||
ELSE(CMAKE_C_COMPILER_FORCED)
|
else(CMAKE_C_COMPILER_FORCED)
|
||||||
# Try to identify the ABI and configure it into CMakeCCompiler.cmake
|
# 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)
|
CMAKE_DETERMINE_COMPILER_ABI(C ${CMAKE_ROOT}/Modules/CMakeCCompilerABI.c)
|
||||||
CONFIGURE_FILE(
|
configure_file(
|
||||||
${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
|
${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake
|
||||||
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
|
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
|
||||||
)
|
)
|
||||||
INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake)
|
include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCCompiler.cmake)
|
||||||
ENDIF(CMAKE_C_COMPILER_FORCED)
|
endif(CMAKE_C_COMPILER_FORCED)
|
||||||
IF(CMAKE_C_SIZEOF_DATA_PTR)
|
if(CMAKE_C_SIZEOF_DATA_PTR)
|
||||||
FOREACH(f ${CMAKE_C_ABI_FILES})
|
foreach(f ${CMAKE_C_ABI_FILES})
|
||||||
INCLUDE(${f})
|
include(${f})
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
UNSET(CMAKE_C_ABI_FILES)
|
unset(CMAKE_C_ABI_FILES)
|
||||||
ENDIF()
|
endif()
|
||||||
ENDIF(NOT CMAKE_C_COMPILER_WORKS)
|
endif(NOT CMAKE_C_COMPILER_WORKS)
|
||||||
|
|
||||||
UNSET(__CMAKE_C_COMPILER_OUTPUT)
|
unset(__CMAKE_C_COMPILER_OUTPUT)
|
||||||
|
|
|
@ -12,69 +12,69 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
INCLUDE(CMakeTestCompilerCommon)
|
include(CMakeTestCompilerCommon)
|
||||||
|
|
||||||
# This file is used by EnableLanguage in cmGlobalGenerator to
|
# This file is used by EnableLanguage in cmGlobalGenerator to
|
||||||
# determine that that selected C++ compiler can actually compile
|
# determine that that selected C++ compiler can actually compile
|
||||||
# and link the most basic of programs. If not, a fatal error
|
# and link the most basic of programs. If not, a fatal error
|
||||||
# is set and cmake stops processing commands and will not generate
|
# is set and cmake stops processing commands and will not generate
|
||||||
# any makefiles or projects.
|
# any makefiles or projects.
|
||||||
IF(NOT CMAKE_CXX_COMPILER_WORKS)
|
if(NOT CMAKE_CXX_COMPILER_WORKS)
|
||||||
PrintTestCompilerStatus("CXX" "")
|
PrintTestCompilerStatus("CXX" "")
|
||||||
FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
|
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
|
||||||
"#ifndef __cplusplus\n"
|
"#ifndef __cplusplus\n"
|
||||||
"# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n"
|
"# error \"The CMAKE_CXX_COMPILER is set to a C compiler\"\n"
|
||||||
"#endif\n"
|
"#endif\n"
|
||||||
"int main(){return 0;}\n")
|
"int main(){return 0;}\n")
|
||||||
TRY_COMPILE(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
|
try_compile(CMAKE_CXX_COMPILER_WORKS ${CMAKE_BINARY_DIR}
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testCXXCompiler.cxx
|
||||||
OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT)
|
OUTPUT_VARIABLE __CMAKE_CXX_COMPILER_OUTPUT)
|
||||||
SET(CXX_TEST_WAS_RUN 1)
|
set(CXX_TEST_WAS_RUN 1)
|
||||||
ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
|
endif(NOT CMAKE_CXX_COMPILER_WORKS)
|
||||||
|
|
||||||
IF(NOT CMAKE_CXX_COMPILER_WORKS)
|
if(NOT CMAKE_CXX_COMPILER_WORKS)
|
||||||
PrintTestCompilerStatus("CXX" " -- broken")
|
PrintTestCompilerStatus("CXX" " -- broken")
|
||||||
# if the compiler is broken make sure to remove the platform file
|
# 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
|
# since Windows-cl configures both c/cxx files both need to be removed
|
||||||
# when c or c++ fails
|
# when c or c++ fails
|
||||||
FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
|
file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCPlatform.cmake )
|
||||||
FILE(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
|
file(REMOVE ${CMAKE_PLATFORM_ROOT_BIN}/CMakeCXXPlatform.cmake )
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
"Determining if the CXX compiler works failed with "
|
"Determining if the CXX compiler works failed with "
|
||||||
"the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
|
"the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
|
||||||
MESSAGE(FATAL_ERROR "The C++ compiler \"${CMAKE_CXX_COMPILER}\" "
|
message(FATAL_ERROR "The C++ compiler \"${CMAKE_CXX_COMPILER}\" "
|
||||||
"is not able to compile a simple test program.\nIt fails "
|
"is not able to compile a simple test program.\nIt fails "
|
||||||
"with the following output:\n ${__CMAKE_CXX_COMPILER_OUTPUT}\n\n"
|
"with the following output:\n ${__CMAKE_CXX_COMPILER_OUTPUT}\n\n"
|
||||||
"CMake will not be able to correctly generate this project.")
|
"CMake will not be able to correctly generate this project.")
|
||||||
ELSE(NOT CMAKE_CXX_COMPILER_WORKS)
|
else(NOT CMAKE_CXX_COMPILER_WORKS)
|
||||||
IF(CXX_TEST_WAS_RUN)
|
if(CXX_TEST_WAS_RUN)
|
||||||
PrintTestCompilerStatus("CXX" " -- works")
|
PrintTestCompilerStatus("CXX" " -- works")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Determining if the CXX compiler works passed with "
|
"Determining if the CXX compiler works passed with "
|
||||||
"the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
|
"the following output:\n${__CMAKE_CXX_COMPILER_OUTPUT}\n\n")
|
||||||
ENDIF(CXX_TEST_WAS_RUN)
|
endif(CXX_TEST_WAS_RUN)
|
||||||
SET(CMAKE_CXX_COMPILER_WORKS 1 CACHE INTERNAL "")
|
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.
|
# The compiler configuration was forced by the user.
|
||||||
# Assume the user has configured all compiler information.
|
# Assume the user has configured all compiler information.
|
||||||
ELSE(CMAKE_CXX_COMPILER_FORCED)
|
else(CMAKE_CXX_COMPILER_FORCED)
|
||||||
# Try to identify the ABI and configure it into CMakeCXXCompiler.cmake
|
# 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)
|
CMAKE_DETERMINE_COMPILER_ABI(CXX ${CMAKE_ROOT}/Modules/CMakeCXXCompilerABI.cpp)
|
||||||
CONFIGURE_FILE(
|
configure_file(
|
||||||
${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
|
${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake
|
||||||
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
|
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
|
||||||
)
|
)
|
||||||
INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake)
|
include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake)
|
||||||
ENDIF(CMAKE_CXX_COMPILER_FORCED)
|
endif(CMAKE_CXX_COMPILER_FORCED)
|
||||||
IF(CMAKE_CXX_SIZEOF_DATA_PTR)
|
if(CMAKE_CXX_SIZEOF_DATA_PTR)
|
||||||
FOREACH(f ${CMAKE_CXX_ABI_FILES})
|
foreach(f ${CMAKE_CXX_ABI_FILES})
|
||||||
INCLUDE(${f})
|
include(${f})
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
UNSET(CMAKE_CXX_ABI_FILES)
|
unset(CMAKE_CXX_ABI_FILES)
|
||||||
ENDIF()
|
endif()
|
||||||
ENDIF(NOT CMAKE_CXX_COMPILER_WORKS)
|
endif(NOT CMAKE_CXX_COMPILER_WORKS)
|
||||||
|
|
||||||
UNSET(__CMAKE_CXX_COMPILER_OUTPUT)
|
unset(__CMAKE_CXX_COMPILER_OUTPUT)
|
||||||
|
|
|
@ -13,9 +13,9 @@
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
function(PrintTestCompilerStatus LANG MSG)
|
function(PrintTestCompilerStatus LANG MSG)
|
||||||
IF(CMAKE_GENERATOR MATCHES Make)
|
if(CMAKE_GENERATOR MATCHES Make)
|
||||||
MESSAGE(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
|
message(STATUS "Check for working ${LANG} compiler: ${CMAKE_${LANG}_COMPILER}${MSG}")
|
||||||
ELSE()
|
else()
|
||||||
MESSAGE(STATUS "Check for working ${LANG} compiler using: ${CMAKE_GENERATOR}${MSG}")
|
message(STATUS "Check for working ${LANG} compiler using: ${CMAKE_GENERATOR}${MSG}")
|
||||||
ENDIF()
|
endif()
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
|
@ -12,90 +12,90 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
INCLUDE(CMakeTestCompilerCommon)
|
include(CMakeTestCompilerCommon)
|
||||||
|
|
||||||
# This file is used by EnableLanguage in cmGlobalGenerator to
|
# This file is used by EnableLanguage in cmGlobalGenerator to
|
||||||
# determine that that selected Fortran compiler can actually compile
|
# determine that that selected Fortran compiler can actually compile
|
||||||
# and link the most basic of programs. If not, a fatal error
|
# and link the most basic of programs. If not, a fatal error
|
||||||
# is set and cmake stops processing commands and will not generate
|
# is set and cmake stops processing commands and will not generate
|
||||||
# any makefiles or projects.
|
# any makefiles or projects.
|
||||||
IF(NOT CMAKE_Fortran_COMPILER_WORKS)
|
if(NOT CMAKE_Fortran_COMPILER_WORKS)
|
||||||
PrintTestCompilerStatus("Fortran" "")
|
PrintTestCompilerStatus("Fortran" "")
|
||||||
FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "
|
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f "
|
||||||
PROGRAM TESTFortran
|
PROGRAM TESTFortran
|
||||||
PRINT *, 'Hello'
|
PRINT *, 'Hello'
|
||||||
END
|
END
|
||||||
")
|
")
|
||||||
TRY_COMPILE(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR}
|
try_compile(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR}
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
|
||||||
OUTPUT_VARIABLE OUTPUT)
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
SET(FORTRAN_TEST_WAS_RUN 1)
|
set(FORTRAN_TEST_WAS_RUN 1)
|
||||||
ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS)
|
endif(NOT CMAKE_Fortran_COMPILER_WORKS)
|
||||||
|
|
||||||
IF(NOT CMAKE_Fortran_COMPILER_WORKS)
|
if(NOT CMAKE_Fortran_COMPILER_WORKS)
|
||||||
PrintTestCompilerStatus("Fortran" " -- broken")
|
PrintTestCompilerStatus("Fortran" " -- broken")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
"Determining if the Fortran compiler works failed with "
|
"Determining if the Fortran compiler works failed with "
|
||||||
"the following output:\n${OUTPUT}\n\n")
|
"the following output:\n${OUTPUT}\n\n")
|
||||||
MESSAGE(FATAL_ERROR "The Fortran compiler \"${CMAKE_Fortran_COMPILER}\" "
|
message(FATAL_ERROR "The Fortran compiler \"${CMAKE_Fortran_COMPILER}\" "
|
||||||
"is not able to compile a simple test program.\nIt fails "
|
"is not able to compile a simple test program.\nIt fails "
|
||||||
"with the following output:\n ${OUTPUT}\n\n"
|
"with the following output:\n ${OUTPUT}\n\n"
|
||||||
"CMake will not be able to correctly generate this project.")
|
"CMake will not be able to correctly generate this project.")
|
||||||
ELSE(NOT CMAKE_Fortran_COMPILER_WORKS)
|
else(NOT CMAKE_Fortran_COMPILER_WORKS)
|
||||||
IF(FORTRAN_TEST_WAS_RUN)
|
if(FORTRAN_TEST_WAS_RUN)
|
||||||
PrintTestCompilerStatus("Fortran" " -- works")
|
PrintTestCompilerStatus("Fortran" " -- works")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Determining if the Fortran compiler works passed with "
|
"Determining if the Fortran compiler works passed with "
|
||||||
"the following output:\n${OUTPUT}\n\n")
|
"the following output:\n${OUTPUT}\n\n")
|
||||||
ENDIF(FORTRAN_TEST_WAS_RUN)
|
endif(FORTRAN_TEST_WAS_RUN)
|
||||||
SET(CMAKE_Fortran_COMPILER_WORKS 1 CACHE INTERNAL "")
|
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.
|
# The compiler configuration was forced by the user.
|
||||||
# Assume the user has configured all compiler information.
|
# Assume the user has configured all compiler information.
|
||||||
ELSE(CMAKE_Fortran_COMPILER_FORCED)
|
else(CMAKE_Fortran_COMPILER_FORCED)
|
||||||
# Try to identify the ABI and configure it into CMakeFortranCompiler.cmake
|
# 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)
|
CMAKE_DETERMINE_COMPILER_ABI(Fortran ${CMAKE_ROOT}/Modules/CMakeFortranCompilerABI.F)
|
||||||
|
|
||||||
# Test for Fortran 90 support by using an f90-specific construct.
|
# Test for Fortran 90 support by using an f90-specific construct.
|
||||||
IF(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
if(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
||||||
MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90")
|
message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90")
|
||||||
FILE(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 "
|
file(WRITE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90 "
|
||||||
PROGRAM TESTFortran90
|
PROGRAM TESTFortran90
|
||||||
stop = 1 ; do while ( stop .eq. 0 ) ; end do
|
stop = 1 ; do while ( stop .eq. 0 ) ; end do
|
||||||
END PROGRAM TESTFortran90
|
END PROGRAM TESTFortran90
|
||||||
")
|
")
|
||||||
TRY_COMPILE(CMAKE_Fortran_COMPILER_SUPPORTS_F90 ${CMAKE_BINARY_DIR}
|
try_compile(CMAKE_Fortran_COMPILER_SUPPORTS_F90 ${CMAKE_BINARY_DIR}
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompilerF90.f90
|
||||||
OUTPUT_VARIABLE OUTPUT)
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
IF(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
if(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
||||||
MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- yes")
|
message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- yes")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Determining if the Fortran compiler supports Fortran 90 passed with "
|
"Determining if the Fortran compiler supports Fortran 90 passed with "
|
||||||
"the following output:\n${OUTPUT}\n\n")
|
"the following output:\n${OUTPUT}\n\n")
|
||||||
SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
|
set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 1)
|
||||||
ELSE(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
else(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
||||||
MESSAGE(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- no")
|
message(STATUS "Checking whether ${CMAKE_Fortran_COMPILER} supports Fortran 90 -- no")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
"Determining if the Fortran compiler supports Fortran 90 failed with "
|
"Determining if the Fortran compiler supports Fortran 90 failed with "
|
||||||
"the following output:\n${OUTPUT}\n\n")
|
"the following output:\n${OUTPUT}\n\n")
|
||||||
SET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0)
|
set(CMAKE_Fortran_COMPILER_SUPPORTS_F90 0)
|
||||||
ENDIF(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
endif(CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
||||||
UNSET(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE)
|
unset(CMAKE_Fortran_COMPILER_SUPPORTS_F90 CACHE)
|
||||||
ENDIF(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
endif(NOT DEFINED CMAKE_Fortran_COMPILER_SUPPORTS_F90)
|
||||||
|
|
||||||
CONFIGURE_FILE(
|
configure_file(
|
||||||
${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
|
${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake
|
||||||
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
|
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
|
||||||
)
|
)
|
||||||
INCLUDE(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake)
|
include(${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeFortranCompiler.cmake)
|
||||||
ENDIF(CMAKE_Fortran_COMPILER_FORCED)
|
endif(CMAKE_Fortran_COMPILER_FORCED)
|
||||||
IF(CMAKE_Fortran_SIZEOF_DATA_PTR)
|
if(CMAKE_Fortran_SIZEOF_DATA_PTR)
|
||||||
FOREACH(f ${CMAKE_Fortran_ABI_FILES})
|
foreach(f ${CMAKE_Fortran_ABI_FILES})
|
||||||
INCLUDE(${f})
|
include(${f})
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
UNSET(CMAKE_Fortran_ABI_FILES)
|
unset(CMAKE_Fortran_ABI_FILES)
|
||||||
ENDIF()
|
endif()
|
||||||
ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS)
|
endif(NOT CMAKE_Fortran_COMPILER_WORKS)
|
||||||
|
|
|
@ -17,4 +17,4 @@
|
||||||
# and link the most basic of programs. If not, a fatal error
|
# and link the most basic of programs. If not, a fatal error
|
||||||
# is set and cmake stops processing commands and will not generate
|
# is set and cmake stops processing commands and will not generate
|
||||||
# any makefiles or projects.
|
# any makefiles or projects.
|
||||||
SET(CMAKE_Java_COMPILER_WORKS 1 CACHE INTERNAL "")
|
set(CMAKE_Java_COMPILER_WORKS 1 CACHE INTERNAL "")
|
||||||
|
|
|
@ -20,4 +20,4 @@
|
||||||
|
|
||||||
# For now there is no way to do a try compile on just a .rc file
|
# For now there is no way to do a try compile on just a .rc file
|
||||||
# so just do nothing in here.
|
# so just do nothing in here.
|
||||||
SET(CMAKE_RC_COMPILER_WORKS 1 CACHE INTERNAL "")
|
set(CMAKE_RC_COMPILER_WORKS 1 CACHE INTERNAL "")
|
||||||
|
|
|
@ -12,5 +12,5 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES gmake make smake)
|
find_program(CMAKE_MAKE_PROGRAM NAMES gmake make smake)
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM)
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
# Look for devenv as a build program. We need to use this to support
|
# Look for devenv as a build program. We need to use this to support
|
||||||
# Intel Fortran integration into VS. MSBuild can not be used for that case
|
# Intel Fortran integration into VS. MSBuild can not be used for that case
|
||||||
# since Intel Fortran uses the older devenv file format.
|
# since Intel Fortran uses the older devenv file format.
|
||||||
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
find_program(CMAKE_MAKE_PROGRAM
|
||||||
NAMES devenv
|
NAMES devenv
|
||||||
HINTS
|
HINTS
|
||||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory]
|
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;EnvironmentDirectory]
|
||||||
|
@ -39,16 +39,16 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
||||||
# causes the compiler checks and try-compile stuff to fail. MSbuild
|
# causes the compiler checks and try-compile stuff to fail. MSbuild
|
||||||
# is a better choice for this. However, VCExpress does not support
|
# is a better choice for this. However, VCExpress does not support
|
||||||
# cross compiling needed for Win CE.
|
# cross compiling needed for Win CE.
|
||||||
IF(NOT CMAKE_CROSSCOMPILING)
|
if(NOT CMAKE_CROSSCOMPILING)
|
||||||
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
find_program(CMAKE_MAKE_PROGRAM
|
||||||
NAMES MSBuild
|
NAMES MSBuild
|
||||||
HINTS
|
HINTS
|
||||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir]
|
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir]
|
||||||
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
|
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
|
||||||
"c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
|
"c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0;CLR Version]/"
|
||||||
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0;CLR Version]/")
|
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\10.0;CLR Version]/")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM)
|
||||||
SET(MSVC10 1)
|
set(MSVC10 1)
|
||||||
SET(MSVC_VERSION 1600)
|
set(MSVC_VERSION 1600)
|
||||||
|
|
|
@ -15,7 +15,7 @@
|
||||||
# Look for devenv as a build program. We need to use this to support
|
# Look for devenv as a build program. We need to use this to support
|
||||||
# Intel Fortran integration into VS. MSBuild can not be used for that case
|
# Intel Fortran integration into VS. MSBuild can not be used for that case
|
||||||
# since Intel Fortran uses the older devenv file format.
|
# since Intel Fortran uses the older devenv file format.
|
||||||
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
find_program(CMAKE_MAKE_PROGRAM
|
||||||
NAMES devenv
|
NAMES devenv
|
||||||
HINTS
|
HINTS
|
||||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;EnvironmentDirectory]
|
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;EnvironmentDirectory]
|
||||||
|
@ -39,16 +39,16 @@ FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
||||||
# causes the compiler checks and try-compile stuff to fail. MSbuild
|
# causes the compiler checks and try-compile stuff to fail. MSbuild
|
||||||
# is a better choice for this. However, VCExpress does not support
|
# is a better choice for this. However, VCExpress does not support
|
||||||
# cross compiling needed for Win CE.
|
# cross compiling needed for Win CE.
|
||||||
IF(NOT CMAKE_CROSSCOMPILING)
|
if(NOT CMAKE_CROSSCOMPILING)
|
||||||
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
find_program(CMAKE_MAKE_PROGRAM
|
||||||
NAMES MSBuild
|
NAMES MSBuild
|
||||||
HINTS
|
HINTS
|
||||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir]
|
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir]
|
||||||
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/"
|
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/"
|
||||||
"c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/"
|
"c:/WINDOWS/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0;CLR Version]/"
|
||||||
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0;CLR Version]/")
|
"$ENV{SYSTEMROOT}/Microsoft.NET/Framework/[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\11.0;CLR Version]/")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM)
|
||||||
SET(MSVC11 1)
|
set(MSVC11 1)
|
||||||
SET(MSVC_VERSION 1700)
|
set(MSVC_VERSION 1700)
|
||||||
|
|
|
@ -13,14 +13,14 @@
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
# hard code these for fast backwards compatibility tests
|
# hard code these for fast backwards compatibility tests
|
||||||
SET (CMAKE_SIZEOF_INT 4 CACHE INTERNAL "Size of int data type")
|
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_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_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_CHAR 1 CACHE INTERNAL "Size of char data type")
|
||||||
SET (CMAKE_SIZEOF_SHORT 2 CACHE INTERNAL "Size of short 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_FLOAT 4 CACHE INTERNAL "Size of float data type")
|
||||||
SET (CMAKE_SIZEOF_DOUBLE 8 CACHE INTERNAL "Size of double 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_NO_ANSI_FOR_SCOPE 1 CACHE INTERNAL
|
||||||
"Does the compiler support ansi for scope.")
|
"Does the compiler support ansi for scope.")
|
||||||
SET (CMAKE_USE_WIN32_THREADS TRUE CACHE BOOL "Use the win32 thread library.")
|
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_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
find_program(CMAKE_MAKE_PROGRAM
|
||||||
NAMES msdev
|
NAMES msdev
|
||||||
PATHS
|
PATHS
|
||||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\6.0\\Setup;VsCommonDir]/MSDev98/Bin
|
[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"
|
"c:/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin"
|
||||||
"/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin"
|
"/Program Files/Microsoft Visual Studio/Common/MSDev98/Bin"
|
||||||
)
|
)
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM)
|
||||||
SET(MSVC60 1)
|
set(MSVC60 1)
|
||||||
SET(MSVC_VERSION 1200)
|
set(MSVC_VERSION 1200)
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
find_program(CMAKE_MAKE_PROGRAM
|
||||||
NAMES devenv
|
NAMES devenv
|
||||||
PATHS
|
PATHS
|
||||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VS;EnvironmentDirectory]
|
[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"
|
"c:/Program Files/Microsoft Visual Studio.NET/Common7/IDE"
|
||||||
"/Program Files/Microsoft Visual Studio .NET/Common7/IDE/"
|
"/Program Files/Microsoft Visual Studio .NET/Common7/IDE/"
|
||||||
)
|
)
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM)
|
||||||
SET(MSVC71 1)
|
set(MSVC71 1)
|
||||||
SET(MSVC_VERSION 1310)
|
set(MSVC_VERSION 1310)
|
||||||
|
|
|
@ -13,14 +13,14 @@
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
# hard code these for fast backwards compatibility tests
|
# hard code these for fast backwards compatibility tests
|
||||||
SET (CMAKE_SIZEOF_INT 4 CACHE INTERNAL "Size of int data type")
|
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_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_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_CHAR 1 CACHE INTERNAL "Size of char data type")
|
||||||
SET (CMAKE_SIZEOF_SHORT 2 CACHE INTERNAL "Size of short 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_FLOAT 4 CACHE INTERNAL "Size of float data type")
|
||||||
SET (CMAKE_SIZEOF_DOUBLE 8 CACHE INTERNAL "Size of double 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_NO_ANSI_FOR_SCOPE 0 CACHE INTERNAL
|
||||||
"Does the compiler support ansi for scope.")
|
"Does the compiler support ansi for scope.")
|
||||||
SET (CMAKE_USE_WIN32_THREADS TRUE CACHE BOOL "Use the win32 thread library.")
|
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_WORDS_BIGENDIAN 0 CACHE INTERNAL "endianness of bytes")
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
find_program(CMAKE_MAKE_PROGRAM
|
||||||
NAMES devenv
|
NAMES devenv
|
||||||
PATHS
|
PATHS
|
||||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.0\\Setup\\VS;EnvironmentDirectory]
|
[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"
|
"c:/Program Files/Microsoft Visual Studio.NET/Common7/IDE"
|
||||||
"/Program Files/Microsoft Visual Studio .NET/Common7/IDE/"
|
"/Program Files/Microsoft Visual Studio .NET/Common7/IDE/"
|
||||||
)
|
)
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM)
|
||||||
SET(MSVC70 1)
|
set(MSVC70 1)
|
||||||
SET(MSVC_VERSION 1300)
|
set(MSVC_VERSION 1300)
|
||||||
|
|
|
@ -13,12 +13,12 @@
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
# VCExpress does not support cross compiling, which is necessary for Win CE
|
# VCExpress does not support cross compiling, which is necessary for Win CE
|
||||||
SET( _CMAKE_MAKE_PROGRAM_NAMES devenv)
|
set( _CMAKE_MAKE_PROGRAM_NAMES devenv)
|
||||||
IF(NOT CMAKE_CROSSCOMPILING)
|
if(NOT CMAKE_CROSSCOMPILING)
|
||||||
SET( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
|
set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
|
||||||
ENDIF(NOT CMAKE_CROSSCOMPILING)
|
endif(NOT CMAKE_CROSSCOMPILING)
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
find_program(CMAKE_MAKE_PROGRAM
|
||||||
NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
|
NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
|
||||||
HINTS
|
HINTS
|
||||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VS;EnvironmentDirectory]
|
[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"
|
"$ENV{ProgramFiles} (x86)/Microsoft Visual Studio8/Common7/IDE"
|
||||||
"/Program Files/Microsoft Visual Studio 8/Common7/IDE/"
|
"/Program Files/Microsoft Visual Studio 8/Common7/IDE/"
|
||||||
)
|
)
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM)
|
||||||
SET(MSVC80 1)
|
set(MSVC80 1)
|
||||||
SET(MSVC_VERSION 1400)
|
set(MSVC_VERSION 1400)
|
||||||
|
|
|
@ -13,12 +13,12 @@
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
# VCExpress does not support cross compiling, which is necessary for Win CE
|
# VCExpress does not support cross compiling, which is necessary for Win CE
|
||||||
SET( _CMAKE_MAKE_PROGRAM_NAMES devenv)
|
set( _CMAKE_MAKE_PROGRAM_NAMES devenv)
|
||||||
IF(NOT CMAKE_CROSSCOMPILING)
|
if(NOT CMAKE_CROSSCOMPILING)
|
||||||
SET( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
|
set( _CMAKE_MAKE_PROGRAM_NAMES ${_CMAKE_MAKE_PROGRAM_NAMES} VCExpress)
|
||||||
ENDIF(NOT CMAKE_CROSSCOMPILING)
|
endif(NOT CMAKE_CROSSCOMPILING)
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_MAKE_PROGRAM
|
find_program(CMAKE_MAKE_PROGRAM
|
||||||
NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
|
NAMES ${_CMAKE_MAKE_PROGRAM_NAMES}
|
||||||
HINTS
|
HINTS
|
||||||
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VS;EnvironmentDirectory]
|
[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.0/Common7/IDE/"
|
||||||
"/Program Files/Microsoft Visual Studio 9/Common7/IDE/"
|
"/Program Files/Microsoft Visual Studio 9/Common7/IDE/"
|
||||||
)
|
)
|
||||||
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)
|
mark_as_advanced(CMAKE_MAKE_PROGRAM)
|
||||||
SET(MSVC90 1)
|
set(MSVC90 1)
|
||||||
SET(MSVC_VERSION 1500)
|
set(MSVC_VERSION 1500)
|
||||||
|
|
|
@ -285,48 +285,48 @@
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
# Define this var in order to avoid (or warn) concerning multiple inclusion
|
# Define this var in order to avoid (or warn) concerning multiple inclusion
|
||||||
IF(CPack_CMake_INCLUDED)
|
if(CPack_CMake_INCLUDED)
|
||||||
MESSAGE(WARNING "CPack.cmake has already been included!!")
|
message(WARNING "CPack.cmake has already been included!!")
|
||||||
ELSE(CPack_CMake_INCLUDED)
|
else(CPack_CMake_INCLUDED)
|
||||||
SET(CPack_CMake_INCLUDED 1)
|
set(CPack_CMake_INCLUDED 1)
|
||||||
ENDIF(CPack_CMake_INCLUDED)
|
endif(CPack_CMake_INCLUDED)
|
||||||
|
|
||||||
# Pick a configuration file
|
# Pick a configuration file
|
||||||
SET(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
|
set(cpack_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
|
||||||
IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
|
if(EXISTS "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
|
||||||
SET(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
|
set(cpack_input_file "${CMAKE_SOURCE_DIR}/CPackConfig.cmake.in")
|
||||||
ENDIF(EXISTS "${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")
|
set(cpack_source_input_file "${CMAKE_ROOT}/Templates/CPackConfig.cmake.in")
|
||||||
IF(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
|
if(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
|
||||||
SET(cpack_source_input_file "${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")
|
endif(EXISTS "${CMAKE_SOURCE_DIR}/CPackSourceConfig.cmake.in")
|
||||||
|
|
||||||
# Backward compatibility
|
# Backward compatibility
|
||||||
# Include CPackComponent macros if it has not already been included before.
|
# Include CPackComponent macros if it has not already been included before.
|
||||||
include(CPackComponent)
|
include(CPackComponent)
|
||||||
|
|
||||||
# Macro for setting values if a user did not overwrite them
|
# Macro for setting values if a user did not overwrite them
|
||||||
MACRO(cpack_set_if_not_set name value)
|
macro(cpack_set_if_not_set name value)
|
||||||
IF(NOT DEFINED "${name}")
|
if(NOT DEFINED "${name}")
|
||||||
SET(${name} "${value}")
|
set(${name} "${value}")
|
||||||
ENDIF(NOT DEFINED "${name}")
|
endif(NOT DEFINED "${name}")
|
||||||
ENDMACRO(cpack_set_if_not_set)
|
endmacro(cpack_set_if_not_set)
|
||||||
|
|
||||||
# cpack_encode_variables - Macro to encode variables for the configuration file
|
# cpack_encode_variables - Macro to encode variables for the configuration file
|
||||||
# find any variable that starts with CPACK and create a variable
|
# find any variable that starts with CPACK and create a variable
|
||||||
# _CPACK_OTHER_VARIABLES_ that contains SET commands for
|
# _CPACK_OTHER_VARIABLES_ that contains SET commands for
|
||||||
# each cpack variable. _CPACK_OTHER_VARIABLES_ is then
|
# each cpack variable. _CPACK_OTHER_VARIABLES_ is then
|
||||||
# used as an @ replacment in configure_file for the CPackConfig.
|
# used as an @ replacment in configure_file for the CPackConfig.
|
||||||
MACRO(cpack_encode_variables)
|
macro(cpack_encode_variables)
|
||||||
SET(_CPACK_OTHER_VARIABLES_)
|
set(_CPACK_OTHER_VARIABLES_)
|
||||||
GET_CMAKE_PROPERTY(res VARIABLES)
|
get_cmake_property(res VARIABLES)
|
||||||
FOREACH(var ${res})
|
foreach(var ${res})
|
||||||
IF("xxx${var}" MATCHES "xxxCPACK")
|
if("xxx${var}" MATCHES "xxxCPACK")
|
||||||
SET(_CPACK_OTHER_VARIABLES_
|
set(_CPACK_OTHER_VARIABLES_
|
||||||
"${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")")
|
"${_CPACK_OTHER_VARIABLES_}\nSET(${var} \"${${var}}\")")
|
||||||
ENDIF("xxx${var}" MATCHES "xxxCPACK")
|
endif("xxx${var}" MATCHES "xxxCPACK")
|
||||||
ENDFOREACH(var ${res})
|
endforeach(var ${res})
|
||||||
ENDMACRO(cpack_encode_variables)
|
endmacro(cpack_encode_variables)
|
||||||
|
|
||||||
# Set the package name
|
# Set the package name
|
||||||
cpack_set_if_not_set(CPACK_PACKAGE_NAME "${CMAKE_PROJECT_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}")
|
cpack_set_if_not_set(CPACK_MODULE_PATH "${CMAKE_MODULE_PATH}")
|
||||||
|
|
||||||
IF(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
|
if(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
|
||||||
SET(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
|
||||||
ENDIF(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
|
endif(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL)
|
||||||
|
|
||||||
IF(CPACK_NSIS_MODIFY_PATH)
|
if(CPACK_NSIS_MODIFY_PATH)
|
||||||
SET(CPACK_NSIS_MODIFY_PATH ON)
|
set(CPACK_NSIS_MODIFY_PATH ON)
|
||||||
ENDIF(CPACK_NSIS_MODIFY_PATH)
|
endif(CPACK_NSIS_MODIFY_PATH)
|
||||||
|
|
||||||
SET(__cpack_system_name ${CMAKE_SYSTEM_NAME})
|
set(__cpack_system_name ${CMAKE_SYSTEM_NAME})
|
||||||
IF(${__cpack_system_name} MATCHES Windows)
|
if(${__cpack_system_name} MATCHES Windows)
|
||||||
IF(CMAKE_CL_64)
|
if(CMAKE_CL_64)
|
||||||
SET(__cpack_system_name win64)
|
set(__cpack_system_name win64)
|
||||||
ELSE(CMAKE_CL_64)
|
else(CMAKE_CL_64)
|
||||||
SET(__cpack_system_name win32)
|
set(__cpack_system_name win32)
|
||||||
ENDIF(CMAKE_CL_64)
|
endif(CMAKE_CL_64)
|
||||||
ENDIF(${__cpack_system_name} MATCHES Windows)
|
endif(${__cpack_system_name} MATCHES Windows)
|
||||||
cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}")
|
cpack_set_if_not_set(CPACK_SYSTEM_NAME "${__cpack_system_name}")
|
||||||
|
|
||||||
# Root dir: default value should be the string literal "$PROGRAMFILES"
|
# Root dir: default value should be the string literal "$PROGRAMFILES"
|
||||||
|
@ -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}")
|
cpack_set_if_not_set(CPACK_TOPLEVEL_TAG "${CPACK_SYSTEM_NAME}")
|
||||||
# if the user has set CPACK_NSIS_DISPLAY_NAME remember it
|
# if the user has set CPACK_NSIS_DISPLAY_NAME remember it
|
||||||
if(DEFINED CPACK_NSIS_DISPLAY_NAME)
|
if(DEFINED CPACK_NSIS_DISPLAY_NAME)
|
||||||
SET(CPACK_NSIS_DISPLAY_NAME_SET TRUE)
|
set(CPACK_NSIS_DISPLAY_NAME_SET TRUE)
|
||||||
endif()
|
endif()
|
||||||
# if the user has set CPACK_NSIS_DISPLAY
|
# if the user has set CPACK_NSIS_DISPLAY
|
||||||
# explicitly, then use that as the default
|
# 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_ICON_CODE "")
|
||||||
cpack_set_if_not_set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
|
cpack_set_if_not_set(CPACK_NSIS_INSTALLER_MUI_ICON_CODE "")
|
||||||
|
|
||||||
IF(DEFINED CPACK_COMPONENTS_ALL)
|
if(DEFINED CPACK_COMPONENTS_ALL)
|
||||||
IF(CPACK_MONOLITHIC_INSTALL)
|
if(CPACK_MONOLITHIC_INSTALL)
|
||||||
MESSAGE("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.")
|
message("CPack warning: both CPACK_COMPONENTS_ALL and CPACK_MONOLITHIC_INSTALL have been set.\nDefaulting to a monolithic installation.")
|
||||||
SET(CPACK_COMPONENTS_ALL)
|
set(CPACK_COMPONENTS_ALL)
|
||||||
ELSE(CPACK_MONOLITHIC_INSTALL)
|
else(CPACK_MONOLITHIC_INSTALL)
|
||||||
# The user has provided the set of components to be installed as
|
# The user has provided the set of components to be installed as
|
||||||
# part of a component-based installation; trust her.
|
# part of a component-based installation; trust her.
|
||||||
SET(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE)
|
set(CPACK_COMPONENTS_ALL_SET_BY_USER TRUE)
|
||||||
ENDIF(CPACK_MONOLITHIC_INSTALL)
|
endif(CPACK_MONOLITHIC_INSTALL)
|
||||||
ELSE(DEFINED CPACK_COMPONENTS_ALL)
|
else(DEFINED CPACK_COMPONENTS_ALL)
|
||||||
# If the user has not specifically requested a monolithic installer
|
# If the user has not specifically requested a monolithic installer
|
||||||
# but has specified components in various "install" commands, tell
|
# but has specified components in various "install" commands, tell
|
||||||
# CPack about those components.
|
# CPack about those components.
|
||||||
IF(NOT CPACK_MONOLITHIC_INSTALL)
|
if(NOT CPACK_MONOLITHIC_INSTALL)
|
||||||
GET_CMAKE_PROPERTY(CPACK_COMPONENTS_ALL COMPONENTS)
|
get_cmake_property(CPACK_COMPONENTS_ALL COMPONENTS)
|
||||||
LIST(LENGTH CPACK_COMPONENTS_ALL CPACK_COMPONENTS_LEN)
|
list(LENGTH CPACK_COMPONENTS_ALL CPACK_COMPONENTS_LEN)
|
||||||
IF(CPACK_COMPONENTS_LEN EQUAL 1)
|
if(CPACK_COMPONENTS_LEN EQUAL 1)
|
||||||
# Only one component: this is not a component-based installation
|
# Only one component: this is not a component-based installation
|
||||||
# (at least, it isn't a component-based installation, but may
|
# (at least, it isn't a component-based installation, but may
|
||||||
# become one later if the user uses the cpack_add_* commands).
|
# become one later if the user uses the cpack_add_* commands).
|
||||||
SET(CPACK_COMPONENTS_ALL)
|
set(CPACK_COMPONENTS_ALL)
|
||||||
ENDIF(CPACK_COMPONENTS_LEN EQUAL 1)
|
endif(CPACK_COMPONENTS_LEN EQUAL 1)
|
||||||
SET(CPACK_COMPONENTS_LEN)
|
set(CPACK_COMPONENTS_LEN)
|
||||||
ENDIF(NOT CPACK_MONOLITHIC_INSTALL)
|
endif(NOT CPACK_MONOLITHIC_INSTALL)
|
||||||
ENDIF(DEFINED CPACK_COMPONENTS_ALL)
|
endif(DEFINED CPACK_COMPONENTS_ALL)
|
||||||
|
|
||||||
# CMake always generates a component named "Unspecified", which is
|
# CMake always generates a component named "Unspecified", which is
|
||||||
# used to install everything that doesn't have an explicitly-provided
|
# 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_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}-Source")
|
||||||
cpack_set_if_not_set(CPACK_SOURCE_IGNORE_FILES
|
cpack_set_if_not_set(CPACK_SOURCE_IGNORE_FILES
|
||||||
"/CVS/;/\\\\\\\\.svn/;/\\\\\\\\.bzr/;/\\\\\\\\.hg/;/\\\\\\\\.git/;\\\\\\\\.swp$;\\\\\\\\.#;/#")
|
"/CVS/;/\\\\\\\\.svn/;/\\\\\\\\.bzr/;/\\\\\\\\.hg/;/\\\\\\\\.git/;\\\\\\\\.swp$;\\\\\\\\.#;/#")
|
||||||
SET(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_SOURCE_INSTALL_CMAKE_PROJECTS}")
|
set(CPACK_INSTALL_CMAKE_PROJECTS "${CPACK_SOURCE_INSTALL_CMAKE_PROJECTS}")
|
||||||
SET(CPACK_INSTALLED_DIRECTORIES "${CPACK_SOURCE_INSTALLED_DIRECTORIES}")
|
set(CPACK_INSTALLED_DIRECTORIES "${CPACK_SOURCE_INSTALLED_DIRECTORIES}")
|
||||||
SET(CPACK_GENERATOR "${CPACK_SOURCE_GENERATOR}")
|
set(CPACK_GENERATOR "${CPACK_SOURCE_GENERATOR}")
|
||||||
SET(CPACK_TOPLEVEL_TAG "${CPACK_SOURCE_TOPLEVEL_TAG}")
|
set(CPACK_TOPLEVEL_TAG "${CPACK_SOURCE_TOPLEVEL_TAG}")
|
||||||
SET(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
|
set(CPACK_PACKAGE_FILE_NAME "${CPACK_SOURCE_PACKAGE_FILE_NAME}")
|
||||||
SET(CPACK_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}")
|
set(CPACK_IGNORE_FILES "${CPACK_SOURCE_IGNORE_FILES}")
|
||||||
SET(CPACK_STRIP_FILES "${CPACK_SOURCE_STRIP_FILES}")
|
set(CPACK_STRIP_FILES "${CPACK_SOURCE_STRIP_FILES}")
|
||||||
|
|
||||||
cpack_encode_variables()
|
cpack_encode_variables()
|
||||||
configure_file("${cpack_source_input_file}"
|
configure_file("${cpack_source_input_file}"
|
||||||
|
|
|
@ -275,84 +275,84 @@
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
# Define var in order to avoid multiple inclusion
|
# Define var in order to avoid multiple inclusion
|
||||||
IF(NOT CPackComponent_CMake_INCLUDED)
|
if(NOT CPackComponent_CMake_INCLUDED)
|
||||||
SET(CPackComponent_CMake_INCLUDED 1)
|
set(CPackComponent_CMake_INCLUDED 1)
|
||||||
|
|
||||||
# Argument-parsing macro from http://www.cmake.org/Wiki/CMakeMacroParseArguments
|
# Argument-parsing macro from http://www.cmake.org/Wiki/CMakeMacroParseArguments
|
||||||
MACRO(cpack_parse_arguments prefix arg_names option_names)
|
macro(cpack_parse_arguments prefix arg_names option_names)
|
||||||
SET(${prefix}_DEFAULT_ARGS)
|
set(${prefix}_DEFAULT_ARGS)
|
||||||
FOREACH(arg_name ${arg_names})
|
foreach(arg_name ${arg_names})
|
||||||
SET(${prefix}_${arg_name})
|
set(${prefix}_${arg_name})
|
||||||
ENDFOREACH(arg_name)
|
endforeach(arg_name)
|
||||||
FOREACH(option ${option_names})
|
foreach(option ${option_names})
|
||||||
SET(${prefix}_${option} FALSE)
|
set(${prefix}_${option} FALSE)
|
||||||
ENDFOREACH(option)
|
endforeach(option)
|
||||||
|
|
||||||
SET(current_arg_name DEFAULT_ARGS)
|
set(current_arg_name DEFAULT_ARGS)
|
||||||
SET(current_arg_list)
|
set(current_arg_list)
|
||||||
FOREACH(arg ${ARGN})
|
foreach(arg ${ARGN})
|
||||||
SET(larg_names ${arg_names})
|
set(larg_names ${arg_names})
|
||||||
LIST(FIND larg_names "${arg}" is_arg_name)
|
list(FIND larg_names "${arg}" is_arg_name)
|
||||||
IF (is_arg_name GREATER -1)
|
if (is_arg_name GREATER -1)
|
||||||
SET(${prefix}_${current_arg_name} ${current_arg_list})
|
set(${prefix}_${current_arg_name} ${current_arg_list})
|
||||||
SET(current_arg_name ${arg})
|
set(current_arg_name ${arg})
|
||||||
SET(current_arg_list)
|
set(current_arg_list)
|
||||||
ELSE (is_arg_name GREATER -1)
|
else (is_arg_name GREATER -1)
|
||||||
SET(loption_names ${option_names})
|
set(loption_names ${option_names})
|
||||||
LIST(FIND loption_names "${arg}" is_option)
|
list(FIND loption_names "${arg}" is_option)
|
||||||
IF (is_option GREATER -1)
|
if (is_option GREATER -1)
|
||||||
SET(${prefix}_${arg} TRUE)
|
set(${prefix}_${arg} TRUE)
|
||||||
ELSE (is_option GREATER -1)
|
else (is_option GREATER -1)
|
||||||
SET(current_arg_list ${current_arg_list} ${arg})
|
set(current_arg_list ${current_arg_list} ${arg})
|
||||||
ENDIF (is_option GREATER -1)
|
endif (is_option GREATER -1)
|
||||||
ENDIF (is_arg_name GREATER -1)
|
endif (is_arg_name GREATER -1)
|
||||||
ENDFOREACH(arg)
|
endforeach(arg)
|
||||||
SET(${prefix}_${current_arg_name} ${current_arg_list})
|
set(${prefix}_${current_arg_name} ${current_arg_list})
|
||||||
ENDMACRO(cpack_parse_arguments)
|
endmacro(cpack_parse_arguments)
|
||||||
|
|
||||||
# Macro that appends a SET command for the given variable name (var)
|
# Macro that appends a SET command for the given variable name (var)
|
||||||
# to the macro named strvar, but only if the variable named "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
|
# has been defined. The string will eventually be appended to a CPack
|
||||||
# configuration file.
|
# configuration file.
|
||||||
MACRO(cpack_append_variable_set_command var strvar)
|
macro(cpack_append_variable_set_command var strvar)
|
||||||
IF (DEFINED ${var})
|
if (DEFINED ${var})
|
||||||
SET(${strvar} "${${strvar}}SET(${var}")
|
set(${strvar} "${${strvar}}set(${var}")
|
||||||
FOREACH(APPENDVAL ${${var}})
|
foreach(APPENDVAL ${${var}})
|
||||||
SET(${strvar} "${${strvar}} ${APPENDVAL}")
|
set(${strvar} "${${strvar}} ${APPENDVAL}")
|
||||||
ENDFOREACH(APPENDVAL)
|
endforeach(APPENDVAL)
|
||||||
SET(${strvar} "${${strvar}})\n")
|
set(${strvar} "${${strvar}})\n")
|
||||||
ENDIF (DEFINED ${var})
|
endif (DEFINED ${var})
|
||||||
ENDMACRO(cpack_append_variable_set_command)
|
endmacro(cpack_append_variable_set_command)
|
||||||
|
|
||||||
# Macro that appends a SET command for the given variable name (var)
|
# Macro that appends a SET command for the given variable name (var)
|
||||||
# to the macro named strvar, but only if the variable named "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
|
# has been defined and is a string. The string will eventually be
|
||||||
# appended to a CPack configuration file.
|
# appended to a CPack configuration file.
|
||||||
MACRO(cpack_append_string_variable_set_command var strvar)
|
macro(cpack_append_string_variable_set_command var strvar)
|
||||||
IF (DEFINED ${var})
|
if (DEFINED ${var})
|
||||||
LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
|
list(LENGTH ${var} CPACK_APP_VALUE_LEN)
|
||||||
IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
if(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
||||||
SET(${strvar} "${${strvar}}SET(${var} \"${${var}}\")\n")
|
set(${strvar} "${${strvar}}set(${var} \"${${var}}\")\n")
|
||||||
ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
endif(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
||||||
ENDIF (DEFINED ${var})
|
endif (DEFINED ${var})
|
||||||
ENDMACRO(cpack_append_string_variable_set_command)
|
endmacro(cpack_append_string_variable_set_command)
|
||||||
|
|
||||||
# Macro that appends a SET command for the given variable name (var)
|
# Macro that appends a SET command for the given variable name (var)
|
||||||
# to the macro named strvar, but only if the variable named "var"
|
# to the macro named strvar, but only if the variable named "var"
|
||||||
# has been set to true. The string will eventually be
|
# has been set to true. The string will eventually be
|
||||||
# appended to a CPack configuration file.
|
# appended to a CPack configuration file.
|
||||||
MACRO(cpack_append_option_set_command var strvar)
|
macro(cpack_append_option_set_command var strvar)
|
||||||
IF (${var})
|
if (${var})
|
||||||
LIST(LENGTH ${var} CPACK_APP_VALUE_LEN)
|
list(LENGTH ${var} CPACK_APP_VALUE_LEN)
|
||||||
IF(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
if(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
||||||
SET(${strvar} "${${strvar}}SET(${var} TRUE)\n")
|
set(${strvar} "${${strvar}}set(${var} TRUE)\n")
|
||||||
ENDIF(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
endif(${CPACK_APP_VALUE_LEN} EQUAL 1)
|
||||||
ENDIF (${var})
|
endif (${var})
|
||||||
ENDMACRO(cpack_append_option_set_command)
|
endmacro(cpack_append_option_set_command)
|
||||||
|
|
||||||
# Macro that adds a component to the CPack installer
|
# Macro that adds a component to the CPack installer
|
||||||
MACRO(cpack_add_component compname)
|
macro(cpack_add_component compname)
|
||||||
STRING(TOUPPER ${compname} CPACK_ADDCOMP_UNAME)
|
string(TOUPPER ${compname} CPACK_ADDCOMP_UNAME)
|
||||||
cpack_parse_arguments(CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}
|
cpack_parse_arguments(CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}
|
||||||
"DISPLAY_NAME;DESCRIPTION;GROUP;DEPENDS;INSTALL_TYPES;ARCHIVE_FILE"
|
"DISPLAY_NAME;DESCRIPTION;GROUP;DEPENDS;INSTALL_TYPES;ARCHIVE_FILE"
|
||||||
"HIDDEN;REQUIRED;DISABLED;DOWNLOADED"
|
"HIDDEN;REQUIRED;DISABLED;DOWNLOADED"
|
||||||
|
@ -360,25 +360,25 @@ MACRO(cpack_add_component compname)
|
||||||
)
|
)
|
||||||
|
|
||||||
if (CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DOWNLOADED)
|
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 ()
|
else ()
|
||||||
SET(CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n")
|
set(CPACK_ADDCOMP_STR "\n# Configuration for component \"${compname}\"\n")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
IF(NOT CPACK_MONOLITHIC_INSTALL)
|
if(NOT CPACK_MONOLITHIC_INSTALL)
|
||||||
# If the user didn't set CPACK_COMPONENTS_ALL explicitly, update the
|
# If the user didn't set CPACK_COMPONENTS_ALL explicitly, update the
|
||||||
# value of CPACK_COMPONENTS_ALL in the configuration file. This will
|
# value of CPACK_COMPONENTS_ALL in the configuration file. This will
|
||||||
# take care of any components that have been added after the CPack
|
# take care of any components that have been added after the CPack
|
||||||
# moduled was included.
|
# moduled was included.
|
||||||
IF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
|
if(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
|
||||||
GET_CMAKE_PROPERTY(CPACK_ADDCOMP_COMPONENTS COMPONENTS)
|
get_cmake_property(CPACK_ADDCOMP_COMPONENTS COMPONENTS)
|
||||||
SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
|
set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR}\nSET(CPACK_COMPONENTS_ALL")
|
||||||
FOREACH(COMP ${CPACK_ADDCOMP_COMPONENTS})
|
foreach(COMP ${CPACK_ADDCOMP_COMPONENTS})
|
||||||
SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}")
|
set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR} ${COMP}")
|
||||||
ENDFOREACH(COMP)
|
endforeach(COMP)
|
||||||
SET(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n")
|
set(CPACK_ADDCOMP_STR "${CPACK_ADDCOMP_STR})\n")
|
||||||
ENDIF(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
|
endif(NOT CPACK_COMPONENTS_ALL_SET_BY_USER)
|
||||||
ENDIF(NOT CPACK_MONOLITHIC_INSTALL)
|
endif(NOT CPACK_MONOLITHIC_INSTALL)
|
||||||
|
|
||||||
cpack_append_string_variable_set_command(
|
cpack_append_string_variable_set_command(
|
||||||
CPACK_COMPONENT_${CPACK_ADDCOMP_UNAME}_DISPLAY_NAME
|
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
|
# Write to config iff the macros is used after CPack.cmake has been
|
||||||
# included, other it's not necessary because the variables
|
# included, other it's not necessary because the variables
|
||||||
# will be encoded by cpack_encode_variables.
|
# will be encoded by cpack_encode_variables.
|
||||||
IF(CPack_CMake_INCLUDED)
|
if(CPack_CMake_INCLUDED)
|
||||||
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}")
|
file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDCOMP_STR}")
|
||||||
ENDIF(CPack_CMake_INCLUDED)
|
endif(CPack_CMake_INCLUDED)
|
||||||
ENDMACRO(cpack_add_component)
|
endmacro(cpack_add_component)
|
||||||
|
|
||||||
# Macro that adds a component group to the CPack installer
|
# Macro that adds a component group to the CPack installer
|
||||||
MACRO(cpack_add_component_group grpname)
|
macro(cpack_add_component_group grpname)
|
||||||
STRING(TOUPPER ${grpname} CPACK_ADDGRP_UNAME)
|
string(TOUPPER ${grpname} CPACK_ADDGRP_UNAME)
|
||||||
cpack_parse_arguments(CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}
|
cpack_parse_arguments(CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}
|
||||||
"DISPLAY_NAME;DESCRIPTION"
|
"DISPLAY_NAME;DESCRIPTION"
|
||||||
"EXPANDED;BOLD_TITLE"
|
"EXPANDED;BOLD_TITLE"
|
||||||
${ARGN}
|
${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_append_string_variable_set_command(
|
||||||
CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_DISPLAY_NAME
|
CPACK_COMPONENT_GROUP_${CPACK_ADDGRP_UNAME}_DISPLAY_NAME
|
||||||
CPACK_ADDGRP_STR)
|
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
|
# Write to config iff the macros is used after CPack.cmake has been
|
||||||
# included, other it's not necessary because the variables
|
# included, other it's not necessary because the variables
|
||||||
# will be encoded by cpack_encode_variables.
|
# will be encoded by cpack_encode_variables.
|
||||||
IF(CPack_CMake_INCLUDED)
|
if(CPack_CMake_INCLUDED)
|
||||||
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}")
|
file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_ADDGRP_STR}")
|
||||||
ENDIF(CPack_CMake_INCLUDED)
|
endif(CPack_CMake_INCLUDED)
|
||||||
ENDMACRO(cpack_add_component_group)
|
endmacro(cpack_add_component_group)
|
||||||
|
|
||||||
# Macro that adds an installation type to the CPack installer
|
# Macro that adds an installation type to the CPack installer
|
||||||
MACRO(cpack_add_install_type insttype)
|
macro(cpack_add_install_type insttype)
|
||||||
STRING(TOUPPER ${insttype} CPACK_INSTTYPE_UNAME)
|
string(TOUPPER ${insttype} CPACK_INSTTYPE_UNAME)
|
||||||
cpack_parse_arguments(CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}
|
cpack_parse_arguments(CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}
|
||||||
"DISPLAY_NAME"
|
"DISPLAY_NAME"
|
||||||
""
|
""
|
||||||
${ARGN}
|
${ARGN}
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(CPACK_INSTTYPE_STR
|
set(CPACK_INSTTYPE_STR
|
||||||
"\n# Configuration for installation type \"${insttype}\"\n")
|
"\n# Configuration for installation type \"${insttype}\"\n")
|
||||||
SET(CPACK_INSTTYPE_STR
|
set(CPACK_INSTTYPE_STR
|
||||||
"${CPACK_INSTTYPE_STR}LIST(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
|
"${CPACK_INSTTYPE_STR}list(APPEND CPACK_ALL_INSTALL_TYPES ${insttype})\n")
|
||||||
cpack_append_string_variable_set_command(
|
cpack_append_string_variable_set_command(
|
||||||
CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}_DISPLAY_NAME
|
CPACK_INSTALL_TYPE_${CPACK_INSTTYPE_UNAME}_DISPLAY_NAME
|
||||||
CPACK_INSTTYPE_STR)
|
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
|
# Write to config iff the macros is used after CPack.cmake has been
|
||||||
# included, other it's not necessary because the variables
|
# included, other it's not necessary because the variables
|
||||||
# will be encoded by cpack_encode_variables.
|
# will be encoded by cpack_encode_variables.
|
||||||
IF(CPack_CMake_INCLUDED)
|
if(CPack_CMake_INCLUDED)
|
||||||
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}")
|
file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_INSTTYPE_STR}")
|
||||||
ENDIF(CPack_CMake_INCLUDED)
|
endif(CPack_CMake_INCLUDED)
|
||||||
ENDMACRO(cpack_add_install_type)
|
endmacro(cpack_add_install_type)
|
||||||
|
|
||||||
MACRO(cpack_configure_downloads site)
|
macro(cpack_configure_downloads site)
|
||||||
cpack_parse_arguments(CPACK_DOWNLOAD
|
cpack_parse_arguments(CPACK_DOWNLOAD
|
||||||
"UPLOAD_DIRECTORY"
|
"UPLOAD_DIRECTORY"
|
||||||
"ALL;ADD_REMOVE;NO_ADD_REMOVE"
|
"ALL;ADD_REMOVE;NO_ADD_REMOVE"
|
||||||
${ARGN}
|
${ARGN}
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(CPACK_CONFIG_DL_STR
|
set(CPACK_CONFIG_DL_STR
|
||||||
"\n# Downloaded components configuration\n")
|
"\n# Downloaded components configuration\n")
|
||||||
SET(CPACK_UPLOAD_DIRECTORY ${CPACK_DOWNLOAD_UPLOAD_DIRECTORY})
|
set(CPACK_UPLOAD_DIRECTORY ${CPACK_DOWNLOAD_UPLOAD_DIRECTORY})
|
||||||
SET(CPACK_DOWNLOAD_SITE ${site})
|
set(CPACK_DOWNLOAD_SITE ${site})
|
||||||
cpack_append_string_variable_set_command(
|
cpack_append_string_variable_set_command(
|
||||||
CPACK_DOWNLOAD_SITE
|
CPACK_DOWNLOAD_SITE
|
||||||
CPACK_CONFIG_DL_STR)
|
CPACK_CONFIG_DL_STR)
|
||||||
|
@ -495,10 +495,10 @@ MACRO(cpack_configure_downloads site)
|
||||||
cpack_append_option_set_command(
|
cpack_append_option_set_command(
|
||||||
CPACK_DOWNLOAD_ALL
|
CPACK_DOWNLOAD_ALL
|
||||||
CPACK_CONFIG_DL_STR)
|
CPACK_CONFIG_DL_STR)
|
||||||
IF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
|
if (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
|
||||||
SET(CPACK_DOWNLOAD_ADD_REMOVE ON)
|
set(CPACK_DOWNLOAD_ADD_REMOVE ON)
|
||||||
ENDIF (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
|
endif (${CPACK_DOWNLOAD_ALL} AND NOT ${CPACK_DOWNLOAD_NO_ADD_REMOVE})
|
||||||
SET(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
|
set(CPACK_ADD_REMOVE ${CPACK_DOWNLOAD_ADD_REMOVE})
|
||||||
cpack_append_option_set_command(
|
cpack_append_option_set_command(
|
||||||
CPACK_ADD_REMOVE
|
CPACK_ADD_REMOVE
|
||||||
CPACK_CONFIG_DL_STR)
|
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
|
# Write to config iff the macros is used after CPack.cmake has been
|
||||||
# included, other it's not necessary because the variables
|
# included, other it's not necessary because the variables
|
||||||
# will be encoded by cpack_encode_variables.
|
# will be encoded by cpack_encode_variables.
|
||||||
IF(CPack_CMake_INCLUDED)
|
if(CPack_CMake_INCLUDED)
|
||||||
FILE(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
|
file(APPEND "${CPACK_OUTPUT_CONFIG_FILE}" "${CPACK_CONFIG_DL_STR}")
|
||||||
ENDIF(CPack_CMake_INCLUDED)
|
endif(CPack_CMake_INCLUDED)
|
||||||
ENDMACRO(cpack_configure_downloads)
|
endmacro(cpack_configure_downloads)
|
||||||
ENDIF(NOT CPackComponent_CMake_INCLUDED)
|
endif(NOT CPackComponent_CMake_INCLUDED)
|
||||||
|
|
|
@ -161,7 +161,7 @@
|
||||||
# Default : -
|
# Default : -
|
||||||
# This variable allow advanced user to add custom script to the control.tar.gz
|
# This variable allow advanced user to add custom script to the control.tar.gz
|
||||||
# Typical usage is for conffiles, postinst, postrm, prerm.
|
# 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")
|
# "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
|
||||||
##end
|
##end
|
||||||
|
|
||||||
|
@ -185,115 +185,115 @@
|
||||||
#
|
#
|
||||||
# http://wiki.debian.org/HowToPackageForDebian
|
# http://wiki.debian.org/HowToPackageForDebian
|
||||||
|
|
||||||
IF(CMAKE_BINARY_DIR)
|
if(CMAKE_BINARY_DIR)
|
||||||
MESSAGE(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.")
|
message(FATAL_ERROR "CPackDeb.cmake may only be used by CPack internally.")
|
||||||
ENDIF(CMAKE_BINARY_DIR)
|
endif(CMAKE_BINARY_DIR)
|
||||||
|
|
||||||
IF(NOT UNIX)
|
if(NOT UNIX)
|
||||||
MESSAGE(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.")
|
message(FATAL_ERROR "CPackDeb.cmake may only be used under UNIX.")
|
||||||
ENDIF(NOT UNIX)
|
endif(NOT UNIX)
|
||||||
|
|
||||||
# CPACK_DEBIAN_PACKAGE_SHLIBDEPS
|
# CPACK_DEBIAN_PACKAGE_SHLIBDEPS
|
||||||
# If specify OFF, only user depends are used
|
# If specify OFF, only user depends are used
|
||||||
IF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
|
if(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
|
||||||
SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
|
set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS OFF)
|
||||||
ENDIF(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
|
endif(NOT DEFINED CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
|
||||||
|
|
||||||
FIND_PROGRAM(FAKEROOT_EXECUTABLE fakeroot)
|
find_program(FAKEROOT_EXECUTABLE fakeroot)
|
||||||
IF(FAKEROOT_EXECUTABLE)
|
if(FAKEROOT_EXECUTABLE)
|
||||||
SET(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE})
|
set(CPACK_DEBIAN_FAKEROOT_EXECUTABLE ${FAKEROOT_EXECUTABLE})
|
||||||
ENDIF(FAKEROOT_EXECUTABLE)
|
endif(FAKEROOT_EXECUTABLE)
|
||||||
|
|
||||||
IF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
|
if(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
|
||||||
# dpkg-shlibdeps is a Debian utility for generating dependency list
|
# 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
|
# Check version of the dpkg-shlibdeps tool using CPackRPM method
|
||||||
IF(SHLIBDEPS_EXECUTABLE)
|
if(SHLIBDEPS_EXECUTABLE)
|
||||||
EXECUTE_PROCESS(COMMAND ${SHLIBDEPS_EXECUTABLE} --version
|
execute_process(COMMAND ${SHLIBDEPS_EXECUTABLE} --version
|
||||||
OUTPUT_VARIABLE _TMP_VERSION
|
OUTPUT_VARIABLE _TMP_VERSION
|
||||||
ERROR_QUIET
|
ERROR_QUIET
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
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
|
SHLIBDEPS_EXECUTABLE_VERSION
|
||||||
${_TMP_VERSION})
|
${_TMP_VERSION})
|
||||||
SET(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
|
set(SHLIBDEPS_EXECUTABLE_VERSION "${CMAKE_MATCH_1}")
|
||||||
IF(CPACK_DEBIAN_PACKAGE_DEBUG)
|
if(CPACK_DEBIAN_PACKAGE_DEBUG)
|
||||||
MESSAGE( "CPackDeb Debug: dpkg-shlibdeps version is <${SHLIBDEPS_EXECUTABLE_VERSION}>")
|
message( "CPackDeb Debug: dpkg-shlibdeps version is <${SHLIBDEPS_EXECUTABLE_VERSION}>")
|
||||||
ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
|
endif(CPACK_DEBIAN_PACKAGE_DEBUG)
|
||||||
|
|
||||||
# Generating binary list - Get type of all install files
|
# Generating binary list - Get type of all install files
|
||||||
EXECUTE_PROCESS(COMMAND find -type f
|
execute_process(COMMAND find -type f
|
||||||
COMMAND xargs file
|
COMMAND xargs file
|
||||||
WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
|
WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
|
||||||
OUTPUT_VARIABLE CPACK_DEB_INSTALL_FILES)
|
OUTPUT_VARIABLE CPACK_DEB_INSTALL_FILES)
|
||||||
|
|
||||||
# Convert to CMake list
|
# 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
|
# Only dynamically linked ELF files are included
|
||||||
# Extract only file name infront of ":"
|
# Extract only file name infront of ":"
|
||||||
FOREACH ( _FILE ${CPACK_DEB_INSTALL_FILES})
|
foreach ( _FILE ${CPACK_DEB_INSTALL_FILES})
|
||||||
IF ( ${_FILE} MATCHES "ELF.*dynamically linked")
|
if ( ${_FILE} MATCHES "ELF.*dynamically linked")
|
||||||
STRING(REGEX MATCH "(^.*):" _FILE_NAME ${_FILE})
|
string(REGEX MATCH "(^.*):" _FILE_NAME ${_FILE})
|
||||||
LIST(APPEND CPACK_DEB_BINARY_FILES ${CMAKE_MATCH_1})
|
list(APPEND CPACK_DEB_BINARY_FILES ${CMAKE_MATCH_1})
|
||||||
ENDIF()
|
endif()
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
|
|
||||||
MESSAGE( "CPackDeb: - Generating dependency list")
|
message( "CPackDeb: - Generating dependency list")
|
||||||
|
|
||||||
# Create blank control file for running dpkg-shlibdeps
|
# Create blank control file for running dpkg-shlibdeps
|
||||||
# There might be some other way to invoke dpkg-shlibdeps without creating this file
|
# 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
|
# but standard debian package should not have anything that can collide with this file or directory
|
||||||
FILE(MAKE_DIRECTORY ${CPACK_TEMPORARY_DIRECTORY}/debian)
|
file(MAKE_DIRECTORY ${CPACK_TEMPORARY_DIRECTORY}/debian)
|
||||||
FILE(WRITE ${CPACK_TEMPORARY_DIRECTORY}/debian/control "")
|
file(WRITE ${CPACK_TEMPORARY_DIRECTORY}/debian/control "")
|
||||||
|
|
||||||
# Execute dpkg-shlibdeps
|
# Execute dpkg-shlibdeps
|
||||||
# --ignore-missing-info : allow dpkg-shlibdeps to run even if some libs do not belong to a package
|
# --ignore-missing-info : allow dpkg-shlibdeps to run even if some libs do not belong to a package
|
||||||
# -O : print to STDOUT
|
# -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}"
|
WORKING_DIRECTORY "${CPACK_TEMPORARY_DIRECTORY}"
|
||||||
OUTPUT_VARIABLE SHLIBDEPS_OUTPUT
|
OUTPUT_VARIABLE SHLIBDEPS_OUTPUT
|
||||||
RESULT_VARIABLE SHLIBDEPS_RESULT
|
RESULT_VARIABLE SHLIBDEPS_RESULT
|
||||||
ERROR_VARIABLE SHLIBDEPS_ERROR
|
ERROR_VARIABLE SHLIBDEPS_ERROR
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE )
|
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
|
# dpkg-shlibdeps will throw some warnings if some input files are not binary
|
||||||
MESSAGE( "CPackDeb Debug: dpkg-shlibdeps warnings \n${SHLIBDEPS_ERROR}")
|
message( "CPackDeb Debug: dpkg-shlibdeps warnings \n${SHLIBDEPS_ERROR}")
|
||||||
ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
|
endif(CPACK_DEBIAN_PACKAGE_DEBUG)
|
||||||
IF (NOT SHLIBDEPS_RESULT EQUAL 0)
|
if (NOT SHLIBDEPS_RESULT EQUAL 0)
|
||||||
MESSAGE (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}")
|
message (FATAL_ERROR "CPackDeb: dpkg-shlibdeps: ${SHLIBDEPS_ERROR}")
|
||||||
ENDIF (NOT SHLIBDEPS_RESULT EQUAL 0)
|
endif (NOT SHLIBDEPS_RESULT EQUAL 0)
|
||||||
|
|
||||||
#Get rid of prefix generated by dpkg-shlibdeps
|
#Get rid of prefix generated by dpkg-shlibdeps
|
||||||
string (REGEX REPLACE "^.*Depends=" "" CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS ${SHLIBDEPS_OUTPUT})
|
string (REGEX REPLACE "^.*Depends=" "" CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS ${SHLIBDEPS_OUTPUT})
|
||||||
|
|
||||||
IF(CPACK_DEBIAN_PACKAGE_DEBUG)
|
if(CPACK_DEBIAN_PACKAGE_DEBUG)
|
||||||
MESSAGE( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
|
message( "CPackDeb Debug: Found dependency: ${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
|
||||||
ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
|
endif(CPACK_DEBIAN_PACKAGE_DEBUG)
|
||||||
|
|
||||||
# Remove blank control file
|
# Remove blank control file
|
||||||
# Might not be safe if package actual contain file or directory named debian
|
# 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
|
# Append user depend if set
|
||||||
IF (CPACK_DEBIAN_PACKAGE_DEPENDS)
|
if (CPACK_DEBIAN_PACKAGE_DEPENDS)
|
||||||
SET (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
|
set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}, ${CPACK_DEBIAN_PACKAGE_DEPENDS}")
|
||||||
ELSE (CPACK_DEBIAN_PACKAGE_DEPENDS)
|
else (CPACK_DEBIAN_PACKAGE_DEPENDS)
|
||||||
SET (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
|
set (CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_AUTO_DEPENDS}")
|
||||||
ENDIF (CPACK_DEBIAN_PACKAGE_DEPENDS)
|
endif (CPACK_DEBIAN_PACKAGE_DEPENDS)
|
||||||
|
|
||||||
ELSE (SHLIBDEPS_EXECUTABLE)
|
else (SHLIBDEPS_EXECUTABLE)
|
||||||
IF(CPACK_DEBIAN_PACKAGE_DEBUG)
|
if(CPACK_DEBIAN_PACKAGE_DEBUG)
|
||||||
MESSAGE( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.")
|
message( "CPackDeb Debug: Using only user-provided depends because dpkg-shlibdeps is not found.")
|
||||||
ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
|
endif(CPACK_DEBIAN_PACKAGE_DEBUG)
|
||||||
ENDIF(SHLIBDEPS_EXECUTABLE)
|
endif(SHLIBDEPS_EXECUTABLE)
|
||||||
|
|
||||||
ELSE (CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
|
else (CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
|
||||||
IF(CPACK_DEBIAN_PACKAGE_DEBUG)
|
if(CPACK_DEBIAN_PACKAGE_DEBUG)
|
||||||
MESSAGE( "CPackDeb Debug: Using only user-provided depends")
|
message( "CPackDeb Debug: Using only user-provided depends")
|
||||||
ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
|
endif(CPACK_DEBIAN_PACKAGE_DEBUG)
|
||||||
ENDIF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
|
endif(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
|
||||||
|
|
||||||
# Let's define the control file found in debian package:
|
# Let's define the control file found in debian package:
|
||||||
|
|
||||||
|
@ -303,67 +303,67 @@ ENDIF(CPACK_DEBIAN_PACKAGE_SHLIBDEPS)
|
||||||
# DEBIAN/control
|
# DEBIAN/control
|
||||||
# debian policy enforce lower case for package name
|
# debian policy enforce lower case for package name
|
||||||
# Package: (mandatory)
|
# Package: (mandatory)
|
||||||
IF(NOT CPACK_DEBIAN_PACKAGE_NAME)
|
if(NOT CPACK_DEBIAN_PACKAGE_NAME)
|
||||||
STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
|
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
|
||||||
ENDIF(NOT CPACK_DEBIAN_PACKAGE_NAME)
|
endif(NOT CPACK_DEBIAN_PACKAGE_NAME)
|
||||||
|
|
||||||
# Version: (mandatory)
|
# Version: (mandatory)
|
||||||
IF(NOT CPACK_DEBIAN_PACKAGE_VERSION)
|
if(NOT CPACK_DEBIAN_PACKAGE_VERSION)
|
||||||
IF(NOT CPACK_PACKAGE_VERSION)
|
if(NOT CPACK_PACKAGE_VERSION)
|
||||||
MESSAGE(FATAL_ERROR "CPackDeb: Debian package requires a package version")
|
message(FATAL_ERROR "CPackDeb: Debian package requires a package version")
|
||||||
ENDIF(NOT CPACK_PACKAGE_VERSION)
|
endif(NOT CPACK_PACKAGE_VERSION)
|
||||||
SET(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
|
set(CPACK_DEBIAN_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
|
||||||
ENDIF(NOT CPACK_DEBIAN_PACKAGE_VERSION)
|
endif(NOT CPACK_DEBIAN_PACKAGE_VERSION)
|
||||||
|
|
||||||
# Architecture: (mandatory)
|
# 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
|
# There is no such thing as i686 architecture on debian, you should use i386 instead
|
||||||
# $ dpkg --print-architecture
|
# $ dpkg --print-architecture
|
||||||
FIND_PROGRAM(DPKG_CMD dpkg)
|
find_program(DPKG_CMD dpkg)
|
||||||
IF(NOT DPKG_CMD)
|
if(NOT DPKG_CMD)
|
||||||
MESSAGE(STATUS "CPackDeb: Can not find dpkg in your path, default to i386.")
|
message(STATUS "CPackDeb: Can not find dpkg in your path, default to i386.")
|
||||||
SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
|
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
|
||||||
ENDIF(NOT DPKG_CMD)
|
endif(NOT DPKG_CMD)
|
||||||
EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture
|
execute_process(COMMAND "${DPKG_CMD}" --print-architecture
|
||||||
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
|
OUTPUT_VARIABLE CPACK_DEBIAN_PACKAGE_ARCHITECTURE
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
)
|
)
|
||||||
ENDIF(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
|
endif(NOT CPACK_DEBIAN_PACKAGE_ARCHITECTURE)
|
||||||
|
|
||||||
# have a look at GET_PROPERTY(result GLOBAL PROPERTY ENABLED_FEATURES),
|
# have a look at get_property(result GLOBAL PROPERTY ENABLED_FEATURES),
|
||||||
# this returns the successful FIND_PACKAGE() calls, maybe this can help
|
# this returns the successful find_package() calls, maybe this can help
|
||||||
# Depends:
|
# Depends:
|
||||||
# You should set: DEBIAN_PACKAGE_DEPENDS
|
# You should set: DEBIAN_PACKAGE_DEPENDS
|
||||||
# TODO: automate 'objdump -p | grep NEEDED'
|
# TODO: automate 'objdump -p | grep NEEDED'
|
||||||
IF(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.")
|
message(STATUS "CPACK_DEBIAN_PACKAGE_DEPENDS not set, the package will have no dependencies.")
|
||||||
ENDIF(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
|
endif(NOT CPACK_DEBIAN_PACKAGE_DEPENDS)
|
||||||
|
|
||||||
# Maintainer: (mandatory)
|
# Maintainer: (mandatory)
|
||||||
IF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
|
if(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
|
||||||
IF(NOT CPACK_PACKAGE_CONTACT)
|
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")
|
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)
|
endif(NOT CPACK_PACKAGE_CONTACT)
|
||||||
SET(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
|
set(CPACK_DEBIAN_PACKAGE_MAINTAINER ${CPACK_PACKAGE_CONTACT})
|
||||||
ENDIF(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
|
endif(NOT CPACK_DEBIAN_PACKAGE_MAINTAINER)
|
||||||
|
|
||||||
# Description: (mandatory)
|
# Description: (mandatory)
|
||||||
IF(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
|
if(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
|
||||||
IF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
|
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")
|
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)
|
endif(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
|
||||||
SET(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
|
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
|
||||||
ENDIF(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
|
endif(NOT CPACK_DEBIAN_PACKAGE_DESCRIPTION)
|
||||||
|
|
||||||
# Section: (recommended)
|
# Section: (recommended)
|
||||||
IF(NOT CPACK_DEBIAN_PACKAGE_SECTION)
|
if(NOT CPACK_DEBIAN_PACKAGE_SECTION)
|
||||||
SET(CPACK_DEBIAN_PACKAGE_SECTION "devel")
|
set(CPACK_DEBIAN_PACKAGE_SECTION "devel")
|
||||||
ENDIF(NOT CPACK_DEBIAN_PACKAGE_SECTION)
|
endif(NOT CPACK_DEBIAN_PACKAGE_SECTION)
|
||||||
|
|
||||||
# Priority: (recommended)
|
# Priority: (recommended)
|
||||||
IF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY)
|
if(NOT CPACK_DEBIAN_PACKAGE_PRIORITY)
|
||||||
SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
set(CPACK_DEBIAN_PACKAGE_PRIORITY "optional")
|
||||||
ENDIF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY )
|
endif(NOT CPACK_DEBIAN_PACKAGE_PRIORITY )
|
||||||
|
|
||||||
# Recommends:
|
# Recommends:
|
||||||
# You should set: CPACK_DEBIAN_PACKAGE_RECOMMENDS
|
# You should set: CPACK_DEBIAN_PACKAGE_RECOMMENDS
|
||||||
|
@ -379,32 +379,32 @@ ENDIF(NOT CPACK_DEBIAN_PACKAGE_PRIORITY )
|
||||||
# - postrm
|
# - postrm
|
||||||
# - prerm"
|
# - prerm"
|
||||||
# Usage:
|
# Usage:
|
||||||
# SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
|
# set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
|
||||||
# "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
|
# "${CMAKE_CURRENT_SOURCE_DIR/prerm;${CMAKE_CURRENT_SOURCE_DIR}/postrm")
|
||||||
|
|
||||||
# Are we packaging components ?
|
# Are we packaging components ?
|
||||||
IF(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_NAME "-${CPACK_DEB_PACKAGE_COMPONENT}")
|
||||||
SET(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "/${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}")
|
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)
|
string(TOLOWER "${CPACK_PACKAGE_NAME}${CPACK_DEB_PACKAGE_COMPONENT_PART_NAME}" CPACK_DEBIAN_PACKAGE_NAME)
|
||||||
ELSE(CPACK_DEB_PACKAGE_COMPONENT)
|
else(CPACK_DEB_PACKAGE_COMPONENT)
|
||||||
SET(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "")
|
set(CPACK_DEB_PACKAGE_COMPONENT_PART_NAME "")
|
||||||
SET(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "")
|
set(CPACK_DEB_PACKAGE_COMPONENT_PART_PATH "")
|
||||||
SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
|
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
|
||||||
ENDIF(CPACK_DEB_PACKAGE_COMPONENT)
|
endif(CPACK_DEB_PACKAGE_COMPONENT)
|
||||||
|
|
||||||
# Print out some debug information if we were asked for that
|
# Print out some debug information if we were asked for that
|
||||||
IF(CPACK_DEBIAN_PACKAGE_DEBUG)
|
if(CPACK_DEBIAN_PACKAGE_DEBUG)
|
||||||
MESSAGE("CPackDeb:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}")
|
message("CPackDeb:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}")
|
||||||
MESSAGE("CPackDeb:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}")
|
message("CPackDeb:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}")
|
||||||
MESSAGE("CPackDeb:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}")
|
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_NAME = ${CPACK_OUTPUT_FILE_NAME}")
|
||||||
MESSAGE("CPackDeb:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}")
|
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_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
|
||||||
MESSAGE("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
|
message("CPackDeb:Debug: CPACK_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
|
||||||
MESSAGE("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
|
message("CPackDeb:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
|
||||||
ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
|
endif(CPACK_DEBIAN_PACKAGE_DEBUG)
|
||||||
|
|
||||||
# For debian source packages:
|
# For debian source packages:
|
||||||
# debian/control
|
# debian/control
|
||||||
|
@ -414,8 +414,8 @@ ENDIF(CPACK_DEBIAN_PACKAGE_DEBUG)
|
||||||
# http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-debiansourcecontrolfiles
|
# http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-debiansourcecontrolfiles
|
||||||
|
|
||||||
# Builds-Depends:
|
# Builds-Depends:
|
||||||
#IF(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS)
|
#if(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS)
|
||||||
# SET(CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS
|
# set(CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS
|
||||||
# "debhelper (>> 5.0.0), libncurses5-dev, tcl8.4"
|
# "debhelper (>> 5.0.0), libncurses5-dev, tcl8.4"
|
||||||
# )
|
# )
|
||||||
#ENDIF(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS)
|
#endif(NOT CPACK_DEBIAN_PACKAGE_BUILDS_DEPENDS)
|
||||||
|
|
|
@ -162,7 +162,7 @@
|
||||||
# Default : -
|
# Default : -
|
||||||
# May be set by the user in order to specify a USER binary spec file
|
# May be set by the user in order to specify a USER binary spec file
|
||||||
# to be used by CPackRPM instead of generating the file.
|
# to be used by CPackRPM instead of generating the file.
|
||||||
# The specified file will be processed by CONFIGURE_FILE( @ONLY).
|
# The specified file will be processed by configure_file( @ONLY).
|
||||||
##end
|
##end
|
||||||
##variable
|
##variable
|
||||||
# CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE - Spec file template.
|
# CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE - Spec file template.
|
||||||
|
@ -239,22 +239,22 @@
|
||||||
|
|
||||||
# Author: Eric Noulard with the help of Alexander Neundorf.
|
# Author: Eric Noulard with the help of Alexander Neundorf.
|
||||||
|
|
||||||
IF(CMAKE_BINARY_DIR)
|
if(CMAKE_BINARY_DIR)
|
||||||
MESSAGE(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.")
|
message(FATAL_ERROR "CPackRPM.cmake may only be used by CPack internally.")
|
||||||
ENDIF(CMAKE_BINARY_DIR)
|
endif(CMAKE_BINARY_DIR)
|
||||||
|
|
||||||
IF(NOT UNIX)
|
if(NOT UNIX)
|
||||||
MESSAGE(FATAL_ERROR "CPackRPM.cmake may only be used under UNIX.")
|
message(FATAL_ERROR "CPackRPM.cmake may only be used under UNIX.")
|
||||||
ENDIF(NOT UNIX)
|
endif(NOT UNIX)
|
||||||
|
|
||||||
# rpmbuild is the basic command for building RPM package
|
# rpmbuild is the basic command for building RPM package
|
||||||
# it may be a simple (symbolic) link to rpm command.
|
# 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
|
# Check version of the rpmbuild tool this would be easier to
|
||||||
# track bugs with users and CPackRPM debug mode.
|
# track bugs with users and CPackRPM debug mode.
|
||||||
# We may use RPM version in order to check for available version dependent features
|
# 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
|
execute_process(COMMAND ${RPMBUILD_EXECUTABLE} --version
|
||||||
OUTPUT_VARIABLE _TMP_VERSION
|
OUTPUT_VARIABLE _TMP_VERSION
|
||||||
ERROR_QUIET
|
ERROR_QUIET
|
||||||
|
@ -262,19 +262,19 @@ IF(RPMBUILD_EXECUTABLE)
|
||||||
string(REGEX REPLACE "^.*\ " ""
|
string(REGEX REPLACE "^.*\ " ""
|
||||||
RPMBUILD_EXECUTABLE_VERSION
|
RPMBUILD_EXECUTABLE_VERSION
|
||||||
${_TMP_VERSION})
|
${_TMP_VERSION})
|
||||||
IF(CPACK_RPM_PACKAGE_DEBUG)
|
if(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
MESSAGE("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>")
|
message("CPackRPM:Debug: rpmbuild version is <${RPMBUILD_EXECUTABLE_VERSION}>")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
ENDIF(RPMBUILD_EXECUTABLE)
|
endif(RPMBUILD_EXECUTABLE)
|
||||||
|
|
||||||
IF(NOT RPMBUILD_EXECUTABLE)
|
if(NOT RPMBUILD_EXECUTABLE)
|
||||||
MESSAGE(FATAL_ERROR "RPM package requires rpmbuild executable")
|
message(FATAL_ERROR "RPM package requires rpmbuild executable")
|
||||||
ENDIF(NOT RPMBUILD_EXECUTABLE)
|
endif(NOT RPMBUILD_EXECUTABLE)
|
||||||
|
|
||||||
# Display lsb_release output if DEBUG mode enable
|
# Display lsb_release output if DEBUG mode enable
|
||||||
# This will help to diagnose problem with CPackRPM
|
# This will help to diagnose problem with CPackRPM
|
||||||
# because we will know on which kind of Linux we are
|
# 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)
|
find_program(LSB_RELEASE_EXECUTABLE lsb_release)
|
||||||
if(LSB_RELEASE_EXECUTABLE)
|
if(LSB_RELEASE_EXECUTABLE)
|
||||||
execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -a
|
execute_process(COMMAND ${LSB_RELEASE_EXECUTABLE} -a
|
||||||
|
@ -287,37 +287,37 @@ IF(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
else (LSB_RELEASE_EXECUTABLE)
|
else (LSB_RELEASE_EXECUTABLE)
|
||||||
set(LSB_RELEASE_OUTPUT "lsb_release not installed/found!")
|
set(LSB_RELEASE_OUTPUT "lsb_release not installed/found!")
|
||||||
endif(LSB_RELEASE_EXECUTABLE)
|
endif(LSB_RELEASE_EXECUTABLE)
|
||||||
MESSAGE("CPackRPM:Debug: LSB_RELEASE = ${LSB_RELEASE_OUTPUT}")
|
message("CPackRPM:Debug: LSB_RELEASE = ${LSB_RELEASE_OUTPUT}")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
|
|
||||||
# We may use RPM version in the future in order
|
# We may use RPM version in the future in order
|
||||||
# to shut down warning about space in buildtree
|
# to shut down warning about space in buildtree
|
||||||
# some recent RPM version should support space in different places.
|
# some recent RPM version should support space in different places.
|
||||||
# not checked [yet].
|
# not checked [yet].
|
||||||
IF(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.")
|
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 ".* .*")
|
endif(CPACK_TOPLEVEL_DIRECTORY MATCHES ".* .*")
|
||||||
|
|
||||||
# If rpmbuild is found
|
# If rpmbuild is found
|
||||||
# we try to discover alien since we may be on non RPM distro like Debian.
|
# 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
|
# In this case we may try to to use more advanced features
|
||||||
# like generating RPM directly from DEB using alien.
|
# like generating RPM directly from DEB using alien.
|
||||||
# FIXME feature not finished (yet)
|
# FIXME feature not finished (yet)
|
||||||
FIND_PROGRAM(ALIEN_EXECUTABLE alien)
|
find_program(ALIEN_EXECUTABLE alien)
|
||||||
IF(ALIEN_EXECUTABLE)
|
if(ALIEN_EXECUTABLE)
|
||||||
MESSAGE(STATUS "alien found, we may be on a Debian based distro.")
|
message(STATUS "alien found, we may be on a Debian based distro.")
|
||||||
ENDIF(ALIEN_EXECUTABLE)
|
endif(ALIEN_EXECUTABLE)
|
||||||
|
|
||||||
# Are we packaging components ?
|
# Are we packaging components ?
|
||||||
IF(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_NAME "-${CPACK_RPM_PACKAGE_COMPONENT}")
|
||||||
SET(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "/${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}")
|
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}/${CPACK_RPM_PACKAGE_COMPONENT}")
|
||||||
ELSE(CPACK_RPM_PACKAGE_COMPONENT)
|
else(CPACK_RPM_PACKAGE_COMPONENT)
|
||||||
SET(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "")
|
set(CPACK_RPM_PACKAGE_COMPONENT_PART_NAME "")
|
||||||
SET(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "")
|
set(CPACK_RPM_PACKAGE_COMPONENT_PART_PATH "")
|
||||||
SET(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
|
set(WDIR "${CPACK_TOPLEVEL_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_COMPONENT)
|
endif(CPACK_RPM_PACKAGE_COMPONENT)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Use user-defined RPM specific variables value
|
# Use user-defined RPM specific variables value
|
||||||
|
@ -329,42 +329,42 @@ ENDIF(CPACK_RPM_PACKAGE_COMPONENT)
|
||||||
#
|
#
|
||||||
|
|
||||||
# CPACK_RPM_PACKAGE_SUMMARY (mandatory)
|
# 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 neither var is defined lets use the name as summary
|
||||||
IF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
|
if(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
|
||||||
STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY)
|
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_SUMMARY)
|
||||||
ELSE(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
|
else(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
|
||||||
SET(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
|
set(CPACK_RPM_PACKAGE_SUMMARY ${CPACK_PACKAGE_DESCRIPTION_SUMMARY})
|
||||||
ENDIF(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
|
endif(NOT CPACK_PACKAGE_DESCRIPTION_SUMMARY)
|
||||||
ENDIF(NOT CPACK_RPM_PACKAGE_SUMMARY)
|
endif(NOT CPACK_RPM_PACKAGE_SUMMARY)
|
||||||
|
|
||||||
# CPACK_RPM_PACKAGE_NAME (mandatory)
|
# CPACK_RPM_PACKAGE_NAME (mandatory)
|
||||||
IF(NOT CPACK_RPM_PACKAGE_NAME)
|
if(NOT CPACK_RPM_PACKAGE_NAME)
|
||||||
STRING(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
|
string(TOLOWER "${CPACK_PACKAGE_NAME}" CPACK_RPM_PACKAGE_NAME)
|
||||||
ENDIF(NOT CPACK_RPM_PACKAGE_NAME)
|
endif(NOT CPACK_RPM_PACKAGE_NAME)
|
||||||
|
|
||||||
# CPACK_RPM_PACKAGE_VERSION (mandatory)
|
# CPACK_RPM_PACKAGE_VERSION (mandatory)
|
||||||
IF(NOT CPACK_RPM_PACKAGE_VERSION)
|
if(NOT CPACK_RPM_PACKAGE_VERSION)
|
||||||
IF(NOT CPACK_PACKAGE_VERSION)
|
if(NOT CPACK_PACKAGE_VERSION)
|
||||||
MESSAGE(FATAL_ERROR "RPM package requires a package version")
|
message(FATAL_ERROR "RPM package requires a package version")
|
||||||
ENDIF(NOT CPACK_PACKAGE_VERSION)
|
endif(NOT CPACK_PACKAGE_VERSION)
|
||||||
SET(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
|
set(CPACK_RPM_PACKAGE_VERSION ${CPACK_PACKAGE_VERSION})
|
||||||
ENDIF(NOT CPACK_RPM_PACKAGE_VERSION)
|
endif(NOT CPACK_RPM_PACKAGE_VERSION)
|
||||||
# Replace '-' in version with '_'
|
# Replace '-' in version with '_'
|
||||||
# '-' character is an Illegal RPM version character
|
# '-' character is an Illegal RPM version character
|
||||||
# it is illegal because it is used to separate
|
# it is illegal because it is used to separate
|
||||||
# RPM "Version" from RPM "Release"
|
# 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)
|
# CPACK_RPM_PACKAGE_ARCHITECTURE (optional)
|
||||||
IF(CPACK_RPM_PACKAGE_ARCHITECTURE)
|
if(CPACK_RPM_PACKAGE_ARCHITECTURE)
|
||||||
SET(TMP_RPM_BUILDARCH "Buildarch: ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
|
set(TMP_RPM_BUILDARCH "Buildarch: ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
|
||||||
IF(CPACK_RPM_PACKAGE_DEBUG)
|
if(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
MESSAGE("CPackRPM:Debug: using user-specified build arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
|
message("CPackRPM:Debug: using user-specified build arch = ${CPACK_RPM_PACKAGE_ARCHITECTURE}")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
ELSE(CPACK_RPM_PACKAGE_ARCHITECTURE)
|
else(CPACK_RPM_PACKAGE_ARCHITECTURE)
|
||||||
SET(TMP_RPM_BUILDARCH "")
|
set(TMP_RPM_BUILDARCH "")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_ARCHITECTURE)
|
endif(CPACK_RPM_PACKAGE_ARCHITECTURE)
|
||||||
|
|
||||||
# CPACK_RPM_PACKAGE_RELEASE
|
# CPACK_RPM_PACKAGE_RELEASE
|
||||||
# The RPM release is the numbering of the RPM package ITSELF
|
# 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.
|
# without changing the version of the packaged software.
|
||||||
# This is the case when the packaging is buggy (not) the software :=)
|
# This is the case when the packaging is buggy (not) the software :=)
|
||||||
# If not set, 1 is a good candidate
|
# If not set, 1 is a good candidate
|
||||||
IF(NOT CPACK_RPM_PACKAGE_RELEASE)
|
if(NOT CPACK_RPM_PACKAGE_RELEASE)
|
||||||
SET(CPACK_RPM_PACKAGE_RELEASE 1)
|
set(CPACK_RPM_PACKAGE_RELEASE 1)
|
||||||
ENDIF(NOT CPACK_RPM_PACKAGE_RELEASE)
|
endif(NOT CPACK_RPM_PACKAGE_RELEASE)
|
||||||
|
|
||||||
# CPACK_RPM_PACKAGE_LICENSE
|
# CPACK_RPM_PACKAGE_LICENSE
|
||||||
IF(NOT CPACK_RPM_PACKAGE_LICENSE)
|
if(NOT CPACK_RPM_PACKAGE_LICENSE)
|
||||||
SET(CPACK_RPM_PACKAGE_LICENSE "unknown")
|
set(CPACK_RPM_PACKAGE_LICENSE "unknown")
|
||||||
ENDIF(NOT CPACK_RPM_PACKAGE_LICENSE)
|
endif(NOT CPACK_RPM_PACKAGE_LICENSE)
|
||||||
|
|
||||||
# CPACK_RPM_PACKAGE_GROUP
|
# CPACK_RPM_PACKAGE_GROUP
|
||||||
IF(NOT CPACK_RPM_PACKAGE_GROUP)
|
if(NOT CPACK_RPM_PACKAGE_GROUP)
|
||||||
SET(CPACK_RPM_PACKAGE_GROUP "unknown")
|
set(CPACK_RPM_PACKAGE_GROUP "unknown")
|
||||||
ENDIF(NOT CPACK_RPM_PACKAGE_GROUP)
|
endif(NOT CPACK_RPM_PACKAGE_GROUP)
|
||||||
|
|
||||||
# CPACK_RPM_PACKAGE_VENDOR
|
# CPACK_RPM_PACKAGE_VENDOR
|
||||||
IF(NOT CPACK_RPM_PACKAGE_VENDOR)
|
if(NOT CPACK_RPM_PACKAGE_VENDOR)
|
||||||
IF(CPACK_PACKAGE_VENDOR)
|
if(CPACK_PACKAGE_VENDOR)
|
||||||
SET(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}")
|
set(CPACK_RPM_PACKAGE_VENDOR "${CPACK_PACKAGE_VENDOR}")
|
||||||
ELSE(CPACK_PACKAGE_VENDOR)
|
else(CPACK_PACKAGE_VENDOR)
|
||||||
SET(CPACK_RPM_PACKAGE_VENDOR "unknown")
|
set(CPACK_RPM_PACKAGE_VENDOR "unknown")
|
||||||
ENDIF(CPACK_PACKAGE_VENDOR)
|
endif(CPACK_PACKAGE_VENDOR)
|
||||||
ENDIF(NOT CPACK_RPM_PACKAGE_VENDOR)
|
endif(NOT CPACK_RPM_PACKAGE_VENDOR)
|
||||||
|
|
||||||
# CPACK_RPM_PACKAGE_SOURCE
|
# CPACK_RPM_PACKAGE_SOURCE
|
||||||
# The name of the source tarball in case we generate a source RPM
|
# The name of the source tarball in case we generate a source RPM
|
||||||
|
@ -407,35 +407,35 @@ ENDIF(NOT CPACK_RPM_PACKAGE_VENDOR)
|
||||||
# if it is defined
|
# if it is defined
|
||||||
# - set to a default value
|
# - set to a default value
|
||||||
#
|
#
|
||||||
IF (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
|
if (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
|
||||||
IF (CPACK_PACKAGE_DESCRIPTION_FILE)
|
if (CPACK_PACKAGE_DESCRIPTION_FILE)
|
||||||
FILE(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION)
|
file(READ ${CPACK_PACKAGE_DESCRIPTION_FILE} CPACK_RPM_PACKAGE_DESCRIPTION)
|
||||||
ELSE (CPACK_PACKAGE_DESCRIPTION_FILE)
|
else (CPACK_PACKAGE_DESCRIPTION_FILE)
|
||||||
SET(CPACK_RPM_PACKAGE_DESCRIPTION "no package description available")
|
set(CPACK_RPM_PACKAGE_DESCRIPTION "no package description available")
|
||||||
ENDIF (CPACK_PACKAGE_DESCRIPTION_FILE)
|
endif (CPACK_PACKAGE_DESCRIPTION_FILE)
|
||||||
ENDIF (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
|
endif (NOT CPACK_RPM_PACKAGE_DESCRIPTION)
|
||||||
|
|
||||||
# CPACK_RPM_COMPRESSION_TYPE
|
# CPACK_RPM_COMPRESSION_TYPE
|
||||||
#
|
#
|
||||||
IF (CPACK_RPM_COMPRESSION_TYPE)
|
if (CPACK_RPM_COMPRESSION_TYPE)
|
||||||
IF(CPACK_RPM_PACKAGE_DEBUG)
|
if(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
MESSAGE("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}")
|
message("CPackRPM:Debug: User Specified RPM compression type: ${CPACK_RPM_COMPRESSION_TYPE}")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
|
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
|
||||||
SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio")
|
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.lzdio")
|
||||||
ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
|
endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "lzma")
|
||||||
IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
|
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
|
||||||
SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio")
|
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w7.xzdio")
|
||||||
ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
|
endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "xz")
|
||||||
IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
|
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
|
||||||
SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio")
|
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.bzdio")
|
||||||
ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
|
endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "bzip2")
|
||||||
IF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
|
if(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
|
||||||
SET(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio")
|
set(CPACK_RPM_COMPRESSION_TYPE_TMP "%define _binary_payload w9.gzdio")
|
||||||
ENDIF(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
|
endif(CPACK_RPM_COMPRESSION_TYPE STREQUAL "gzip")
|
||||||
ELSE(CPACK_RPM_COMPRESSION_TYPE)
|
else(CPACK_RPM_COMPRESSION_TYPE)
|
||||||
SET(CPACK_RPM_COMPRESSION_TYPE_TMP "")
|
set(CPACK_RPM_COMPRESSION_TYPE_TMP "")
|
||||||
ENDIF(CPACK_RPM_COMPRESSION_TYPE)
|
endif(CPACK_RPM_COMPRESSION_TYPE)
|
||||||
|
|
||||||
if(CPACK_PACKAGE_RELOCATABLE)
|
if(CPACK_PACKAGE_RELOCATABLE)
|
||||||
set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
|
set(CPACK_RPM_PACKAGE_RELOCATABLE TRUE)
|
||||||
|
@ -453,57 +453,57 @@ endif(CPACK_RPM_PACKAGE_RELOCATABLE)
|
||||||
|
|
||||||
# Check if additional fields for RPM spec header are given
|
# Check if additional fields for RPM spec header are given
|
||||||
# There may be some COMPONENT specific variables as well
|
# There may be some COMPONENT specific variables as well
|
||||||
FOREACH(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV)
|
foreach(_RPM_SPEC_HEADER URL REQUIRES SUGGESTS PROVIDES OBSOLETES PREFIX CONFLICTS AUTOPROV AUTOREQ AUTOREQPROV)
|
||||||
IF(CPACK_RPM_PACKAGE_DEBUG)
|
if(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}")
|
message("CPackRPM:Debug: processing ${_RPM_SPEC_HEADER}")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
if(CPACK_RPM_PACKAGE_COMPONENT)
|
if(CPACK_RPM_PACKAGE_COMPONENT)
|
||||||
if(CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER})
|
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}")
|
message("CPackRPM:Debug: using CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}})
|
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER}})
|
||||||
else()
|
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: CPACK_RPM_${CPACK_RPM_PACKAGE_COMPONENT}_PACKAGE_${_RPM_SPEC_HEADER} not defined")
|
||||||
message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
|
message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
|
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
|
||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
IF(CPACK_RPM_PACKAGE_DEBUG)
|
if(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
|
message("CPackRPM:Debug: using CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
|
set(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
IF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
|
if(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
|
||||||
STRING(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH)
|
string(LENGTH ${_RPM_SPEC_HEADER} _PACKAGE_HEADER_STRLENGTH)
|
||||||
MATH(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1")
|
math(EXPR _PACKAGE_HEADER_STRLENGTH "${_PACKAGE_HEADER_STRLENGTH} - 1")
|
||||||
STRING(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL)
|
string(SUBSTRING ${_RPM_SPEC_HEADER} 1 ${_PACKAGE_HEADER_STRLENGTH} _PACKAGE_HEADER_TAIL)
|
||||||
STRING(TOLOWER "${_PACKAGE_HEADER_TAIL}" _PACKAGE_HEADER_TAIL)
|
string(TOLOWER "${_PACKAGE_HEADER_TAIL}" _PACKAGE_HEADER_TAIL)
|
||||||
STRING(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME)
|
string(SUBSTRING ${_RPM_SPEC_HEADER} 0 1 _PACKAGE_HEADER_NAME)
|
||||||
SET(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
|
set(_PACKAGE_HEADER_NAME "${_PACKAGE_HEADER_NAME}${_PACKAGE_HEADER_TAIL}")
|
||||||
IF(CPACK_RPM_PACKAGE_DEBUG)
|
if(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
MESSAGE("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
|
message("CPackRPM:Debug: User defined ${_PACKAGE_HEADER_NAME}:\n ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
SET(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
|
set(TMP_RPM_${_RPM_SPEC_HEADER} "${_PACKAGE_HEADER_NAME}: ${CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP}")
|
||||||
ELSE(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
|
else(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
|
||||||
# Do not forget to unset previously set header (from previous component)
|
# Do not forget to unset previously set header (from previous component)
|
||||||
UNSET(TMP_RPM_${_RPM_SPEC_HEADER})
|
unset(TMP_RPM_${_RPM_SPEC_HEADER})
|
||||||
ENDIF(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
|
endif(CPACK_RPM_PACKAGE_${_RPM_SPEC_HEADER}_TMP)
|
||||||
ENDFOREACH(_RPM_SPEC_HEADER)
|
endforeach(_RPM_SPEC_HEADER)
|
||||||
|
|
||||||
# CPACK_RPM_SPEC_INSTALL_POST
|
# CPACK_RPM_SPEC_INSTALL_POST
|
||||||
# May be used to define a RPM post intallation script
|
# May be used to define a RPM post intallation script
|
||||||
# for example setting it to "/bin/true" may prevent
|
# for example setting it to "/bin/true" may prevent
|
||||||
# rpmbuild from stripping binaries.
|
# rpmbuild from stripping binaries.
|
||||||
IF(CPACK_RPM_SPEC_INSTALL_POST)
|
if(CPACK_RPM_SPEC_INSTALL_POST)
|
||||||
IF(CPACK_RPM_PACKAGE_DEBUG)
|
if(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
MESSAGE("CPackRPM:Debug: User defined CPACK_RPM_SPEC_INSTALL_POST = ${CPACK_RPM_SPEC_INSTALL_POST}")
|
message("CPackRPM:Debug: User defined CPACK_RPM_SPEC_INSTALL_POST = ${CPACK_RPM_SPEC_INSTALL_POST}")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
SET(TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}")
|
set(TMP_RPM_SPEC_INSTALL_POST "%define __spec_install_post ${CPACK_RPM_SPEC_INSTALL_POST}")
|
||||||
ENDIF(CPACK_RPM_SPEC_INSTALL_POST)
|
endif(CPACK_RPM_SPEC_INSTALL_POST)
|
||||||
|
|
||||||
# CPACK_RPM_POST_INSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_INSTALL_SCRIPT_FILE)
|
# 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)
|
# CPACK_RPM_POST_UNINSTALL_SCRIPT_FILE (or CPACK_RPM_<COMPONENT>_POST_UNINSTALL_SCRIPT_FILE)
|
||||||
|
@ -614,30 +614,30 @@ endif(CPACK_RPM_CHANGELOG_FILE)
|
||||||
|
|
||||||
# CPACK_RPM_SPEC_MORE_DEFINE
|
# CPACK_RPM_SPEC_MORE_DEFINE
|
||||||
# This is a generated spec rpm file spaceholder
|
# This is a generated spec rpm file spaceholder
|
||||||
IF(CPACK_RPM_SPEC_MORE_DEFINE)
|
if(CPACK_RPM_SPEC_MORE_DEFINE)
|
||||||
IF(CPACK_RPM_PACKAGE_DEBUG)
|
if(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
MESSAGE("CPackRPM:Debug: User defined more define spec line specified:\n ${CPACK_RPM_SPEC_MORE_DEFINE}")
|
message("CPackRPM:Debug: User defined more define spec line specified:\n ${CPACK_RPM_SPEC_MORE_DEFINE}")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
ENDIF(CPACK_RPM_SPEC_MORE_DEFINE)
|
endif(CPACK_RPM_SPEC_MORE_DEFINE)
|
||||||
|
|
||||||
# Now we may create the RPM build tree structure
|
# Now we may create the RPM build tree structure
|
||||||
SET(CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}")
|
set(CPACK_RPM_ROOTDIR "${CPACK_TOPLEVEL_DIRECTORY}")
|
||||||
MESSAGE(STATUS "CPackRPM:Debug: Using CPACK_RPM_ROOTDIR=${CPACK_RPM_ROOTDIR}")
|
message(STATUS "CPackRPM:Debug: Using CPACK_RPM_ROOTDIR=${CPACK_RPM_ROOTDIR}")
|
||||||
# Prepare RPM build tree
|
# Prepare RPM build tree
|
||||||
FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR})
|
file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR})
|
||||||
FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/tmp)
|
file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/tmp)
|
||||||
FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/BUILD)
|
file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/BUILD)
|
||||||
FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/RPMS)
|
file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/RPMS)
|
||||||
FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SOURCES)
|
file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SOURCES)
|
||||||
FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SPECS)
|
file(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SPECS)
|
||||||
FILE(MAKE_DIRECTORY ${CPACK_RPM_ROOTDIR}/SRPMS)
|
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_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_OUTPUT_FILE_NAME}")
|
||||||
# it seems rpmbuild can't handle spaces in the path
|
# it seems rpmbuild can't handle spaces in the path
|
||||||
# neither escaping (as below) nor putting quotes around the path seem to help
|
# neither escaping (as below) nor putting quotes around the path seem to help
|
||||||
#STRING(REGEX REPLACE " " "\\\\ " CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
|
#string(REGEX REPLACE " " "\\\\ " CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
|
||||||
SET(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
|
set(CPACK_RPM_DIRECTORY "${CPACK_TOPLEVEL_DIRECTORY}")
|
||||||
|
|
||||||
# if we are creating a relocatable package, omit parent directories of
|
# if we are creating a relocatable package, omit parent directories of
|
||||||
# CPACK_RPM_PACKAGE_PREFIX. This is achieved by building a "filter list"
|
# 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)
|
# file name by enclosing it between double quotes (thus the sed)
|
||||||
# Then we must authorize any man pages extension (adding * at the end)
|
# Then we must authorize any man pages extension (adding * at the end)
|
||||||
# because rpmbuild may automatically compress those files
|
# 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:.*/man.*/.*:&*:
|
||||||
COMMAND sed s/\\.\\\(.*\\\)/\"\\1\"/
|
COMMAND sed s/\\.\\\(.*\\\)/\"\\1\"/
|
||||||
WORKING_DIRECTORY "${WDIR}"
|
WORKING_DIRECTORY "${WDIR}"
|
||||||
|
@ -715,9 +715,9 @@ endif()
|
||||||
# or CPACK_RPM_INSTALL_FILES,
|
# or CPACK_RPM_INSTALL_FILES,
|
||||||
# hence it must be done before these auto-generated lists are processed.
|
# hence it must be done before these auto-generated lists are processed.
|
||||||
if(CPACK_RPM_USER_FILELIST_INTERNAL)
|
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}>")
|
message("CPackRPM:Debug: Handling User Filelist: <${CPACK_RPM_USER_FILELIST_INTERNAL}>")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
|
|
||||||
# Create CMake list from CPACK_RPM_INSTALL_FILES
|
# Create CMake list from CPACK_RPM_INSTALL_FILES
|
||||||
string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
|
string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
|
||||||
|
@ -753,9 +753,9 @@ else()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
|
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}")
|
message("CPackRPM:Debug: Handling Absolute Destination Files: ${CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL}")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
# Remove trailing space
|
# Remove trailing space
|
||||||
string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
|
string(STRIP "${CPACK_RPM_INSTALL_FILES}" CPACK_RPM_INSTALL_FILES_LIST)
|
||||||
# Transform endline separated - string into CMake List
|
# Transform endline separated - string into CMake List
|
||||||
|
@ -774,10 +774,10 @@ if (CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
|
||||||
foreach(F IN LISTS CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
|
foreach(F IN LISTS CPACK_ABSOLUTE_DESTINATION_FILES_INTERNAL)
|
||||||
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "${CPACK_RPM_ABSOLUTE_INSTALL_FILES}%config \"${F}\"\n")
|
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "${CPACK_RPM_ABSOLUTE_INSTALL_FILES}%config \"${F}\"\n")
|
||||||
endforeach(F)
|
endforeach(F)
|
||||||
IF(CPACK_RPM_PACKAGE_DEBUG)
|
if(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
message("CPackRPM:Debug: CPACK_RPM_ABSOLUTE_INSTALL_FILES=${CPACK_RPM_ABSOLUTE_INSTALL_FILES}")
|
message("CPackRPM:Debug: CPACK_RPM_ABSOLUTE_INSTALL_FILES=${CPACK_RPM_ABSOLUTE_INSTALL_FILES}")
|
||||||
message("CPackRPM:Debug: CPACK_RPM_INSTALL_FILES=${CPACK_RPM_INSTALL_FILES}")
|
message("CPackRPM:Debug: CPACK_RPM_INSTALL_FILES=${CPACK_RPM_INSTALL_FILES}")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
else()
|
else()
|
||||||
# reset vars in order to avoid leakage of value(s) from one component to another
|
# reset vars in order to avoid leakage of value(s) from one component to another
|
||||||
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
|
set(CPACK_RPM_ABSOLUTE_INSTALL_FILES "")
|
||||||
|
@ -803,28 +803,28 @@ endforeach(F)
|
||||||
set(CPACK_RPM_INSTALL_FILES_LIST "")
|
set(CPACK_RPM_INSTALL_FILES_LIST "")
|
||||||
|
|
||||||
# The name of the final spec file to be used by rpmbuild
|
# 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
|
# Print out some debug information if we were asked for that
|
||||||
IF(CPACK_RPM_PACKAGE_DEBUG)
|
if(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
MESSAGE("CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}")
|
message("CPackRPM:Debug: CPACK_TOPLEVEL_DIRECTORY = ${CPACK_TOPLEVEL_DIRECTORY}")
|
||||||
MESSAGE("CPackRPM:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}")
|
message("CPackRPM:Debug: CPACK_TOPLEVEL_TAG = ${CPACK_TOPLEVEL_TAG}")
|
||||||
MESSAGE("CPackRPM:Debug: CPACK_TEMPORARY_DIRECTORY = ${CPACK_TEMPORARY_DIRECTORY}")
|
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_NAME = ${CPACK_OUTPUT_FILE_NAME}")
|
||||||
MESSAGE("CPackRPM:Debug: CPACK_OUTPUT_FILE_PATH = ${CPACK_OUTPUT_FILE_PATH}")
|
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_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}")
|
||||||
MESSAGE("CPackRPM:Debug: CPACK_RPM_BINARY_SPECFILE = ${CPACK_RPM_BINARY_SPECFILE}")
|
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_PACKAGE_INSTALL_DIRECTORY = ${CPACK_PACKAGE_INSTALL_DIRECTORY}")
|
||||||
MESSAGE("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
|
message("CPackRPM:Debug: CPACK_TEMPORARY_PACKAGE_FILE_NAME = ${CPACK_TEMPORARY_PACKAGE_FILE_NAME}")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG)
|
endif(CPACK_RPM_PACKAGE_DEBUG)
|
||||||
|
|
||||||
# USER generated spec file handling.
|
# USER generated spec file handling.
|
||||||
# We should generate a spec file template:
|
# We should generate a spec file template:
|
||||||
# - either because the user asked for it : CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_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
|
# - 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)
|
if(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
|
||||||
FILE(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in
|
file(WRITE ${CPACK_RPM_BINARY_SPECFILE}.in
|
||||||
"# -*- rpm-spec -*-
|
"# -*- rpm-spec -*-
|
||||||
BuildRoot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@\@CPACK_RPM_PACKAGE_COMPONENT_PART_PATH\@
|
BuildRoot: \@CPACK_RPM_DIRECTORY\@/\@CPACK_PACKAGE_FILE_NAME\@\@CPACK_RPM_PACKAGE_COMPONENT_PART_PATH\@
|
||||||
Summary: \@CPACK_RPM_PACKAGE_SUMMARY\@
|
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
|
# 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
|
# The generated file may then be used as a template by user who wants
|
||||||
# to customize their own spec file.
|
# to customize their own spec file.
|
||||||
IF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE)
|
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")
|
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)
|
||||||
ENDIF(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
|
endif(CPACK_RPM_GENERATE_USER_BINARY_SPECFILE_TEMPLATE OR NOT CPACK_RPM_USER_BINARY_SPECFILE)
|
||||||
|
|
||||||
# After that we may either use a user provided spec file
|
# After that we may either use a user provided spec file
|
||||||
# or generate one using appropriate variables value.
|
# 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
|
# 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
|
# The user provided file is processed for @var replacement
|
||||||
CONFIGURE_FILE(${CPACK_RPM_USER_BINARY_SPECFILE} ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
|
configure_file(${CPACK_RPM_USER_BINARY_SPECFILE} ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
|
||||||
ELSE(CPACK_RPM_USER_BINARY_SPECFILE)
|
else(CPACK_RPM_USER_BINARY_SPECFILE)
|
||||||
# No User specified spec file, will use the generated spec file
|
# 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
|
# Note the just created file is processed for @var replacement
|
||||||
CONFIGURE_FILE(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
|
configure_file(${CPACK_RPM_BINARY_SPECFILE}.in ${CPACK_RPM_BINARY_SPECFILE} @ONLY)
|
||||||
ENDIF(CPACK_RPM_USER_BINARY_SPECFILE)
|
endif(CPACK_RPM_USER_BINARY_SPECFILE)
|
||||||
|
|
||||||
IF(RPMBUILD_EXECUTABLE)
|
if(RPMBUILD_EXECUTABLE)
|
||||||
# Now call rpmbuild using the SPECFILE
|
# Now call rpmbuild using the SPECFILE
|
||||||
EXECUTE_PROCESS(
|
execute_process(
|
||||||
COMMAND "${RPMBUILD_EXECUTABLE}" -bb
|
COMMAND "${RPMBUILD_EXECUTABLE}" -bb
|
||||||
--define "_topdir ${CPACK_RPM_DIRECTORY}"
|
--define "_topdir ${CPACK_RPM_DIRECTORY}"
|
||||||
--buildroot "${CPACK_RPM_DIRECTORY}/${CPACK_PACKAGE_FILE_NAME}${CPACK_RPM_PACKAGE_COMPONENT_PART_PATH}"
|
--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
|
RESULT_VARIABLE CPACK_RPMBUILD_EXEC_RESULT
|
||||||
ERROR_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err"
|
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")
|
OUTPUT_FILE "${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
|
||||||
IF(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
|
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}.err RPMBUILDERR)
|
||||||
FILE(READ ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out RPMBUILDOUT)
|
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: You may consult rpmbuild logs in: ")
|
||||||
MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err")
|
message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.err")
|
||||||
MESSAGE("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
|
message("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
|
||||||
MESSAGE("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
|
message("CPackRPM:Debug: - ${CPACK_TOPLEVEL_DIRECTORY}/rpmbuild${CPACK_RPM_PACKAGE_COMPONENT_PART_NAME}.out")
|
||||||
MESSAGE("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
|
message("CPackRPM:Debug: *** ${RPMBUILDERR} ***")
|
||||||
ENDIF(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
|
endif(CPACK_RPM_PACKAGE_DEBUG OR CPACK_RPMBUILD_EXEC_RESULT)
|
||||||
ELSE(RPMBUILD_EXECUTABLE)
|
else(RPMBUILD_EXECUTABLE)
|
||||||
IF(ALIEN_EXECUTABLE)
|
if(ALIEN_EXECUTABLE)
|
||||||
MESSAGE(FATAL_ERROR "RPM packaging through alien not done (yet)")
|
message(FATAL_ERROR "RPM packaging through alien not done (yet)")
|
||||||
ENDIF(ALIEN_EXECUTABLE)
|
endif(ALIEN_EXECUTABLE)
|
||||||
ENDIF(RPMBUILD_EXECUTABLE)
|
endif(RPMBUILD_EXECUTABLE)
|
||||||
|
|
|
@ -12,30 +12,30 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
IF(CMAKE_BINARY_DIR)
|
if(CMAKE_BINARY_DIR)
|
||||||
MESSAGE(FATAL_ERROR "CPackZIP.cmake may only be used by CPack internally.")
|
message(FATAL_ERROR "CPackZIP.cmake may only be used by CPack internally.")
|
||||||
ENDIF(CMAKE_BINARY_DIR)
|
endif(CMAKE_BINARY_DIR)
|
||||||
|
|
||||||
FIND_PROGRAM(ZIP_EXECUTABLE wzzip PATHS "$ENV{ProgramFiles}/WinZip")
|
find_program(ZIP_EXECUTABLE wzzip PATHS "$ENV{ProgramFiles}/WinZip")
|
||||||
IF(ZIP_EXECUTABLE)
|
if(ZIP_EXECUTABLE)
|
||||||
SET(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -P \"<ARCHIVE>\" @<FILELIST>")
|
set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -P \"<ARCHIVE>\" @<FILELIST>")
|
||||||
SET(CPACK_ZIP_NEED_QUOTES TRUE)
|
set(CPACK_ZIP_NEED_QUOTES TRUE)
|
||||||
ENDIF(ZIP_EXECUTABLE)
|
endif(ZIP_EXECUTABLE)
|
||||||
|
|
||||||
IF(NOT ZIP_EXECUTABLE)
|
if(NOT ZIP_EXECUTABLE)
|
||||||
FIND_PROGRAM(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip")
|
find_program(ZIP_EXECUTABLE 7z PATHS "$ENV{ProgramFiles}/7-Zip")
|
||||||
IF(ZIP_EXECUTABLE)
|
if(ZIP_EXECUTABLE)
|
||||||
SET(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" a -tzip \"<ARCHIVE>\" @<FILELIST>")
|
set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" a -tzip \"<ARCHIVE>\" @<FILELIST>")
|
||||||
SET(CPACK_ZIP_NEED_QUOTES TRUE)
|
set(CPACK_ZIP_NEED_QUOTES TRUE)
|
||||||
ENDIF(ZIP_EXECUTABLE)
|
endif(ZIP_EXECUTABLE)
|
||||||
ENDIF(NOT ZIP_EXECUTABLE)
|
endif(NOT ZIP_EXECUTABLE)
|
||||||
|
|
||||||
IF(NOT ZIP_EXECUTABLE)
|
if(NOT ZIP_EXECUTABLE)
|
||||||
FIND_PACKAGE(Cygwin)
|
find_package(Cygwin)
|
||||||
FIND_PROGRAM(ZIP_EXECUTABLE zip PATHS "${CYGWIN_INSTALL_PATH}/bin")
|
find_program(ZIP_EXECUTABLE zip PATHS "${CYGWIN_INSTALL_PATH}/bin")
|
||||||
IF(ZIP_EXECUTABLE)
|
if(ZIP_EXECUTABLE)
|
||||||
SET(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -r \"<ARCHIVE>\" . -i@<FILELIST>")
|
set(CPACK_ZIP_COMMAND "\"${ZIP_EXECUTABLE}\" -r \"<ARCHIVE>\" . -i@<FILELIST>")
|
||||||
SET(CPACK_ZIP_NEED_QUOTES FALSE)
|
set(CPACK_ZIP_NEED_QUOTES FALSE)
|
||||||
ENDIF(ZIP_EXECUTABLE)
|
endif(ZIP_EXECUTABLE)
|
||||||
ENDIF(NOT ZIP_EXECUTABLE)
|
endif(NOT ZIP_EXECUTABLE)
|
||||||
|
|
||||||
|
|
|
@ -58,46 +58,46 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
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
|
# function to turn generator name into a version string
|
||||||
# like vs7 vs71 vs8 vs9
|
# like vs7 vs71 vs8 vs9
|
||||||
FUNCTION(GET_VS_VERSION_STRING generator var)
|
function(GET_VS_VERSION_STRING generator var)
|
||||||
STRING(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1"
|
string(REGEX REPLACE "Visual Studio ([0-9][0-9]?)($|.*)" "\\1"
|
||||||
NUMBER "${generator}")
|
NUMBER "${generator}")
|
||||||
IF("${generator}" MATCHES "Visual Studio 7 .NET 2003")
|
if("${generator}" MATCHES "Visual Studio 7 .NET 2003")
|
||||||
SET(ver_string "vs71")
|
set(ver_string "vs71")
|
||||||
ELSE("${generator}" MATCHES "Visual Studio 7 .NET 2003")
|
else("${generator}" MATCHES "Visual Studio 7 .NET 2003")
|
||||||
SET(ver_string "vs${NUMBER}")
|
set(ver_string "vs${NUMBER}")
|
||||||
ENDIF("${generator}" MATCHES "Visual Studio 7 .NET 2003")
|
endif("${generator}" MATCHES "Visual Studio 7 .NET 2003")
|
||||||
SET(${var} ${ver_string} PARENT_SCOPE)
|
set(${var} ${ver_string} PARENT_SCOPE)
|
||||||
ENDFUNCTION(GET_VS_VERSION_STRING)
|
endfunction(GET_VS_VERSION_STRING)
|
||||||
|
|
||||||
IF(BUILD_TESTING)
|
if(BUILD_TESTING)
|
||||||
# Setup some auxilary macros
|
# Setup some auxilary macros
|
||||||
MACRO(SET_IF_NOT_SET var val)
|
macro(SET_IF_NOT_SET var val)
|
||||||
IF(NOT DEFINED "${var}")
|
if(NOT DEFINED "${var}")
|
||||||
SET("${var}" "${val}")
|
set("${var}" "${val}")
|
||||||
ENDIF(NOT DEFINED "${var}")
|
endif(NOT DEFINED "${var}")
|
||||||
ENDMACRO(SET_IF_NOT_SET)
|
endmacro(SET_IF_NOT_SET)
|
||||||
|
|
||||||
MACRO(SET_IF_SET var val)
|
macro(SET_IF_SET var val)
|
||||||
IF(NOT "${val}" MATCHES "^$")
|
if(NOT "${val}" MATCHES "^$")
|
||||||
SET("${var}" "${val}")
|
set("${var}" "${val}")
|
||||||
ENDIF(NOT "${val}" MATCHES "^$")
|
endif(NOT "${val}" MATCHES "^$")
|
||||||
ENDMACRO(SET_IF_SET)
|
endmacro(SET_IF_SET)
|
||||||
|
|
||||||
MACRO(SET_IF_SET_AND_NOT_SET var val)
|
macro(SET_IF_SET_AND_NOT_SET var val)
|
||||||
IF(NOT "${val}" MATCHES "^$")
|
if(NOT "${val}" MATCHES "^$")
|
||||||
SET_IF_NOT_SET("${var}" "${val}")
|
SET_IF_NOT_SET("${var}" "${val}")
|
||||||
ENDIF(NOT "${val}" MATCHES "^$")
|
endif(NOT "${val}" MATCHES "^$")
|
||||||
ENDMACRO(SET_IF_SET_AND_NOT_SET)
|
endmacro(SET_IF_SET_AND_NOT_SET)
|
||||||
|
|
||||||
# Make sure testing is enabled
|
# Make sure testing is enabled
|
||||||
ENABLE_TESTING()
|
enable_testing()
|
||||||
|
|
||||||
IF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
|
if(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
|
||||||
INCLUDE("${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(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_METHOD "${CTEST_DROP_METHOD}")
|
||||||
SET_IF_SET_AND_NOT_SET(DROP_SITE "${CTEST_DROP_SITE}")
|
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(DROP_LOCATION "${CTEST_DROP_LOCATION}")
|
||||||
SET_IF_SET_AND_NOT_SET(TRIGGER_SITE "${CTEST_TRIGGER_SITE}")
|
SET_IF_SET_AND_NOT_SET(TRIGGER_SITE "${CTEST_TRIGGER_SITE}")
|
||||||
SET_IF_SET_AND_NOT_SET(UPDATE_TYPE "${CTEST_UPDATE_TYPE}")
|
SET_IF_SET_AND_NOT_SET(UPDATE_TYPE "${CTEST_UPDATE_TYPE}")
|
||||||
ENDIF(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
|
endif(EXISTS "${PROJECT_SOURCE_DIR}/CTestConfig.cmake")
|
||||||
|
|
||||||
# the project can have a DartConfig.cmake file
|
# the project can have a DartConfig.cmake file
|
||||||
IF(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
|
if(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
|
||||||
INCLUDE("${PROJECT_SOURCE_DIR}/DartConfig.cmake")
|
include("${PROJECT_SOURCE_DIR}/DartConfig.cmake")
|
||||||
ELSE(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
|
else(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
|
||||||
# Dashboard is opened for submissions for a 24 hour period starting at
|
# Dashboard is opened for submissions for a 24 hour period starting at
|
||||||
# the specified NIGHTLY_START_TIME. Time is specified in 24 hour format.
|
# 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 (NIGHTLY_START_TIME "00:00:00 EDT")
|
||||||
SET_IF_NOT_SET(DROP_METHOD "http")
|
SET_IF_NOT_SET(DROP_METHOD "http")
|
||||||
SET_IF_NOT_SET (COMPRESS_SUBMISSION ON)
|
SET_IF_NOT_SET (COMPRESS_SUBMISSION ON)
|
||||||
ENDIF(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
|
endif(EXISTS "${PROJECT_SOURCE_DIR}/DartConfig.cmake")
|
||||||
SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT")
|
SET_IF_NOT_SET (NIGHTLY_START_TIME "00:00:00 EDT")
|
||||||
|
|
||||||
FIND_PROGRAM(CVSCOMMAND cvs )
|
find_program(CVSCOMMAND cvs )
|
||||||
SET(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING
|
set(CVS_UPDATE_OPTIONS "-d -A -P" CACHE STRING
|
||||||
"Options passed to the cvs update command.")
|
"Options passed to the cvs update command.")
|
||||||
FIND_PROGRAM(SVNCOMMAND svn)
|
find_program(SVNCOMMAND svn)
|
||||||
FIND_PROGRAM(BZRCOMMAND bzr)
|
find_program(BZRCOMMAND bzr)
|
||||||
FIND_PROGRAM(HGCOMMAND hg)
|
find_program(HGCOMMAND hg)
|
||||||
FIND_PROGRAM(GITCOMMAND git)
|
find_program(GITCOMMAND git)
|
||||||
|
|
||||||
IF(NOT UPDATE_TYPE)
|
if(NOT UPDATE_TYPE)
|
||||||
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS")
|
if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/CVS")
|
||||||
SET(UPDATE_TYPE cvs)
|
set(UPDATE_TYPE cvs)
|
||||||
ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
|
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.svn")
|
||||||
SET(UPDATE_TYPE svn)
|
set(UPDATE_TYPE svn)
|
||||||
ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
|
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.bzr")
|
||||||
SET(UPDATE_TYPE bzr)
|
set(UPDATE_TYPE bzr)
|
||||||
ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg")
|
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.hg")
|
||||||
SET(UPDATE_TYPE hg)
|
set(UPDATE_TYPE hg)
|
||||||
ELSEIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
|
elseif(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
|
||||||
SET(UPDATE_TYPE git)
|
set(UPDATE_TYPE git)
|
||||||
ENDIF()
|
endif()
|
||||||
ENDIF(NOT UPDATE_TYPE)
|
endif(NOT UPDATE_TYPE)
|
||||||
|
|
||||||
STRING(TOLOWER "${UPDATE_TYPE}" _update_type)
|
string(TOLOWER "${UPDATE_TYPE}" _update_type)
|
||||||
IF("${_update_type}" STREQUAL "cvs")
|
if("${_update_type}" STREQUAL "cvs")
|
||||||
SET(UPDATE_COMMAND "${CVSCOMMAND}")
|
set(UPDATE_COMMAND "${CVSCOMMAND}")
|
||||||
SET(UPDATE_OPTIONS "${CVS_UPDATE_OPTIONS}")
|
set(UPDATE_OPTIONS "${CVS_UPDATE_OPTIONS}")
|
||||||
ELSEIF("${_update_type}" STREQUAL "svn")
|
elseif("${_update_type}" STREQUAL "svn")
|
||||||
SET(UPDATE_COMMAND "${SVNCOMMAND}")
|
set(UPDATE_COMMAND "${SVNCOMMAND}")
|
||||||
SET(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}")
|
set(UPDATE_OPTIONS "${SVN_UPDATE_OPTIONS}")
|
||||||
ELSEIF("${_update_type}" STREQUAL "bzr")
|
elseif("${_update_type}" STREQUAL "bzr")
|
||||||
SET(UPDATE_COMMAND "${BZRCOMMAND}")
|
set(UPDATE_COMMAND "${BZRCOMMAND}")
|
||||||
SET(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}")
|
set(UPDATE_OPTIONS "${BZR_UPDATE_OPTIONS}")
|
||||||
ELSEIF("${_update_type}" STREQUAL "hg")
|
elseif("${_update_type}" STREQUAL "hg")
|
||||||
SET(UPDATE_COMMAND "${HGCOMMAND}")
|
set(UPDATE_COMMAND "${HGCOMMAND}")
|
||||||
SET(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}")
|
set(UPDATE_OPTIONS "${HG_UPDATE_OPTIONS}")
|
||||||
ELSEIF("${_update_type}" STREQUAL "git")
|
elseif("${_update_type}" STREQUAL "git")
|
||||||
SET(UPDATE_COMMAND "${GITCOMMAND}")
|
set(UPDATE_COMMAND "${GITCOMMAND}")
|
||||||
SET(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}")
|
set(UPDATE_OPTIONS "${GIT_UPDATE_OPTIONS}")
|
||||||
ENDIF()
|
endif()
|
||||||
|
|
||||||
SET(DART_TESTING_TIMEOUT 1500 CACHE STRING
|
set(DART_TESTING_TIMEOUT 1500 CACHE STRING
|
||||||
"Maximum time allowed before CTest will kill the test.")
|
"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.")
|
"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.")
|
"How many times to retry timed-out CTest submissions.")
|
||||||
|
|
||||||
FIND_PROGRAM(MEMORYCHECK_COMMAND
|
find_program(MEMORYCHECK_COMMAND
|
||||||
NAMES purify valgrind boundscheck
|
NAMES purify valgrind boundscheck
|
||||||
PATHS
|
PATHS
|
||||||
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Rational Software\\Purify\\Setup;InstallFolder]"
|
"[HKEY_LOCAL_MACHINE\\SOFTWARE\\Rational Software\\Purify\\Setup;InstallFolder]"
|
||||||
DOC "Path to the memory checking command, used for memory error detection."
|
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"
|
"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"
|
"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")
|
"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"
|
"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"
|
"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")
|
"Extra command line flags to pass to the coverage tool")
|
||||||
|
|
||||||
# set the site name
|
# set the site name
|
||||||
SITE_NAME(SITE)
|
site_name(SITE)
|
||||||
# set the build name
|
# set the build name
|
||||||
IF(NOT BUILDNAME)
|
if(NOT BUILDNAME)
|
||||||
SET(DART_COMPILER "${CMAKE_CXX_COMPILER}")
|
set(DART_COMPILER "${CMAKE_CXX_COMPILER}")
|
||||||
IF(NOT DART_COMPILER)
|
if(NOT DART_COMPILER)
|
||||||
SET(DART_COMPILER "${CMAKE_C_COMPILER}")
|
set(DART_COMPILER "${CMAKE_C_COMPILER}")
|
||||||
ENDIF(NOT DART_COMPILER)
|
endif(NOT DART_COMPILER)
|
||||||
IF(NOT DART_COMPILER)
|
if(NOT DART_COMPILER)
|
||||||
SET(DART_COMPILER "unknown")
|
set(DART_COMPILER "unknown")
|
||||||
ENDIF(NOT DART_COMPILER)
|
endif(NOT DART_COMPILER)
|
||||||
IF(WIN32)
|
if(WIN32)
|
||||||
SET(DART_NAME_COMPONENT "NAME_WE")
|
set(DART_NAME_COMPONENT "NAME_WE")
|
||||||
ELSE(WIN32)
|
else(WIN32)
|
||||||
SET(DART_NAME_COMPONENT "NAME")
|
set(DART_NAME_COMPONENT "NAME")
|
||||||
ENDIF(WIN32)
|
endif(WIN32)
|
||||||
IF(NOT BUILD_NAME_SYSTEM_NAME)
|
if(NOT BUILD_NAME_SYSTEM_NAME)
|
||||||
SET(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
|
set(BUILD_NAME_SYSTEM_NAME "${CMAKE_SYSTEM_NAME}")
|
||||||
ENDIF(NOT BUILD_NAME_SYSTEM_NAME)
|
endif(NOT BUILD_NAME_SYSTEM_NAME)
|
||||||
IF(WIN32)
|
if(WIN32)
|
||||||
SET(BUILD_NAME_SYSTEM_NAME "Win32")
|
set(BUILD_NAME_SYSTEM_NAME "Win32")
|
||||||
ENDIF(WIN32)
|
endif(WIN32)
|
||||||
IF(UNIX OR BORLAND)
|
if(UNIX OR BORLAND)
|
||||||
GET_FILENAME_COMPONENT(DART_CXX_NAME
|
get_filename_component(DART_CXX_NAME
|
||||||
"${CMAKE_CXX_COMPILER}" ${DART_NAME_COMPONENT})
|
"${CMAKE_CXX_COMPILER}" ${DART_NAME_COMPONENT})
|
||||||
ELSE(UNIX OR BORLAND)
|
else(UNIX OR BORLAND)
|
||||||
GET_FILENAME_COMPONENT(DART_CXX_NAME
|
get_filename_component(DART_CXX_NAME
|
||||||
"${CMAKE_BUILD_TOOL}" ${DART_NAME_COMPONENT})
|
"${CMAKE_BUILD_TOOL}" ${DART_NAME_COMPONENT})
|
||||||
ENDIF(UNIX OR BORLAND)
|
endif(UNIX OR BORLAND)
|
||||||
IF(DART_CXX_NAME MATCHES "msdev")
|
if(DART_CXX_NAME MATCHES "msdev")
|
||||||
SET(DART_CXX_NAME "vs60")
|
set(DART_CXX_NAME "vs60")
|
||||||
ENDIF(DART_CXX_NAME MATCHES "msdev")
|
endif(DART_CXX_NAME MATCHES "msdev")
|
||||||
IF(DART_CXX_NAME MATCHES "devenv")
|
if(DART_CXX_NAME MATCHES "devenv")
|
||||||
GET_VS_VERSION_STRING("${CMAKE_GENERATOR}" DART_CXX_NAME)
|
GET_VS_VERSION_STRING("${CMAKE_GENERATOR}" DART_CXX_NAME)
|
||||||
ENDIF(DART_CXX_NAME MATCHES "devenv")
|
endif(DART_CXX_NAME MATCHES "devenv")
|
||||||
SET(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}")
|
set(BUILDNAME "${BUILD_NAME_SYSTEM_NAME}-${DART_CXX_NAME}")
|
||||||
ENDIF(NOT BUILDNAME)
|
endif(NOT BUILDNAME)
|
||||||
|
|
||||||
# the build command
|
# the build command
|
||||||
BUILD_COMMAND(MAKECOMMAND_DEFAULT_VALUE
|
build_command(MAKECOMMAND_DEFAULT_VALUE
|
||||||
CONFIGURATION "\${CTEST_CONFIGURATION_TYPE}")
|
CONFIGURATION "\${CTEST_CONFIGURATION_TYPE}")
|
||||||
SET(MAKECOMMAND ${MAKECOMMAND_DEFAULT_VALUE}
|
set(MAKECOMMAND ${MAKECOMMAND_DEFAULT_VALUE}
|
||||||
CACHE STRING "Command to build the project")
|
CACHE STRING "Command to build the project")
|
||||||
|
|
||||||
# the default build configuration the ctest build handler will use
|
# the default build configuration the ctest build handler will use
|
||||||
# if there is no -C arg given to ctest:
|
# if there is no -C arg given to ctest:
|
||||||
SET(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
|
set(DEFAULT_CTEST_CONFIGURATION_TYPE "$ENV{CMAKE_CONFIG_TYPE}")
|
||||||
IF(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
|
if(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
|
||||||
SET(DEFAULT_CTEST_CONFIGURATION_TYPE "Release")
|
set(DEFAULT_CTEST_CONFIGURATION_TYPE "Release")
|
||||||
ENDIF(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
|
endif(DEFAULT_CTEST_CONFIGURATION_TYPE STREQUAL "")
|
||||||
|
|
||||||
IF(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
|
if(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
|
||||||
SET(CTEST_USE_LAUNCHERS 0)
|
set(CTEST_USE_LAUNCHERS 0)
|
||||||
ENDIF(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
|
endif(NOT "${CMAKE_GENERATOR}" MATCHES "Make")
|
||||||
IF(CTEST_USE_LAUNCHERS)
|
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_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_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(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_COMPILE "${CTEST_LAUNCH_COMPILE}")
|
||||||
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}")
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK "${CTEST_LAUNCH_LINK}")
|
||||||
SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}")
|
set_property(GLOBAL PROPERTY RULE_LAUNCH_CUSTOM "${CTEST_LAUNCH_CUSTOM}")
|
||||||
ENDIF(CTEST_USE_LAUNCHERS)
|
endif(CTEST_USE_LAUNCHERS)
|
||||||
|
|
||||||
MARK_AS_ADVANCED(
|
mark_as_advanced(
|
||||||
BZRCOMMAND
|
BZRCOMMAND
|
||||||
BZR_UPDATE_OPTIONS
|
BZR_UPDATE_OPTIONS
|
||||||
COVERAGE_COMMAND
|
COVERAGE_COMMAND
|
||||||
|
@ -278,9 +278,9 @@ IF(BUILD_TESTING)
|
||||||
SVNCOMMAND
|
SVNCOMMAND
|
||||||
SVN_UPDATE_OPTIONS
|
SVN_UPDATE_OPTIONS
|
||||||
)
|
)
|
||||||
IF(NOT RUN_FROM_DART)
|
if(NOT RUN_FROM_DART)
|
||||||
SET(RUN_FROM_CTEST_OR_DART 1)
|
set(RUN_FROM_CTEST_OR_DART 1)
|
||||||
INCLUDE(CTestTargets)
|
include(CTestTargets)
|
||||||
SET(RUN_FROM_CTEST_OR_DART)
|
set(RUN_FROM_CTEST_OR_DART)
|
||||||
ENDIF(NOT RUN_FROM_DART)
|
endif(NOT RUN_FROM_DART)
|
||||||
ENDIF(BUILD_TESTING)
|
endif(BUILD_TESTING)
|
||||||
|
|
|
@ -12,29 +12,29 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
IF(NOT RUN_FROM_CTEST_OR_DART)
|
if(NOT RUN_FROM_CTEST_OR_DART)
|
||||||
MESSAGE(FATAL_ERROR "Do not incldue CTestTargets.cmake directly")
|
message(FATAL_ERROR "Do not incldue CTestTargets.cmake directly")
|
||||||
ENDIF(NOT RUN_FROM_CTEST_OR_DART)
|
endif(NOT RUN_FROM_CTEST_OR_DART)
|
||||||
|
|
||||||
# make directories in the binary tree
|
# make directories in the binary tree
|
||||||
FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary)
|
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/Testing/Temporary)
|
||||||
GET_FILENAME_COMPONENT(CMAKE_HOST_PATH ${CMAKE_COMMAND} PATH)
|
get_filename_component(CMAKE_HOST_PATH ${CMAKE_COMMAND} PATH)
|
||||||
SET(CMAKE_TARGET_PATH ${EXECUTABLE_OUTPUT_PATH})
|
set(CMAKE_TARGET_PATH ${EXECUTABLE_OUTPUT_PATH})
|
||||||
FIND_PROGRAM(CMAKE_CTEST_COMMAND ctest ${CMAKE_HOST_PATH} ${CMAKE_TARGET_PATH})
|
find_program(CMAKE_CTEST_COMMAND ctest ${CMAKE_HOST_PATH} ${CMAKE_TARGET_PATH})
|
||||||
MARK_AS_ADVANCED(CMAKE_CTEST_COMMAND)
|
mark_as_advanced(CMAKE_CTEST_COMMAND)
|
||||||
|
|
||||||
# Use CTest
|
# Use CTest
|
||||||
# configure files
|
# configure files
|
||||||
|
|
||||||
IF(CTEST_NEW_FORMAT)
|
if(CTEST_NEW_FORMAT)
|
||||||
CONFIGURE_FILE(
|
configure_file(
|
||||||
${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
|
${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
|
||||||
${PROJECT_BINARY_DIR}/CTestConfiguration.ini )
|
${PROJECT_BINARY_DIR}/CTestConfiguration.ini )
|
||||||
ELSE(CTEST_NEW_FORMAT)
|
else(CTEST_NEW_FORMAT)
|
||||||
CONFIGURE_FILE(
|
configure_file(
|
||||||
${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
|
${CMAKE_ROOT}/Modules/DartConfiguration.tcl.in
|
||||||
${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
|
${PROJECT_BINARY_DIR}/DartConfiguration.tcl )
|
||||||
ENDIF(CTEST_NEW_FORMAT)
|
endif(CTEST_NEW_FORMAT)
|
||||||
|
|
||||||
#
|
#
|
||||||
# Section 3:
|
# Section 3:
|
||||||
|
@ -43,53 +43,53 @@ ENDIF(CTEST_NEW_FORMAT)
|
||||||
# These should NOT need to be modified from project to project.
|
# These should NOT need to be modified from project to project.
|
||||||
#
|
#
|
||||||
|
|
||||||
SET(__conf_types "")
|
set(__conf_types "")
|
||||||
IF(CMAKE_CONFIGURATION_TYPES)
|
if(CMAKE_CONFIGURATION_TYPES)
|
||||||
# We need to pass the configuration type on the test command line.
|
# We need to pass the configuration type on the test command line.
|
||||||
SET(__conf_types -C "${CMAKE_CFG_INTDIR}")
|
set(__conf_types -C "${CMAKE_CFG_INTDIR}")
|
||||||
ENDIF(CMAKE_CONFIGURATION_TYPES)
|
endif(CMAKE_CONFIGURATION_TYPES)
|
||||||
|
|
||||||
# Add convenience targets. Do this at most once in case of nested
|
# Add convenience targets. Do this at most once in case of nested
|
||||||
# projects.
|
# projects.
|
||||||
DEFINE_PROPERTY(GLOBAL PROPERTY CTEST_TARGETS_ADDED
|
define_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED
|
||||||
BRIEF_DOCS "Internal property used by CTestTargets module."
|
BRIEF_DOCS "Internal property used by CTestTargets module."
|
||||||
FULL_DOCS "Set by the CTestTargets module to track addition of testing targets."
|
FULL_DOCS "Set by the CTestTargets module to track addition of testing targets."
|
||||||
)
|
)
|
||||||
GET_PROPERTY(_CTEST_TARGETS_ADDED GLOBAL PROPERTY CTEST_TARGETS_ADDED)
|
get_property(_CTEST_TARGETS_ADDED GLOBAL PROPERTY CTEST_TARGETS_ADDED)
|
||||||
IF(NOT _CTEST_TARGETS_ADDED)
|
if(NOT _CTEST_TARGETS_ADDED)
|
||||||
SET_PROPERTY(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
|
set_property(GLOBAL PROPERTY CTEST_TARGETS_ADDED 1)
|
||||||
|
|
||||||
# For all generators add basic testing targets.
|
# For all generators add basic testing targets.
|
||||||
FOREACH(mode Experimental Nightly Continuous NightlyMemoryCheck)
|
foreach(mode Experimental Nightly Continuous NightlyMemoryCheck)
|
||||||
ADD_CUSTOM_TARGET(${mode}
|
add_custom_target(${mode}
|
||||||
${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}
|
${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${mode}
|
||||||
)
|
)
|
||||||
SET_PROPERTY(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "")
|
set_property(TARGET ${mode} PROPERTY RULE_LAUNCH_CUSTOM "")
|
||||||
SET_PROPERTY(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets")
|
set_property(TARGET ${mode} PROPERTY FOLDER "CTestDashboardTargets")
|
||||||
ENDFOREACH(mode)
|
endforeach(mode)
|
||||||
|
|
||||||
# For Makefile generators add more granular targets.
|
# For Makefile generators add more granular targets.
|
||||||
IF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
|
if("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
|
||||||
# Make targets for Experimental builds
|
# Make targets for Experimental builds
|
||||||
FOREACH(mode Nightly Experimental Continuous)
|
foreach(mode Nightly Experimental Continuous)
|
||||||
FOREACH(testtype
|
foreach(testtype
|
||||||
Start Update Configure Build Test Coverage MemCheck Submit
|
Start Update Configure Build Test Coverage MemCheck Submit
|
||||||
# missing purify
|
# missing purify
|
||||||
)
|
)
|
||||||
ADD_CUSTOM_TARGET(${mode}${testtype}
|
add_custom_target(${mode}${testtype}
|
||||||
${CMAKE_CTEST_COMMAND} ${__conf_types} -D ${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 RULE_LAUNCH_CUSTOM "")
|
||||||
SET_PROPERTY(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets")
|
set_property(TARGET ${mode}${testtype} PROPERTY FOLDER "CTestDashboardTargets")
|
||||||
ENDFOREACH(testtype)
|
endforeach(testtype)
|
||||||
ENDFOREACH(mode)
|
endforeach(mode)
|
||||||
ENDIF("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
|
endif("${CMAKE_GENERATOR}" MATCHES "(Ninja|Make)")
|
||||||
|
|
||||||
# If requested, add an alias that is the equivalent of the built-in "test"
|
# If requested, add an alias that is the equivalent of the built-in "test"
|
||||||
# or "RUN_TESTS" target:
|
# or "RUN_TESTS" target:
|
||||||
IF(CTEST_TEST_TARGET_ALIAS)
|
if(CTEST_TEST_TARGET_ALIAS)
|
||||||
ADD_CUSTOM_TARGET(${CTEST_TEST_TARGET_ALIAS}
|
add_custom_target(${CTEST_TEST_TARGET_ALIAS}
|
||||||
${CMAKE_CTEST_COMMAND} ${__conf_types}
|
${CMAKE_CTEST_COMMAND} ${__conf_types}
|
||||||
)
|
)
|
||||||
ENDIF()
|
endif()
|
||||||
ENDIF(NOT _CTEST_TARGETS_ADDED)
|
endif(NOT _CTEST_TARGETS_ADDED)
|
||||||
|
|
|
@ -21,11 +21,11 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
INCLUDE(CheckCSourceCompiles)
|
include(CheckCSourceCompiles)
|
||||||
|
|
||||||
MACRO (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
|
macro (CHECK_C_COMPILER_FLAG _FLAG _RESULT)
|
||||||
SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
|
set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
|
||||||
SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
|
set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
|
||||||
CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT}
|
CHECK_C_SOURCE_COMPILES("int main(void) { return 0; }" ${_RESULT}
|
||||||
# Some compilers do not fail with a bad flag
|
# Some compilers do not fail with a bad flag
|
||||||
FAIL_REGEX "command line option .* is valid for .* but not for C" # GNU
|
FAIL_REGEX "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 "command option .* is not recognized" # XL
|
||||||
FAIL_REGEX "WARNING: unknown flag:" # Open64
|
FAIL_REGEX "WARNING: unknown flag:" # Open64
|
||||||
)
|
)
|
||||||
SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
|
set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
|
||||||
ENDMACRO (CHECK_C_COMPILER_FLAG)
|
endmacro (CHECK_C_COMPILER_FLAG)
|
||||||
|
|
|
@ -24,43 +24,43 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
|
||||||
|
|
||||||
|
|
||||||
MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
|
macro(CHECK_C_SOURCE_COMPILES SOURCE VAR)
|
||||||
IF("${VAR}" MATCHES "^${VAR}$")
|
if("${VAR}" MATCHES "^${VAR}$")
|
||||||
SET(_FAIL_REGEX)
|
set(_FAIL_REGEX)
|
||||||
SET(_key)
|
set(_key)
|
||||||
FOREACH(arg ${ARGN})
|
foreach(arg ${ARGN})
|
||||||
IF("${arg}" MATCHES "^(FAIL_REGEX)$")
|
if("${arg}" MATCHES "^(FAIL_REGEX)$")
|
||||||
SET(_key "${arg}")
|
set(_key "${arg}")
|
||||||
ELSEIF(_key)
|
elseif(_key)
|
||||||
LIST(APPEND _${_key} "${arg}")
|
list(APPEND _${_key} "${arg}")
|
||||||
ELSE()
|
else()
|
||||||
MESSAGE(FATAL_ERROR "Unknown argument:\n ${arg}\n")
|
message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
|
||||||
ENDIF()
|
endif()
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
|
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||||
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
||||||
IF(CMAKE_REQUIRED_LIBRARIES)
|
if(CMAKE_REQUIRED_LIBRARIES)
|
||||||
# this one translates potentially used imported library targets to their files on disk
|
# 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}")
|
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}")
|
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
|
||||||
ELSE(CMAKE_REQUIRED_LIBRARIES)
|
else(CMAKE_REQUIRED_LIBRARIES)
|
||||||
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
|
set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
|
||||||
ENDIF(CMAKE_REQUIRED_LIBRARIES)
|
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||||
IF(CMAKE_REQUIRED_INCLUDES)
|
if(CMAKE_REQUIRED_INCLUDES)
|
||||||
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
|
set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
|
||||||
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
||||||
ELSE(CMAKE_REQUIRED_INCLUDES)
|
else(CMAKE_REQUIRED_INCLUDES)
|
||||||
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
|
set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
|
||||||
ENDIF(CMAKE_REQUIRED_INCLUDES)
|
endif(CMAKE_REQUIRED_INCLUDES)
|
||||||
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
|
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
|
||||||
"${SOURCE}\n")
|
"${SOURCE}\n")
|
||||||
|
|
||||||
MESSAGE(STATUS "Performing Test ${VAR}")
|
message(STATUS "Performing Test ${VAR}")
|
||||||
TRY_COMPILE(${VAR}
|
try_compile(${VAR}
|
||||||
${CMAKE_BINARY_DIR}
|
${CMAKE_BINARY_DIR}
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
|
||||||
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
||||||
|
@ -69,27 +69,27 @@ MACRO(CHECK_C_SOURCE_COMPILES SOURCE VAR)
|
||||||
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
|
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
|
||||||
OUTPUT_VARIABLE OUTPUT)
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
|
|
||||||
FOREACH(_regex ${_FAIL_REGEX})
|
foreach(_regex ${_FAIL_REGEX})
|
||||||
IF("${OUTPUT}" MATCHES "${_regex}")
|
if("${OUTPUT}" MATCHES "${_regex}")
|
||||||
SET(${VAR} 0)
|
set(${VAR} 0)
|
||||||
ENDIF()
|
endif()
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
|
|
||||||
IF(${VAR})
|
if(${VAR})
|
||||||
SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
|
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
|
||||||
MESSAGE(STATUS "Performing Test ${VAR} - Success")
|
message(STATUS "Performing Test ${VAR} - Success")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
|
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
|
||||||
"${OUTPUT}\n"
|
"${OUTPUT}\n"
|
||||||
"Source file was:\n${SOURCE}\n")
|
"Source file was:\n${SOURCE}\n")
|
||||||
ELSE(${VAR})
|
else(${VAR})
|
||||||
MESSAGE(STATUS "Performing Test ${VAR} - Failed")
|
message(STATUS "Performing Test ${VAR} - Failed")
|
||||||
SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
|
set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
|
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
|
||||||
"${OUTPUT}\n"
|
"${OUTPUT}\n"
|
||||||
"Source file was:\n${SOURCE}\n")
|
"Source file was:\n${SOURCE}\n")
|
||||||
ENDIF(${VAR})
|
endif(${VAR})
|
||||||
ENDIF("${VAR}" MATCHES "^${VAR}$")
|
endif("${VAR}" MATCHES "^${VAR}$")
|
||||||
ENDMACRO(CHECK_C_SOURCE_COMPILES)
|
endmacro(CHECK_C_SOURCE_COMPILES)
|
||||||
|
|
||||||
|
|
|
@ -24,32 +24,32 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
|
||||||
|
|
||||||
|
|
||||||
MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
|
macro(CHECK_C_SOURCE_RUNS SOURCE VAR)
|
||||||
IF("${VAR}" MATCHES "^${VAR}$")
|
if("${VAR}" MATCHES "^${VAR}$")
|
||||||
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
|
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||||
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
||||||
IF(CMAKE_REQUIRED_LIBRARIES)
|
if(CMAKE_REQUIRED_LIBRARIES)
|
||||||
# this one translates potentially used imported library targets to their files on disk
|
# 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}")
|
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}")
|
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
|
||||||
ELSE(CMAKE_REQUIRED_LIBRARIES)
|
else(CMAKE_REQUIRED_LIBRARIES)
|
||||||
SET(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
|
set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES)
|
||||||
ENDIF(CMAKE_REQUIRED_LIBRARIES)
|
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||||
IF(CMAKE_REQUIRED_INCLUDES)
|
if(CMAKE_REQUIRED_INCLUDES)
|
||||||
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
|
set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES
|
||||||
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
||||||
ELSE(CMAKE_REQUIRED_INCLUDES)
|
else(CMAKE_REQUIRED_INCLUDES)
|
||||||
SET(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
|
set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES)
|
||||||
ENDIF(CMAKE_REQUIRED_INCLUDES)
|
endif(CMAKE_REQUIRED_INCLUDES)
|
||||||
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
|
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c"
|
||||||
"${SOURCE}\n")
|
"${SOURCE}\n")
|
||||||
|
|
||||||
MESSAGE(STATUS "Performing Test ${VAR}")
|
message(STATUS "Performing Test ${VAR}")
|
||||||
TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
|
try_run(${VAR}_EXITCODE ${VAR}_COMPILED
|
||||||
${CMAKE_BINARY_DIR}
|
${CMAKE_BINARY_DIR}
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c
|
||||||
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
||||||
|
@ -59,33 +59,33 @@ MACRO(CHECK_C_SOURCE_RUNS SOURCE VAR)
|
||||||
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
|
"${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}"
|
||||||
COMPILE_OUTPUT_VARIABLE OUTPUT)
|
COMPILE_OUTPUT_VARIABLE OUTPUT)
|
||||||
# if it did not compile make the return value fail code of 1
|
# if it did not compile make the return value fail code of 1
|
||||||
IF(NOT ${VAR}_COMPILED)
|
if(NOT ${VAR}_COMPILED)
|
||||||
SET(${VAR}_EXITCODE 1)
|
set(${VAR}_EXITCODE 1)
|
||||||
ENDIF(NOT ${VAR}_COMPILED)
|
endif(NOT ${VAR}_COMPILED)
|
||||||
# if the return value was 0 then it worked
|
# if the return value was 0 then it worked
|
||||||
IF("${${VAR}_EXITCODE}" EQUAL 0)
|
if("${${VAR}_EXITCODE}" EQUAL 0)
|
||||||
SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
|
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
|
||||||
MESSAGE(STATUS "Performing Test ${VAR} - Success")
|
message(STATUS "Performing Test ${VAR} - Success")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
|
"Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n"
|
||||||
"${OUTPUT}\n"
|
"${OUTPUT}\n"
|
||||||
"Return value: ${${VAR}}\n"
|
"Return value: ${${VAR}}\n"
|
||||||
"Source file was:\n${SOURCE}\n")
|
"Source file was:\n${SOURCE}\n")
|
||||||
ELSE("${${VAR}_EXITCODE}" EQUAL 0)
|
else("${${VAR}_EXITCODE}" EQUAL 0)
|
||||||
IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
||||||
SET(${VAR} "${${VAR}_EXITCODE}")
|
set(${VAR} "${${VAR}_EXITCODE}")
|
||||||
ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
||||||
SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
|
set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
|
||||||
ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
||||||
|
|
||||||
MESSAGE(STATUS "Performing Test ${VAR} - Failed")
|
message(STATUS "Performing Test ${VAR} - Failed")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
|
"Performing C SOURCE FILE Test ${VAR} failed with the following output:\n"
|
||||||
"${OUTPUT}\n"
|
"${OUTPUT}\n"
|
||||||
"Return value: ${${VAR}_EXITCODE}\n"
|
"Return value: ${${VAR}_EXITCODE}\n"
|
||||||
"Source file was:\n${SOURCE}\n")
|
"Source file was:\n${SOURCE}\n")
|
||||||
|
|
||||||
ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
|
endif("${${VAR}_EXITCODE}" EQUAL 0)
|
||||||
ENDIF("${VAR}" MATCHES "^${VAR}$")
|
endif("${VAR}" MATCHES "^${VAR}$")
|
||||||
ENDMACRO(CHECK_C_SOURCE_RUNS)
|
endmacro(CHECK_C_SOURCE_RUNS)
|
||||||
|
|
||||||
|
|
|
@ -21,11 +21,11 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
INCLUDE(CheckCXXSourceCompiles)
|
include(CheckCXXSourceCompiles)
|
||||||
|
|
||||||
MACRO (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
|
macro (CHECK_CXX_COMPILER_FLAG _FLAG _RESULT)
|
||||||
SET(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
|
set(SAFE_CMAKE_REQUIRED_DEFINITIONS "${CMAKE_REQUIRED_DEFINITIONS}")
|
||||||
SET(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
|
set(CMAKE_REQUIRED_DEFINITIONS "${_FLAG}")
|
||||||
CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}
|
CHECK_CXX_SOURCE_COMPILES("int main() { return 0;}" ${_RESULT}
|
||||||
# Some compilers do not fail with a bad flag
|
# Some compilers do not fail with a bad flag
|
||||||
FAIL_REGEX "command line option .* is valid for .* but not for C\\\\+\\\\+" # GNU
|
FAIL_REGEX "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 "File with unknown suffix passed to linker" # PGI
|
||||||
FAIL_REGEX "WARNING: unknown flag:" # Open64
|
FAIL_REGEX "WARNING: unknown flag:" # Open64
|
||||||
)
|
)
|
||||||
SET (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
|
set (CMAKE_REQUIRED_DEFINITIONS "${SAFE_CMAKE_REQUIRED_DEFINITIONS}")
|
||||||
ENDMACRO (CHECK_CXX_COMPILER_FLAG)
|
endmacro (CHECK_CXX_COMPILER_FLAG)
|
||||||
|
|
||||||
|
|
|
@ -24,44 +24,44 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
|
||||||
|
|
||||||
|
|
||||||
MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
|
macro(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
|
||||||
IF("${VAR}" MATCHES "^${VAR}$")
|
if("${VAR}" MATCHES "^${VAR}$")
|
||||||
SET(_FAIL_REGEX)
|
set(_FAIL_REGEX)
|
||||||
SET(_key)
|
set(_key)
|
||||||
FOREACH(arg ${ARGN})
|
foreach(arg ${ARGN})
|
||||||
IF("${arg}" MATCHES "^(FAIL_REGEX)$")
|
if("${arg}" MATCHES "^(FAIL_REGEX)$")
|
||||||
SET(_key "${arg}")
|
set(_key "${arg}")
|
||||||
ELSEIF(_key)
|
elseif(_key)
|
||||||
LIST(APPEND _${_key} "${arg}")
|
list(APPEND _${_key} "${arg}")
|
||||||
ELSE()
|
else()
|
||||||
MESSAGE(FATAL_ERROR "Unknown argument:\n ${arg}\n")
|
message(FATAL_ERROR "Unknown argument:\n ${arg}\n")
|
||||||
ENDIF()
|
endif()
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
|
|
||||||
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
|
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||||
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
||||||
IF(CMAKE_REQUIRED_LIBRARIES)
|
if(CMAKE_REQUIRED_LIBRARIES)
|
||||||
# this one translates potentially used imported library targets to their files on disk
|
# 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}")
|
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
|
||||||
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
|
set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
|
||||||
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
|
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
|
||||||
ELSE(CMAKE_REQUIRED_LIBRARIES)
|
else(CMAKE_REQUIRED_LIBRARIES)
|
||||||
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
|
set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
|
||||||
ENDIF(CMAKE_REQUIRED_LIBRARIES)
|
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||||
IF(CMAKE_REQUIRED_INCLUDES)
|
if(CMAKE_REQUIRED_INCLUDES)
|
||||||
SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
|
set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
|
||||||
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
||||||
ELSE(CMAKE_REQUIRED_INCLUDES)
|
else(CMAKE_REQUIRED_INCLUDES)
|
||||||
SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
|
set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
|
||||||
ENDIF(CMAKE_REQUIRED_INCLUDES)
|
endif(CMAKE_REQUIRED_INCLUDES)
|
||||||
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
|
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
|
||||||
"${SOURCE}\n")
|
"${SOURCE}\n")
|
||||||
|
|
||||||
MESSAGE(STATUS "Performing Test ${VAR}")
|
message(STATUS "Performing Test ${VAR}")
|
||||||
TRY_COMPILE(${VAR}
|
try_compile(${VAR}
|
||||||
${CMAKE_BINARY_DIR}
|
${CMAKE_BINARY_DIR}
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
|
||||||
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
||||||
|
@ -70,27 +70,27 @@ MACRO(CHECK_CXX_SOURCE_COMPILES SOURCE VAR)
|
||||||
"${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
|
"${CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES}"
|
||||||
OUTPUT_VARIABLE OUTPUT)
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
|
|
||||||
FOREACH(_regex ${_FAIL_REGEX})
|
foreach(_regex ${_FAIL_REGEX})
|
||||||
IF("${OUTPUT}" MATCHES "${_regex}")
|
if("${OUTPUT}" MATCHES "${_regex}")
|
||||||
SET(${VAR} 0)
|
set(${VAR} 0)
|
||||||
ENDIF()
|
endif()
|
||||||
ENDFOREACH()
|
endforeach()
|
||||||
|
|
||||||
IF(${VAR})
|
if(${VAR})
|
||||||
SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
|
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
|
||||||
MESSAGE(STATUS "Performing Test ${VAR} - Success")
|
message(STATUS "Performing Test ${VAR} - Success")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
|
"Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
|
||||||
"${OUTPUT}\n"
|
"${OUTPUT}\n"
|
||||||
"Source file was:\n${SOURCE}\n")
|
"Source file was:\n${SOURCE}\n")
|
||||||
ELSE(${VAR})
|
else(${VAR})
|
||||||
MESSAGE(STATUS "Performing Test ${VAR} - Failed")
|
message(STATUS "Performing Test ${VAR} - Failed")
|
||||||
SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
|
set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
|
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
|
||||||
"${OUTPUT}\n"
|
"${OUTPUT}\n"
|
||||||
"Source file was:\n${SOURCE}\n")
|
"Source file was:\n${SOURCE}\n")
|
||||||
ENDIF(${VAR})
|
endif(${VAR})
|
||||||
ENDIF("${VAR}" MATCHES "^${VAR}$")
|
endif("${VAR}" MATCHES "^${VAR}$")
|
||||||
ENDMACRO(CHECK_CXX_SOURCE_COMPILES)
|
endmacro(CHECK_CXX_SOURCE_COMPILES)
|
||||||
|
|
||||||
|
|
|
@ -24,32 +24,32 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
|
||||||
|
|
||||||
|
|
||||||
MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
|
macro(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
|
||||||
IF("${VAR}" MATCHES "^${VAR}$")
|
if("${VAR}" MATCHES "^${VAR}$")
|
||||||
SET(MACRO_CHECK_FUNCTION_DEFINITIONS
|
set(MACRO_CHECK_FUNCTION_DEFINITIONS
|
||||||
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
"-D${VAR} ${CMAKE_REQUIRED_FLAGS}")
|
||||||
IF(CMAKE_REQUIRED_LIBRARIES)
|
if(CMAKE_REQUIRED_LIBRARIES)
|
||||||
# this one translates potentially used imported library targets to their files on disk
|
# 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}")
|
CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}")
|
||||||
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
|
set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES
|
||||||
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
|
"-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}")
|
||||||
ELSE(CMAKE_REQUIRED_LIBRARIES)
|
else(CMAKE_REQUIRED_LIBRARIES)
|
||||||
SET(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
|
set(CHECK_CXX_SOURCE_COMPILES_ADD_LIBRARIES)
|
||||||
ENDIF(CMAKE_REQUIRED_LIBRARIES)
|
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||||
IF(CMAKE_REQUIRED_INCLUDES)
|
if(CMAKE_REQUIRED_INCLUDES)
|
||||||
SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
|
set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES
|
||||||
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
"-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}")
|
||||||
ELSE(CMAKE_REQUIRED_INCLUDES)
|
else(CMAKE_REQUIRED_INCLUDES)
|
||||||
SET(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
|
set(CHECK_CXX_SOURCE_COMPILES_ADD_INCLUDES)
|
||||||
ENDIF(CMAKE_REQUIRED_INCLUDES)
|
endif(CMAKE_REQUIRED_INCLUDES)
|
||||||
FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
|
file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx"
|
||||||
"${SOURCE}\n")
|
"${SOURCE}\n")
|
||||||
|
|
||||||
MESSAGE(STATUS "Performing Test ${VAR}")
|
message(STATUS "Performing Test ${VAR}")
|
||||||
TRY_RUN(${VAR}_EXITCODE ${VAR}_COMPILED
|
try_run(${VAR}_EXITCODE ${VAR}_COMPILED
|
||||||
${CMAKE_BINARY_DIR}
|
${CMAKE_BINARY_DIR}
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.cxx
|
||||||
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS}
|
||||||
|
@ -60,32 +60,32 @@ MACRO(CHECK_CXX_SOURCE_RUNS SOURCE VAR)
|
||||||
COMPILE_OUTPUT_VARIABLE OUTPUT)
|
COMPILE_OUTPUT_VARIABLE OUTPUT)
|
||||||
|
|
||||||
# if it did not compile make the return value fail code of 1
|
# if it did not compile make the return value fail code of 1
|
||||||
IF(NOT ${VAR}_COMPILED)
|
if(NOT ${VAR}_COMPILED)
|
||||||
SET(${VAR}_EXITCODE 1)
|
set(${VAR}_EXITCODE 1)
|
||||||
ENDIF(NOT ${VAR}_COMPILED)
|
endif(NOT ${VAR}_COMPILED)
|
||||||
# if the return value was 0 then it worked
|
# if the return value was 0 then it worked
|
||||||
IF("${${VAR}_EXITCODE}" EQUAL 0)
|
if("${${VAR}_EXITCODE}" EQUAL 0)
|
||||||
SET(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
|
set(${VAR} 1 CACHE INTERNAL "Test ${VAR}")
|
||||||
MESSAGE(STATUS "Performing Test ${VAR} - Success")
|
message(STATUS "Performing Test ${VAR} - Success")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||||
"Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
|
"Performing C++ SOURCE FILE Test ${VAR} succeded with the following output:\n"
|
||||||
"${OUTPUT}\n"
|
"${OUTPUT}\n"
|
||||||
"Return value: ${${VAR}}\n"
|
"Return value: ${${VAR}}\n"
|
||||||
"Source file was:\n${SOURCE}\n")
|
"Source file was:\n${SOURCE}\n")
|
||||||
ELSE("${${VAR}_EXITCODE}" EQUAL 0)
|
else("${${VAR}_EXITCODE}" EQUAL 0)
|
||||||
IF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
||||||
SET(${VAR} "${${VAR}_EXITCODE}")
|
set(${VAR} "${${VAR}_EXITCODE}")
|
||||||
ELSE(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
else(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
||||||
SET(${VAR} "" CACHE INTERNAL "Test ${VAR}")
|
set(${VAR} "" CACHE INTERNAL "Test ${VAR}")
|
||||||
ENDIF(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
endif(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN")
|
||||||
|
|
||||||
MESSAGE(STATUS "Performing Test ${VAR} - Failed")
|
message(STATUS "Performing Test ${VAR} - Failed")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log
|
||||||
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
|
"Performing C++ SOURCE FILE Test ${VAR} failed with the following output:\n"
|
||||||
"${OUTPUT}\n"
|
"${OUTPUT}\n"
|
||||||
"Return value: ${${VAR}_EXITCODE}\n"
|
"Return value: ${${VAR}_EXITCODE}\n"
|
||||||
"Source file was:\n${SOURCE}\n")
|
"Source file was:\n${SOURCE}\n")
|
||||||
ENDIF("${${VAR}_EXITCODE}" EQUAL 0)
|
endif("${${VAR}_EXITCODE}" EQUAL 0)
|
||||||
ENDIF("${VAR}" MATCHES "^${VAR}$")
|
endif("${VAR}" MATCHES "^${VAR}$")
|
||||||
ENDMACRO(CHECK_CXX_SOURCE_RUNS)
|
endmacro(CHECK_CXX_SOURCE_RUNS)
|
||||||
|
|
||||||
|
|
|
@ -35,8 +35,8 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
INCLUDE(CheckSymbolExists)
|
include(CheckSymbolExists)
|
||||||
|
|
||||||
MACRO(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
|
macro(CHECK_CXX_SYMBOL_EXISTS SYMBOL FILES VARIABLE)
|
||||||
_CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
|
_CHECK_SYMBOL_EXISTS("${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/CheckSymbolExists.cxx" "${SYMBOL}" "${FILES}" "${VARIABLE}" )
|
||||||
ENDMACRO(CHECK_CXX_SYMBOL_EXISTS)
|
endmacro(CHECK_CXX_SYMBOL_EXISTS)
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
INCLUDE("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
|
include("${CMAKE_CURRENT_LIST_DIR}/CMakeExpandImportedTargets.cmake")
|
||||||
|
|
||||||
|
|
||||||
macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
|
macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
|
||||||
|
@ -36,7 +36,7 @@ macro(CHECK_FORTRAN_FUNCTION_EXISTS FUNCTION VARIABLE)
|
||||||
else(CMAKE_REQUIRED_LIBRARIES)
|
else(CMAKE_REQUIRED_LIBRARIES)
|
||||||
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
|
set(CHECK_FUNCTION_EXISTS_ADD_LIBRARIES)
|
||||||
endif(CMAKE_REQUIRED_LIBRARIES)
|
endif(CMAKE_REQUIRED_LIBRARIES)
|
||||||
FILE(WRITE
|
file(WRITE
|
||||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
|
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/testFortranCompiler.f
|
||||||
"
|
"
|
||||||
program TESTFortran
|
program TESTFortran
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue