Commit dc1d2189 authored by Brad King's avatar Brad King

CMake 2.8.1-rc1

parent 612409e5
......@@ -20,6 +20,8 @@ MARK_AS_ADVANCED(CMAKE_BACKWARDS_COMPATIBILITY)
# Allow empty endif() and such with CMake 2.4.
SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS 1)
SET(CMake_BIN_DIR ${CMake_BINARY_DIR}/bin)
IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
# Since the built CMake will install itself instead of the
# generating CMake, tell it that the install rules were generated
......@@ -27,6 +29,17 @@ IF(NOT ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 2.4)
INSTALL(CODE "SET(CMAKE_INSTALL_SELF_2_4 1)")
ENDIF()
IF("${CMake_SOURCE_DIR}" STREQUAL "${CMAKE_SOURCE_DIR}")
# Disallow architecture-specific try_run. It may not run on the host.
MACRO(TRY_RUN)
IF(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
MESSAGE(FATAL_ERROR "TRY_RUN not allowed with CMAKE_TRY_COMPILE_OSX_ARCHITECTURES=[${CMAKE_TRY_COMPILE_OSX_ARCHITECTURES}]")
ELSE()
_TRY_RUN(${ARGV})
ENDIF()
ENDMACRO()
ENDIF()
#-----------------------------------------------------------------------
# a macro to deal with system libraries, implemented as a macro
# simply to improve readability of the main script
......@@ -139,9 +152,9 @@ MACRO(CMAKE_SETUP_TESTING)
# the ctest from this cmake is used for testing
# and not the ctest from the cmake building and testing
# cmake.
SET(CMAKE_CTEST_COMMAND "${EXECUTABLE_OUTPUT_PATH}/ctest")
SET(CMAKE_CMAKE_COMMAND "${EXECUTABLE_OUTPUT_PATH}/cmake")
SET(CMAKE_CPACK_COMMAND "${EXECUTABLE_OUTPUT_PATH}/cpack")
SET(CMAKE_CTEST_COMMAND "${CMake_BIN_DIR}/ctest")
SET(CMAKE_CMAKE_COMMAND "${CMake_BIN_DIR}/cmake")
SET(CMAKE_CPACK_COMMAND "${CMake_BIN_DIR}/cpack")
ENDIF(BUILD_TESTING)
# configure some files for testing
......@@ -183,7 +196,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
SET(KWSYS_USE_CommandLineArguments 1)
SET(KWSYS_HEADER_ROOT ${CMake_BINARY_DIR}/Source)
SET(KWSYS_INSTALL_DOC_DIR "${CMake_DOC_DEST}")
SUBDIRS(Source/kwsys)
ADD_SUBDIRECTORY(Source/kwsys)
#---------------------------------------------------------------------
# Setup third-party libraries.
......@@ -212,7 +225,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
ELSE(CMAKE_USE_SYSTEM_ZLIB)
SET(CMAKE_ZLIB_INCLUDES)
SET(CMAKE_ZLIB_LIBRARIES cmzlib)
SUBDIRS(Utilities/cmzlib)
ADD_SUBDIRECTORY(Utilities/cmzlib)
ENDIF(CMAKE_USE_SYSTEM_ZLIB)
#---------------------------------------------------------------------
......@@ -235,7 +248,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
ENDIF(NOT CMAKE_BUILD_CURL_SHARED)
SET(CMAKE_CURL_INCLUDES)
SET(CMAKE_CURL_LIBRARIES cmcurl)
SUBDIRS(Utilities/cmcurl)
ADD_SUBDIRECTORY(Utilities/cmcurl)
ENDIF(CMAKE_USE_SYSTEM_CURL)
#---------------------------------------------------------------------
......@@ -252,7 +265,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
SET(CMAKE_COMPRESS_INCLUDES
"${CMAKE_CURRENT_BINARY_DIR}/Utilities/cmcompress")
SET(CMAKE_COMPRESS_LIBRARIES "cmcompress")
SUBDIRS(Utilities/cmcompress)
ADD_SUBDIRECTORY(Utilities/cmcompress)
#---------------------------------------------------------------------
# Build expat library for CMake and CTest.
......@@ -267,7 +280,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
ELSE(CMAKE_USE_SYSTEM_EXPAT)
SET(CMAKE_EXPAT_INCLUDES)
SET(CMAKE_EXPAT_LIBRARIES cmexpat)
SUBDIRS(Utilities/cmexpat)
ADD_SUBDIRECTORY(Utilities/cmexpat)
ENDIF(CMAKE_USE_SYSTEM_EXPAT)
#---------------------------------------------------------------------
......@@ -302,7 +315,7 @@ MACRO (CMAKE_BUILD_UTILITIES)
SET(BUILD_CursesDialog 0)
ENDIF (UNIX)
IF(BUILD_CursesDialog)
SUBDIRS(Source/CursesDialog/form)
ADD_SUBDIRECTORY(Source/CursesDialog/form)
ENDIF(BUILD_CursesDialog)
ENDMACRO (CMAKE_BUILD_UTILITIES)
......@@ -315,8 +328,8 @@ ENDMACRO (CMAKE_BUILD_UTILITIES)
# The CMake version number.
SET(CMake_VERSION_MAJOR 2)
SET(CMake_VERSION_MINOR 8)
SET(CMake_VERSION_PATCH 0)
#SET(CMake_VERSION_RC 8)
SET(CMake_VERSION_PATCH 1)
SET(CMake_VERSION_RC 1)
# We use odd minor numbers for development versions.
# Use a date for the development patch level.
......@@ -334,13 +347,15 @@ SET(CMake_VERSION_FULL "${CMake_VERSION}.${CMake_VERSION_PATCH}")
ENABLE_TESTING()
INCLUDE (${CMAKE_ROOT}/Modules/Dart.cmake)
# Set up test-time configuration.
SET_DIRECTORY_PROPERTIES(PROPERTIES
TEST_INCLUDE_FILE "${CMake_BINARY_DIR}/Tests/EnforceConfig.cmake")
# where to write the resulting executables and libraries
SET(BUILD_SHARED_LIBS OFF)
SET(EXECUTABLE_OUTPUT_PATH ${CMake_BINARY_DIR}/bin CACHE INTERNAL
"Where to put the executables for CMake")
SET(EXECUTABLE_OUTPUT_PATH "" CACHE INTERNAL "No configurable exe dir.")
SET(LIBRARY_OUTPUT_PATH "" CACHE INTERNAL
"Where to put the libraries for CMake")
INCLUDE_REGULAR_EXPRESSION("^.*$")
# The CMake executables usually do not need any rpath to run in the build or
# install tree.
......@@ -356,6 +371,10 @@ MARK_AS_ADVANCED(CMAKE_DATA_DIR CMAKE_DOC_DIR CMAKE_MAN_DIR)
STRING(REGEX REPLACE "^/" "" CMake_DATA_DEST "${CMAKE_DATA_DIR}")
STRING(REGEX REPLACE "^/" "" CMake_DOC_DEST "${CMAKE_DOC_DIR}")
IF(BUILD_TESTING)
INCLUDE(${CMake_SOURCE_DIR}/Tests/CMakeInstall.cmake)
ENDIF()
# include special compile flags for some compilers
INCLUDE(CompileFlags.cmake)
......@@ -442,9 +461,9 @@ MARK_AS_ADVANCED(CMAKE_STRICT)
# build the remaining subdirectories
SUBDIRS(Source)
SUBDIRS(Utilities)
SUBDIRS(Tests)
ADD_SUBDIRECTORY(Source)
ADD_SUBDIRECTORY(Utilities)
ADD_SUBDIRECTORY(Tests)
# add a test
ADD_TEST(SystemInformationNew "${CMAKE_CMAKE_COMMAND}"
......@@ -470,3 +489,10 @@ INSTALL(
#-----------------------------------------------------------------------
# End of the main section of the CMakeLists file
#-----------------------------------------------------------------------
# As a special case when building CMake itself, CMake 2.8.0 and below
# look up EXECUTABLE_OUTPUT_PATH in the top-level CMakeLists.txt file
# to compute the location of the "cmake" executable. We set it here
# so that those CMake versions can find it. We wait until after all
# the add_subdirectory() calls to avoid affecting the subdirectories.
SET(EXECUTABLE_OUTPUT_PATH ${CMake_BIN_DIR})
......@@ -16,6 +16,7 @@ set(CTEST_DROP_METHOD "http")
set(CTEST_DROP_SITE "www.cdash.org")
set(CTEST_DROP_LOCATION "/CDash/submit.php?project=CMake")
set(CTEST_DROP_SITE_CDASH TRUE)
set(CTEST_CDASH_VERSION "1.4")
# use old trigger stuff so that cmake 2.4 and below will not
# get errors on trigger
......
Changes in CMake 2.8.1 RC 1
- Add "NMake Makefiles JOM" generator
- Add PathScale compiler support
- Add per-configuration OUTPUT_DIRECTORY properties
- Add per-target OSX_ARCHITECTURES property
- check_type_size(): Handle mixed-size universal binaries
- CPack: Document Mac generators
- CPack: Improve RPM spec files
- Create CMAKE_FORCE_Fortran_COMPILER for cross-compiling
- CTest: Add --http1.0 command-line option
- CTest: Add --timeout command-line option
- CTest: Do not munge UTF-8 output in XML files
- CTest: Document CTEST_USE_LAUNCHERS option
- CTest: Fix killing of whole test process trees
- CTest: Handle failure of running invalid executables
- CTest: Honor the -C arg to ctest (#2336)
- CTest: Improve host system introspection
- CTest: Optionally randomize test order (--schedule-random)
- CTest: Skip tests with unsatisfied REQUIRED_FILES test property
- CTest: Submit arbitrary results with ATTACHED_FILES test property
- ctest_build(): Enhance signature
- ctest_start(): Add APPEND option
- ctest_start(): Move CTEST_CHECKOUT_COMMAND from ctest_update
- ctest_update(): Submit global tree revision in Update.xml
- Cygwin: Do not export all symbols from DLLs (#10122)
- Cygwin: Name DLLs with SOVERSION, not VERSION (#10122)
- Detect 32/64-bit Windows with Intel compiler
- Eclipse generator enhancements
- ExternalProject: Add TIMEOUT parameter
- FindCUDA: Respect CUDA version differences
- FindCURL: Find import libraries on Windows
- FindDCMTK: Look in more places
- FindGTest: Handle spaces better (#10065)
- FindGTK2: Look in fink locations on Mac OS X
- FindHDF5: Follow find-module API conventions
- FindJava: Support for versioned find
- FindJNI: Honor find_package() REQUIRED and QUIET options
- FindMPI: Improve Windows support
- FindOpenSSL: Fix MinGW support
- FindPythonLibs: Look in config for static library
- FindQt4: Misc enhancements, sync with KDE vesion
- FindRuby: Fix version convention on Windows
- FindX11: Improve documentation
- Fortran: Detect address size (#10119)
- FortranCInterface: Honor user flags
- Improve VS 2010 beta2 support
- link_directories(): Treat relative paths consistently (CMP0015)
- Modernize FindLibXslt and FindLibXml.cmake
- Refactor platform info to simplify adding new compilers
- Support cross-compiling versioned DLLs
- UseQt4: Provide dependencies only for static Qt (#10021)
- Address issues:
#2336, #3571, #5041, #7541, #8725, #9011, #9042, #9054, #9163,
#9171, #9450, #9697, #9764, #9782, #9792, #9862, #9894, #9913,
#9916, #9917, #9918, #9949, #9965, #9970, #9982, #9985, #10003,
#10014, #10021, #10032, #10055, #10060, #10065, #10114, #10119,
#10122, #10126, #10136.
Changes in CMake 2.8.0 Release
- CPack: Honor CPACK_NSIS_DISPLAY_NAME (fixes regression)
......
......@@ -23,6 +23,17 @@ IF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6")
IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
# Old CMake versions did not support OS X universal binaries anyway,
# so just get through this with at least some size for the types.
LIST(LENGTH CMAKE_OSX_ARCHITECTURES NUM_ARCHS)
IF(${NUM_ARCHS} GREATER 1)
IF(NOT DEFINED CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
MESSAGE(WARNING "This module does not work with OS X universal binaries.")
SET(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES 1)
LIST(GET CMAKE_OSX_ARCHITECTURES 0 CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
ENDIF()
ENDIF()
INCLUDE (CheckTypeSize)
CHECK_TYPE_SIZE(int CMAKE_SIZEOF_INT)
CHECK_TYPE_SIZE(long CMAKE_SIZEOF_LONG)
......@@ -70,6 +81,11 @@ IF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
SET (CMAKE_USE_SPROC ${CMAKE_USE_SPROC_INIT} CACHE BOOL
"Use sproc libs.")
IF(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
SET(CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
SET(__ERASE_CMAKE_TRY_COMPILE_OSX_ARCHITECTURES)
ENDIF()
ENDIF(NOT CMAKE_SKIP_COMPATIBILITY_TESTS)
MARK_AS_ADVANCED(
......
......@@ -2,8 +2,10 @@ SET(CMAKE_C_COMPILER "@CMAKE_C_COMPILER@")
SET(CMAKE_C_COMPILER_ARG1 "@CMAKE_C_COMPILER_ARG1@")
SET(CMAKE_C_COMPILER_ID "@CMAKE_C_COMPILER_ID@")
SET(CMAKE_C_PLATFORM_ID "@CMAKE_C_PLATFORM_ID@")
@SET_MSVC_C_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@")
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
SET(CMAKE_LINKER "@CMAKE_LINKER@")
SET(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@)
SET(CMAKE_C_COMPILER_LOADED 1)
SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
......
......@@ -36,6 +36,9 @@
#elif defined(__PGI)
# define COMPILER_ID "PGI"
#elif defined(__PATHSCALE__)
# define COMPILER_ID "PathScale"
#elif defined(__GNUC__)
# define COMPILER_ID "GNU"
......@@ -93,6 +96,7 @@ int main(int argc, char* argv[])
int require = 0;
require += info_compiler[argc];
require += info_platform[argc];
require += info_arch[argc];
(void)argv;
return require;
}
......
......@@ -2,8 +2,10 @@ SET(CMAKE_CXX_COMPILER "@CMAKE_CXX_COMPILER@")
SET(CMAKE_CXX_COMPILER_ARG1 "@CMAKE_CXX_COMPILER_ARG1@")
SET(CMAKE_CXX_COMPILER_ID "@CMAKE_CXX_COMPILER_ID@")
SET(CMAKE_CXX_PLATFORM_ID "@CMAKE_CXX_PLATFORM_ID@")
@SET_MSVC_CXX_ARCHITECTURE_ID@
SET(CMAKE_AR "@CMAKE_AR@")
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
SET(CMAKE_LINKER "@CMAKE_LINKER@")
SET(CMAKE_COMPILER_IS_GNUCXX @CMAKE_COMPILER_IS_GNUCXX@)
SET(CMAKE_CXX_COMPILER_LOADED 1)
SET(CMAKE_COMPILER_IS_MINGW @CMAKE_COMPILER_IS_MINGW@)
......
......@@ -38,6 +38,9 @@
#elif defined(__PGI)
# define COMPILER_ID "PGI"
#elif defined(__PATHSCALE__)
# define COMPILER_ID "PathScale"
#elif defined(__GNUC__)
# define COMPILER_ID "GNU"
......
......@@ -114,6 +114,14 @@ IF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
ENDIF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_CXX_FLAG)
IF(NOT DEFINED CMAKE_EXE_EXPORTS_CXX_FLAG)
SET(CMAKE_EXE_EXPORTS_CXX_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
ENDIF()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG)
SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
ENDIF()
IF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
SET(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG})
ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG)
......@@ -147,14 +155,6 @@ IF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
ENDIF(NOT CMAKE_SHARED_MODULE_CXX_FLAGS)
IF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG)
SET(CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG ${CMAKE_SHARED_MODULE_RUNTIME_FLAG})
ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG)
IF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG_SEP)
SET(CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_FLAG_SEP})
ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_CXX_FLAG_SEP)
# Initialize CXX link type selection flags from C versions.
FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
IF(NOT CMAKE_${type}_LINK_STATIC_CXX_FLAGS)
......
......@@ -171,11 +171,13 @@ ENDIF (CMAKE_CROSSCOMPILING
INCLUDE(CMakeFindBinUtils)
IF(MSVC_C_ARCHITECTURE_ID)
SET(SET_MSVC_C_ARCHITECTURE_ID
"SET(MSVC_C_ARCHITECTURE_ID ${MSVC_C_ARCHITECTURE_ID})")
ENDIF(MSVC_C_ARCHITECTURE_ID)
# configure variables set in this file for fast reload later on
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
"${CMAKE_PLATFORM_ROOT_BIN}/CMakeCCompiler.cmake"
@ONLY IMMEDIATE # IMMEDIATE must be here for compatibility mode <= 2.0
)
)
SET(CMAKE_C_COMPILER_ENV_VAR "CC")
......@@ -176,7 +176,10 @@ ENDIF (CMAKE_CROSSCOMPILING
AND NOT _CMAKE_TOOLCHAIN_PREFIX)
INCLUDE(CMakeFindBinUtils)
IF(MSVC_CXX_ARCHITECTURE_ID)
SET(SET_MSVC_CXX_ARCHITECTURE_ID
"SET(MSVC_CXX_ARCHITECTURE_ID ${MSVC_CXX_ARCHITECTURE_ID})")
ENDIF(MSVC_CXX_ARCHITECTURE_ID)
# configure all variables set in this file
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeCXXCompiler.cmake
......
......@@ -57,6 +57,8 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID lang flagvar src)
SET(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID)
#-----------------------------------------------------------------------------
......@@ -171,7 +173,7 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
SET(COMPILER_ID)
SET(PLATFORM_ID)
FILE(STRINGS ${file}
CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 2 REGEX "INFO:")
CMAKE_${lang}_COMPILER_ID_STRINGS LIMIT_COUNT 3 REGEX "INFO:")
SET(HAVE_COMPILER_TWICE 0)
FOREACH(info ${CMAKE_${lang}_COMPILER_ID_STRINGS})
IF("${info}" MATCHES ".*INFO:compiler\\[([^]\"]*)\\].*")
......@@ -185,12 +187,17 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
STRING(REGEX REPLACE ".*INFO:platform\\[([^]]*)\\].*" "\\1"
PLATFORM_ID "${info}")
ENDIF("${info}" MATCHES ".*INFO:platform\\[([^]\"]*)\\].*")
IF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
STRING(REGEX REPLACE ".*INFO:arch\\[([^]]*)\\].*" "\\1"
ARCHITECTURE_ID "${info}")
ENDIF("${info}" MATCHES ".*INFO:arch\\[([^]\"]*)\\].*")
ENDFOREACH(info)
# Check if a valid compiler and platform were found.
IF(COMPILER_ID AND NOT COMPILER_ID_TWICE)
SET(CMAKE_${lang}_COMPILER_ID "${COMPILER_ID}")
SET(CMAKE_${lang}_PLATFORM_ID "${PLATFORM_ID}")
SET(MSVC_${lang}_ARCHITECTURE_ID "${ARCHITECTURE_ID}")
ENDIF(COMPILER_ID AND NOT COMPILER_ID_TWICE)
# Check the compiler identification string.
......@@ -234,5 +241,7 @@ FUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang file)
# Return the information extracted.
SET(CMAKE_${lang}_COMPILER_ID "${CMAKE_${lang}_COMPILER_ID}" PARENT_SCOPE)
SET(CMAKE_${lang}_PLATFORM_ID "${CMAKE_${lang}_PLATFORM_ID}" PARENT_SCOPE)
SET(MSVC_${lang}_ARCHITECTURE_ID "${MSVC_${lang}_ARCHITECTURE_ID}"
PARENT_SCOPE)
SET(CMAKE_EXECUTABLE_FORMAT "${CMAKE_EXECUTABLE_FORMAT}" PARENT_SCOPE)
ENDFUNCTION(CMAKE_DETERMINE_COMPILER_ID_CHECK lang)
......@@ -62,9 +62,6 @@ IF(NOT CMAKE_Fortran_COMPILER)
# The order is 95 or newer compilers first, then 90,
# then 77 or older compilers, gnu is always last in the group,
# so if you paid for a compiler it is picked by default.
# NOTE for testing purposes this list is DUPLICATED in
# CMake/Source/CMakeLists.txt, IF YOU CHANGE THIS LIST,
# PLEASE UPDATE THAT FILE AS WELL!
SET(CMAKE_Fortran_COMPILER_LIST
ifort ifc efc f95 pgf95 lf95 xlf95 fort gfortran gfortran-4 g95 f90
pgf90 xlf90 epcf90 fort77 frt pgf77 xlf fl32 af77 g77 f77
......
......@@ -16,6 +16,13 @@
# It also bypasses the check for working compiler and basic compiler
# information tests.
#
# Macro CMAKE_FORCE_Fortran_COMPILER has the following signature:
# CMAKE_FORCE_Fortran_COMPILER(<compiler> <compiler-id>)
# It sets CMAKE_Fortran_COMPILER to the given compiler and the cmake
# internal variable CMAKE_Fortran_COMPILER_ID to the given compiler-id.
# It also bypasses the check for working compiler and basic compiler
# information tests.
#
# So a simple toolchain file could look like this:
# INCLUDE (CMakeForceCompiler)
# SET(CMAKE_SYSTEM_NAME Generic)
......@@ -60,3 +67,16 @@ MACRO(CMAKE_FORCE_CXX_COMPILER compiler id)
SET(CMAKE_COMPILER_IS_GNUCXX 1)
ENDIF("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
ENDMACRO(CMAKE_FORCE_CXX_COMPILER)
MACRO(CMAKE_FORCE_Fortran_COMPILER compiler id)
SET(CMAKE_Fortran_COMPILER "${compiler}")
SET(CMAKE_Fortran_COMPILER_ID_RUN TRUE)
SET(CMAKE_Fortran_COMPILER_ID ${id})
SET(CMAKE_Fortran_COMPILER_WORKS TRUE)
SET(CMAKE_Fortran_COMPILER_FORCED TRUE)
# Set old compiler id variables.
IF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
SET(CMAKE_COMPILER_IS_GNUG77 1)
ENDIF("${CMAKE_Fortran_COMPILER_ID}" MATCHES "GNU")
ENDMACRO(CMAKE_FORCE_Fortran_COMPILER)
......@@ -30,5 +30,17 @@ ELSE(UNIX)
SET(CMAKE_Fortran_OUTPUT_EXTENSION .obj)
ENDIF(UNIX)
# Save compiler ABI information.
SET(CMAKE_Fortran_SIZEOF_DATA_PTR "@CMAKE_Fortran_SIZEOF_DATA_PTR@")
SET(CMAKE_Fortran_COMPILER_ABI "@CMAKE_Fortran_COMPILER_ABI@")
IF(CMAKE_Fortran_SIZEOF_DATA_PTR)
SET(CMAKE_SIZEOF_VOID_P "${CMAKE_Fortran_SIZEOF_DATA_PTR}")
ENDIF(CMAKE_Fortran_SIZEOF_DATA_PTR)
IF(CMAKE_Fortran_COMPILER_ABI)
SET(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_Fortran_COMPILER_ABI}")
ENDIF(CMAKE_Fortran_COMPILER_ABI)
SET(CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES "@CMAKE_Fortran_IMPLICIT_LINK_LIBRARIES@")
SET(CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES "@CMAKE_Fortran_IMPLICIT_LINK_DIRECTORIES@")
PROGRAM CMakeFortranCompilerId
PRINT *, 'ABI Detection Binary'
PROGRAM CMakeFortranCompilerABI
#if 0
! Address Size
#endif
#if defined(_LP64)
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_M_IA64)
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_M_X64)
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_M_AMD64)
PRINT *, 'INFO:sizeof_dptr[8]'
#elif defined(_ILP32)
PRINT *, 'INFO:sizeof_dptr[4]'
#elif defined(_M_IX86)
PRINT *, 'INFO:sizeof_dptr[4]'
#endif
#if 0
! Application Binary Interface
#endif
#if defined(__sgi) && defined(_ABIO32)
PRINT *, 'INFO:abi[ELF O32]'
#elif defined(__sgi) && defined(_ABIN32)
PRINT *, 'INFO:abi[ELF N32]'
#elif defined(__sgi) && defined(_ABI64)
PRINT *, 'INFO:abi[ELF 64]'
#elif defined(__ELF__)
PRINT *, 'INFO:abi[ELF]'
#endif
PRINT *, 'ABI Detection'
END
......@@ -8,6 +8,8 @@
PRINT *, 'INFO:compiler[SunPro]'
#elif defined(__G95__)
PRINT *, 'INFO:compiler[G95]'
#elif defined(__PATHSCALE__)
PRINT *, 'INFO:compiler[PathScale]'
#elif defined(__GNUC__)
PRINT *, 'INFO:compiler[GNU]'
#elif defined(__IBMC__)
......
......@@ -89,6 +89,14 @@ IF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
SET(CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RPATH_LINK_C_FLAG})
ENDIF(NOT CMAKE_SHARED_LIBRARY_RPATH_LINK_Fortran_FLAG)
IF(NOT DEFINED CMAKE_EXE_EXPORTS_Fortran_FLAG)
SET(CMAKE_EXE_EXPORTS_Fortran_FLAG ${CMAKE_EXE_EXPORTS_C_FLAG})
ENDIF()
IF(NOT DEFINED CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG)
SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_SONAME_C_FLAG})
ENDIF()
# repeat for modules
IF(NOT CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS)
SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS})
......@@ -98,14 +106,6 @@ IF(NOT CMAKE_SHARED_MODULE_Fortran_FLAGS)
SET(CMAKE_SHARED_MODULE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_C_FLAGS})
ENDIF(NOT CMAKE_SHARED_MODULE_Fortran_FLAGS)
IF(NOT CMAKE_SHARED_MODULE_RUNTIME_Fortran_FLAG)
SET(CMAKE_SHARED_MODULE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG})
ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_Fortran_FLAG)
IF(NOT CMAKE_SHARED_MODULE_RUNTIME_Fortran_FLAG_SEP)
SET(CMAKE_SHARED_MODULE_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_C_FLAG_SEP})
ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_Fortran_FLAG_SEP)
IF(NOT CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG})
ENDIF(NOT CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG)
......
......@@ -88,6 +88,3 @@ MARK_AS_ADVANCED(
CMAKE_SKIP_RPATH
CMAKE_VERBOSE_MAKEFILE
)
# always include the gcc compiler information
INCLUDE(Platform/gcc)
#=============================================================================
# Copyright 2002-2009 Kitware, Inc.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
SET (CMAKE_MAKE_PROGRAM "jom" CACHE STRING
"Program used to build from makefiles.")
MARK_AS_ADVANCED(CMAKE_MAKE_PROGRAM)