From 66a08c10e5bd4b8eff58837cd58372a4dfdd19df Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 26 Aug 2004 14:55:55 -0400 Subject: ENH: more uniform approach to enable language, one step closer to being able to enable a language without modifing cmake source code --- Modules/CMake.cmake | 3 + Modules/CMakeCInformation.cmake | 115 ++++++++ Modules/CMakeCXXInformation.cmake | 164 +++++++++++ Modules/CMakeCommonLanguageInclude.cmake | 89 ++++++ Modules/CMakeDefaultMakeRuleVariables.cmake | 140 ---------- Modules/CMakeDetermineCCompiler.cmake | 2 +- Modules/CMakeDetermineCXXCompiler.cmake | 4 +- Modules/CMakeDetermineFortranCompiler.cmake | 68 +++-- Modules/CMakeDetermineJavaCompiler.cmake | 1 + Modules/CMakeFortranCompiler.cmake.in | 4 +- Modules/CMakeFortranInformation.cmake | 120 +++++++++ Modules/CMakeGenericSystem.cmake | 36 +++ Modules/CMakeJavaCompiler.cmake.in | 2 +- Modules/CMakeJavaInformation.cmake | 1 + Modules/CMakeSystemSpecificInformation.cmake | 314 +--------------------- Modules/CMakeTestFortranCompiler.cmake | 24 +- Modules/Platform/AIX.cmake | 1 - Modules/Platform/BSDOS.cmake | 2 +- Modules/Platform/CYGWIN.cmake | 1 - Modules/Platform/Darwin.cmake | 1 - Modules/Platform/FreeBSD.cmake | 1 - Modules/Platform/HP-UX.cmake | 1 - Modules/Platform/IRIX.cmake | 1 - Modules/Platform/IRIX64.cmake | 5 +- Modules/Platform/Linux.cmake | 2 - Modules/Platform/MP-RAS.cmake | 2 - Modules/Platform/NetBSD.cmake | 2 - Modules/Platform/OSF1.cmake | 1 - Modules/Platform/OpenBSD.cmake | 3 +- Modules/Platform/RISCos.cmake | 2 - Modules/Platform/SCO_SV.cmake | 2 - Modules/Platform/SINIX.cmake | 2 - Modules/Platform/SunOS.cmake | 2 - Modules/Platform/True64.cmake | 3 +- Modules/Platform/ULTRIX.cmake | 2 - Modules/Platform/UNIX_SV.cmake | 2 - Modules/Platform/UnixWare.cmake | 2 - Modules/Platform/Windows-gcc.cmake | 2 - Modules/Platform/Windows-ifort.cmake | 65 +++++ Modules/Platform/Xenix.cmake | 3 +- Source/CMakeLists.txt | 3 + Source/cmGlobalBorlandMakefileGenerator.cxx | 7 - Source/cmGlobalGenerator.cxx | 290 +++++++++----------- Source/cmGlobalGenerator.h | 3 +- Source/cmGlobalUnixMakefileGenerator.cxx | 47 ++-- Source/cmListFileCache.cxx | 1 - Source/cmLocalUnixMakefileGenerator.cxx | 56 ++-- Source/cmProjectCommand.cxx | 4 +- Source/cmTryCompileCommand.cxx | 6 +- Source/cmake.cxx | 14 +- Tests/Complex/Executable/complex.cxx | 4 +- Tests/ComplexOneConfig/Executable/complex.cxx | 4 +- Tests/ComplexRelativePaths/Executable/complex.cxx | 4 +- Tests/Fortran/CMakeLists.txt | 2 +- 54 files changed, 885 insertions(+), 757 deletions(-) create mode 100644 Modules/CMake.cmake create mode 100644 Modules/CMakeCInformation.cmake create mode 100644 Modules/CMakeCXXInformation.cmake create mode 100644 Modules/CMakeCommonLanguageInclude.cmake delete mode 100644 Modules/CMakeDefaultMakeRuleVariables.cmake create mode 100644 Modules/CMakeFortranInformation.cmake create mode 100644 Modules/CMakeGenericSystem.cmake create mode 100644 Modules/CMakeJavaInformation.cmake create mode 100644 Modules/Platform/Windows-ifort.cmake diff --git a/Modules/CMake.cmake b/Modules/CMake.cmake new file mode 100644 index 0000000..411544f --- /dev/null +++ b/Modules/CMake.cmake @@ -0,0 +1,3 @@ +# This file is used by cmake.cxx to compute the CMAKE_ROOT location. +# Do not remove this file from cvs without updating cmake.cxx to look +# for a different file. diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake new file mode 100644 index 0000000..440550b --- /dev/null +++ b/Modules/CMakeCInformation.cmake @@ -0,0 +1,115 @@ +# This file sets the basic flags for the C language in CMake. +# It also loads the available platform file for the system-compiler +# if it exists. + +GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE) +IF(CMAKE_COMPILER_IS_GNUCC) + SET(CMAKE_BASE_NAME gcc) +ENDIF(CMAKE_COMPILER_IS_GNUCC) +SET(CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE + ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) +INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL) + +# for most systems a module is the same as a shared library +# so unless the variable CMAKE_MODULE_EXISTS is set just +# copy the values from the LIBRARY variables +IF(NOT CMAKE_MODULE_EXISTS) + SET(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) + SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) +ENDIF(NOT CMAKE_MODULE_EXISTS) + +SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_ENV_INIT} $ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}" CACHE STRING + "Flags for C compiler.") + +SET (CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS} + CACHE STRING "Flags used by the linker.") + +IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) +# default build type is none + IF(NOT CMAKE_NO_BUILD_TYPE) + SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING + "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.") + ENDIF(NOT CMAKE_NO_BUILD_TYPE) + SET (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING + "Flags used by the compiler during debug builds.") + SET (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING + "Flags used by the compiler during release minsize builds.") + SET (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE_INIT}" CACHE STRING + "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 + "Flags used by the compiler during Release with Debug Info builds.") +ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) + +INCLUDE(CMakeCommonLanguageInclude) + +# now define the following rule variables + +# CMAKE_C_CREATE_SHARED_LIBRARY +# CMAKE_C_CREATE_SHARED_MODULE +# CMAKE_C_CREATE_STATIC_LIBRARY +# CMAKE_C_COMPILE_OBJECT +# CMAKE_C_LINK_EXECUTABLE + +# variables supplied by the generator at use time +# +# the target without the suffix +# +# +# +# +# + +# C compiler information +# +# +# +# + +# Static library tools +# +# + + +# create a C shared library +IF(NOT CMAKE_C_CREATE_SHARED_LIBRARY) + SET(CMAKE_C_CREATE_SHARED_LIBRARY + " -o ") +ENDIF(NOT CMAKE_C_CREATE_SHARED_LIBRARY) + +# create a C shared module just copy the shared library rule +IF(NOT CMAKE_C_CREATE_SHARED_MODULE) + SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY}) +ENDIF(NOT CMAKE_C_CREATE_SHARED_MODULE) + +# create a C static library +IF(NOT CMAKE_C_CREATE_STATIC_LIBRARY) + SET(CMAKE_C_CREATE_STATIC_LIBRARY + " cr " + " ") +ENDIF(NOT CMAKE_C_CREATE_STATIC_LIBRARY) + +# compile a C file into an object file +IF(NOT CMAKE_C_COMPILE_OBJECT) + SET(CMAKE_C_COMPILE_OBJECT + " -o -c ") +ENDIF(NOT CMAKE_C_COMPILE_OBJECT) + +IF(NOT CMAKE_C_LINK_EXECUTABLE) + SET(CMAKE_C_LINK_EXECUTABLE + " -o ") +ENDIF(NOT CMAKE_C_LINK_EXECUTABLE) + +IF(CMAKE_USER_MAKE_RULES_OVERRIDE) + INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE}) +ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE) + +MARK_AS_ADVANCED( +CMAKE_C_FLAGS +CMAKE_C_FLAGS_DEBUG +CMAKE_C_FLAGS_MINSIZEREL +CMAKE_C_FLAGS_RELEASE +CMAKE_C_FLAGS_RELWITHDEBINFO +) +SET(CMAKE_C_INFOMATION_LOADED 1) + + diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake new file mode 100644 index 0000000..52f1ff9 --- /dev/null +++ b/Modules/CMakeCXXInformation.cmake @@ -0,0 +1,164 @@ +# This file sets the basic flags for the C++ language in CMake. +# It also loads the available platform file for the system-compiler +# if it exists. + + +GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE) +# since the gnu compiler has several names force g++ +IF(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_BASE_NAME g++) +ENDIF(CMAKE_COMPILER_IS_GNUCXX) +SET(CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE + ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) +INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL) + +# for most systems a module is the same as a shared library +# so unless the variable CMAKE_MODULE_EXISTS is set just +# copy the values from the LIBRARY variables +IF(NOT CMAKE_MODULE_EXISTS) + SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) +ENDIF(NOT CMAKE_MODULE_EXISTS) +# Create a set of shared library variable specific to C++ +# For 90% of the systems, these are the same flags as the C versions +# so if these are not set just copy the flags from the c version +IF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS) + SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS) + +IF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS) + SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS) + +IF(NOT CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) + SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_FLAGS}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) + +IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG) + SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_FLAG}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG) + +IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP) + SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP) + +# repeat for modules +IF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS) + SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) +ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS) + +IF(NOT CMAKE_SHARED_MODULE_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_LINK_CXX_FLAGS) + SET(CMAKE_SHARED_MODULE_LINK_CXX_FLAGS ${CMAKE_SHARED_MODULE_LINK_FLAGS}) +ENDIF(NOT CMAKE_SHARED_MODULE_LINK_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) + +# add the flags to the cache based +# on the initial values computed in the platform/*.cmake files +# use _INIT variables so that this only happens the first time +# and you can set these flags in the cmake cache +SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_ENV_INIT} $ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}" CACHE STRING + "Flags used by the compiler during all build types.") + + +IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) + SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG_INIT}" CACHE STRING + "Flags used by the compiler during debug builds.") + SET (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" CACHE STRING + "Flags used by the compiler during release minsize builds.") + SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE_INIT}" CACHE STRING + "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 + "Flags used by the compiler during Release with Debug Info builds.") + +ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) + + +INCLUDE(CMakeCommonLanguageInclude) + +# now define the following rules: +# CMAKE_CXX_CREATE_SHARED_LIBRARY +# CMAKE_CXX_CREATE_SHARED_MODULE +# CMAKE_CXX_CREATE_STATIC_LIBRARY +# CMAKE_CXX_COMPILE_OBJECT +# CMAKE_CXX_LINK_EXECUTABLE + +# variables supplied by the generator at use time +# +# the target without the suffix +# +# +# +# +# + +# CXX compiler information +# +# +# +# + +# Static library tools +# +# + + +# create a shared C++ library +IF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY) + SET(CMAKE_CXX_CREATE_SHARED_LIBRARY + " -o ") +ENDIF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY) + +IF(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} -lgcc") +ENDIF(CMAKE_COMPILER_IS_GNUCXX) + +# create a c++ shared module copy the shared library rule by default +IF(NOT CMAKE_CXX_CREATE_SHARED_MODULE) + SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) +ENDIF(NOT CMAKE_CXX_CREATE_SHARED_MODULE) + + +# create a C++ static library +IF(NOT CMAKE_CXX_CREATE_STATIC_LIBRARY) + SET(CMAKE_CXX_CREATE_STATIC_LIBRARY + " cr " + " ") +ENDIF(NOT CMAKE_CXX_CREATE_STATIC_LIBRARY) + +# compile a C++ file into an object file +IF(NOT CMAKE_CXX_COMPILE_OBJECT) + SET(CMAKE_CXX_COMPILE_OBJECT + " -o -c ") +ENDIF(NOT CMAKE_CXX_COMPILE_OBJECT) + +IF(NOT CMAKE_CXX_LINK_EXECUTABLE) + SET(CMAKE_CXX_LINK_EXECUTABLE + " -o ") +ENDIF(NOT CMAKE_CXX_LINK_EXECUTABLE) + +IF(CMAKE_USER_MAKE_RULES_OVERRIDE) + INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE}) +ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE) + + +MARK_AS_ADVANCED( +CMAKE_BUILD_TOOL +CMAKE_VERBOSE_MAKEFILE +CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_DEBUG) + +SET(CMAKE_CXX_INFOMATION_LOADED 1) + diff --git a/Modules/CMakeCommonLanguageInclude.cmake b/Modules/CMakeCommonLanguageInclude.cmake new file mode 100644 index 0000000..1ed1543 --- /dev/null +++ b/Modules/CMakeCommonLanguageInclude.cmake @@ -0,0 +1,89 @@ +# this file has flags that are shared across languages and sets +# cache values that can be initialized in the platform-compiler.cmake file +# it may be included by more than one language. + +IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) +# default build type is none + IF(NOT CMAKE_NO_BUILD_TYPE) + SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING + "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.") + ENDIF(NOT CMAKE_NO_BUILD_TYPE) + + SET (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING + "Flags used by the linker during debug builds.") + + SET (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT} CACHE STRING + "Flags used by the linker during release minsize builds.") + + SET (CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} "" CACHE STRING + "Flags used by the linker during release builds.") + + SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO + ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING + "Flags used by the linker during Release with Debug Info builds.") + + SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING + "Flags used by the linker during debug builds.") + + SET (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL ${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT} + CACHE STRING + "Flags used by the linker during release minsize builds.") + + SET (CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} "" CACHE STRING + "Flags used by the linker during release builds.") + + SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO + ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING + "Flags used by the linker during Release with Debug Info builds.") + + SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG ${CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING + "Flags used by the linker during debug builds.") + + SET (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL ${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT} + CACHE STRING + "Flags used by the linker during release minsize builds.") + + SET (CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} "" CACHE STRING + "Flags used by the linker during release builds.") + + SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO + ${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING + "Flags used by the linker during Release with Debug Info builds.") + +ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) +# shared linker flags +SET (CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS} + CACHE STRING "Flags used by the linker during the creation of dll's.") + +# module linker flags +SET (CMAKE_MODULE_LINKER_FLAGS ${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS} + CACHE STRING "Flags used by the linker during the creation of modules.") + +SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL + "What is the target build tool cmake is generating for.") + + +MARK_AS_ADVANCED( +CMAKE_BUILD_TOOL +CMAKE_VERBOSE_MAKEFILE + +CMAKE_EXE_LINKER_FLAGS +CMAKE_EXE_LINKER_FLAGS_DEBUG +CMAKE_EXE_LINKER_FLAGS_MINSIZEREL +CMAKE_EXE_LINKER_FLAGS_RELEASE +CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO + +CMAKE_SHARED_LINKER_FLAGS +CMAKE_SHARED_LINKER_FLAGS_DEBUG +CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL +CMAKE_SHARED_LINKER_FLAGS_RELEASE +CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO + +CMAKE_MODULE_LINKER_FLAGS +CMAKE_MODULE_LINKER_FLAGS_DEBUG +CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL +CMAKE_MODULE_LINKER_FLAGS_RELEASE +CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO + +) + diff --git a/Modules/CMakeDefaultMakeRuleVariables.cmake b/Modules/CMakeDefaultMakeRuleVariables.cmake deleted file mode 100644 index 73d8ab8..0000000 --- a/Modules/CMakeDefaultMakeRuleVariables.cmake +++ /dev/null @@ -1,140 +0,0 @@ -# this file contains rule variables that tell cmake how to -# do things like build a .o file, create a shared or static library -# - -# this file defines the following rule variables -# CMAKE_CXX_CREATE_SHARED_LIBRARY -# CMAKE_CXX_CREATE_SHARED_MODULE -# CMAKE_C_CREATE_SHARED_LIBRARY -# CMAKE_C_CREATE_SHARED_MODULE -# CMAKE_FORTRAN_CREATE_SHARED_LIBRARY -# CMAKE_FORTRAN_CREATE_SHARED_MODULE -# CMAKE_CXX_CREATE_STATIC_LIBRARY -# CMAKE_C_CREATE_STATIC_LIBRARY -# CMAKE_FORTRAN_CREATE_STATIC_LIBRARY -# CMAKE_CXX_COMPILE_OBJECT -# CMAKE_C_COMPILE_OBJECT -# CMAKE_FORTRAN_COMPILE_OBJECT -# CMAKE_C_LINK_EXECUTABLE -# CMAKE_FORTRAN_LINK_EXECUTABLE -# CMAKE_CXX_LINK_EXECUTABLE - -# variables supplied by the generator at use time -# -# the target without the suffix -# -# -# -# -# - -# CXX compiler information -# -# -# -# - -# C compiler information -# -# -# -# - -# Static library tools -# -# - - -# create a shared C++ library -IF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY) - SET(CMAKE_CXX_CREATE_SHARED_LIBRARY - " -o ") -ENDIF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY) - -IF(CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY} -lgcc") -ENDIF(CMAKE_COMPILER_IS_GNUCXX) - -# create a c++ shared module copy the shared library rule by default -IF(NOT CMAKE_CXX_CREATE_SHARED_MODULE) - SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY}) -ENDIF(NOT CMAKE_CXX_CREATE_SHARED_MODULE) - - -# create a C shared library -IF(NOT CMAKE_C_CREATE_SHARED_LIBRARY) - SET(CMAKE_C_CREATE_SHARED_LIBRARY - " -o ") -ENDIF(NOT CMAKE_C_CREATE_SHARED_LIBRARY) - -# create a C shared module just copy the shared library rule -IF(NOT CMAKE_C_CREATE_SHARED_MODULE) - SET(CMAKE_C_CREATE_SHARED_MODULE ${CMAKE_C_CREATE_SHARED_LIBRARY}) -ENDIF(NOT CMAKE_C_CREATE_SHARED_MODULE) - -# create a FORTRAN shared library -IF(NOT CMAKE_FORTRAN_CREATE_SHARED_LIBRARY) - SET(CMAKE_FORTRAN_CREATE_SHARED_LIBRARY - " -o ") -ENDIF(NOT CMAKE_FORTRAN_CREATE_SHARED_LIBRARY) - -# create a FORTRAN shared module just copy the shared library rule -IF(NOT CMAKE_FORTRAN_CREATE_SHARED_MODULE) - SET(CMAKE_FORTRAN_CREATE_SHARED_MODULE ${CMAKE_FORTRAN_CREATE_SHARED_LIBRARY}) -ENDIF(NOT CMAKE_FORTRAN_CREATE_SHARED_MODULE) - -# create a C++ static library -IF(NOT CMAKE_CXX_CREATE_STATIC_LIBRARY) - SET(CMAKE_CXX_CREATE_STATIC_LIBRARY - " cr " - " ") -ENDIF(NOT CMAKE_CXX_CREATE_STATIC_LIBRARY) - -# create a C static library -IF(NOT CMAKE_C_CREATE_STATIC_LIBRARY) - SET(CMAKE_C_CREATE_STATIC_LIBRARY - " cr " - " ") -ENDIF(NOT CMAKE_C_CREATE_STATIC_LIBRARY) - -# create a Fortran static library -IF(NOT CMAKE_FORTRAN_CREATE_STATIC_LIBRARY) - SET(CMAKE_FORTRAN_CREATE_STATIC_LIBRARY - " cr " - " ") -ENDIF(NOT CMAKE_FORTRAN_CREATE_STATIC_LIBRARY) - -# compile a C++ file into an object file -IF(NOT CMAKE_CXX_COMPILE_OBJECT) - SET(CMAKE_CXX_COMPILE_OBJECT - " -o -c ") -ENDIF(NOT CMAKE_CXX_COMPILE_OBJECT) - -# compile a C file into an object file -IF(NOT CMAKE_C_COMPILE_OBJECT) - SET(CMAKE_C_COMPILE_OBJECT - " -o -c ") -ENDIF(NOT CMAKE_C_COMPILE_OBJECT) - -# compile a Fortran file into an object file -IF(NOT CMAKE_FORTRAN_COMPILE_OBJECT) - SET(CMAKE_FORTRAN_COMPILE_OBJECT - " -o -c ") -ENDIF(NOT CMAKE_FORTRAN_COMPILE_OBJECT) - - -IF(NOT CMAKE_C_LINK_EXECUTABLE) - SET(CMAKE_C_LINK_EXECUTABLE - " -o ") -ENDIF(NOT CMAKE_C_LINK_EXECUTABLE) - -IF(NOT CMAKE_FORTRAN_LINK_EXECUTABLE) - SET(CMAKE_FORTRAN_LINK_EXECUTABLE - " -o ") -ENDIF(NOT CMAKE_FORTRAN_LINK_EXECUTABLE) - - -IF(NOT CMAKE_CXX_LINK_EXECUTABLE) - SET(CMAKE_CXX_LINK_EXECUTABLE - " -o ") -ENDIF(NOT CMAKE_CXX_LINK_EXECUTABLE) diff --git a/Modules/CMakeDetermineCCompiler.cmake b/Modules/CMakeDetermineCCompiler.cmake index 2dc6383..a14dd04 100644 --- a/Modules/CMakeDetermineCCompiler.cmake +++ b/Modules/CMakeDetermineCCompiler.cmake @@ -37,7 +37,6 @@ IF(NOT CMAKE_C_COMPILER) SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_INIT} CACHE STRING "C compiler") ENDIF(NOT CMAKE_C_COMPILER) MARK_AS_ADVANCED(CMAKE_C_COMPILER) - FIND_PROGRAM(CMAKE_AR NAMES ar ) FIND_PROGRAM(CMAKE_RANLIB NAMES ranlib) @@ -81,3 +80,4 @@ ENDIF(NOT CMAKE_COMPILER_IS_GNUCC_RUN) CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in ${CMAKE_BINARY_DIR}/CMakeCCompiler.cmake IMMEDIATE) MARK_AS_ADVANCED(CMAKE_AR) +SET(CMAKE_C_COMPILER_ENV_VAR "CC") diff --git a/Modules/CMakeDetermineCXXCompiler.cmake b/Modules/CMakeDetermineCXXCompiler.cmake index 661f489..3718f5f 100644 --- a/Modules/CMakeDetermineCXXCompiler.cmake +++ b/Modules/CMakeDetermineCXXCompiler.cmake @@ -60,6 +60,4 @@ ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX_RUN) CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in ${CMAKE_BINARY_DIR}/CMakeCXXCompiler.cmake IMMEDIATE) - - - +SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX") diff --git a/Modules/CMakeDetermineFortranCompiler.cmake b/Modules/CMakeDetermineFortranCompiler.cmake index 52004ee..de75627 100644 --- a/Modules/CMakeDetermineFortranCompiler.cmake +++ b/Modules/CMakeDetermineFortranCompiler.cmake @@ -5,38 +5,55 @@ # the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator # as a default compiler -IF(NOT CMAKE_FORTRAN_COMPILER) +IF(NOT CMAKE_Fortran_COMPILER) # prefer the environment variable CC IF($ENV{FC} MATCHES ".+") - GET_FILENAME_COMPONENT(CMAKE_FORTRAN_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_FORTRAN_FLAGS_ENV_INIT) - IF(EXISTS ${CMAKE_FORTRAN_COMPILER_INIT}) - ELSE(EXISTS ${CMAKE_FORTRAN_COMPILER_INIT}) + GET_FILENAME_COMPONENT(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT) + IF(EXISTS ${CMAKE_Fortran_COMPILER_INIT}) + ELSE(EXISTS ${CMAKE_Fortran_COMPILER_INIT}) MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.") - ENDIF(EXISTS ${CMAKE_FORTRAN_COMPILER_INIT}) + ENDIF(EXISTS ${CMAKE_Fortran_COMPILER_INIT}) ENDIF($ENV{FC} MATCHES ".+") # next try prefer the compiler specified by the generator IF(CMAKE_GENERATOR_FC) - IF(NOT CMAKE_FORTRAN_COMPILER_INIT) - SET(CMAKE_FORTRAN_COMPILER_INIT ${CMAKE_GENERATOR_FC}) - ENDIF(NOT CMAKE_FORTRAN_COMPILER_INIT) + IF(NOT CMAKE_Fortran_COMPILER_INIT) + SET(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC}) + ENDIF(NOT CMAKE_Fortran_COMPILER_INIT) ENDIF(CMAKE_GENERATOR_FC) # if no compiler has been specified yet, then look for one - IF(NOT CMAKE_FORTRAN_COMPILER_INIT) - # if not in the envionment then search for the compiler in the path - SET(CMAKE_FORTRAN_COMPILER_LIST g77 ifort f77 f90 epcf90 efc ecc) - FIND_PROGRAM(CMAKE_FORTRAN_COMPILER_FULLPATH NAMES ${CMAKE_FORTRAN_COMPILER_LIST} ) - GET_FILENAME_COMPONENT(CMAKE_FORTRAN_COMPILER_INIT - ${CMAKE_FORTRAN_COMPILER_FULLPATH} NAME) - SET(CMAKE_FORTRAN_COMPILER_FULLPATH "${CMAKE_FORTRAN_COMPILER_FULLPATH}" CACHE INTERNAL "full path to the compiler cmake found") - ENDIF(NOT CMAKE_FORTRAN_COMPILER_INIT) + IF(NOT CMAKE_Fortran_COMPILER_INIT) + # if not in the envionment then search for the compiler in the path# Known compilers: + # f77/f90/f95: generic compiler names + # g77: GNU Fortran 77 compiler + # gfortran: putative GNU Fortran 95+ compiler (in progress) + # fort77: native F77 compiler under HP-UX (and some older Crays) + # frt: Fujitsu F77 compiler + # pgf77/pgf90/pgf95: Portland Group F77/F90/F95 compilers + # xlf/xlf90/xlf95: IBM (AIX) F77/F90/F95 compilers + # lf95: Lahey-Fujitsu F95 compiler + # fl32: Microsoft Fortran 77 "PowerStation" compiler + # af77: Apogee F77 compiler for Intergraph hardware running CLIX + # epcf90: "Edinburgh Portable Compiler" F90 + # fort: Compaq (now HP) Fortran 90/95 compiler for Tru64 and Linux/Alpha + # ifc: Intel Fortran 95 compiler for Linux/x86 + # efc: Intel Fortran 95 compiler for IA64 + # the order is 95 or newer compilers first, then 90, then 77 or older compilers, gnu is always last in the group, + # so if you paid for a compiler it is picked by default + SET(CMAKE_Fortran_COMPILER_LIST ifort ifc efc f95 pgf95 lf95 xlf95 fort gfortran f90 pgf90 xlf90 epcf90 + f77 fort77 frt pgf77 xlf fl32 af77 g77 ) + FIND_PROGRAM(CMAKE_Fortran_COMPILER_FULLPATH NAMES ${CMAKE_Fortran_COMPILER_LIST} ) + GET_FILENAME_COMPONENT(CMAKE_Fortran_COMPILER_INIT + ${CMAKE_Fortran_COMPILER_FULLPATH} NAME) + SET(CMAKE_Fortran_COMPILER_FULLPATH "${CMAKE_Fortran_COMPILER_FULLPATH}" CACHE INTERNAL "full path to the compiler cmake found") + ENDIF(NOT CMAKE_Fortran_COMPILER_INIT) - SET(CMAKE_FORTRAN_COMPILER ${CMAKE_FORTRAN_COMPILER_INIT} CACHE STRING "Fortran compiler") -ENDIF(NOT CMAKE_FORTRAN_COMPILER) + SET(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_INIT} CACHE STRING "Fortran compiler") +ENDIF(NOT CMAKE_Fortran_COMPILER) -MARK_AS_ADVANCED(CMAKE_FORTRAN_COMPILER) +MARK_AS_ADVANCED(CMAKE_Fortran_COMPILER) FIND_PROGRAM(CMAKE_AR NAMES ar ) @@ -49,12 +66,12 @@ MARK_AS_ADVANCED(CMAKE_RANLIB) IF(NOT CMAKE_COMPILER_IS_GNUG77_RUN) # test to see if the Fortran compiler is gnu - IF(CMAKE_FORTRAN_FLAGS) - SET(CMAKE_BOOT_FORTRAN_FLAGS ${CMAKE_FORTRAN_FLAGS}) - ELSE(CMAKE_FORTRAN_FLAGS) - SET(CMAKE_BOOT_FORTRAN_FLAGS $ENV{FFLAGS}) - ENDIF(CMAKE_FORTRAN_FLAGS) - EXEC_PROGRAM(${CMAKE_FORTRAN_COMPILER} ARGS ${CMAKE_BOOT_FORTRAN_FLAGS} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\"" OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN) + IF(CMAKE_Fortran_FLAGS) + SET(CMAKE_BOOT_Fortran_FLAGS ${CMAKE_Fortran_FLAGS}) + ELSE(CMAKE_Fortran_FLAGS) + SET(CMAKE_BOOT_Fortran_FLAGS $ENV{FFLAGS}) + ENDIF(CMAKE_Fortran_FLAGS) + EXEC_PROGRAM(${CMAKE_Fortran_COMPILER} ARGS ${CMAKE_BOOT_Fortran_FLAGS} -E "\"${CMAKE_ROOT}/Modules/CMakeTestGNU.c\"" OUTPUT_VARIABLE CMAKE_COMPILER_OUTPUT RETURN_VALUE CMAKE_COMPILER_RETURN) SET(CMAKE_COMPILER_IS_GNUG77_RUN 1) IF(NOT CMAKE_COMPILER_RETURN) IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" ) @@ -81,3 +98,4 @@ ENDIF(NOT CMAKE_COMPILER_IS_GNUG77_RUN) CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in ${CMAKE_BINARY_DIR}/CMakeFortranCompiler.cmake IMMEDIATE) MARK_AS_ADVANCED(CMAKE_AR) +SET(CMAKE_Fortran_COMPILER_ENV_VAR "FC") diff --git a/Modules/CMakeDetermineJavaCompiler.cmake b/Modules/CMakeDetermineJavaCompiler.cmake index 91a44e7..de5227d 100644 --- a/Modules/CMakeDetermineJavaCompiler.cmake +++ b/Modules/CMakeDetermineJavaCompiler.cmake @@ -73,3 +73,4 @@ MARK_AS_ADVANCED(CMAKE_JAVA_COMPILER) CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in ${CMAKE_BINARY_DIR}/CMakeJavaCompiler.cmake IMMEDIATE @ONLY) MARK_AS_ADVANCED(CMAKE_AR CMAKE_JAVA_COMPILER_FULLPATH) +SET(CMAKE_JAVA_COMPILER_ENV_VAR "JC") diff --git a/Modules/CMakeFortranCompiler.cmake.in b/Modules/CMakeFortranCompiler.cmake.in index 1bf30a1..21a5f0d 100644 --- a/Modules/CMakeFortranCompiler.cmake.in +++ b/Modules/CMakeFortranCompiler.cmake.in @@ -1,8 +1,8 @@ -SET(CMAKE_FORTRAN_COMPILER "@CMAKE_FORTRAN_COMPILER@") +SET(CMAKE_Fortran_COMPILER "@CMAKE_Fortran_COMPILER@") SET(CMAKE_AR "@CMAKE_AR@") SET(CMAKE_RANLIB "@CMAKE_RANLIB@") SET(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@) -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_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@) IF(CMAKE_COMPILER_IS_CYGWIN) diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake new file mode 100644 index 0000000..fa4894a --- /dev/null +++ b/Modules/CMakeFortranInformation.cmake @@ -0,0 +1,120 @@ +# This file sets the basic flags for the Fortran language in CMake. +# It also loads the available platform file for the system-compiler +# if it exists. + +GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_Fortran_COMPILER} NAME_WE) +# since the gnu compiler has several names force g++ +IF(CMAKE_COMPILER_IS_GNUG77) + SET(CMAKE_BASE_NAME g77) +ENDIF(CMAKE_COMPILER_IS_GNUG77) +SET(CMAKE_SYSTEM_AND_Fortran_COMPILER_INFO_FILE + ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) +INCLUDE(Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME} OPTIONAL) + + +# Create a set of shared library variable specific to Fortran +# For 90% of the systems, these are the same flags as the C versions +# so if these are not set just copy the flags from the c version +IF(NOT CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS) + SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS) + +IF(NOT CMAKE_SHARED_LIBRARY_Fortran_FLAGS) + SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_Fortran_FLAGS) + +IF(NOT CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS) + SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_FLAGS}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS) + +IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG) + SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_FLAG}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG) + +IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP) + SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP) + +# repeat for modules +IF(NOT CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS) + SET(CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) +ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS) + +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_LINK_Fortran_FLAGS) + SET(CMAKE_SHARED_MODULE_LINK_Fortran_FLAGS ${CMAKE_SHARED_MODULE_LINK_FLAGS}) +ENDIF(NOT CMAKE_SHARED_MODULE_LINK_Fortran_FLAGS) + +IF(NOT CMAKE_SHARED_MODULE_RUNTIME_Fortran_FLAG) + SET(CMAKE_SHARED_MODULE_RUNTIME_Fortran_FLAG ${CMAKE_SHARED_MODULE_RUNTIME_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_FLAG_SEP}) +ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_Fortran_FLAG_SEP) + +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 "${CMAKE_Fortran_FLAGS_ENV_INIT} $ENV{FFLAGS} ${CMAKE_Fortran_FLAGS_INIT}" CACHE STRING + "Flags for Fortran compiler.") + + + +INCLUDE(CMakeCommonLanguageInclude) + +# now define the following rule variables +# CMAKE_Fortran_CREATE_SHARED_LIBRARY +# CMAKE_Fortran_CREATE_SHARED_MODULE +# CMAKE_Fortran_CREATE_STATIC_LIBRARY +# CMAKE_Fortran_COMPILE_OBJECT +# CMAKE_Fortran_LINK_EXECUTABLE + +# create a Fortran shared library +IF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY) + SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY + " -o ") +ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_LIBRARY) + +# create a Fortran shared module just copy the shared library rule +IF(NOT CMAKE_Fortran_CREATE_SHARED_MODULE) + SET(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY}) +ENDIF(NOT CMAKE_Fortran_CREATE_SHARED_MODULE) + +# create a Fortran static library +IF(NOT CMAKE_Fortran_CREATE_STATIC_LIBRARY) + SET(CMAKE_Fortran_CREATE_STATIC_LIBRARY + " cr " + " ") +ENDIF(NOT CMAKE_Fortran_CREATE_STATIC_LIBRARY) + +# compile a Fortran file into an object file +IF(NOT CMAKE_Fortran_COMPILE_OBJECT) + SET(CMAKE_Fortran_COMPILE_OBJECT + " -o -c ") +ENDIF(NOT CMAKE_Fortran_COMPILE_OBJECT) + +# link a fortran program +IF(NOT CMAKE_Fortran_LINK_EXECUTABLE) + SET(CMAKE_Fortran_LINK_EXECUTABLE + " -o ") +ENDIF(NOT CMAKE_Fortran_LINK_EXECUTABLE) + + +# Load the user define rules +IF(CMAKE_USER_MAKE_RULES_OVERRIDE) + INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE}) +ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE) + + +MARK_AS_ADVANCED( +CMAKE_Fortran_FLAGS +CMAKE_Fortran_FLAGS_DEBUG +CMAKE_Fortran_FLAGS_MINSIZEREL +CMAKE_Fortran_FLAGS_RELEASE +CMAKE_Fortran_FLAGS_RELWITHDEBINFO) + +# set this variable so we can avoid loading this more than once. +SET(CMAKE_Fortran_INFOMATION_LOADED 1) diff --git a/Modules/CMakeGenericSystem.cmake b/Modules/CMakeGenericSystem.cmake new file mode 100644 index 0000000..7ab9995 --- /dev/null +++ b/Modules/CMakeGenericSystem.cmake @@ -0,0 +1,36 @@ +SET(CMAKE_LINK_LIBRARY_SUFFIX "") + +SET(CMAKE_STATIC_LIBRARY_PREFIX "lib") +SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a") +SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib +SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so +SET(CMAKE_DL_LIBS "-ldl") +SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic +SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared +SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "") # +s, flag for exe link to use shared lib +SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "") # -rpath +SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP "") # : or empty +SET(CMAKE_LIBRARY_PATH_FLAG "-L") +SET(CMAKE_LINK_LIBRARY_FLAG "-l") +IF(CMAKE_COMPILER_IS_GNUCC) + SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic +ENDIF(CMAKE_COMPILER_IS_GNUCC) +IF(CMAKE_COMPILER_IS_GNUCXX) + SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fPIC") # -pic +ENDIF(CMAKE_COMPILER_IS_GNUCXX) + +SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL + "If set, runtime paths are not added when using shared libraries.") +SET (CMAKE_INSTALL_PREFIX /usr/local CACHE PATH + "Install path prefix, prepended onto install directories.") + +MARK_AS_ADVANCED( +CMAKE_SKIP_RPATH +) + +IF(NOT UNIX) + MARK_AS_ADVANCED(CMAKE_INSTALL_PREFIX) +ENDIF(NOT UNIX) + +# always include the gcc compiler information +INCLUDE(Platform/gcc) diff --git a/Modules/CMakeJavaCompiler.cmake.in b/Modules/CMakeJavaCompiler.cmake.in index d1b85e7..f0ae7c0 100644 --- a/Modules/CMakeJavaCompiler.cmake.in +++ b/Modules/CMakeJavaCompiler.cmake.in @@ -63,4 +63,4 @@ MACRO(ADD_JAVA_LIBRARY LIBRARYNAME SOURCES) ELSE(CMAKE_JAVA_COMPILER AND CMAKE_JAVA_ARCHIVE) MESSAGE(SEND_ERROR "Java compiler and/or Java archiver not found") ENDIF(CMAKE_JAVA_COMPILER AND CMAKE_JAVA_ARCHIVE) -ENDMACRO(ADD_JAVA_LIBRARY LIBRARYNAME SOURCES) \ No newline at end of file +ENDMACRO(ADD_JAVA_LIBRARY LIBRARYNAME SOURCES) diff --git a/Modules/CMakeJavaInformation.cmake b/Modules/CMakeJavaInformation.cmake new file mode 100644 index 0000000..891ac06 --- /dev/null +++ b/Modules/CMakeJavaInformation.cmake @@ -0,0 +1 @@ +# this is a place holder if java needed flags for javac they would go here. diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake index bdc3fe0..aeb4d09 100644 --- a/Modules/CMakeSystemSpecificInformation.cmake +++ b/Modules/CMakeSystemSpecificInformation.cmake @@ -1,48 +1,14 @@ -# this module sets system information like how to build libraries -# before including this file the system, C, and C++ compilers must -# have already been determined. -# This file first sets default variables that can be used for most -# makefiles. Next, it will include a system specific file. Finally, -# it will optionally include a system and compiler specific file that -# can be used to override any of this information. -# For debugging new systems, and expert users, if the -# CMAKE_USER_MAKE_RULES_OVERRIDE is set to a file name, that -# file will be included last, and can override any variable +# This file is included by cmGlobalGenerator::EnableLanguage. +# It is included after the compiler has been determined, so +# we know things like the compiler name and if the compiler is gnu. +# include Generic system information +INCLUDE(CMakeGenericSystem) -# 1. set default values that will work for most system - -# suffix that needs to be added onto a library to link it .lib on windows -# not used on most unix systems -SET(CMAKE_LINK_LIBRARY_SUFFIX "") - -SET(CMAKE_STATIC_LIBRARY_PREFIX "lib") -SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a") -SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib -SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so -SET(CMAKE_DL_LIBS "-ldl") -SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic -SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared -SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "") # +s, flag for exe link to use shared lib -SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "") # -rpath -SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP "") # : or empty -SET(CMAKE_LIBRARY_PATH_FLAG "-L") -SET(CMAKE_LINK_LIBRARY_FLAG "-l") -IF(CMAKE_COMPILER_IS_GNUCC) - SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic -ENDIF(CMAKE_COMPILER_IS_GNUCC) -IF(CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fPIC") # -pic -ENDIF(CMAKE_COMPILER_IS_GNUCXX) - - -SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL - "If set, runtime paths are not added when using shared libraries.") -MARK_AS_ADVANCED(CMAKE_SKIP_RPATH) # 2. now include SystemName.cmake file to set the system specific information SET(CMAKE_SYSTEM_INFO_FILE ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}.cmake) IF(EXISTS ${CMAKE_SYSTEM_INFO_FILE}) - INCLUDE(${CMAKE_SYSTEM_INFO_FILE}) + INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL) ELSE(EXISTS ${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 " @@ -52,39 +18,15 @@ ELSE(EXISTS ${CMAKE_SYSTEM_INFO_FILE}) ${CMAKE_BINARY_DIR}/CopyOfCMakeCache.txt COPYONLY) MESSAGE("You CMakeCache.txt file was copied to CopyOfCMakeCache.txt. " "Please send that file to cmake@www.cmake.org.") - ENDIF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt) + ENDIF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt) ENDIF(EXISTS ${CMAKE_SYSTEM_INFO_FILE}) -# 3. include optional systemname-compiler.cmake files -IF(CMAKE_C_COMPILER) - GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_C_COMPILER} NAME_WE) - # since the gnu compiler has several names force gcc - IF(CMAKE_COMPILER_IS_GNUCC) - SET(CMAKE_BASE_NAME gcc) - ENDIF(CMAKE_COMPILER_IS_GNUCC) - SET(CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE - ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) - INCLUDE(${CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE} OPTIONAL) -ENDIF(CMAKE_C_COMPILER) -IF(CMAKE_CXX_COMPILER) - GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE) - # since the gnu compiler has several names force g++ - IF(CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_BASE_NAME g++) - ENDIF(CMAKE_COMPILER_IS_GNUCXX) - SET(CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE - ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) - INCLUDE(${CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE} OPTIONAL) -ENDIF(CMAKE_CXX_COMPILER) - # for most systems a module is the same as a shared library # so unless the variable CMAKE_MODULE_EXISTS is set just # copy the values from the LIBRARY variables +# this has to be done after the system information has been loaded IF(NOT CMAKE_MODULE_EXISTS) - SET(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) - SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) - SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) SET(CMAKE_SHARED_MODULE_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX}) SET(CMAKE_SHARED_MODULE_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) SET(CMAKE_SHARED_MODULE_LINK_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_FLAGS}) @@ -93,244 +35,4 @@ IF(NOT CMAKE_MODULE_EXISTS) ENDIF(NOT CMAKE_MODULE_EXISTS) -# Create a set of shared library variable specific to C++ -# For 90% of the systems, these are the same flags as the C versions -# so if these are not set just copy the flags from the c version -IF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS) - SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) -ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS) - -IF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS) - SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) -ENDIF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS) - -IF(NOT CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) - SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_FLAGS}) -ENDIF(NOT CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) - -IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG) - SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_FLAG}) -ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG) - -IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP) - SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP}) -ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP) - -# repeat for modules -IF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS) - SET(CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) -ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS) - -IF(NOT CMAKE_SHARED_MODULE_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_LINK_CXX_FLAGS) - SET(CMAKE_SHARED_MODULE_LINK_CXX_FLAGS ${CMAKE_SHARED_MODULE_LINK_FLAGS}) -ENDIF(NOT CMAKE_SHARED_MODULE_LINK_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) - -# Create a set of shared library variable specific to Fortran -# For 90% of the systems, these are the same flags as the C versions -# so if these are not set just copy the flags from the c version -IF(NOT CMAKE_SHARED_LIBRARY_CREATE_FORTRAN_FLAGS) - SET(CMAKE_SHARED_LIBRARY_CREATE_FORTRAN_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) -ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_FORTRAN_FLAGS) - -IF(NOT CMAKE_SHARED_LIBRARY_FORTRAN_FLAGS) - SET(CMAKE_SHARED_LIBRARY_FORTRAN_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) -ENDIF(NOT CMAKE_SHARED_LIBRARY_FORTRAN_FLAGS) - -IF(NOT CMAKE_SHARED_LIBRARY_LINK_FORTRAN_FLAGS) - SET(CMAKE_SHARED_LIBRARY_LINK_FORTRAN_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_FLAGS}) -ENDIF(NOT CMAKE_SHARED_LIBRARY_LINK_FORTRAN_FLAGS) - -IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_FORTRAN_FLAG) - SET(CMAKE_SHARED_LIBRARY_RUNTIME_FORTRAN_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_FLAG}) -ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_FORTRAN_FLAG) - -IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_FORTRAN_FLAG_SEP) - SET(CMAKE_SHARED_LIBRARY_RUNTIME_FORTRAN_FLAG_SEP ${CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP}) -ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_FORTRAN_FLAG_SEP) - -# repeat for modules -IF(NOT CMAKE_SHARED_MODULE_CREATE_FORTRAN_FLAGS) - SET(CMAKE_SHARED_MODULE_CREATE_FORTRAN_FLAGS ${CMAKE_SHARED_MODULE_CREATE_C_FLAGS}) -ENDIF(NOT CMAKE_SHARED_MODULE_CREATE_FORTRAN_FLAGS) - -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_LINK_FORTRAN_FLAGS) - SET(CMAKE_SHARED_MODULE_LINK_FORTRAN_FLAGS ${CMAKE_SHARED_MODULE_LINK_FLAGS}) -ENDIF(NOT CMAKE_SHARED_MODULE_LINK_FORTRAN_FLAGS) - -IF(NOT CMAKE_SHARED_MODULE_RUNTIME_FORTRAN_FLAG) - SET(CMAKE_SHARED_MODULE_RUNTIME_FORTRAN_FLAG ${CMAKE_SHARED_MODULE_RUNTIME_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_FLAG_SEP}) -ENDIF(NOT CMAKE_SHARED_MODULE_RUNTIME_FORTRAN_FLAG_SEP) - -# include default rules that work for most unix like systems and compilers -# this file will not set anything if it is already set -INCLUDE(${CMAKE_ROOT}/Modules/CMakeDefaultMakeRuleVariables.cmake) - -IF(CMAKE_USER_MAKE_RULES_OVERRIDE) - INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE}) -ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE) - -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_INSTALL_PREFIX /usr/local CACHE PATH - "Install path prefix, prepended onto install directories.") - -# add the flags to the cache based -# on the initial values computed in the platform/*.cmake files -# use _INIT variables so that this only happens the first time -# and you can set these flags in the cmake cache -SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS_ENV_INIT} $ENV{CXXFLAGS} ${CMAKE_CXX_FLAGS_INIT}" CACHE STRING - "Flags used by the compiler during all build types.") - -SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_ENV_INIT} $ENV{CFLAGS} ${CMAKE_C_FLAGS_INIT}" CACHE STRING - "Flags for C compiler.") - -SET (CMAKE_FORTRAN_FLAGS "${CMAKE_FORTRAN_FLAGS_ENV_INIT} $ENV{FFLAGS} ${CMAKE_FORTRAN_FLAGS_INIT}" CACHE STRING - "Flags for Fortran compiler.") - -SET (CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS_INIT} $ENV{LDFLAGS} - CACHE STRING "Flags used by the linker.") - -IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) -# default build type is none - IF(NOT CMAKE_NO_BUILD_TYPE) - SET (CMAKE_BUILD_TYPE ${CMAKE_BUILD_TYPE_INIT} CACHE STRING - "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.") - ENDIF(NOT CMAKE_NO_BUILD_TYPE) - - SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG_INIT}" CACHE STRING - "Flags used by the compiler during debug builds.") - SET (CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL_INIT}" CACHE STRING - "Flags used by the compiler during release minsize builds.") - SET (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE_INIT}" CACHE STRING - "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).") - SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING - "Flags used by the compiler during Release with Debug Info builds.") - SET (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG_INIT}" CACHE STRING - "Flags used by the compiler during debug builds.") - SET (CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL_INIT}" CACHE STRING - "Flags used by the compiler during release minsize builds.") - SET (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE_INIT}" CACHE STRING - "Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot /Oy /Gs will produce slightly less optimized but smaller files).") - SET (CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO_INIT}" CACHE STRING - "Flags used by the compiler during Release with Debug Info builds.") - - SET (CMAKE_EXE_LINKER_FLAGS_DEBUG ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING - "Flags used by the linker during debug builds.") - - SET (CMAKE_EXE_LINKER_FLAGS_MINSIZEREL ${CMAKE_EXE_LINKER_FLAGS_MINSIZEREL_INIT} CACHE STRING - "Flags used by the linker during release minsize builds.") - - SET (CMAKE_EXE_LINKER_FLAGS_RELEASE ${CMAKE_EXE_LINKER_FLAGS_RELEASE_INIT} "" CACHE STRING - "Flags used by the linker during release builds.") - - SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO - ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING - "Flags used by the linker during Release with Debug Info builds.") - - SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT} CACHE STRING - "Flags used by the linker during debug builds.") - - SET (CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL ${CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL_INIT} - CACHE STRING - "Flags used by the linker during release minsize builds.") - - SET (CMAKE_SHARED_LINKER_FLAGS_RELEASE ${CMAKE_SHARED_LINKER_FLAGS_RELEASE_INIT} "" CACHE STRING - "Flags used by the linker during release builds.") - - SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO - ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING - "Flags used by the linker during Release with Debug Info builds.") - - SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG ${CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT} CACHE STRING - "Flags used by the linker during debug builds.") - - SET (CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL ${CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL_INIT} - CACHE STRING - "Flags used by the linker during release minsize builds.") - - SET (CMAKE_MODULE_LINKER_FLAGS_RELEASE ${CMAKE_MODULE_LINKER_FLAGS_RELEASE_INIT} "" CACHE STRING - "Flags used by the linker during release builds.") - - SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO - ${CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT} CACHE STRING - "Flags used by the linker during Release with Debug Info builds.") -ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) - - - -# shared linker flags -SET (CMAKE_SHARED_LINKER_FLAGS ${CMAKE_SHARED_LINKER_FLAGS_INIT} $ENV{LDFLAGS} - CACHE STRING "Flags used by the linker during the creation of dll's.") - -# module linker flags -SET (CMAKE_MODULE_LINKER_FLAGS ${CMAKE_MODULE_LINKER_FLAGS_INIT} $ENV{LDFLAGS} - CACHE STRING "Flags used by the linker during the creation of modules.") - -SET(CMAKE_BUILD_TOOL ${CMAKE_MAKE_PROGRAM} CACHE INTERNAL - "What is the target build tool cmake is generating for.") - -MARK_AS_ADVANCED( -CMAKE_BUILD_TOOL -CMAKE_VERBOSE_MAKEFILE -CMAKE_CXX_FLAGS -CMAKE_CXX_FLAGS_RELEASE -CMAKE_CXX_FLAGS_RELWITHDEBINFO -CMAKE_CXX_FLAGS_MINSIZEREL -CMAKE_CXX_FLAGS_DEBUG - -CMAKE_C_FLAGS -CMAKE_C_FLAGS_DEBUG -CMAKE_C_FLAGS_MINSIZEREL -CMAKE_C_FLAGS_RELEASE -CMAKE_C_FLAGS_RELWITHDEBINFO - -CMAKE_FORTRAN_FLAGS -CMAKE_FORTRAN_FLAGS_DEBUG -CMAKE_FORTRAN_FLAGS_MINSIZEREL -CMAKE_FORTRAN_FLAGS_RELEASE -CMAKE_FORTRAN_FLAGS_RELWITHDEBINFO - -CMAKE_EXE_LINKER_FLAGS -CMAKE_EXE_LINKER_FLAGS_DEBUG -CMAKE_EXE_LINKER_FLAGS_MINSIZEREL -CMAKE_EXE_LINKER_FLAGS_RELEASE -CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO - -CMAKE_SHARED_LINKER_FLAGS -CMAKE_SHARED_LINKER_FLAGS_DEBUG -CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL -CMAKE_SHARED_LINKER_FLAGS_RELEASE -CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO - -CMAKE_MODULE_LINKER_FLAGS -CMAKE_MODULE_LINKER_FLAGS_DEBUG -CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL -CMAKE_MODULE_LINKER_FLAGS_RELEASE -CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO - -) -IF(NOT UNIX) - MARK_AS_ADVANCED(CMAKE_INSTALL_PREFIX) -ENDIF(NOT UNIX) - SET(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1) diff --git a/Modules/CMakeTestFortranCompiler.cmake b/Modules/CMakeTestFortranCompiler.cmake index 677cb77..e805d62 100644 --- a/Modules/CMakeTestFortranCompiler.cmake +++ b/Modules/CMakeTestFortranCompiler.cmake @@ -1,32 +1,32 @@ # This file is used by EnableLanguage in cmGlobalGenerator to -# determine that that selected C 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 # is set and cmake stops processing commands and will not generate # any makefiles or projects. -IF(NOT CMAKE_FORTRAN_COMPILER_WORKS) - MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_FORTRAN_COMPILER}") +IF(NOT CMAKE_Fortran_COMPILER_WORKS) + MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_Fortran_COMPILER}") FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/testFortranCompiler.f " - PROGRAM TESTFORTRAN + PROGRAM TESTFortran PRINT *, 'Hello' END ") - TRY_COMPILE(CMAKE_FORTRAN_COMPILER_WORKS ${CMAKE_BINARY_DIR} + TRY_COMPILE(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}/CMakeTmp/testFortranCompiler.f OUTPUT_VARIABLE OUTPUT) -ENDIF(NOT CMAKE_FORTRAN_COMPILER_WORKS) +ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS) -IF(NOT CMAKE_FORTRAN_COMPILER_WORKS) - MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_FORTRAN_COMPILER} -- broken") +IF(NOT CMAKE_Fortran_COMPILER_WORKS) + MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_Fortran_COMPILER} -- broken") FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log "Determining if the Fortran compiler works failed with " "the following output:\n${OUTPUT}\n\n") - MESSAGE(FATAL_ERROR "The Fortran compiler \"${CMAKE_FORTRAN_COMPILER}\" " + MESSAGE(FATAL_ERROR "The Fortran compiler \"${CMAKE_Fortran_COMPILER}\" " "is not able to compile a simple test program.\nIt fails " "with the following output:\n ${OUTPUT}\n\n" "CMake will not be able to correctly generate this project.") -ELSE(NOT CMAKE_FORTRAN_COMPILER_WORKS) - MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_FORTRAN_COMPILER} -- works") +ELSE(NOT CMAKE_Fortran_COMPILER_WORKS) + MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_Fortran_COMPILER} -- works") FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log "Determining if the Fortran compiler works passed with " "the following output:\n${OUTPUT}\n\n") -ENDIF(NOT CMAKE_FORTRAN_COMPILER_WORKS) +ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS) diff --git a/Modules/Platform/AIX.cmake b/Modules/Platform/AIX.cmake index 7dffcde..7f17c83 100644 --- a/Modules/Platform/AIX.cmake +++ b/Modules/Platform/AIX.cmake @@ -9,4 +9,3 @@ ENDIF(CMAKE_COMPILER_IS_GNUCXX) IF(CMAKE_COMPILER_IS_GNUCC) SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-G") # -shared ENDIF(CMAKE_COMPILER_IS_GNUCC) -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) diff --git a/Modules/Platform/BSDOS.cmake b/Modules/Platform/BSDOS.cmake index 7d4d0c8..8b13789 100644 --- a/Modules/Platform/BSDOS.cmake +++ b/Modules/Platform/BSDOS.cmake @@ -1 +1 @@ -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) + diff --git a/Modules/Platform/CYGWIN.cmake b/Modules/Platform/CYGWIN.cmake index a7cb34c..78a53ce 100644 --- a/Modules/Platform/CYGWIN.cmake +++ b/Modules/Platform/CYGWIN.cmake @@ -5,4 +5,3 @@ SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") # no pic for gcc on cygwin SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "") -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index 8a1fd17..88eab7e 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -24,6 +24,5 @@ SET(CMAKE_CXX_CREATE_SHARED_MODULE SET(CMAKE_C_CREATE_SHARED_MODULE " -o ") -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) SET(CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES /usr/local/include) diff --git a/Modules/Platform/FreeBSD.cmake b/Modules/Platform/FreeBSD.cmake index e5a8093..e5c03cb 100644 --- a/Modules/Platform/FreeBSD.cmake +++ b/Modules/Platform/FreeBSD.cmake @@ -7,4 +7,3 @@ IF(EXISTS /usr/include/dlfcn.h) SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") # : or empty ENDIF(EXISTS /usr/include/dlfcn.h) # include the gcc flags -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake index 97d3e24..b66a9eb 100644 --- a/Modules/Platform/HP-UX.cmake +++ b/Modules/Platform/HP-UX.cmake @@ -51,4 +51,3 @@ ELSE(CMAKE_COMPILER_IS_GNUCXX) ENDIF(CMAKE_COMPILER_IS_GNUCXX) # set flags for gcc support -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) diff --git a/Modules/Platform/IRIX.cmake b/Modules/Platform/IRIX.cmake index 9d924c9..96c8258 100644 --- a/Modules/Platform/IRIX.cmake +++ b/Modules/Platform/IRIX.cmake @@ -14,4 +14,3 @@ IF(NOT CMAKE_COMPILER_IS_GNUCXX) SET (CMAKE_C_FLAGS_INIT "") ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) # set flags for gcc support -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) diff --git a/Modules/Platform/IRIX64.cmake b/Modules/Platform/IRIX64.cmake index 9403381..1d556fb 100644 --- a/Modules/Platform/IRIX64.cmake +++ b/Modules/Platform/IRIX64.cmake @@ -9,6 +9,7 @@ IF(NOT CMAKE_COMPILER_IS_GNUCXX) # Set default flags init. SET(CMAKE_C_FLAGS_INIT "") SET(CMAKE_CXX_FLAGS_INIT "") + SET(CMAKE_FORTRAN_FLAGS_INIT "") SET(CMAKE_EXE_LINKER_FLAGS_INIT "") SET(CMAKE_SHARED_LINKER_FLAGS_INIT "") SET(CMAKE_MODULE_LINKER_FLAGS_INIT "") @@ -27,6 +28,7 @@ IF(NOT CMAKE_COMPILER_IS_GNUCXX) IF(CMAKE_FILE_SELF MATCHES " 64-bit ") SET(CMAKE_C_FLAGS_INIT "-64") SET(CMAKE_CXX_FLAGS_INIT "-64") + SET(CMAKE_Fortran_FLAGS_INIT "-64") SET(CMAKE_EXE_LINKER_FLAGS_INIT "-64") SET(CMAKE_SHARED_LINKER_FLAGS_INIT "-64") SET(CMAKE_MODULE_LINKER_FLAGS_INIT "-64") @@ -41,6 +43,3 @@ IF(NOT CMAKE_COMPILER_IS_GNUCXX) SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O2 -DNDEBUG") SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2") ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) - -# set up for gcc if the compiler is gcc -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake index 02c809e..6e76a2f 100644 --- a/Modules/Platform/Linux.cmake +++ b/Modules/Platform/Linux.cmake @@ -1,6 +1,4 @@ # GCC is the default compiler on Linux. -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) - SET(CMAKE_DL_LIBS "-ldl") SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") diff --git a/Modules/Platform/MP-RAS.cmake b/Modules/Platform/MP-RAS.cmake index b52fe12..5a644dc 100644 --- a/Modules/Platform/MP-RAS.cmake +++ b/Modules/Platform/MP-RAS.cmake @@ -7,5 +7,3 @@ ENDIF(CMAKE_SYSTEM MATCHES "MP-RAS-02*.") -# include the gcc flags -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) diff --git a/Modules/Platform/NetBSD.cmake b/Modules/Platform/NetBSD.cmake index e5a8093..e9c9ab2 100644 --- a/Modules/Platform/NetBSD.cmake +++ b/Modules/Platform/NetBSD.cmake @@ -6,5 +6,3 @@ IF(EXISTS /usr/include/dlfcn.h) SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "-Wl,-rpath,") # -rpath SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") # : or empty ENDIF(EXISTS /usr/include/dlfcn.h) -# include the gcc flags -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) diff --git a/Modules/Platform/OSF1.cmake b/Modules/Platform/OSF1.cmake index f31aac0..d501c2d 100644 --- a/Modules/Platform/OSF1.cmake +++ b/Modules/Platform/OSF1.cmake @@ -29,7 +29,6 @@ ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*") IF(CMAKE_COMPILER_IS_GNUCXX) # include the gcc flags - INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) ELSE (CMAKE_COMPILER_IS_GNUCXX) # use default OSF compiler flags SET (CMAKE_C_FLAGS_INIT "") diff --git a/Modules/Platform/OpenBSD.cmake b/Modules/Platform/OpenBSD.cmake index 63ffb93..8b13789 100644 --- a/Modules/Platform/OpenBSD.cmake +++ b/Modules/Platform/OpenBSD.cmake @@ -1,2 +1 @@ -# include the gcc flags -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) + diff --git a/Modules/Platform/RISCos.cmake b/Modules/Platform/RISCos.cmake index 5622827..1979d5e 100644 --- a/Modules/Platform/RISCos.cmake +++ b/Modules/Platform/RISCos.cmake @@ -2,5 +2,3 @@ SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0") SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o") SET(CMAKE_DL_LIBS "") SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-D,08000000") -# include the gcc flags -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) diff --git a/Modules/Platform/SCO_SV.cmake b/Modules/Platform/SCO_SV.cmake index 929b04d..89dcd56 100644 --- a/Modules/Platform/SCO_SV.cmake +++ b/Modules/Platform/SCO_SV.cmake @@ -2,5 +2,3 @@ SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-Kpic -belf") SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-Kpic -belf") SET(CMAKE_DL_LIBS "") SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-belf -Wl,-Bexport") -# include the gcc flags -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) diff --git a/Modules/Platform/SINIX.cmake b/Modules/Platform/SINIX.cmake index 5542709..1acacbb 100644 --- a/Modules/Platform/SINIX.cmake +++ b/Modules/Platform/SINIX.cmake @@ -1,4 +1,2 @@ SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") -# include the gcc flags -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) diff --git a/Modules/Platform/SunOS.cmake b/Modules/Platform/SunOS.cmake index ea2ecd9..c8b4a38 100644 --- a/Modules/Platform/SunOS.cmake +++ b/Modules/Platform/SunOS.cmake @@ -46,5 +46,3 @@ ELSE(CMAKE_COMPILER_IS_GNUCXX) " -xar -o " " ") ENDIF(CMAKE_COMPILER_IS_GNUCXX) -# include the gcc flags -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) diff --git a/Modules/Platform/True64.cmake b/Modules/Platform/True64.cmake index 63ffb93..8b13789 100644 --- a/Modules/Platform/True64.cmake +++ b/Modules/Platform/True64.cmake @@ -1,2 +1 @@ -# include the gcc flags -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) + diff --git a/Modules/Platform/ULTRIX.cmake b/Modules/Platform/ULTRIX.cmake index 5d425fc..4064721 100644 --- a/Modules/Platform/ULTRIX.cmake +++ b/Modules/Platform/ULTRIX.cmake @@ -2,5 +2,3 @@ SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0") SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o") SET(CMAKE_DL_LIBS "") SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-D,08000000") -# include the gcc flags -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) diff --git a/Modules/Platform/UNIX_SV.cmake b/Modules/Platform/UNIX_SV.cmake index 14e0689..62b0e59 100644 --- a/Modules/Platform/UNIX_SV.cmake +++ b/Modules/Platform/UNIX_SV.cmake @@ -1,4 +1,2 @@ SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-Bexport") -# include the gcc flags -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) \ No newline at end of file diff --git a/Modules/Platform/UnixWare.cmake b/Modules/Platform/UnixWare.cmake index a471bcb..80acb87 100644 --- a/Modules/Platform/UnixWare.cmake +++ b/Modules/Platform/UnixWare.cmake @@ -1,4 +1,2 @@ SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC") SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-Wl,-Bexport") -# include the gcc flags -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) \ No newline at end of file diff --git a/Modules/Platform/Windows-gcc.cmake b/Modules/Platform/Windows-gcc.cmake index c38df85..0fab3f6 100644 --- a/Modules/Platform/Windows-gcc.cmake +++ b/Modules/Platform/Windows-gcc.cmake @@ -12,5 +12,3 @@ SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP "") # : or empty SET(CMAKE_LIBRARY_PATH_FLAG "-L") SET(CMAKE_LINK_LIBRARY_FLAG "-l") -# include the gcc flags -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) \ No newline at end of file diff --git a/Modules/Platform/Windows-ifort.cmake b/Modules/Platform/Windows-ifort.cmake new file mode 100644 index 0000000..7665422 --- /dev/null +++ b/Modules/Platform/Windows-ifort.cmake @@ -0,0 +1,65 @@ +SET(CMAKE_LIBRARY_PATH_FLAG "-LIBPATH:") +SET(CMAKE_LINK_LIBRARY_FLAG "") +SET(WIN32 1) + +SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY + "link /nologo ${CMAKE_START_TEMP_FILE} /out: /dll ${CMAKE_END_TEMP_FILE}") + +SET(CMAKE_Fortran_CREATE_SHARED_MODULE ${CMAKE_Fortran_CREATE_SHARED_LIBRARY}) + +# create a C++ static library +SET(CMAKE_Fortran_CREATE_STATIC_LIBRARY "lib /nologo /out: ") + +# compile a C++ file into an object file +SET(CMAKE_Fortran_COMPILE_OBJECT + " ${CMAKE_START_TEMP_FILE} /nologo /Fo -c ${CMAKE_END_TEMP_FILE}") + +SET(CMAKE_COMPILE_RESOURCE "rc /fo ") + +SET(CMAKE_Fortran_LINK_EXECUTABLE + " /nologo ${CMAKE_START_TEMP_FILE} /Fe -link ${CMAKE_END_TEMP_FILE}") + +SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows) +SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console) + +IF(CMAKE_GENERATOR MATCHES "Visual Studio 6") + SET (CMAKE_NO_BUILD_TYPE 1) +ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 6") +IF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") + SET (CMAKE_NO_BUILD_TYPE 1) + SET (CMAKE_CONFIGURATION_TYPES "Debug;Release;MinSizeRel;RelWithDebInfo" CACHE STRING + "Semicolon separated list of supported configuration types, only supports Debug, Release, MinSizeRel, and RelWithDebInfo, anything else will be ignored.") +ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visual Studio 8") +# does the compiler support pdbtype and is it the newer compiler + +SET(CMAKE_BUILD_TYPE_INIT Debug) +SET (CMAKE_Fortran_FLAGS_INIT "/W1") +SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full") +SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /D NDEBUG") +SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/MD /O1 /D NDEBUG") +SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O1 /debug:full /D NDEBUG") +SET (CMAKE_STANDARD_LIBRARIES "user32.lib" CACHE STRING + "Libraries linked by defalut with all applications.") + + +MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES) + + + +# executable linker flags +SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") +SET (CMAKE_EXE_LINKER_FLAGS_INIT " /INCREMENTAL:YES") +IF (CMAKE_COMPILER_SUPPORTS_PDBTYPE) + SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug /pdbtype:sept") + SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug /pdbtype:sept") +ELSE (CMAKE_COMPILER_SUPPORTS_PDBTYPE) + SET (CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "/debug") + SET (CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "/debug") +ENDIF (CMAKE_COMPILER_SUPPORTS_PDBTYPE) + +SET (CMAKE_SHARED_LINKER_FLAGS_INIT ${CMAKE_EXE_LINKER_FLAGS_INIT}) +SET (CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT}) +SET (CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT}) +SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT}) +SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT}) +SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT}) diff --git a/Modules/Platform/Xenix.cmake b/Modules/Platform/Xenix.cmake index 63ffb93..8b13789 100644 --- a/Modules/Platform/Xenix.cmake +++ b/Modules/Platform/Xenix.cmake @@ -1,2 +1 @@ -# include the gcc flags -INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake) + diff --git a/Source/CMakeLists.txt b/Source/CMakeLists.txt index 4f59aed..1a1fea0 100644 --- a/Source/CMakeLists.txt +++ b/Source/CMakeLists.txt @@ -119,6 +119,9 @@ TARGET_LINK_LIBRARIES(cmake CMakeLib) TARGET_LINK_LIBRARIES(DumpDocumentation CMakeLib) IF(CMAKE_BUILD_WITH_CURL) + # Don't even look for this as we don't use that part of curl + # and linking in the the library can cause problems. + SET(HAVE_LIBCRYPTO 0) SUBDIRS(CTest) SET(CMTEST_SRCS ${CMTEST_SRCS} CTest/cmCTestSubmit.cxx) ADD_DEFINITIONS(-DHAVE_CURL) diff --git a/Source/cmGlobalBorlandMakefileGenerator.cxx b/Source/cmGlobalBorlandMakefileGenerator.cxx index ca99c92..0fd068d 100644 --- a/Source/cmGlobalBorlandMakefileGenerator.cxx +++ b/Source/cmGlobalBorlandMakefileGenerator.cxx @@ -27,13 +27,6 @@ cmGlobalBorlandMakefileGenerator::cmGlobalBorlandMakefileGenerator() void cmGlobalBorlandMakefileGenerator::EnableLanguage(const char* l, cmMakefile *mf) { - // now load the settings - if(!mf->GetDefinition("CMAKE_ROOT")) - { - cmSystemTools::Error( - "CMAKE_ROOT has not been defined, bad GUI or driver program"); - return; - } std::string outdir = m_CMakeInstance->GetStartOutputDirectory(); mf->AddDefinition("BORLAND", "1"); mf->AddDefinition("CMAKE_GENERATOR_CC", "bcc32"); diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx index d33694b..1b416be 100644 --- a/Source/cmGlobalGenerator.cxx +++ b/Source/cmGlobalGenerator.cxx @@ -43,9 +43,8 @@ cmGlobalGenerator::~cmGlobalGenerator() m_LocalGenerators.clear(); } - -void cmGlobalGenerator::EnableLanguage(const char* lang, - cmMakefile *mf) +// Find the make program for the generator, required for try compiles +void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf) { if(m_FindMakeProgramFile.size() == 0) { @@ -53,14 +52,14 @@ void cmGlobalGenerator::EnableLanguage(const char* lang, "Generator implementation error, " "all generators must specify m_FindMakeProgramFile"); } - std::string root = mf->GetRequiredDefinition("CMAKE_ROOT"); if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM") || cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) { - std::string setMakeProgram = root; - setMakeProgram += "/Modules/"; - setMakeProgram += m_FindMakeProgramFile; - mf->ReadListFile(0, setMakeProgram.c_str()); + std::string setMakeProgram = mf->GetModulesFile(m_FindMakeProgramFile.c_str()); + if(setMakeProgram.size()) + { + mf->ReadListFile(0, setMakeProgram.c_str()); + } } if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM") || cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM"))) @@ -94,24 +93,40 @@ void cmGlobalGenerator::EnableLanguage(const char* lang, "make program", cmCacheManager::FILEPATH); } - + +} + + +// enable the given language +void cmGlobalGenerator::EnableLanguage(const char* lang, + cmMakefile *mf) +{ + if(!lang) + { + cmSystemTools::Error("EnableLanguage must have a lang specified!"); + cmSystemTools::SetFatalErrorOccured(); + return; + } + // setup some variables for the EnableLanguage function bool isLocal = m_CMakeInstance->GetLocal(); - // if no lang specified use CXX - if(!lang ) + // if we are from the top, always define this + if(!isLocal) { - lang = "CXX"; + mf->AddDefinition("RUN_CONFIGURE", true); } + bool needTestLanguage = false; std::string rootBin = mf->GetHomeOutputDirectory(); if(m_ConfiguredFilesPath.size()) { rootBin = m_ConfiguredFilesPath; } - bool needCBackwards = false; - bool needCXXBackwards = false; - bool needTestFortran = false; - if (!isLocal && - !this->GetLanguageEnabled("C") && !this->GetLanguageEnabled("CXX") && - !this->GetLanguageEnabled("JAVA") && !this->GetLanguageEnabled("FORTRAN")) + + // **** Step 1, find and make sure CMAKE_MAKE_PROGRAM is defined + this->FindMakeProgram(mf); + + // **** Step 2, Load the CMakeDetermineSystem.cmake file and find out + // what platform we are running on + if (!isLocal && !this->GetLanguageEnabled(lang)) { #if defined(_WIN32) && !defined(__CYGWIN__) /* Windows version number data. */ @@ -125,14 +140,20 @@ void cmGlobalGenerator::EnableLanguage(const char* lang, mf->AddDefinition("CMAKE_SYSTEM_VERSION", windowsVersionString.str().c_str()); #endif // Read the DetermineSystem file - std::string systemFile = root; - systemFile += "/Modules/CMakeDetermineSystem.cmake"; + std::string systemFile = mf->GetModulesFile("CMakeDetermineSystem.cmake"); mf->ReadListFile(0, systemFile.c_str()); } - // check for a C compiler and configure it - if(!isLocal && - !this->GetLanguageEnabled("C") && - lang[0] == 'C') + // **** Step 3, load the CMakeSystem.cmake from the binary directory + // this file is configured by the CMakeDetermineSystem.cmake file + std::string fpath = rootBin; + if(!mf->GetDefinition("CMAKE_SYSTEM_LOADED")) + { + fpath += "/CMakeSystem.cmake"; + mf->ReadListFile(0,fpath.c_str()); + } + // **** Step 4, load the CMakeDetermine(LANG)Compiler.cmake file to find + // the compiler + if(!isLocal && !this->GetLanguageEnabled(lang) ) { if (m_CMakeInstance->GetIsInTryCompile()) { @@ -141,154 +162,117 @@ void cmGlobalGenerator::EnableLanguage(const char* lang, "broken CMakeLists.txt file or a problematic release of " "CMake"); } - needCBackwards = true; - // read determine C compiler - std::string determineCFile = root; - determineCFile += "/Modules/CMakeDetermineCCompiler.cmake"; - mf->ReadListFile(0,determineCFile.c_str()); - this->SetLanguageEnabled("C"); - // put CC in the environment in case user scripts want - // to run configure - if(mf->GetDefinition("CMAKE_C_COMPILER")) - { - std::string env = "CC=${CMAKE_C_COMPILER}"; - mf->ExpandVariablesInString(env); - cmSystemTools::PutEnv(env.c_str()); - } - } - - // check for a CXX compiler and configure it - if(!isLocal && - !this->GetLanguageEnabled("CXX") && - strcmp(lang, "CXX") == 0) - { - needCXXBackwards = true; - std::string determineCFile = root; - determineCFile += "/Modules/CMakeDetermineCXXCompiler.cmake"; - mf->ReadListFile(0,determineCFile.c_str()); - this->SetLanguageEnabled("CXX"); - // put CXX in the environment in case user scripts want - // to run configure - if(mf->GetDefinition("CMAKE_CXX_COMPILER")) + needTestLanguage = true; // must test a language after finding it + // read determine LANG compiler + std::string determinCompiler = "CMakeDetermine"; + determinCompiler += lang; + determinCompiler += "Compiler.cmake"; + std::string determineFile = mf->GetModulesFile(determinCompiler.c_str()); + if(!mf->ReadListFile(0,determineFile.c_str())) { - std::string env = "CXX=${CMAKE_CXX_COMPILER}"; - mf->ExpandVariablesInString(env); - cmSystemTools::PutEnv(env.c_str()); + cmSystemTools::Error("Could not find cmake module file:", determineFile.c_str()); } - } - // check for a Java compiler and configure it - if(!isLocal && - !this->GetLanguageEnabled("JAVA") && - strcmp(lang, "JAVA") == 0) - { - std::string determineCFile = root; - determineCFile += "/Modules/CMakeDetermineJavaCompiler.cmake"; - mf->ReadListFile(0,determineCFile.c_str()); - this->SetLanguageEnabled("JAVA"); - } - // check for a Fortran compiler and configure it - if(!isLocal && - !this->GetLanguageEnabled("FORTRAN") && - strcmp(lang, "FORTRAN") == 0) - { - needTestFortran = true; - std::string determineCFile = root; - determineCFile += "/Modules/CMakeDetermineFortranCompiler.cmake"; - mf->ReadListFile(0,determineCFile.c_str()); - this->SetLanguageEnabled("FORTRAN"); - } - - std::string fpath = rootBin; - if(!mf->GetDefinition("CMAKE_SYSTEM_LOADED")) - { - fpath += "/CMakeSystem.cmake"; - mf->ReadListFile(0,fpath.c_str()); - } - // if C, then enable C - if(lang[0] == 'C' && !mf->GetDefinition("CMAKE_C_COMPILER_LOADED")) - { - fpath = rootBin; - fpath += "/CMakeCCompiler.cmake"; - mf->ReadListFile(0,fpath.c_str()); - this->SetLanguageEnabled("C"); - } - if(strcmp(lang, "CXX") == 0 && !mf->GetDefinition("CMAKE_CXX_COMPILER_LOADED")) - { - fpath = rootBin; - fpath += "/CMakeCXXCompiler.cmake"; - mf->ReadListFile(0,fpath.c_str()); - this->SetLanguageEnabled("CXX"); + + this->SetLanguageEnabled(lang); + // put ${CMake_(LANG)_COMPILER_ENV_VAR}=${CMAKE_(LANG)_COMPILER into the + // environment, in case user scripts want to run configure, or sub cmakes + std::string compilerName = "CMAKE_"; + compilerName += lang; + compilerName += "_COMPILER"; + std::string compilerEnv = "CMAKE_"; + compilerEnv += lang; + compilerEnv += "_COMPILER_ENV_VAR"; + std::string envVar = mf->GetRequiredDefinition(compilerEnv.c_str()); + std::string envVarValue = mf->GetRequiredDefinition(compilerName.c_str()); + std::string env = envVar; + env += "="; + env += envVarValue; + cmSystemTools::PutEnv(env.c_str()); + } - } - if(strcmp(lang, "JAVA") == 0 && !mf->GetDefinition("CMAKE_JAVA_COMPILER_LOADED")) + // **** Step 5, Load the configured language compiler file, if not loaded. + // look to see if CMAKE_(LANG)_COMPILER_LOADED is set, + // if not then load the CMake(LANG)Compiler.cmake file from the + // binary tree, this is a configured file provided by + // CMakeDetermine(LANG)Compiler.cmake + std::string loadedLang = "CMAKE_"; + loadedLang += lang; + loadedLang += "_COMPILER_LOADED"; + if(!mf->GetDefinition(loadedLang.c_str())) { fpath = rootBin; - fpath += "/CMakeJavaCompiler.cmake"; - mf->ReadListFile(0,fpath.c_str()); - this->SetLanguageEnabled("JAVA"); + fpath += "/CMake"; + fpath += lang; + fpath += "Compiler.cmake"; + if(!mf->ReadListFile(0,fpath.c_str())) + { + cmSystemTools::Error("Could not find cmake module file:", fpath.c_str()); + } + this->SetLanguageEnabled(lang); } - if(strcmp(lang, "FORTRAN") == 0 && !mf->GetDefinition("CMAKE_FORTRAN_COMPILER_LOADED")) + // **** Step 6, Load the system specific information if not yet loaded + if (!mf->GetDefinition("CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED")) { - fpath = rootBin; - fpath += "/CMakeFortranCompiler.cmake"; - mf->ReadListFile(0,fpath.c_str()); - this->SetLanguageEnabled("FORTRAN"); + fpath = mf->GetModulesFile("CMakeSystemSpecificInformation.cmake"); + if(!mf->ReadListFile(0,fpath.c_str())) + { + cmSystemTools::Error("Could not find cmake module file:", fpath.c_str()); + } } - if ( (lang[0] == 'C' || lang[0] == 'F') && !mf->GetDefinition("CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED")) - { - fpath = root; - fpath += "/Modules/CMakeSystemSpecificInformation.cmake"; - mf->ReadListFile(0,fpath.c_str()); + std::string langLoadedVar = "CMAKE_"; + langLoadedVar += lang; + langLoadedVar += "_INFORMATION_LOADED"; + if (!mf->GetDefinition(langLoadedVar.c_str())) + { + fpath = "CMake"; + fpath += lang; + fpath += "Information.cmake"; + fpath = mf->GetModulesFile(fpath.c_str()); + if(!mf->ReadListFile(0,fpath.c_str())) + { + cmSystemTools::Error("Could not find cmake module file:", fpath.c_str()); + } } + // **** Step 7, Test the compiler for the language just setup + // At this point we should have enough info for a try compile + // which is used in the backward stuff if(!isLocal) { - // At this point we should have enough info for a try compile - // which is used in the backward stuff - if(needCBackwards) + if(needTestLanguage) { if (!m_CMakeInstance->GetIsInTryCompile()) { - std::string ifpath = root + "/Modules/CMakeTestCCompiler.cmake"; - mf->ReadListFile(0,ifpath.c_str()); - // for old versions of CMake ListFiles - const char* versionValue - = mf->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY"); - if (atof(versionValue) <= 1.4) + std::string testLang = "CMakeTest"; + testLang += lang; + testLang += "Compiler.cmake"; + std::string ifpath = mf->GetModulesFile(testLang.c_str()); + if(!mf->ReadListFile(0,ifpath.c_str())) { - ifpath = root + "/Modules/CMakeBackwardCompatibilityC.cmake"; - mf->ReadListFile(0,ifpath.c_str()); + cmSystemTools::Error("Could not find cmake module file:", ifpath.c_str()); } - } - } - if(needCXXBackwards) - { - if (!m_CMakeInstance->GetIsInTryCompile()) - { - std::string ifpath = root + "/Modules/CMakeTestCXXCompiler.cmake"; - mf->ReadListFile(0,ifpath.c_str()); - // for old versions of CMake ListFiles + // **** Step 8, load backwards compatibility stuff for C and CXX + // for old versions of CMake ListFiles C and CXX had some + // backwards compatibility files they have to load const char* versionValue = mf->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY"); if (atof(versionValue) <= 1.4) { - std::string nfpath = root + "/Modules/CMakeBackwardCompatibilityCXX.cmake"; - mf->ReadListFile(0,nfpath.c_str()); + if(strcmp(lang, "C") == 0) + { + ifpath = mf->GetModulesFile("CMakeBackwardCompatibilityC.cmake"); + mf->ReadListFile(0,ifpath.c_str()); + } + if(strcmp(lang, "CXX") == 0) + { + ifpath = mf->GetModulesFile("CMakeBackwardCompatibilityCXX.cmake"); + mf->ReadListFile(0,ifpath.c_str()); + } + } } } - if(needTestFortran) - { - if (!m_CMakeInstance->GetIsInTryCompile()) - { - std::string ifpath = root + "/Modules/CMakeTestFortranCompiler.cmake"; - mf->ReadListFile(0,ifpath.c_str()); - } - } - - // if we are from the top, always define this - mf->AddDefinition("RUN_CONFIGURE", true); } } @@ -564,16 +548,10 @@ void cmGlobalGenerator::EnableLanguagesFromGenerator(cmGlobalGenerator *gen ) this->GetCMakeInstance()->AddCacheEntry("CMAKE_MAKE_PROGRAM", make, "make program", cmCacheManager::FILEPATH); - // if C, then enable C - if(gen->GetLanguageEnabled("C")) - { - this->SetLanguageEnabled("C"); - } - - // if CXX - if(gen->GetLanguageEnabled("CXX")) + for(std::map::iterator i = gen->m_LanguageEnabled.begin(); + i != gen->m_LanguageEnabled.end(); ++i) { - this->SetLanguageEnabled("CXX"); + this->SetLanguageEnabled(i->first.c_str()); } } diff --git a/Source/cmGlobalGenerator.h b/Source/cmGlobalGenerator.h index b963316..71b1859 100644 --- a/Source/cmGlobalGenerator.h +++ b/Source/cmGlobalGenerator.h @@ -107,7 +107,8 @@ public: bool GetForceUnixPaths() {return m_ForceUnixPaths;} protected: bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen); - + void FindMakeProgram(cmMakefile*); + bool m_ForceUnixPaths; cmStdString m_FindMakeProgramFile; cmStdString m_ConfiguredFilesPath; diff --git a/Source/cmGlobalUnixMakefileGenerator.cxx b/Source/cmGlobalUnixMakefileGenerator.cxx index 463c209..170c97b 100644 --- a/Source/cmGlobalUnixMakefileGenerator.cxx +++ b/Source/cmGlobalUnixMakefileGenerator.cxx @@ -32,11 +32,8 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang, { mf->AddDefinition("CMAKE_CFG_INTDIR","."); this->cmGlobalGenerator::EnableLanguage(lang, mf); - if(!lang) - { - lang = "CXX"; - } - if(lang[0] == 'C') + std::string path; + if(strcmp(lang, "C") == 0) { if(!mf->GetDefinition("CMAKE_C_COMPILER")) { @@ -44,7 +41,7 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang, return; } const char* cc = mf->GetRequiredDefinition("CMAKE_C_COMPILER"); - std::string path = cmSystemTools::FindProgram(cc); + path = cmSystemTools::FindProgram(cc); if(path.size() == 0) { std::string message = "your C compiler: "; @@ -62,28 +59,28 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang, " and re-run CMake."; cmSystemTools::Error(message.c_str()); } - if(strcmp(lang, "CXX") == 0) + } + if(strcmp(lang, "CXX") == 0) + { + const char* cxx = mf->GetRequiredDefinition("CMAKE_CXX_COMPILER"); + path = cmSystemTools::FindProgram(cxx); + if(path.size() == 0) { - const char* cxx = mf->GetRequiredDefinition("CMAKE_CXX_COMPILER"); - path = cmSystemTools::FindProgram(cxx); - if(path.size() == 0) + std::string message = "your C++ compiler: "; + if(cxx) { - std::string message = "your C++ compiler: "; - if(cxx) - { - message += cxx; - } - else - { - message += "(NULL)"; - } - - message += " was not found in your path. " - "For CMake to correctly use try compile commands, the compiler must " - "be in your path. Please add the compiler to your PATH environment," - " and re-run CMake."; - cmSystemTools::Error(message.c_str()); + message += cxx; + } + else + { + message += "(NULL)"; } + + message += " was not found in your path. " + "For CMake to correctly use try compile commands, the compiler must " + "be in your path. Please add the compiler to your PATH environment," + " and re-run CMake."; + cmSystemTools::Error(message.c_str()); } } } diff --git a/Source/cmListFileCache.cxx b/Source/cmListFileCache.cxx index e56b19b..092d73b 100644 --- a/Source/cmListFileCache.cxx +++ b/Source/cmListFileCache.cxx @@ -89,7 +89,6 @@ bool cmListFileCache::CacheFile(const char* path, bool requireProjectCommand) { return false; } - // Get a pointer to a persistent copy of the name. const char* filename = this->GetUniqueStringPointer(path); diff --git a/Source/cmLocalUnixMakefileGenerator.cxx b/Source/cmLocalUnixMakefileGenerator.cxx index 63de272..b00b7e4 100644 --- a/Source/cmLocalUnixMakefileGenerator.cxx +++ b/Source/cmLocalUnixMakefileGenerator.cxx @@ -995,21 +995,21 @@ static RuleVariables ruleReplaceVars[] = {"", "CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS"}, {"", "CMAKE_SHARED_MODULE_CREATE_FORTAN_FLAGS"}, {"", "CMAKE_SHARED_MODULE_C_FLAGS"}, - {"", "CMAKE_SHARED_MODULE_FORTRAN_FLAGS"}, + {"", "CMAKE_SHARED_MODULE_Fortran_FLAGS"}, {"", "CMAKE_SHARED_MODULE_CXX_FLAGS"}, {"", "CMAKE_SHARED_LIBRARY_C_FLAGS"}, - {"", "CMAKE_SHARED_LIBRARY_FORTRAN_FLAGS"}, + {"", "CMAKE_SHARED_LIBRARY_Fortran_FLAGS"}, {"", "CMAKE_SHARED_LIBRARY_CXX_FLAGS"}, {"", "CMAKE_CXX_LINK_FLAGS"}, {"", "CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS"}, - {"", "CMAKE_SHARED_LIBRARY_CREATE_FORTRAN_FLAGS"}, + {"", "CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS"}, {"", "CMAKE_SHARED_MODULE_CREATE_C_FLAGS"}, {"", "CMAKE_SHARED_LIBRARY_SONAME_C_FLAG"}, - {"", "CMAKE_SHARED_LIBRARY_SONAME_FORTRAN_FLAG"}, + {"", "CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG"}, {"", "CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG"}, {"", "CMAKE_C_LINK_FLAGS"}, - {"", "CMAKE_FORTRAN_LINK_FLAGS"}, + {"", "CMAKE_Fortran_LINK_FLAGS"}, {"", "CMAKE_AR"}, {"", "CMAKE_RANLIB"}, @@ -1037,8 +1037,8 @@ cmLocalUnixMakefileGenerator::ExpandRuleVariables(std::string& s, std::string ccompiler = this->ConvertToOutputForExisting( m_Makefile->GetSafeDefinition("CMAKE_C_COMPILER")); std::string fcompiler = this->ConvertToOutputForExisting( - m_Makefile->GetSafeDefinition("CMAKE_FORTRAN_COMPILER")); - cmSystemTools::ReplaceString(s, "", fcompiler.c_str()); + m_Makefile->GetSafeDefinition("CMAKE_Fortran_COMPILER")); + cmSystemTools::ReplaceString(s, "", fcompiler.c_str()); cmSystemTools::ReplaceString(s, "", cxxcompiler.c_str()); cmSystemTools::ReplaceString(s, "", ccompiler.c_str()); if(linkFlags) @@ -1297,7 +1297,7 @@ void cmLocalUnixMakefileGenerator::OutputSharedLibraryRule(std::ostream& fout, { if(t.HasFortran()) { - createRule = "CMAKE_FORTRAN_CREATE_SHARED_LIBRARY"; + createRule = "CMAKE_Fortran_CREATE_SHARED_LIBRARY"; } else { @@ -1351,11 +1351,19 @@ void cmLocalUnixMakefileGenerator::OutputModuleLibraryRule(std::ostream& fout, if(t.HasCxx()) { createRule = "CMAKE_CXX_CREATE_SHARED_MODULE"; - } + } else { - createRule = "CMAKE_C_CREATE_SHARED_MODULE"; + if(t.HasFortran()) + { + createRule = "CMAKE_Fortran_CREATE_SHARED_MODULE"; + } + else + { + createRule = "CMAKE_C_CREATE_SHARED_MODULE"; + } } + std::string buildType = m_Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE"); buildType = cmSystemTools::UpperCase(buildType); std::string linkFlags = m_Makefile->GetSafeDefinition("CMAKE_MODULE_LINKER_FLAGS"); @@ -1391,8 +1399,16 @@ void cmLocalUnixMakefileGenerator::OutputStaticLibraryRule(std::ostream& fout, } else { - createRule = "CMAKE_C_CREATE_STATIC_LIBRARY"; - } + if(t.HasFortran()) + { + createRule = "CMAKE_Fortran_CREATE_STATIC_LIBRARY"; + } + else + { + createRule = "CMAKE_C_CREATE_STATIC_LIBRARY"; + } + } + std::string linkFlags; const char* targetLinkFlags = t.GetProperty("STATIC_LIBRARY_FLAGS"); if(targetLinkFlags) @@ -1482,10 +1498,10 @@ void cmLocalUnixMakefileGenerator::OutputExecutableRule(std::ostream& fout, { if(t.HasFortran()) { - rules.push_back(m_Makefile->GetRequiredDefinition("CMAKE_FORTRAN_LINK_EXECUTABLE")); - flags += m_Makefile->GetSafeDefinition("CMAKE_FORTRAN_FLAGS"); + rules.push_back(m_Makefile->GetRequiredDefinition("CMAKE_Fortran_LINK_EXECUTABLE")); + flags += m_Makefile->GetSafeDefinition("CMAKE_Fortran_FLAGS"); flags += " "; - flags += m_Makefile->GetSafeDefinition("CMAKE_SHARED_LIBRARY_FORTRAN_FLAGS"); + flags += m_Makefile->GetSafeDefinition("CMAKE_SHARED_LIBRARY_Fortran_FLAGS"); flags += " "; } else @@ -2879,24 +2895,24 @@ OutputBuildObjectFromSource(std::ostream& fout, } case cmSystemTools::FORTRAN_FILE_FORMAT: { - rules.push_back(m_Makefile->GetRequiredDefinition("CMAKE_FORTRAN_COMPILE_OBJECT")); - flags += m_Makefile->GetSafeDefinition("CMAKE_FORTRAN_FLAGS"); + rules.push_back(m_Makefile->GetRequiredDefinition("CMAKE_Fortran_COMPILE_OBJECT")); + flags += m_Makefile->GetSafeDefinition("CMAKE_Fortran_FLAGS"); flags += " "; if(buildType.size()) { - std::string build = "CMAKE_FORTRAN_FLAGS_"; + std::string build = "CMAKE_Fortran_FLAGS_"; build += buildType; flags += m_Makefile->GetSafeDefinition(build.c_str()); flags += " "; } if(shared) { - flags += m_Makefile->GetSafeDefinition("CMAKE_SHARED_LIBRARY_FORTRAN_FLAGS"); + flags += m_Makefile->GetSafeDefinition("CMAKE_SHARED_LIBRARY_Fortran_FLAGS"); flags += " "; } if(cmSystemTools::IsOn(m_Makefile->GetDefinition("BUILD_SHARED_LIBS"))) { - flags += m_Makefile->GetSafeDefinition("CMAKE_SHARED_BUILD_FORTRAN_FLAGS"); + flags += m_Makefile->GetSafeDefinition("CMAKE_SHARED_BUILD_Fortran_FLAGS"); flags += " "; } break; diff --git a/Source/cmProjectCommand.cxx b/Source/cmProjectCommand.cxx index 8f48fd6..41592e7 100644 --- a/Source/cmProjectCommand.cxx +++ b/Source/cmProjectCommand.cxx @@ -57,7 +57,9 @@ bool cmProjectCommand::InitialPass(std::vector const& args) } else { - m_Makefile->EnableLanguage(0); + // if no language is specified do c and c++ + m_Makefile->EnableLanguage("C"); + m_Makefile->EnableLanguage("CXX"); } return true; } diff --git a/Source/cmTryCompileCommand.cxx b/Source/cmTryCompileCommand.cxx index b72f14d..47c3bd4 100644 --- a/Source/cmTryCompileCommand.cxx +++ b/Source/cmTryCompileCommand.cxx @@ -158,7 +158,7 @@ int cmTryCompileCommand::CoreTryCompileCode( } else if ( format == cmSystemTools::FORTRAN_FILE_FORMAT ) { - fprintf(fout, "PROJECT(CMAKE_TRY_COMPILE FORTRAN)\n"); + fprintf(fout, "PROJECT(CMAKE_TRY_COMPILE Fortran)\n"); } else { @@ -187,8 +187,8 @@ int cmTryCompileCommand::CoreTryCompileCode( } if(format == cmSystemTools::FORTRAN_FILE_FORMAT ) { - const char* fflags = mf->GetDefinition("CMAKE_FORTRAN_FLAGS"); - fprintf(fout, "SET(CMAKE_FORTRAN_FLAGS \"${CMAKE_FORTRAN_FLAGS} "); + const char* fflags = mf->GetDefinition("CMAKE_Fortran_FLAGS"); + fprintf(fout, "SET(CMAKE_Fortran_FLAGS \"${CMAKE_Fortran_FLAGS} "); if(fflags) { fprintf(fout, " %s ", fflags); diff --git a/Source/cmake.cxx b/Source/cmake.cxx index ca07acf..ae57145 100644 --- a/Source/cmake.cxx +++ b/Source/cmake.cxx @@ -560,7 +560,7 @@ int cmake::AddCMakePaths(const char *arg0) if (getenv("CMAKE_ROOT")) { cMakeRoot = getenv("CMAKE_ROOT"); - modules = cMakeRoot + "/Modules/CMakeDefaultMakeRuleVariables.cmake"; + modules = cMakeRoot + "/Modules/CMake.cmake"; } if(!cmSystemTools::FileExists(modules.c_str())) { @@ -572,21 +572,21 @@ int cmake::AddCMakePaths(const char *arg0) cMakeRoot = cMakeRoot.substr(0, slashPos); } // is there no Modules direcory there? - modules = cMakeRoot + "/Modules/CMakeDefaultMakeRuleVariables.cmake"; + modules = cMakeRoot + "/Modules/CMake.cmake"; } if (!cmSystemTools::FileExists(modules.c_str())) { // try exe/../share/cmake cMakeRoot += CMAKE_DATA_DIR; - modules = cMakeRoot + "/Modules/CMakeDefaultMakeRuleVariables.cmake"; + modules = cMakeRoot + "/Modules/CMake.cmake"; } #ifdef CMAKE_ROOT_DIR if (!cmSystemTools::FileExists(modules.c_str())) { // try compiled in root directory cMakeRoot = CMAKE_ROOT_DIR; - modules = cMakeRoot + "/Modules/CMakeDefaultMakeRuleVariables.cmake"; + modules = cMakeRoot + "/Modules/CMake.cmake"; } #endif #ifdef CMAKE_PREFIX @@ -594,7 +594,7 @@ int cmake::AddCMakePaths(const char *arg0) { // try compiled in install prefix cMakeRoot = CMAKE_PREFIX CMAKE_DATA_DIR; - modules = cMakeRoot + "/Modules/CMakeDefaultMakeRuleVariables.cmake"; + modules = cMakeRoot + "/Modules/CMake.cmake"; } #endif if (!cmSystemTools::FileExists(modules.c_str())) @@ -602,14 +602,14 @@ int cmake::AddCMakePaths(const char *arg0) // try cMakeRoot = cmSystemTools::GetProgramPath(cMakeSelf.c_str()); cMakeRoot += CMAKE_DATA_DIR; - modules = cMakeRoot + "/Modules/CMakeDefaultMakeRuleVariables.cmake"; + modules = cMakeRoot + "/Modules/CMake.cmake"; } if(!cmSystemTools::FileExists(modules.c_str())) { // next try exe cMakeRoot = cmSystemTools::GetProgramPath(cMakeSelf.c_str()); // is there no Modules direcory there? - modules = cMakeRoot + "/Modules/CMakeDefaultMakeRuleVariables.cmake"; + modules = cMakeRoot + "/Modules/CMake.cmake"; } if (!cmSystemTools::FileExists(modules.c_str())) { diff --git a/Tests/Complex/Executable/complex.cxx b/Tests/Complex/Executable/complex.cxx index 29bf4cd..adf99d7 100644 --- a/Tests/Complex/Executable/complex.cxx +++ b/Tests/Complex/Executable/complex.cxx @@ -118,9 +118,9 @@ int main() cmLibHandle handle = cmDynamicLoader::OpenLibrary(lib.c_str()); if(!handle) { - std::string err = "Can not open CMakeTestModule:"; + std::string err = "Can not open CMakeTestModule:\n"; err += lib; - cmFailed(lib.c_str()); + cmFailed(err.c_str()); } else { diff --git a/Tests/ComplexOneConfig/Executable/complex.cxx b/Tests/ComplexOneConfig/Executable/complex.cxx index 29bf4cd..adf99d7 100644 --- a/Tests/ComplexOneConfig/Executable/complex.cxx +++ b/Tests/ComplexOneConfig/Executable/complex.cxx @@ -118,9 +118,9 @@ int main() cmLibHandle handle = cmDynamicLoader::OpenLibrary(lib.c_str()); if(!handle) { - std::string err = "Can not open CMakeTestModule:"; + std::string err = "Can not open CMakeTestModule:\n"; err += lib; - cmFailed(lib.c_str()); + cmFailed(err.c_str()); } else { diff --git a/Tests/ComplexRelativePaths/Executable/complex.cxx b/Tests/ComplexRelativePaths/Executable/complex.cxx index 29bf4cd..adf99d7 100644 --- a/Tests/ComplexRelativePaths/Executable/complex.cxx +++ b/Tests/ComplexRelativePaths/Executable/complex.cxx @@ -118,9 +118,9 @@ int main() cmLibHandle handle = cmDynamicLoader::OpenLibrary(lib.c_str()); if(!handle) { - std::string err = "Can not open CMakeTestModule:"; + std::string err = "Can not open CMakeTestModule:\n"; err += lib; - cmFailed(lib.c_str()); + cmFailed(err.c_str()); } else { diff --git a/Tests/Fortran/CMakeLists.txt b/Tests/Fortran/CMakeLists.txt index 1a90130..a10f61f 100644 --- a/Tests/Fortran/CMakeLists.txt +++ b/Tests/Fortran/CMakeLists.txt @@ -1,2 +1,2 @@ -PROJECT(testf FORTRAN) +PROJECT(testf Fortran) ADD_EXECUTABLE(testf hello.f) -- cgit v0.12