ENH: more uniform approach to enable language, one step closer to being able to enable a language without modifing cmake source code
This commit is contained in:
parent
7cdf5c4601
commit
66a08c10e5
|
@ -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.
|
|
@ -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
|
||||||
|
# <TARGET>
|
||||||
|
# <TARGET_BASE> the target without the suffix
|
||||||
|
# <OBJECTS>
|
||||||
|
# <OBJECT>
|
||||||
|
# <LINK_LIBRARIES>
|
||||||
|
# <FLAGS>
|
||||||
|
# <LINK_FLAGS>
|
||||||
|
|
||||||
|
# C compiler information
|
||||||
|
# <CMAKE_C_COMPILER>
|
||||||
|
# <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS>
|
||||||
|
# <CMAKE_SHARED_MODULE_CREATE_C_FLAGS>
|
||||||
|
# <CMAKE_C_LINK_FLAGS>
|
||||||
|
|
||||||
|
# Static library tools
|
||||||
|
# <CMAKE_AR>
|
||||||
|
# <CMAKE_RANLIB>
|
||||||
|
|
||||||
|
|
||||||
|
# create a C shared library
|
||||||
|
IF(NOT CMAKE_C_CREATE_SHARED_LIBRARY)
|
||||||
|
SET(CMAKE_C_CREATE_SHARED_LIBRARY
|
||||||
|
"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||||
|
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
|
||||||
|
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
|
||||||
|
"<CMAKE_RANLIB> <TARGET> ")
|
||||||
|
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
|
||||||
|
"<CMAKE_C_COMPILER> -o <OBJECT> <FLAGS> -c <SOURCE>")
|
||||||
|
ENDIF(NOT CMAKE_C_COMPILE_OBJECT)
|
||||||
|
|
||||||
|
IF(NOT CMAKE_C_LINK_EXECUTABLE)
|
||||||
|
SET(CMAKE_C_LINK_EXECUTABLE
|
||||||
|
"<CMAKE_C_COMPILER> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||||
|
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)
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
# <TARGET>
|
||||||
|
# <TARGET_BASE> the target without the suffix
|
||||||
|
# <OBJECTS>
|
||||||
|
# <OBJECT>
|
||||||
|
# <LINK_LIBRARIES>
|
||||||
|
# <FLAGS>
|
||||||
|
# <LINK_FLAGS>
|
||||||
|
|
||||||
|
# CXX compiler information
|
||||||
|
# <CMAKE_CXX_COMPILER>
|
||||||
|
# <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS>
|
||||||
|
# <CMAKE_CXX_SHARED_MODULE_CREATE_FLAGS>
|
||||||
|
# <CMAKE_CXX_LINK_FLAGS>
|
||||||
|
|
||||||
|
# Static library tools
|
||||||
|
# <CMAKE_AR>
|
||||||
|
# <CMAKE_RANLIB>
|
||||||
|
|
||||||
|
|
||||||
|
# create a shared C++ library
|
||||||
|
IF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
|
||||||
|
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
|
||||||
|
"<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||||
|
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
|
||||||
|
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
|
||||||
|
"<CMAKE_RANLIB> <TARGET> ")
|
||||||
|
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
|
||||||
|
"<CMAKE_CXX_COMPILER> -o <OBJECT> <FLAGS> -c <SOURCE>")
|
||||||
|
ENDIF(NOT CMAKE_CXX_COMPILE_OBJECT)
|
||||||
|
|
||||||
|
IF(NOT CMAKE_CXX_LINK_EXECUTABLE)
|
||||||
|
SET(CMAKE_CXX_LINK_EXECUTABLE
|
||||||
|
"<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||||
|
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)
|
||||||
|
|
|
@ -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
|
||||||
|
|
||||||
|
)
|
||||||
|
|
|
@ -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
|
|
||||||
# <TARGET>
|
|
||||||
# <TARGET_BASE> the target without the suffix
|
|
||||||
# <OBJECTS>
|
|
||||||
# <OBJECT>
|
|
||||||
# <LINK_LIBRARIES>
|
|
||||||
# <FLAGS>
|
|
||||||
# <LINK_FLAGS>
|
|
||||||
|
|
||||||
# CXX compiler information
|
|
||||||
# <CMAKE_CXX_COMPILER>
|
|
||||||
# <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS>
|
|
||||||
# <CMAKE_CXX_SHARED_MODULE_CREATE_FLAGS>
|
|
||||||
# <CMAKE_CXX_LINK_FLAGS>
|
|
||||||
|
|
||||||
# C compiler information
|
|
||||||
# <CMAKE_C_COMPILER>
|
|
||||||
# <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS>
|
|
||||||
# <CMAKE_SHARED_MODULE_CREATE_C_FLAGS>
|
|
||||||
# <CMAKE_C_LINK_FLAGS>
|
|
||||||
|
|
||||||
# Static library tools
|
|
||||||
# <CMAKE_AR>
|
|
||||||
# <CMAKE_RANLIB>
|
|
||||||
|
|
||||||
|
|
||||||
# create a shared C++ library
|
|
||||||
IF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
|
|
||||||
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
|
|
||||||
"<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
|
||||||
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
|
|
||||||
"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
|
||||||
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
|
|
||||||
"<CMAKE_FORTRAN_COMPILER> <CMAKE_SHARED_LIBRARY_FORTRAN_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_FORTRAN_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_FORTRAN_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
|
||||||
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
|
|
||||||
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
|
|
||||||
"<CMAKE_RANLIB> <TARGET> ")
|
|
||||||
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
|
|
||||||
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
|
|
||||||
"<CMAKE_RANLIB> <TARGET> ")
|
|
||||||
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
|
|
||||||
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
|
|
||||||
"<CMAKE_RANLIB> <TARGET> ")
|
|
||||||
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
|
|
||||||
"<CMAKE_CXX_COMPILER> -o <OBJECT> <FLAGS> -c <SOURCE>")
|
|
||||||
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
|
|
||||||
"<CMAKE_C_COMPILER> -o <OBJECT> <FLAGS> -c <SOURCE>")
|
|
||||||
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
|
|
||||||
"<CMAKE_FORTRAN_COMPILER> -o <OBJECT> <FLAGS> -c <SOURCE>")
|
|
||||||
ENDIF(NOT CMAKE_FORTRAN_COMPILE_OBJECT)
|
|
||||||
|
|
||||||
|
|
||||||
IF(NOT CMAKE_C_LINK_EXECUTABLE)
|
|
||||||
SET(CMAKE_C_LINK_EXECUTABLE
|
|
||||||
"<CMAKE_C_COMPILER> <CMAKE_C_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
|
||||||
ENDIF(NOT CMAKE_C_LINK_EXECUTABLE)
|
|
||||||
|
|
||||||
IF(NOT CMAKE_FORTRAN_LINK_EXECUTABLE)
|
|
||||||
SET(CMAKE_FORTRAN_LINK_EXECUTABLE
|
|
||||||
"<CMAKE_FORTRAN_COMPILER> <CMAKE_FORTRAN_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
|
||||||
ENDIF(NOT CMAKE_FORTRAN_LINK_EXECUTABLE)
|
|
||||||
|
|
||||||
|
|
||||||
IF(NOT CMAKE_CXX_LINK_EXECUTABLE)
|
|
||||||
SET(CMAKE_CXX_LINK_EXECUTABLE
|
|
||||||
"<CMAKE_CXX_COMPILER> <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
|
||||||
ENDIF(NOT CMAKE_CXX_LINK_EXECUTABLE)
|
|
|
@ -37,7 +37,6 @@ IF(NOT CMAKE_C_COMPILER)
|
||||||
SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_INIT} CACHE STRING "C compiler")
|
SET(CMAKE_C_COMPILER ${CMAKE_C_COMPILER_INIT} CACHE STRING "C compiler")
|
||||||
ENDIF(NOT CMAKE_C_COMPILER)
|
ENDIF(NOT CMAKE_C_COMPILER)
|
||||||
MARK_AS_ADVANCED(CMAKE_C_COMPILER)
|
MARK_AS_ADVANCED(CMAKE_C_COMPILER)
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_AR NAMES ar )
|
FIND_PROGRAM(CMAKE_AR NAMES ar )
|
||||||
|
|
||||||
FIND_PROGRAM(CMAKE_RANLIB NAMES ranlib)
|
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
|
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCCompiler.cmake.in
|
||||||
${CMAKE_BINARY_DIR}/CMakeCCompiler.cmake IMMEDIATE)
|
${CMAKE_BINARY_DIR}/CMakeCCompiler.cmake IMMEDIATE)
|
||||||
MARK_AS_ADVANCED(CMAKE_AR)
|
MARK_AS_ADVANCED(CMAKE_AR)
|
||||||
|
SET(CMAKE_C_COMPILER_ENV_VAR "CC")
|
||||||
|
|
|
@ -60,6 +60,4 @@ ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX_RUN)
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
|
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeCXXCompiler.cmake.in
|
||||||
${CMAKE_BINARY_DIR}/CMakeCXXCompiler.cmake IMMEDIATE)
|
${CMAKE_BINARY_DIR}/CMakeCXXCompiler.cmake IMMEDIATE)
|
||||||
|
|
||||||
|
SET(CMAKE_CXX_COMPILER_ENV_VAR "CXX")
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -5,38 +5,55 @@
|
||||||
# the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
|
# the cmake variable CMAKE_GENERATOR_CC which can be defined by a generator
|
||||||
# as a default compiler
|
# as a default compiler
|
||||||
|
|
||||||
IF(NOT CMAKE_FORTRAN_COMPILER)
|
IF(NOT CMAKE_Fortran_COMPILER)
|
||||||
# prefer the environment variable CC
|
# prefer the environment variable CC
|
||||||
IF($ENV{FC} MATCHES ".+")
|
IF($ENV{FC} MATCHES ".+")
|
||||||
GET_FILENAME_COMPONENT(CMAKE_FORTRAN_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_FORTRAN_FLAGS_ENV_INIT)
|
GET_FILENAME_COMPONENT(CMAKE_Fortran_COMPILER_INIT $ENV{FC} PROGRAM PROGRAM_ARGS CMAKE_Fortran_FLAGS_ENV_INIT)
|
||||||
IF(EXISTS ${CMAKE_FORTRAN_COMPILER_INIT})
|
IF(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
|
||||||
ELSE(EXISTS ${CMAKE_FORTRAN_COMPILER_INIT})
|
ELSE(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
|
||||||
MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.")
|
MESSAGE(FATAL_ERROR "Could not find compiler set in environment variable FC:\n$ENV{FC}.")
|
||||||
ENDIF(EXISTS ${CMAKE_FORTRAN_COMPILER_INIT})
|
ENDIF(EXISTS ${CMAKE_Fortran_COMPILER_INIT})
|
||||||
ENDIF($ENV{FC} MATCHES ".+")
|
ENDIF($ENV{FC} MATCHES ".+")
|
||||||
|
|
||||||
# next try prefer the compiler specified by the generator
|
# next try prefer the compiler specified by the generator
|
||||||
IF(CMAKE_GENERATOR_FC)
|
IF(CMAKE_GENERATOR_FC)
|
||||||
IF(NOT CMAKE_FORTRAN_COMPILER_INIT)
|
IF(NOT CMAKE_Fortran_COMPILER_INIT)
|
||||||
SET(CMAKE_FORTRAN_COMPILER_INIT ${CMAKE_GENERATOR_FC})
|
SET(CMAKE_Fortran_COMPILER_INIT ${CMAKE_GENERATOR_FC})
|
||||||
ENDIF(NOT CMAKE_FORTRAN_COMPILER_INIT)
|
ENDIF(NOT CMAKE_Fortran_COMPILER_INIT)
|
||||||
ENDIF(CMAKE_GENERATOR_FC)
|
ENDIF(CMAKE_GENERATOR_FC)
|
||||||
|
|
||||||
|
|
||||||
# if no compiler has been specified yet, then look for one
|
# if no compiler has been specified yet, then look for one
|
||||||
IF(NOT CMAKE_FORTRAN_COMPILER_INIT)
|
IF(NOT CMAKE_Fortran_COMPILER_INIT)
|
||||||
# if not in the envionment then search for the compiler in the path
|
# if not in the envionment then search for the compiler in the path# Known compilers:
|
||||||
SET(CMAKE_FORTRAN_COMPILER_LIST g77 ifort f77 f90 epcf90 efc ecc)
|
# f77/f90/f95: generic compiler names
|
||||||
FIND_PROGRAM(CMAKE_FORTRAN_COMPILER_FULLPATH NAMES ${CMAKE_FORTRAN_COMPILER_LIST} )
|
# g77: GNU Fortran 77 compiler
|
||||||
GET_FILENAME_COMPONENT(CMAKE_FORTRAN_COMPILER_INIT
|
# gfortran: putative GNU Fortran 95+ compiler (in progress)
|
||||||
${CMAKE_FORTRAN_COMPILER_FULLPATH} NAME)
|
# fort77: native F77 compiler under HP-UX (and some older Crays)
|
||||||
SET(CMAKE_FORTRAN_COMPILER_FULLPATH "${CMAKE_FORTRAN_COMPILER_FULLPATH}" CACHE INTERNAL "full path to the compiler cmake found")
|
# frt: Fujitsu F77 compiler
|
||||||
ENDIF(NOT CMAKE_FORTRAN_COMPILER_INIT)
|
# 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")
|
SET(CMAKE_Fortran_COMPILER ${CMAKE_Fortran_COMPILER_INIT} CACHE STRING "Fortran compiler")
|
||||||
ENDIF(NOT CMAKE_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 )
|
FIND_PROGRAM(CMAKE_AR NAMES ar )
|
||||||
|
|
||||||
|
@ -49,12 +66,12 @@ MARK_AS_ADVANCED(CMAKE_RANLIB)
|
||||||
IF(NOT CMAKE_COMPILER_IS_GNUG77_RUN)
|
IF(NOT CMAKE_COMPILER_IS_GNUG77_RUN)
|
||||||
# test to see if the Fortran compiler is gnu
|
# test to see if the Fortran compiler is gnu
|
||||||
|
|
||||||
IF(CMAKE_FORTRAN_FLAGS)
|
IF(CMAKE_Fortran_FLAGS)
|
||||||
SET(CMAKE_BOOT_FORTRAN_FLAGS ${CMAKE_FORTRAN_FLAGS})
|
SET(CMAKE_BOOT_Fortran_FLAGS ${CMAKE_Fortran_FLAGS})
|
||||||
ELSE(CMAKE_FORTRAN_FLAGS)
|
ELSE(CMAKE_Fortran_FLAGS)
|
||||||
SET(CMAKE_BOOT_FORTRAN_FLAGS $ENV{FFLAGS})
|
SET(CMAKE_BOOT_Fortran_FLAGS $ENV{FFLAGS})
|
||||||
ENDIF(CMAKE_FORTRAN_FLAGS)
|
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)
|
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)
|
SET(CMAKE_COMPILER_IS_GNUG77_RUN 1)
|
||||||
IF(NOT CMAKE_COMPILER_RETURN)
|
IF(NOT CMAKE_COMPILER_RETURN)
|
||||||
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
|
IF("${CMAKE_COMPILER_OUTPUT}" MATCHES ".*THIS_IS_GNU.*" )
|
||||||
|
@ -81,3 +98,4 @@ ENDIF(NOT CMAKE_COMPILER_IS_GNUG77_RUN)
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
|
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeFortranCompiler.cmake.in
|
||||||
${CMAKE_BINARY_DIR}/CMakeFortranCompiler.cmake IMMEDIATE)
|
${CMAKE_BINARY_DIR}/CMakeFortranCompiler.cmake IMMEDIATE)
|
||||||
MARK_AS_ADVANCED(CMAKE_AR)
|
MARK_AS_ADVANCED(CMAKE_AR)
|
||||||
|
SET(CMAKE_Fortran_COMPILER_ENV_VAR "FC")
|
||||||
|
|
|
@ -73,3 +73,4 @@ MARK_AS_ADVANCED(CMAKE_JAVA_COMPILER)
|
||||||
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in
|
CONFIGURE_FILE(${CMAKE_ROOT}/Modules/CMakeJavaCompiler.cmake.in
|
||||||
${CMAKE_BINARY_DIR}/CMakeJavaCompiler.cmake IMMEDIATE @ONLY)
|
${CMAKE_BINARY_DIR}/CMakeJavaCompiler.cmake IMMEDIATE @ONLY)
|
||||||
MARK_AS_ADVANCED(CMAKE_AR CMAKE_JAVA_COMPILER_FULLPATH)
|
MARK_AS_ADVANCED(CMAKE_AR CMAKE_JAVA_COMPILER_FULLPATH)
|
||||||
|
SET(CMAKE_JAVA_COMPILER_ENV_VAR "JC")
|
||||||
|
|
|
@ -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_AR "@CMAKE_AR@")
|
||||||
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
SET(CMAKE_RANLIB "@CMAKE_RANLIB@")
|
||||||
SET(CMAKE_COMPILER_IS_GNUCC @CMAKE_COMPILER_IS_GNUCC@)
|
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_MINGW @CMAKE_COMPILER_IS_MINGW@)
|
||||||
SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
|
SET(CMAKE_COMPILER_IS_CYGWIN @CMAKE_COMPILER_IS_CYGWIN@)
|
||||||
IF(CMAKE_COMPILER_IS_CYGWIN)
|
IF(CMAKE_COMPILER_IS_CYGWIN)
|
||||||
|
|
|
@ -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
|
||||||
|
"<CMAKE_Fortran_COMPILER> <CMAKE_SHARED_LIBRARY_Fortran_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||||
|
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
|
||||||
|
"<CMAKE_AR> cr <TARGET> <LINK_FLAGS> <OBJECTS> "
|
||||||
|
"<CMAKE_RANLIB> <TARGET> ")
|
||||||
|
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
|
||||||
|
"<CMAKE_Fortran_COMPILER> -o <OBJECT> <FLAGS> -c <SOURCE>")
|
||||||
|
ENDIF(NOT CMAKE_Fortran_COMPILE_OBJECT)
|
||||||
|
|
||||||
|
# link a fortran program
|
||||||
|
IF(NOT CMAKE_Fortran_LINK_EXECUTABLE)
|
||||||
|
SET(CMAKE_Fortran_LINK_EXECUTABLE
|
||||||
|
"<CMAKE_Fortran_COMPILER> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>")
|
||||||
|
ENDIF(NOT CMAKE_Fortran_LINK_EXECUTABLE)
|
||||||
|
|
||||||
|
|
||||||
|
# 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)
|
|
@ -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)
|
|
@ -0,0 +1 @@
|
||||||
|
# this is a place holder if java needed flags for javac they would go here.
|
|
@ -1,48 +1,14 @@
|
||||||
# this module sets system information like how to build libraries
|
# This file is included by cmGlobalGenerator::EnableLanguage.
|
||||||
# before including this file the system, C, and C++ compilers must
|
# It is included after the compiler has been determined, so
|
||||||
# have already been determined.
|
# we know things like the compiler name and if the compiler is gnu.
|
||||||
# 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
|
|
||||||
|
|
||||||
|
# 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
|
# 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)
|
SET(CMAKE_SYSTEM_INFO_FILE ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}.cmake)
|
||||||
IF(EXISTS ${CMAKE_SYSTEM_INFO_FILE})
|
IF(EXISTS ${CMAKE_SYSTEM_INFO_FILE})
|
||||||
INCLUDE(${CMAKE_SYSTEM_INFO_FILE})
|
INCLUDE(Platform/${CMAKE_SYSTEM_NAME} OPTIONAL)
|
||||||
ELSE(EXISTS ${CMAKE_SYSTEM_INFO_FILE})
|
ELSE(EXISTS ${CMAKE_SYSTEM_INFO_FILE})
|
||||||
MESSAGE("System is unknown to cmake, create:\n${CMAKE_SYSTEM_INFO_FILE}"
|
MESSAGE("System is unknown to cmake, create:\n${CMAKE_SYSTEM_INFO_FILE}"
|
||||||
" to use this system, please send your config file to "
|
" to use this system, please send your config file to "
|
||||||
|
@ -55,36 +21,12 @@ ELSE(EXISTS ${CMAKE_SYSTEM_INFO_FILE})
|
||||||
ENDIF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
|
ENDIF(EXISTS ${CMAKE_BINARY_DIR}/CMakeCache.txt)
|
||||||
ENDIF(EXISTS ${CMAKE_SYSTEM_INFO_FILE})
|
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
|
# for most systems a module is the same as a shared library
|
||||||
# so unless the variable CMAKE_MODULE_EXISTS is set just
|
# so unless the variable CMAKE_MODULE_EXISTS is set just
|
||||||
# copy the values from the LIBRARY variables
|
# copy the values from the LIBRARY variables
|
||||||
|
# this has to be done after the system information has been loaded
|
||||||
IF(NOT CMAKE_MODULE_EXISTS)
|
IF(NOT CMAKE_MODULE_EXISTS)
|
||||||
SET(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS})
|
|
||||||
SET(CMAKE_SHARED_MODULE_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_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX})
|
||||||
SET(CMAKE_SHARED_MODULE_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
|
SET(CMAKE_SHARED_MODULE_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX})
|
||||||
SET(CMAKE_SHARED_MODULE_LINK_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_FLAGS})
|
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)
|
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)
|
SET(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1)
|
||||||
|
|
|
@ -1,32 +1,32 @@
|
||||||
# This file is used by EnableLanguage in cmGlobalGenerator to
|
# This file is used by EnableLanguage in cmGlobalGenerator to
|
||||||
# determine that that selected C compiler can actually compile
|
# determine that that selected Fortran compiler can actually compile
|
||||||
# and link the most basic of programs. If not, a fatal error
|
# and link the most basic of programs. If not, a fatal error
|
||||||
# is set and cmake stops processing commands and will not generate
|
# is set and cmake stops processing commands and will not generate
|
||||||
# any makefiles or projects.
|
# any makefiles or projects.
|
||||||
IF(NOT CMAKE_FORTRAN_COMPILER_WORKS)
|
IF(NOT CMAKE_Fortran_COMPILER_WORKS)
|
||||||
MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_FORTRAN_COMPILER}")
|
MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_Fortran_COMPILER}")
|
||||||
FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/testFortranCompiler.f "
|
FILE(WRITE ${CMAKE_BINARY_DIR}/CMakeTmp/testFortranCompiler.f "
|
||||||
PROGRAM TESTFORTRAN
|
PROGRAM TESTFortran
|
||||||
PRINT *, 'Hello'
|
PRINT *, 'Hello'
|
||||||
END
|
END
|
||||||
")
|
")
|
||||||
TRY_COMPILE(CMAKE_FORTRAN_COMPILER_WORKS ${CMAKE_BINARY_DIR}
|
TRY_COMPILE(CMAKE_Fortran_COMPILER_WORKS ${CMAKE_BINARY_DIR}
|
||||||
${CMAKE_BINARY_DIR}/CMakeTmp/testFortranCompiler.f
|
${CMAKE_BINARY_DIR}/CMakeTmp/testFortranCompiler.f
|
||||||
OUTPUT_VARIABLE OUTPUT)
|
OUTPUT_VARIABLE OUTPUT)
|
||||||
ENDIF(NOT CMAKE_FORTRAN_COMPILER_WORKS)
|
ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS)
|
||||||
|
|
||||||
IF(NOT CMAKE_FORTRAN_COMPILER_WORKS)
|
IF(NOT CMAKE_Fortran_COMPILER_WORKS)
|
||||||
MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_FORTRAN_COMPILER} -- broken")
|
MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_Fortran_COMPILER} -- broken")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
|
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeError.log
|
||||||
"Determining if the Fortran compiler works failed with "
|
"Determining if the Fortran compiler works failed with "
|
||||||
"the following output:\n${OUTPUT}\n\n")
|
"the following output:\n${OUTPUT}\n\n")
|
||||||
MESSAGE(FATAL_ERROR "The Fortran compiler \"${CMAKE_FORTRAN_COMPILER}\" "
|
MESSAGE(FATAL_ERROR "The Fortran compiler \"${CMAKE_Fortran_COMPILER}\" "
|
||||||
"is not able to compile a simple test program.\nIt fails "
|
"is not able to compile a simple test program.\nIt fails "
|
||||||
"with the following output:\n ${OUTPUT}\n\n"
|
"with the following output:\n ${OUTPUT}\n\n"
|
||||||
"CMake will not be able to correctly generate this project.")
|
"CMake will not be able to correctly generate this project.")
|
||||||
ELSE(NOT CMAKE_FORTRAN_COMPILER_WORKS)
|
ELSE(NOT CMAKE_Fortran_COMPILER_WORKS)
|
||||||
MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_FORTRAN_COMPILER} -- works")
|
MESSAGE(STATUS "Check for working Fortran compiler: ${CMAKE_Fortran_COMPILER} -- works")
|
||||||
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
FILE(APPEND ${CMAKE_BINARY_DIR}/CMakeOutput.log
|
||||||
"Determining if the Fortran compiler works passed with "
|
"Determining if the Fortran compiler works passed with "
|
||||||
"the following output:\n${OUTPUT}\n\n")
|
"the following output:\n${OUTPUT}\n\n")
|
||||||
ENDIF(NOT CMAKE_FORTRAN_COMPILER_WORKS)
|
ENDIF(NOT CMAKE_Fortran_COMPILER_WORKS)
|
||||||
|
|
|
@ -9,4 +9,3 @@ ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
IF(CMAKE_COMPILER_IS_GNUCC)
|
IF(CMAKE_COMPILER_IS_GNUCC)
|
||||||
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-G") # -shared
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,-G") # -shared
|
||||||
ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
|
@ -5,4 +5,3 @@ SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")
|
||||||
# no pic for gcc on cygwin
|
# no pic for gcc on cygwin
|
||||||
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")
|
||||||
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
|
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
|
@ -24,6 +24,5 @@ SET(CMAKE_CXX_CREATE_SHARED_MODULE
|
||||||
SET(CMAKE_C_CREATE_SHARED_MODULE
|
SET(CMAKE_C_CREATE_SHARED_MODULE
|
||||||
"<CMAKE_C_COMPILER> <CMAKE_SHARED_MODULE_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
"<CMAKE_C_COMPILER> <CMAKE_SHARED_MODULE_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
|
||||||
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
||||||
SET(CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES /usr/local/include)
|
SET(CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES /usr/local/include)
|
||||||
|
|
|
@ -7,4 +7,3 @@ IF(EXISTS /usr/include/dlfcn.h)
|
||||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") # : or empty
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") # : or empty
|
||||||
ENDIF(EXISTS /usr/include/dlfcn.h)
|
ENDIF(EXISTS /usr/include/dlfcn.h)
|
||||||
# include the gcc flags
|
# include the gcc flags
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
|
@ -51,4 +51,3 @@ ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
||||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
# set flags for gcc support
|
# set flags for gcc support
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
|
@ -14,4 +14,3 @@ IF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
SET (CMAKE_C_FLAGS_INIT "")
|
SET (CMAKE_C_FLAGS_INIT "")
|
||||||
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
# set flags for gcc support
|
# set flags for gcc support
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
|
@ -9,6 +9,7 @@ IF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
# Set default flags init.
|
# Set default flags init.
|
||||||
SET(CMAKE_C_FLAGS_INIT "")
|
SET(CMAKE_C_FLAGS_INIT "")
|
||||||
SET(CMAKE_CXX_FLAGS_INIT "")
|
SET(CMAKE_CXX_FLAGS_INIT "")
|
||||||
|
SET(CMAKE_FORTRAN_FLAGS_INIT "")
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS_INIT "")
|
SET(CMAKE_EXE_LINKER_FLAGS_INIT "")
|
||||||
SET(CMAKE_SHARED_LINKER_FLAGS_INIT "")
|
SET(CMAKE_SHARED_LINKER_FLAGS_INIT "")
|
||||||
SET(CMAKE_MODULE_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 ")
|
IF(CMAKE_FILE_SELF MATCHES " 64-bit ")
|
||||||
SET(CMAKE_C_FLAGS_INIT "-64")
|
SET(CMAKE_C_FLAGS_INIT "-64")
|
||||||
SET(CMAKE_CXX_FLAGS_INIT "-64")
|
SET(CMAKE_CXX_FLAGS_INIT "-64")
|
||||||
|
SET(CMAKE_Fortran_FLAGS_INIT "-64")
|
||||||
SET(CMAKE_EXE_LINKER_FLAGS_INIT "-64")
|
SET(CMAKE_EXE_LINKER_FLAGS_INIT "-64")
|
||||||
SET(CMAKE_SHARED_LINKER_FLAGS_INIT "-64")
|
SET(CMAKE_SHARED_LINKER_FLAGS_INIT "-64")
|
||||||
SET(CMAKE_MODULE_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_RELEASE_INIT "-O2 -DNDEBUG")
|
||||||
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
|
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
|
||||||
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
|
||||||
|
|
||||||
# set up for gcc if the compiler is gcc
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
# GCC is the default compiler on Linux.
|
# GCC is the default compiler on Linux.
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
||||||
SET(CMAKE_DL_LIBS "-ldl")
|
SET(CMAKE_DL_LIBS "-ldl")
|
||||||
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC")
|
||||||
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared")
|
||||||
|
|
|
@ -7,5 +7,3 @@ ENDIF(CMAKE_SYSTEM MATCHES "MP-RAS-02*.")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# include the gcc flags
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.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 "-Wl,-rpath,") # -rpath
|
||||||
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") # : or empty
|
SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP ":") # : or empty
|
||||||
ENDIF(EXISTS /usr/include/dlfcn.h)
|
ENDIF(EXISTS /usr/include/dlfcn.h)
|
||||||
# include the gcc flags
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
|
@ -29,7 +29,6 @@ ENDIF(CMAKE_SYSTEM MATCHES "OSF1-V.*")
|
||||||
|
|
||||||
IF(CMAKE_COMPILER_IS_GNUCXX)
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
# include the gcc flags
|
# include the gcc flags
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
ELSE (CMAKE_COMPILER_IS_GNUCXX)
|
ELSE (CMAKE_COMPILER_IS_GNUCXX)
|
||||||
# use default OSF compiler flags
|
# use default OSF compiler flags
|
||||||
SET (CMAKE_C_FLAGS_INIT "")
|
SET (CMAKE_C_FLAGS_INIT "")
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
# include the gcc flags
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
|
@ -2,5 +2,3 @@ SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0")
|
||||||
SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o")
|
SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o")
|
||||||
SET(CMAKE_DL_LIBS "")
|
SET(CMAKE_DL_LIBS "")
|
||||||
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-D,08000000")
|
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-D,08000000")
|
||||||
# include the gcc flags
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
|
@ -2,5 +2,3 @@ SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-Kpic -belf")
|
||||||
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-Kpic -belf")
|
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-Kpic -belf")
|
||||||
SET(CMAKE_DL_LIBS "")
|
SET(CMAKE_DL_LIBS "")
|
||||||
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-belf -Wl,-Bexport")
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-belf -Wl,-Bexport")
|
||||||
# include the gcc flags
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
|
@ -1,4 +1,2 @@
|
||||||
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
|
||||||
# include the gcc flags
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
||||||
|
|
|
@ -46,5 +46,3 @@ ELSE(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
"<CMAKE_CXX_COMPILER> -xar -o <TARGET> <OBJECTS> "
|
"<CMAKE_CXX_COMPILER> -xar -o <TARGET> <OBJECTS> "
|
||||||
"<CMAKE_RANLIB> <TARGET> ")
|
"<CMAKE_RANLIB> <TARGET> ")
|
||||||
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
||||||
# include the gcc flags
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
|
@ -1,2 +1 @@
|
||||||
# include the gcc flags
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
|
@ -2,5 +2,3 @@ SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-G 0")
|
||||||
SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o")
|
SET(CMAKE_SHARED_LIBRARY_SUFFIX "..o")
|
||||||
SET(CMAKE_DL_LIBS "")
|
SET(CMAKE_DL_LIBS "")
|
||||||
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-D,08000000")
|
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-D,08000000")
|
||||||
# include the gcc flags
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
|
@ -1,4 +1,2 @@
|
||||||
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
|
||||||
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-Bexport")
|
SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "-Wl,-Bexport")
|
||||||
# include the gcc flags
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
|
@ -1,4 +1,2 @@
|
||||||
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
|
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-K PIC")
|
||||||
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-Wl,-Bexport")
|
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-Wl,-Bexport")
|
||||||
# include the gcc flags
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
|
@ -12,5 +12,3 @@ SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP "") # : or empty
|
||||||
SET(CMAKE_LIBRARY_PATH_FLAG "-L")
|
SET(CMAKE_LIBRARY_PATH_FLAG "-L")
|
||||||
SET(CMAKE_LINK_LIBRARY_FLAG "-l")
|
SET(CMAKE_LINK_LIBRARY_FLAG "-l")
|
||||||
|
|
||||||
# include the gcc flags
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.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:<TARGET> /dll <LINK_FLAGS> <OBJECTS> <LINK_LIBRARIES> ${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 <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
|
||||||
|
|
||||||
|
# compile a C++ file into an object file
|
||||||
|
SET(CMAKE_Fortran_COMPILE_OBJECT
|
||||||
|
"<CMAKE_Fortran_COMPILER> ${CMAKE_START_TEMP_FILE} /nologo /Fo<OBJECT> <FLAGS> -c <SOURCE>${CMAKE_END_TEMP_FILE}")
|
||||||
|
|
||||||
|
SET(CMAKE_COMPILE_RESOURCE "rc <FLAGS> /fo<OBJECT> <SOURCE>")
|
||||||
|
|
||||||
|
SET(CMAKE_Fortran_LINK_EXECUTABLE
|
||||||
|
"<CMAKE_Fortran_COMPILER> /nologo ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> -link <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${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})
|
|
@ -1,2 +1 @@
|
||||||
# include the gcc flags
|
|
||||||
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
|
|
||||||
|
|
|
@ -119,6 +119,9 @@ TARGET_LINK_LIBRARIES(cmake CMakeLib)
|
||||||
TARGET_LINK_LIBRARIES(DumpDocumentation CMakeLib)
|
TARGET_LINK_LIBRARIES(DumpDocumentation CMakeLib)
|
||||||
|
|
||||||
IF(CMAKE_BUILD_WITH_CURL)
|
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)
|
SUBDIRS(CTest)
|
||||||
SET(CMTEST_SRCS ${CMTEST_SRCS} CTest/cmCTestSubmit.cxx)
|
SET(CMTEST_SRCS ${CMTEST_SRCS} CTest/cmCTestSubmit.cxx)
|
||||||
ADD_DEFINITIONS(-DHAVE_CURL)
|
ADD_DEFINITIONS(-DHAVE_CURL)
|
||||||
|
|
|
@ -27,13 +27,6 @@ cmGlobalBorlandMakefileGenerator::cmGlobalBorlandMakefileGenerator()
|
||||||
void cmGlobalBorlandMakefileGenerator::EnableLanguage(const char* l,
|
void cmGlobalBorlandMakefileGenerator::EnableLanguage(const char* l,
|
||||||
cmMakefile *mf)
|
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();
|
std::string outdir = m_CMakeInstance->GetStartOutputDirectory();
|
||||||
mf->AddDefinition("BORLAND", "1");
|
mf->AddDefinition("BORLAND", "1");
|
||||||
mf->AddDefinition("CMAKE_GENERATOR_CC", "bcc32");
|
mf->AddDefinition("CMAKE_GENERATOR_CC", "bcc32");
|
||||||
|
|
|
@ -43,9 +43,8 @@ cmGlobalGenerator::~cmGlobalGenerator()
|
||||||
m_LocalGenerators.clear();
|
m_LocalGenerators.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Find the make program for the generator, required for try compiles
|
||||||
void cmGlobalGenerator::EnableLanguage(const char* lang,
|
void cmGlobalGenerator::FindMakeProgram(cmMakefile* mf)
|
||||||
cmMakefile *mf)
|
|
||||||
{
|
{
|
||||||
if(m_FindMakeProgramFile.size() == 0)
|
if(m_FindMakeProgramFile.size() == 0)
|
||||||
{
|
{
|
||||||
|
@ -53,15 +52,15 @@ void cmGlobalGenerator::EnableLanguage(const char* lang,
|
||||||
"Generator implementation error, "
|
"Generator implementation error, "
|
||||||
"all generators must specify m_FindMakeProgramFile");
|
"all generators must specify m_FindMakeProgramFile");
|
||||||
}
|
}
|
||||||
std::string root = mf->GetRequiredDefinition("CMAKE_ROOT");
|
|
||||||
if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM")
|
if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM")
|
||||||
|| cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM")))
|
|| cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM")))
|
||||||
{
|
{
|
||||||
std::string setMakeProgram = root;
|
std::string setMakeProgram = mf->GetModulesFile(m_FindMakeProgramFile.c_str());
|
||||||
setMakeProgram += "/Modules/";
|
if(setMakeProgram.size())
|
||||||
setMakeProgram += m_FindMakeProgramFile;
|
{
|
||||||
mf->ReadListFile(0, setMakeProgram.c_str());
|
mf->ReadListFile(0, setMakeProgram.c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM")
|
if(!mf->GetDefinition("CMAKE_MAKE_PROGRAM")
|
||||||
|| cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM")))
|
|| cmSystemTools::IsOff(mf->GetDefinition("CMAKE_MAKE_PROGRAM")))
|
||||||
{
|
{
|
||||||
|
@ -95,23 +94,39 @@ void cmGlobalGenerator::EnableLanguage(const char* lang,
|
||||||
cmCacheManager::FILEPATH);
|
cmCacheManager::FILEPATH);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isLocal = m_CMakeInstance->GetLocal();
|
}
|
||||||
// if no lang specified use CXX
|
|
||||||
if(!lang )
|
|
||||||
|
// enable the given language
|
||||||
|
void cmGlobalGenerator::EnableLanguage(const char* lang,
|
||||||
|
cmMakefile *mf)
|
||||||
|
{
|
||||||
|
if(!lang)
|
||||||
{
|
{
|
||||||
lang = "CXX";
|
cmSystemTools::Error("EnableLanguage must have a lang specified!");
|
||||||
|
cmSystemTools::SetFatalErrorOccured();
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
// setup some variables for the EnableLanguage function
|
||||||
|
bool isLocal = m_CMakeInstance->GetLocal();
|
||||||
|
// if we are from the top, always define this
|
||||||
|
if(!isLocal)
|
||||||
|
{
|
||||||
|
mf->AddDefinition("RUN_CONFIGURE", true);
|
||||||
|
}
|
||||||
|
bool needTestLanguage = false;
|
||||||
std::string rootBin = mf->GetHomeOutputDirectory();
|
std::string rootBin = mf->GetHomeOutputDirectory();
|
||||||
if(m_ConfiguredFilesPath.size())
|
if(m_ConfiguredFilesPath.size())
|
||||||
{
|
{
|
||||||
rootBin = m_ConfiguredFilesPath;
|
rootBin = m_ConfiguredFilesPath;
|
||||||
}
|
}
|
||||||
bool needCBackwards = false;
|
|
||||||
bool needCXXBackwards = false;
|
// **** Step 1, find and make sure CMAKE_MAKE_PROGRAM is defined
|
||||||
bool needTestFortran = false;
|
this->FindMakeProgram(mf);
|
||||||
if (!isLocal &&
|
|
||||||
!this->GetLanguageEnabled("C") && !this->GetLanguageEnabled("CXX") &&
|
// **** Step 2, Load the CMakeDetermineSystem.cmake file and find out
|
||||||
!this->GetLanguageEnabled("JAVA") && !this->GetLanguageEnabled("FORTRAN"))
|
// what platform we are running on
|
||||||
|
if (!isLocal && !this->GetLanguageEnabled(lang))
|
||||||
{
|
{
|
||||||
#if defined(_WIN32) && !defined(__CYGWIN__)
|
#if defined(_WIN32) && !defined(__CYGWIN__)
|
||||||
/* Windows version number data. */
|
/* Windows version number data. */
|
||||||
|
@ -125,14 +140,20 @@ void cmGlobalGenerator::EnableLanguage(const char* lang,
|
||||||
mf->AddDefinition("CMAKE_SYSTEM_VERSION", windowsVersionString.str().c_str());
|
mf->AddDefinition("CMAKE_SYSTEM_VERSION", windowsVersionString.str().c_str());
|
||||||
#endif
|
#endif
|
||||||
// Read the DetermineSystem file
|
// Read the DetermineSystem file
|
||||||
std::string systemFile = root;
|
std::string systemFile = mf->GetModulesFile("CMakeDetermineSystem.cmake");
|
||||||
systemFile += "/Modules/CMakeDetermineSystem.cmake";
|
|
||||||
mf->ReadListFile(0, systemFile.c_str());
|
mf->ReadListFile(0, systemFile.c_str());
|
||||||
}
|
}
|
||||||
// check for a C compiler and configure it
|
// **** Step 3, load the CMakeSystem.cmake from the binary directory
|
||||||
if(!isLocal &&
|
// this file is configured by the CMakeDetermineSystem.cmake file
|
||||||
!this->GetLanguageEnabled("C") &&
|
std::string fpath = rootBin;
|
||||||
lang[0] == 'C')
|
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())
|
if (m_CMakeInstance->GetIsInTryCompile())
|
||||||
{
|
{
|
||||||
|
@ -141,154 +162,117 @@ void cmGlobalGenerator::EnableLanguage(const char* lang,
|
||||||
"broken CMakeLists.txt file or a problematic release of "
|
"broken CMakeLists.txt file or a problematic release of "
|
||||||
"CMake");
|
"CMake");
|
||||||
}
|
}
|
||||||
needCBackwards = true;
|
needTestLanguage = true; // must test a language after finding it
|
||||||
// read determine C compiler
|
// read determine LANG compiler
|
||||||
std::string determineCFile = root;
|
std::string determinCompiler = "CMakeDetermine";
|
||||||
determineCFile += "/Modules/CMakeDetermineCCompiler.cmake";
|
determinCompiler += lang;
|
||||||
mf->ReadListFile(0,determineCFile.c_str());
|
determinCompiler += "Compiler.cmake";
|
||||||
this->SetLanguageEnabled("C");
|
std::string determineFile = mf->GetModulesFile(determinCompiler.c_str());
|
||||||
// put CC in the environment in case user scripts want
|
if(!mf->ReadListFile(0,determineFile.c_str()))
|
||||||
// to run configure
|
|
||||||
if(mf->GetDefinition("CMAKE_C_COMPILER"))
|
|
||||||
{
|
{
|
||||||
std::string env = "CC=${CMAKE_C_COMPILER}";
|
cmSystemTools::Error("Could not find cmake module file:", determineFile.c_str());
|
||||||
mf->ExpandVariablesInString(env);
|
}
|
||||||
|
|
||||||
|
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());
|
cmSystemTools::PutEnv(env.c_str());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// check for a CXX compiler and configure it
|
// **** Step 5, Load the configured language compiler file, if not loaded.
|
||||||
if(!isLocal &&
|
// look to see if CMAKE_(LANG)_COMPILER_LOADED is set,
|
||||||
!this->GetLanguageEnabled("CXX") &&
|
// if not then load the CMake(LANG)Compiler.cmake file from the
|
||||||
strcmp(lang, "CXX") == 0)
|
// binary tree, this is a configured file provided by
|
||||||
{
|
// CMakeDetermine(LANG)Compiler.cmake
|
||||||
needCXXBackwards = true;
|
std::string loadedLang = "CMAKE_";
|
||||||
std::string determineCFile = root;
|
loadedLang += lang;
|
||||||
determineCFile += "/Modules/CMakeDetermineCXXCompiler.cmake";
|
loadedLang += "_COMPILER_LOADED";
|
||||||
mf->ReadListFile(0,determineCFile.c_str());
|
if(!mf->GetDefinition(loadedLang.c_str()))
|
||||||
this->SetLanguageEnabled("CXX");
|
|
||||||
// put CXX in the environment in case user scripts want
|
|
||||||
// to run configure
|
|
||||||
if(mf->GetDefinition("CMAKE_CXX_COMPILER"))
|
|
||||||
{
|
|
||||||
std::string env = "CXX=${CMAKE_CXX_COMPILER}";
|
|
||||||
mf->ExpandVariablesInString(env);
|
|
||||||
cmSystemTools::PutEnv(env.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 = rootBin;
|
||||||
fpath += "/CMakeCCompiler.cmake";
|
fpath += "/CMake";
|
||||||
mf->ReadListFile(0,fpath.c_str());
|
fpath += lang;
|
||||||
this->SetLanguageEnabled("C");
|
fpath += "Compiler.cmake";
|
||||||
}
|
if(!mf->ReadListFile(0,fpath.c_str()))
|
||||||
if(strcmp(lang, "CXX") == 0 && !mf->GetDefinition("CMAKE_CXX_COMPILER_LOADED"))
|
|
||||||
{
|
{
|
||||||
fpath = rootBin;
|
cmSystemTools::Error("Could not find cmake module file:", fpath.c_str());
|
||||||
fpath += "/CMakeCXXCompiler.cmake";
|
|
||||||
mf->ReadListFile(0,fpath.c_str());
|
|
||||||
this->SetLanguageEnabled("CXX");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
if(strcmp(lang, "JAVA") == 0 && !mf->GetDefinition("CMAKE_JAVA_COMPILER_LOADED"))
|
this->SetLanguageEnabled(lang);
|
||||||
{
|
|
||||||
fpath = rootBin;
|
|
||||||
fpath += "/CMakeJavaCompiler.cmake";
|
|
||||||
mf->ReadListFile(0,fpath.c_str());
|
|
||||||
this->SetLanguageEnabled("JAVA");
|
|
||||||
}
|
}
|
||||||
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 = mf->GetModulesFile("CMakeSystemSpecificInformation.cmake");
|
||||||
fpath += "/CMakeFortranCompiler.cmake";
|
if(!mf->ReadListFile(0,fpath.c_str()))
|
||||||
mf->ReadListFile(0,fpath.c_str());
|
{
|
||||||
this->SetLanguageEnabled("FORTRAN");
|
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"))
|
}
|
||||||
|
std::string langLoadedVar = "CMAKE_";
|
||||||
|
langLoadedVar += lang;
|
||||||
|
langLoadedVar += "_INFORMATION_LOADED";
|
||||||
|
if (!mf->GetDefinition(langLoadedVar.c_str()))
|
||||||
{
|
{
|
||||||
fpath = root;
|
fpath = "CMake";
|
||||||
fpath += "/Modules/CMakeSystemSpecificInformation.cmake";
|
fpath += lang;
|
||||||
mf->ReadListFile(0,fpath.c_str());
|
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());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!isLocal)
|
// **** Step 7, Test the compiler for the language just setup
|
||||||
{
|
|
||||||
// At this point we should have enough info for a try compile
|
// At this point we should have enough info for a try compile
|
||||||
// which is used in the backward stuff
|
// which is used in the backward stuff
|
||||||
if(needCBackwards)
|
if(!isLocal)
|
||||||
|
{
|
||||||
|
if(needTestLanguage)
|
||||||
{
|
{
|
||||||
if (!m_CMakeInstance->GetIsInTryCompile())
|
if (!m_CMakeInstance->GetIsInTryCompile())
|
||||||
{
|
{
|
||||||
std::string ifpath = root + "/Modules/CMakeTestCCompiler.cmake";
|
std::string testLang = "CMakeTest";
|
||||||
mf->ReadListFile(0,ifpath.c_str());
|
testLang += lang;
|
||||||
// for old versions of CMake ListFiles
|
testLang += "Compiler.cmake";
|
||||||
|
std::string ifpath = mf->GetModulesFile(testLang.c_str());
|
||||||
|
if(!mf->ReadListFile(0,ifpath.c_str()))
|
||||||
|
{
|
||||||
|
cmSystemTools::Error("Could not find cmake module file:", ifpath.c_str());
|
||||||
|
}
|
||||||
|
// **** 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
|
const char* versionValue
|
||||||
= mf->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY");
|
= mf->GetDefinition("CMAKE_BACKWARDS_COMPATIBILITY");
|
||||||
if (atof(versionValue) <= 1.4)
|
if (atof(versionValue) <= 1.4)
|
||||||
{
|
{
|
||||||
ifpath = root + "/Modules/CMakeBackwardCompatibilityC.cmake";
|
if(strcmp(lang, "C") == 0)
|
||||||
|
{
|
||||||
|
ifpath = mf->GetModulesFile("CMakeBackwardCompatibilityC.cmake");
|
||||||
mf->ReadListFile(0,ifpath.c_str());
|
mf->ReadListFile(0,ifpath.c_str());
|
||||||
}
|
}
|
||||||
}
|
if(strcmp(lang, "CXX") == 0)
|
||||||
}
|
|
||||||
if(needCXXBackwards)
|
|
||||||
{
|
{
|
||||||
if (!m_CMakeInstance->GetIsInTryCompile())
|
ifpath = mf->GetModulesFile("CMakeBackwardCompatibilityCXX.cmake");
|
||||||
{
|
|
||||||
std::string ifpath = root + "/Modules/CMakeTestCXXCompiler.cmake";
|
|
||||||
mf->ReadListFile(0,ifpath.c_str());
|
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 nfpath = root + "/Modules/CMakeBackwardCompatibilityCXX.cmake";
|
|
||||||
mf->ReadListFile(0,nfpath.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,
|
this->GetCMakeInstance()->AddCacheEntry("CMAKE_MAKE_PROGRAM", make,
|
||||||
"make program",
|
"make program",
|
||||||
cmCacheManager::FILEPATH);
|
cmCacheManager::FILEPATH);
|
||||||
// if C, then enable C
|
for(std::map<cmStdString, bool>::iterator i = gen->m_LanguageEnabled.begin();
|
||||||
if(gen->GetLanguageEnabled("C"))
|
i != gen->m_LanguageEnabled.end(); ++i)
|
||||||
{
|
{
|
||||||
this->SetLanguageEnabled("C");
|
this->SetLanguageEnabled(i->first.c_str());
|
||||||
}
|
|
||||||
|
|
||||||
// if CXX
|
|
||||||
if(gen->GetLanguageEnabled("CXX"))
|
|
||||||
{
|
|
||||||
this->SetLanguageEnabled("CXX");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,7 @@ public:
|
||||||
bool GetForceUnixPaths() {return m_ForceUnixPaths;}
|
bool GetForceUnixPaths() {return m_ForceUnixPaths;}
|
||||||
protected:
|
protected:
|
||||||
bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen);
|
bool IsExcluded(cmLocalGenerator* root, cmLocalGenerator* gen);
|
||||||
|
void FindMakeProgram(cmMakefile*);
|
||||||
|
|
||||||
bool m_ForceUnixPaths;
|
bool m_ForceUnixPaths;
|
||||||
cmStdString m_FindMakeProgramFile;
|
cmStdString m_FindMakeProgramFile;
|
||||||
|
|
|
@ -32,11 +32,8 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
|
||||||
{
|
{
|
||||||
mf->AddDefinition("CMAKE_CFG_INTDIR",".");
|
mf->AddDefinition("CMAKE_CFG_INTDIR",".");
|
||||||
this->cmGlobalGenerator::EnableLanguage(lang, mf);
|
this->cmGlobalGenerator::EnableLanguage(lang, mf);
|
||||||
if(!lang)
|
std::string path;
|
||||||
{
|
if(strcmp(lang, "C") == 0)
|
||||||
lang = "CXX";
|
|
||||||
}
|
|
||||||
if(lang[0] == 'C')
|
|
||||||
{
|
{
|
||||||
if(!mf->GetDefinition("CMAKE_C_COMPILER"))
|
if(!mf->GetDefinition("CMAKE_C_COMPILER"))
|
||||||
{
|
{
|
||||||
|
@ -44,7 +41,7 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const char* cc = mf->GetRequiredDefinition("CMAKE_C_COMPILER");
|
const char* cc = mf->GetRequiredDefinition("CMAKE_C_COMPILER");
|
||||||
std::string path = cmSystemTools::FindProgram(cc);
|
path = cmSystemTools::FindProgram(cc);
|
||||||
if(path.size() == 0)
|
if(path.size() == 0)
|
||||||
{
|
{
|
||||||
std::string message = "your C compiler: ";
|
std::string message = "your C compiler: ";
|
||||||
|
@ -62,6 +59,7 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
|
||||||
" and re-run CMake.";
|
" and re-run CMake.";
|
||||||
cmSystemTools::Error(message.c_str());
|
cmSystemTools::Error(message.c_str());
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if(strcmp(lang, "CXX") == 0)
|
if(strcmp(lang, "CXX") == 0)
|
||||||
{
|
{
|
||||||
const char* cxx = mf->GetRequiredDefinition("CMAKE_CXX_COMPILER");
|
const char* cxx = mf->GetRequiredDefinition("CMAKE_CXX_COMPILER");
|
||||||
|
@ -85,7 +83,6 @@ void cmGlobalUnixMakefileGenerator::EnableLanguage(const char* lang,
|
||||||
cmSystemTools::Error(message.c_str());
|
cmSystemTools::Error(message.c_str());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
///! Create a local generator appropriate to this Global Generator
|
///! Create a local generator appropriate to this Global Generator
|
||||||
|
|
|
@ -89,7 +89,6 @@ bool cmListFileCache::CacheFile(const char* path, bool requireProjectCommand)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get a pointer to a persistent copy of the name.
|
// Get a pointer to a persistent copy of the name.
|
||||||
const char* filename = this->GetUniqueStringPointer(path);
|
const char* filename = this->GetUniqueStringPointer(path);
|
||||||
|
|
||||||
|
|
|
@ -995,21 +995,21 @@ static RuleVariables ruleReplaceVars[] =
|
||||||
{"<CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS>", "CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS"},
|
{"<CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS>", "CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS"},
|
||||||
{"<CMAKE_SHARED_MODULE_CREATE_FORTAN_FLAGS>", "CMAKE_SHARED_MODULE_CREATE_FORTAN_FLAGS"},
|
{"<CMAKE_SHARED_MODULE_CREATE_FORTAN_FLAGS>", "CMAKE_SHARED_MODULE_CREATE_FORTAN_FLAGS"},
|
||||||
{"<CMAKE_SHARED_MODULE_C_FLAGS>", "CMAKE_SHARED_MODULE_C_FLAGS"},
|
{"<CMAKE_SHARED_MODULE_C_FLAGS>", "CMAKE_SHARED_MODULE_C_FLAGS"},
|
||||||
{"<CMAKE_SHARED_MODULE_FORTRAN_FLAGS>", "CMAKE_SHARED_MODULE_FORTRAN_FLAGS"},
|
{"<CMAKE_SHARED_MODULE_Fortran_FLAGS>", "CMAKE_SHARED_MODULE_Fortran_FLAGS"},
|
||||||
{"<CMAKE_SHARED_MODULE_CXX_FLAGS>", "CMAKE_SHARED_MODULE_CXX_FLAGS"},
|
{"<CMAKE_SHARED_MODULE_CXX_FLAGS>", "CMAKE_SHARED_MODULE_CXX_FLAGS"},
|
||||||
{"<CMAKE_SHARED_LIBRARY_C_FLAGS>", "CMAKE_SHARED_LIBRARY_C_FLAGS"},
|
{"<CMAKE_SHARED_LIBRARY_C_FLAGS>", "CMAKE_SHARED_LIBRARY_C_FLAGS"},
|
||||||
{"<CMAKE_SHARED_LIBRARY_FORTRAN_FLAGS>", "CMAKE_SHARED_LIBRARY_FORTRAN_FLAGS"},
|
{"<CMAKE_SHARED_LIBRARY_Fortran_FLAGS>", "CMAKE_SHARED_LIBRARY_Fortran_FLAGS"},
|
||||||
{"<CMAKE_SHARED_LIBRARY_CXX_FLAGS>", "CMAKE_SHARED_LIBRARY_CXX_FLAGS"},
|
{"<CMAKE_SHARED_LIBRARY_CXX_FLAGS>", "CMAKE_SHARED_LIBRARY_CXX_FLAGS"},
|
||||||
{"<CMAKE_CXX_LINK_FLAGS>", "CMAKE_CXX_LINK_FLAGS"},
|
{"<CMAKE_CXX_LINK_FLAGS>", "CMAKE_CXX_LINK_FLAGS"},
|
||||||
|
|
||||||
{"<CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS>", "CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS"},
|
{"<CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS>", "CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS"},
|
||||||
{"<CMAKE_SHARED_LIBRARY_CREATE_FORTRAN_FLAGS>", "CMAKE_SHARED_LIBRARY_CREATE_FORTRAN_FLAGS"},
|
{"<CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS>", "CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS"},
|
||||||
{"<CMAKE_SHARED_MODULE_CREATE_C_FLAGS>", "CMAKE_SHARED_MODULE_CREATE_C_FLAGS"},
|
{"<CMAKE_SHARED_MODULE_CREATE_C_FLAGS>", "CMAKE_SHARED_MODULE_CREATE_C_FLAGS"},
|
||||||
{"<CMAKE_SHARED_LIBRARY_SONAME_C_FLAG>", "CMAKE_SHARED_LIBRARY_SONAME_C_FLAG"},
|
{"<CMAKE_SHARED_LIBRARY_SONAME_C_FLAG>", "CMAKE_SHARED_LIBRARY_SONAME_C_FLAG"},
|
||||||
{"<CMAKE_SHARED_LIBRARY_SONAME_FORTRAN_FLAG>", "CMAKE_SHARED_LIBRARY_SONAME_FORTRAN_FLAG"},
|
{"<CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG>", "CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG"},
|
||||||
{"<CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG>", "CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG"},
|
{"<CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG>", "CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG"},
|
||||||
{"<CMAKE_C_LINK_FLAGS>", "CMAKE_C_LINK_FLAGS"},
|
{"<CMAKE_C_LINK_FLAGS>", "CMAKE_C_LINK_FLAGS"},
|
||||||
{"<CMAKE_FORTRAN_LINK_FLAGS>", "CMAKE_FORTRAN_LINK_FLAGS"},
|
{"<CMAKE_Fortran_LINK_FLAGS>", "CMAKE_Fortran_LINK_FLAGS"},
|
||||||
|
|
||||||
{"<CMAKE_AR>", "CMAKE_AR"},
|
{"<CMAKE_AR>", "CMAKE_AR"},
|
||||||
{"<CMAKE_RANLIB>", "CMAKE_RANLIB"},
|
{"<CMAKE_RANLIB>", "CMAKE_RANLIB"},
|
||||||
|
@ -1037,8 +1037,8 @@ cmLocalUnixMakefileGenerator::ExpandRuleVariables(std::string& s,
|
||||||
std::string ccompiler = this->ConvertToOutputForExisting(
|
std::string ccompiler = this->ConvertToOutputForExisting(
|
||||||
m_Makefile->GetSafeDefinition("CMAKE_C_COMPILER"));
|
m_Makefile->GetSafeDefinition("CMAKE_C_COMPILER"));
|
||||||
std::string fcompiler = this->ConvertToOutputForExisting(
|
std::string fcompiler = this->ConvertToOutputForExisting(
|
||||||
m_Makefile->GetSafeDefinition("CMAKE_FORTRAN_COMPILER"));
|
m_Makefile->GetSafeDefinition("CMAKE_Fortran_COMPILER"));
|
||||||
cmSystemTools::ReplaceString(s, "<CMAKE_FORTRAN_COMPILER>", fcompiler.c_str());
|
cmSystemTools::ReplaceString(s, "<CMAKE_Fortran_COMPILER>", fcompiler.c_str());
|
||||||
cmSystemTools::ReplaceString(s, "<CMAKE_CXX_COMPILER>", cxxcompiler.c_str());
|
cmSystemTools::ReplaceString(s, "<CMAKE_CXX_COMPILER>", cxxcompiler.c_str());
|
||||||
cmSystemTools::ReplaceString(s, "<CMAKE_C_COMPILER>", ccompiler.c_str());
|
cmSystemTools::ReplaceString(s, "<CMAKE_C_COMPILER>", ccompiler.c_str());
|
||||||
if(linkFlags)
|
if(linkFlags)
|
||||||
|
@ -1297,7 +1297,7 @@ void cmLocalUnixMakefileGenerator::OutputSharedLibraryRule(std::ostream& fout,
|
||||||
{
|
{
|
||||||
if(t.HasFortran())
|
if(t.HasFortran())
|
||||||
{
|
{
|
||||||
createRule = "CMAKE_FORTRAN_CREATE_SHARED_LIBRARY";
|
createRule = "CMAKE_Fortran_CREATE_SHARED_LIBRARY";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -1352,10 +1352,18 @@ void cmLocalUnixMakefileGenerator::OutputModuleLibraryRule(std::ostream& fout,
|
||||||
{
|
{
|
||||||
createRule = "CMAKE_CXX_CREATE_SHARED_MODULE";
|
createRule = "CMAKE_CXX_CREATE_SHARED_MODULE";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(t.HasFortran())
|
||||||
|
{
|
||||||
|
createRule = "CMAKE_Fortran_CREATE_SHARED_MODULE";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
createRule = "CMAKE_C_CREATE_SHARED_MODULE";
|
createRule = "CMAKE_C_CREATE_SHARED_MODULE";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::string buildType = m_Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
|
std::string buildType = m_Makefile->GetSafeDefinition("CMAKE_BUILD_TYPE");
|
||||||
buildType = cmSystemTools::UpperCase(buildType);
|
buildType = cmSystemTools::UpperCase(buildType);
|
||||||
std::string linkFlags = m_Makefile->GetSafeDefinition("CMAKE_MODULE_LINKER_FLAGS");
|
std::string linkFlags = m_Makefile->GetSafeDefinition("CMAKE_MODULE_LINKER_FLAGS");
|
||||||
|
@ -1389,10 +1397,18 @@ void cmLocalUnixMakefileGenerator::OutputStaticLibraryRule(std::ostream& fout,
|
||||||
{
|
{
|
||||||
createRule = "CMAKE_CXX_CREATE_STATIC_LIBRARY";
|
createRule = "CMAKE_CXX_CREATE_STATIC_LIBRARY";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(t.HasFortran())
|
||||||
|
{
|
||||||
|
createRule = "CMAKE_Fortran_CREATE_STATIC_LIBRARY";
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
createRule = "CMAKE_C_CREATE_STATIC_LIBRARY";
|
createRule = "CMAKE_C_CREATE_STATIC_LIBRARY";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
std::string linkFlags;
|
std::string linkFlags;
|
||||||
const char* targetLinkFlags = t.GetProperty("STATIC_LIBRARY_FLAGS");
|
const char* targetLinkFlags = t.GetProperty("STATIC_LIBRARY_FLAGS");
|
||||||
if(targetLinkFlags)
|
if(targetLinkFlags)
|
||||||
|
@ -1482,10 +1498,10 @@ void cmLocalUnixMakefileGenerator::OutputExecutableRule(std::ostream& fout,
|
||||||
{
|
{
|
||||||
if(t.HasFortran())
|
if(t.HasFortran())
|
||||||
{
|
{
|
||||||
rules.push_back(m_Makefile->GetRequiredDefinition("CMAKE_FORTRAN_LINK_EXECUTABLE"));
|
rules.push_back(m_Makefile->GetRequiredDefinition("CMAKE_Fortran_LINK_EXECUTABLE"));
|
||||||
flags += m_Makefile->GetSafeDefinition("CMAKE_FORTRAN_FLAGS");
|
flags += m_Makefile->GetSafeDefinition("CMAKE_Fortran_FLAGS");
|
||||||
flags += " ";
|
flags += " ";
|
||||||
flags += m_Makefile->GetSafeDefinition("CMAKE_SHARED_LIBRARY_FORTRAN_FLAGS");
|
flags += m_Makefile->GetSafeDefinition("CMAKE_SHARED_LIBRARY_Fortran_FLAGS");
|
||||||
flags += " ";
|
flags += " ";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2879,24 +2895,24 @@ OutputBuildObjectFromSource(std::ostream& fout,
|
||||||
}
|
}
|
||||||
case cmSystemTools::FORTRAN_FILE_FORMAT:
|
case cmSystemTools::FORTRAN_FILE_FORMAT:
|
||||||
{
|
{
|
||||||
rules.push_back(m_Makefile->GetRequiredDefinition("CMAKE_FORTRAN_COMPILE_OBJECT"));
|
rules.push_back(m_Makefile->GetRequiredDefinition("CMAKE_Fortran_COMPILE_OBJECT"));
|
||||||
flags += m_Makefile->GetSafeDefinition("CMAKE_FORTRAN_FLAGS");
|
flags += m_Makefile->GetSafeDefinition("CMAKE_Fortran_FLAGS");
|
||||||
flags += " ";
|
flags += " ";
|
||||||
if(buildType.size())
|
if(buildType.size())
|
||||||
{
|
{
|
||||||
std::string build = "CMAKE_FORTRAN_FLAGS_";
|
std::string build = "CMAKE_Fortran_FLAGS_";
|
||||||
build += buildType;
|
build += buildType;
|
||||||
flags += m_Makefile->GetSafeDefinition(build.c_str());
|
flags += m_Makefile->GetSafeDefinition(build.c_str());
|
||||||
flags += " ";
|
flags += " ";
|
||||||
}
|
}
|
||||||
if(shared)
|
if(shared)
|
||||||
{
|
{
|
||||||
flags += m_Makefile->GetSafeDefinition("CMAKE_SHARED_LIBRARY_FORTRAN_FLAGS");
|
flags += m_Makefile->GetSafeDefinition("CMAKE_SHARED_LIBRARY_Fortran_FLAGS");
|
||||||
flags += " ";
|
flags += " ";
|
||||||
}
|
}
|
||||||
if(cmSystemTools::IsOn(m_Makefile->GetDefinition("BUILD_SHARED_LIBS")))
|
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 += " ";
|
flags += " ";
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -57,7 +57,9 @@ bool cmProjectCommand::InitialPass(std::vector<std::string> const& args)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_Makefile->EnableLanguage(0);
|
// if no language is specified do c and c++
|
||||||
|
m_Makefile->EnableLanguage("C");
|
||||||
|
m_Makefile->EnableLanguage("CXX");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,7 +158,7 @@ int cmTryCompileCommand::CoreTryCompileCode(
|
||||||
}
|
}
|
||||||
else if ( format == cmSystemTools::FORTRAN_FILE_FORMAT )
|
else if ( format == cmSystemTools::FORTRAN_FILE_FORMAT )
|
||||||
{
|
{
|
||||||
fprintf(fout, "PROJECT(CMAKE_TRY_COMPILE FORTRAN)\n");
|
fprintf(fout, "PROJECT(CMAKE_TRY_COMPILE Fortran)\n");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -187,8 +187,8 @@ int cmTryCompileCommand::CoreTryCompileCode(
|
||||||
}
|
}
|
||||||
if(format == cmSystemTools::FORTRAN_FILE_FORMAT )
|
if(format == cmSystemTools::FORTRAN_FILE_FORMAT )
|
||||||
{
|
{
|
||||||
const char* fflags = mf->GetDefinition("CMAKE_FORTRAN_FLAGS");
|
const char* fflags = mf->GetDefinition("CMAKE_Fortran_FLAGS");
|
||||||
fprintf(fout, "SET(CMAKE_FORTRAN_FLAGS \"${CMAKE_FORTRAN_FLAGS} ");
|
fprintf(fout, "SET(CMAKE_Fortran_FLAGS \"${CMAKE_Fortran_FLAGS} ");
|
||||||
if(fflags)
|
if(fflags)
|
||||||
{
|
{
|
||||||
fprintf(fout, " %s ", fflags);
|
fprintf(fout, " %s ", fflags);
|
||||||
|
|
|
@ -560,7 +560,7 @@ int cmake::AddCMakePaths(const char *arg0)
|
||||||
if (getenv("CMAKE_ROOT"))
|
if (getenv("CMAKE_ROOT"))
|
||||||
{
|
{
|
||||||
cMakeRoot = getenv("CMAKE_ROOT");
|
cMakeRoot = getenv("CMAKE_ROOT");
|
||||||
modules = cMakeRoot + "/Modules/CMakeDefaultMakeRuleVariables.cmake";
|
modules = cMakeRoot + "/Modules/CMake.cmake";
|
||||||
}
|
}
|
||||||
if(!cmSystemTools::FileExists(modules.c_str()))
|
if(!cmSystemTools::FileExists(modules.c_str()))
|
||||||
{
|
{
|
||||||
|
@ -572,21 +572,21 @@ int cmake::AddCMakePaths(const char *arg0)
|
||||||
cMakeRoot = cMakeRoot.substr(0, slashPos);
|
cMakeRoot = cMakeRoot.substr(0, slashPos);
|
||||||
}
|
}
|
||||||
// is there no Modules direcory there?
|
// is there no Modules direcory there?
|
||||||
modules = cMakeRoot + "/Modules/CMakeDefaultMakeRuleVariables.cmake";
|
modules = cMakeRoot + "/Modules/CMake.cmake";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cmSystemTools::FileExists(modules.c_str()))
|
if (!cmSystemTools::FileExists(modules.c_str()))
|
||||||
{
|
{
|
||||||
// try exe/../share/cmake
|
// try exe/../share/cmake
|
||||||
cMakeRoot += CMAKE_DATA_DIR;
|
cMakeRoot += CMAKE_DATA_DIR;
|
||||||
modules = cMakeRoot + "/Modules/CMakeDefaultMakeRuleVariables.cmake";
|
modules = cMakeRoot + "/Modules/CMake.cmake";
|
||||||
}
|
}
|
||||||
#ifdef CMAKE_ROOT_DIR
|
#ifdef CMAKE_ROOT_DIR
|
||||||
if (!cmSystemTools::FileExists(modules.c_str()))
|
if (!cmSystemTools::FileExists(modules.c_str()))
|
||||||
{
|
{
|
||||||
// try compiled in root directory
|
// try compiled in root directory
|
||||||
cMakeRoot = CMAKE_ROOT_DIR;
|
cMakeRoot = CMAKE_ROOT_DIR;
|
||||||
modules = cMakeRoot + "/Modules/CMakeDefaultMakeRuleVariables.cmake";
|
modules = cMakeRoot + "/Modules/CMake.cmake";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifdef CMAKE_PREFIX
|
#ifdef CMAKE_PREFIX
|
||||||
|
@ -594,7 +594,7 @@ int cmake::AddCMakePaths(const char *arg0)
|
||||||
{
|
{
|
||||||
// try compiled in install prefix
|
// try compiled in install prefix
|
||||||
cMakeRoot = CMAKE_PREFIX CMAKE_DATA_DIR;
|
cMakeRoot = CMAKE_PREFIX CMAKE_DATA_DIR;
|
||||||
modules = cMakeRoot + "/Modules/CMakeDefaultMakeRuleVariables.cmake";
|
modules = cMakeRoot + "/Modules/CMake.cmake";
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!cmSystemTools::FileExists(modules.c_str()))
|
if (!cmSystemTools::FileExists(modules.c_str()))
|
||||||
|
@ -602,14 +602,14 @@ int cmake::AddCMakePaths(const char *arg0)
|
||||||
// try
|
// try
|
||||||
cMakeRoot = cmSystemTools::GetProgramPath(cMakeSelf.c_str());
|
cMakeRoot = cmSystemTools::GetProgramPath(cMakeSelf.c_str());
|
||||||
cMakeRoot += CMAKE_DATA_DIR;
|
cMakeRoot += CMAKE_DATA_DIR;
|
||||||
modules = cMakeRoot + "/Modules/CMakeDefaultMakeRuleVariables.cmake";
|
modules = cMakeRoot + "/Modules/CMake.cmake";
|
||||||
}
|
}
|
||||||
if(!cmSystemTools::FileExists(modules.c_str()))
|
if(!cmSystemTools::FileExists(modules.c_str()))
|
||||||
{
|
{
|
||||||
// next try exe
|
// next try exe
|
||||||
cMakeRoot = cmSystemTools::GetProgramPath(cMakeSelf.c_str());
|
cMakeRoot = cmSystemTools::GetProgramPath(cMakeSelf.c_str());
|
||||||
// is there no Modules direcory there?
|
// is there no Modules direcory there?
|
||||||
modules = cMakeRoot + "/Modules/CMakeDefaultMakeRuleVariables.cmake";
|
modules = cMakeRoot + "/Modules/CMake.cmake";
|
||||||
}
|
}
|
||||||
if (!cmSystemTools::FileExists(modules.c_str()))
|
if (!cmSystemTools::FileExists(modules.c_str()))
|
||||||
{
|
{
|
||||||
|
|
|
@ -118,9 +118,9 @@ int main()
|
||||||
cmLibHandle handle = cmDynamicLoader::OpenLibrary(lib.c_str());
|
cmLibHandle handle = cmDynamicLoader::OpenLibrary(lib.c_str());
|
||||||
if(!handle)
|
if(!handle)
|
||||||
{
|
{
|
||||||
std::string err = "Can not open CMakeTestModule:";
|
std::string err = "Can not open CMakeTestModule:\n";
|
||||||
err += lib;
|
err += lib;
|
||||||
cmFailed(lib.c_str());
|
cmFailed(err.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -118,9 +118,9 @@ int main()
|
||||||
cmLibHandle handle = cmDynamicLoader::OpenLibrary(lib.c_str());
|
cmLibHandle handle = cmDynamicLoader::OpenLibrary(lib.c_str());
|
||||||
if(!handle)
|
if(!handle)
|
||||||
{
|
{
|
||||||
std::string err = "Can not open CMakeTestModule:";
|
std::string err = "Can not open CMakeTestModule:\n";
|
||||||
err += lib;
|
err += lib;
|
||||||
cmFailed(lib.c_str());
|
cmFailed(err.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -118,9 +118,9 @@ int main()
|
||||||
cmLibHandle handle = cmDynamicLoader::OpenLibrary(lib.c_str());
|
cmLibHandle handle = cmDynamicLoader::OpenLibrary(lib.c_str());
|
||||||
if(!handle)
|
if(!handle)
|
||||||
{
|
{
|
||||||
std::string err = "Can not open CMakeTestModule:";
|
std::string err = "Can not open CMakeTestModule:\n";
|
||||||
err += lib;
|
err += lib;
|
||||||
cmFailed(lib.c_str());
|
cmFailed(err.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
PROJECT(testf FORTRAN)
|
PROJECT(testf Fortran)
|
||||||
ADD_EXECUTABLE(testf hello.f)
|
ADD_EXECUTABLE(testf hello.f)
|
||||||
|
|
Loading…
Reference in New Issue