From c89ebb4240a711fb269f006b5005d530e920b95a Mon Sep 17 00:00:00 2001 From: Bill Hoffman Date: Thu, 1 May 2008 12:35:40 -0400 Subject: ENH: merge from cvs create yikes RC 10! (I hope this is the last RC...) --- Modules/CheckTypeSize.cmake | 22 ++++++++++++++++++++-- Modules/FindBoost.cmake | 6 +++++- Modules/FindCurses.cmake | 6 +++++- Modules/FindKDE.cmake | 9 --------- Modules/FindSDL.cmake | 2 +- Modules/FindSDL_sound.cmake | 1 - Modules/FindVTK.cmake | 12 ++++++------ Modules/Platform/Darwin.cmake | 1 + Modules/Platform/Linux-Intel-C.cmake | 13 +++++++++++++ Modules/Platform/Linux-Intel-CXX.cmake | 13 +++++++++++++ Modules/Platform/Linux-Intel-Fortran.cmake | 14 ++++++++++++++ Modules/Platform/SunOS.cmake | 6 ++++++ Modules/Platform/Windows-ifort.cmake | 2 +- 13 files changed, 85 insertions(+), 22 deletions(-) delete mode 100644 Modules/FindKDE.cmake create mode 100644 Modules/Platform/Linux-Intel-C.cmake create mode 100644 Modules/Platform/Linux-Intel-CXX.cmake create mode 100644 Modules/Platform/Linux-Intel-Fortran.cmake (limited to 'Modules') diff --git a/Modules/CheckTypeSize.cmake b/Modules/CheckTypeSize.cmake index 0e7e364a8d..cc5dcebce8 100644 --- a/Modules/CheckTypeSize.cmake +++ b/Modules/CheckTypeSize.cmake @@ -1,9 +1,16 @@ # - Check sizeof a type -# CHECK_TYPE_SIZE(TYPE VARIABLE) +# CHECK_TYPE_SIZE(TYPE VARIABLE [BUILTIN_TYPES_ONLY]) # Check if the type exists and determine size of type. if the type -# exists, the size will be stored to the variable. +# exists, the size will be stored to the variable. This also +# calls check_include_file for sys/types.h stdint.h +# and stddef.h, setting HAVE_SYS_TYPES_H, HAVE_STDINT_H, +# and HAVE_STDDEF_H. This is because many types are stored +# in these include files. # VARIABLE - variable to store size if the type exists. # HAVE_${VARIABLE} - does the variable exists or not +# BUILTIN_TYPES_ONLY - The third argument is optional and if +# it is set to the string BUILTIN_TYPES_ONLY +# this macro will not check for any header files. # The following variables may be set before calling this macro to # modify the way the check is run: # @@ -12,7 +19,18 @@ # CMAKE_REQUIRED_INCLUDES = list of include directories # CMAKE_REQUIRED_LIBRARIES = list of libraries to link +# These variables are referenced in CheckTypeSizeC.c so we have +# to check for them. + +include(CheckIncludeFile) + MACRO(CHECK_TYPE_SIZE TYPE VARIABLE) + IF(NOT "${ARGV2}" STREQUAL "BUILTIN_TYPES_ONLY") + check_include_file(sys/types.h HAVE_SYS_TYPES_H) + check_include_file(stdint.h HAVE_STDINT_H) + check_include_file(stddef.h HAVE_STDDEF_H) + ENDIF(NOT "${ARGV2}" STREQUAL "BUILTIN_TYPES_ONLY") + IF("HAVE_${VARIABLE}" MATCHES "^HAVE_${VARIABLE}$") MESSAGE(STATUS "Check size of ${TYPE}") SET(CHECK_TYPE_SIZE_TYPE "${TYPE}") diff --git a/Modules/FindBoost.cmake b/Modules/FindBoost.cmake index fe9025ad4a..ab00fcc723 100644 --- a/Modules/FindBoost.cmake +++ b/Modules/FindBoost.cmake @@ -93,7 +93,11 @@ # # this module required CMake 2.5 for the Boost_FIND_VERSION stuff -CMAKE_MINIMUM_REQUIRED(VERSION "2.6" FATAL_ERROR) + +# this must not be done in find modules, it changes the policy settings, which may have been +# set in the projects cmake files. +# beside that this module comes with cmake, so the cmake version is always correct, Alex +# CMAKE_MINIMUM_REQUIRED(VERSION "2.6" FATAL_ERROR) # MESSAGE(STATUS "Finding Boost libraries.... ") diff --git a/Modules/FindCurses.cmake b/Modules/FindCurses.cmake index cd170c1268..3eb54e5f5c 100644 --- a/Modules/FindCurses.cmake +++ b/Modules/FindCurses.cmake @@ -70,7 +70,11 @@ ELSE(NOT CURSES_USE_NCURSES) FIND_PATH(CURSES_NCURSES_INCLUDE_PATH curses.h) SET(CURSES_INCLUDE_PATH "${CURSES_NCURSES_INCLUDE_PATH}") - SET(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}" CACHE FILEPATH "path to curses") + SET(FORCE_ARG "") + IF("${CURSES_LIBRARY}" STREQUAL "CURSES_LIBRARY-NOTFOUND") + SET(FORCE_ARG "FORCE") + ENDIF("${CURSES_LIBRARY}" STREQUAL "CURSES_LIBRARY-NOTFOUND") + SET(CURSES_LIBRARY "${CURSES_NCURSES_LIBRARY}" CACHE FILEPATH "path to curses" ${FORCE_ARG}) ENDIF(NOT CURSES_USE_NCURSES) diff --git a/Modules/FindKDE.cmake b/Modules/FindKDE.cmake deleted file mode 100644 index 58f32064e9..0000000000 --- a/Modules/FindKDE.cmake +++ /dev/null @@ -1,9 +0,0 @@ - -# I don't think anybody actually used this file -# at least not in any large scale -# so it should be safe to obsolete it now -# -# Alex - -MESSAGE(FATAL_ERROR "FindKDE.cmake is obsolete, please use FindKDE3.cmake or FindKDE4.cmake instead.") - diff --git a/Modules/FindSDL.cmake b/Modules/FindSDL.cmake index 64d4262255..75b42cca0a 100644 --- a/Modules/FindSDL.cmake +++ b/Modules/FindSDL.cmake @@ -183,7 +183,7 @@ IF(SDL_LIBRARY_TEMP) # Set the final string here so the GUI reflects the final state. SET(SDL_LIBRARY ${SDL_LIBRARY_TEMP} CACHE STRING "Where the SDL Library can be found") # Set the temp variable to INTERNAL so it is not seen in the CMake GUI - SET(SDL_LIBRARY_TEMP "" CACHE INTERNAL "") + SET(SDL_LIBRARY_TEMP "${SDL_LIBRARY_TEMP}" CACHE INTERNAL "") SET(SDL_FOUND "YES") ENDIF(SDL_LIBRARY_TEMP) diff --git a/Modules/FindSDL_sound.cmake b/Modules/FindSDL_sound.cmake index 64a0d5faf2..71d7334cee 100644 --- a/Modules/FindSDL_sound.cmake +++ b/Modules/FindSDL_sound.cmake @@ -270,7 +270,6 @@ IF(SDL_FOUND AND SDL_SOUND_INCLUDE_DIR AND SDL_SOUND_LIBRARY) /opt/csw/lib /opt/lib ) - SET(TEMP_SDLSOUND_FIND_VORBIS_FRAMEWORK "" CACHE INTERNAL "") IF(VORBIS_LIBRARY) SET(SDL_SOUND_LIBRARIES_TMP ${SDL_SOUND_LIBRARIES_TMP} ${VORBIS_LIBRARY}) ENDIF(VORBIS_LIBRARY) diff --git a/Modules/FindVTK.cmake b/Modules/FindVTK.cmake index f79a7026a6..6e42ba3fd5 100644 --- a/Modules/FindVTK.cmake +++ b/Modules/FindVTK.cmake @@ -130,11 +130,11 @@ IF(VTK_FOUND) SET(USE_VTK_FILE ${VTK_USE_FILE}) ELSE(VTK_FOUND) # VTK not found, explain to the user how to specify its location. - IF(NOT VTK_FIND_QUIETLY) + IF(VTK_FIND_REQUIRED) MESSAGE(FATAL_ERROR ${VTK_DIR_MESSAGE}) - ELSE(NOT VTK_FIND_QUIETLY) - IF(VTK_FIND_REQUIRED) - MESSAGE(FATAL_ERROR ${VTK_DIR_MESSAGE}) - ENDIF(VTK_FIND_REQUIRED) - ENDIF(NOT VTK_FIND_QUIETLY) + ELSE(VTK_FIND_REQUIRED) + IF(NOT VTK_FIND_QUIETLY) + MESSAGE(STATUS ${VTK_DIR_MESSAGE}) + ENDIF(NOT VTK_FIND_QUIETLY) + ENDIF(VTK_FIND_REQUIRED) ENDIF(VTK_FOUND) diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index dfdc8eb7f8..ecc465ca13 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -57,6 +57,7 @@ IF(_CMAKE_OSX_SDKS) LIST(SORT _CMAKE_OSX_SDKS) LIST(REVERSE _CMAKE_OSX_SDKS) LIST(GET _CMAKE_OSX_SDKS 0 _CMAKE_OSX_SDKS) + SET(CMAKE_OSX_SYSROOT_DEFAULT "${_CMAKE_OSX_SDKS}") # use the environment variable CMAKE_OSX_SYSROOT if it is set IF(NOT "$ENV{CMAKE_OSX_SYSROOT}" STREQUAL "") SET(_CMAKE_OSX_SDKS "$ENV{CMAKE_OSX_SYSROOT}") diff --git a/Modules/Platform/Linux-Intel-C.cmake b/Modules/Platform/Linux-Intel-C.cmake new file mode 100644 index 0000000000..bde187e159 --- /dev/null +++ b/Modules/Platform/Linux-Intel-C.cmake @@ -0,0 +1,13 @@ +SET (CMAKE_C_FLAGS_INIT "") +SET (CMAKE_C_FLAGS_DEBUG_INIT "-g") +SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG") +SET (CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG") +SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g") + +FIND_PROGRAM(XIAR xiar) +IF(XIAR) + SET(CMAKE_C_CREATE_STATIC_LIBRARY + "${XIAR} cr " + "${XIAR} -s ") +ENDIF(XIAR) +MARK_AS_ADVANCED(XIAR) diff --git a/Modules/Platform/Linux-Intel-CXX.cmake b/Modules/Platform/Linux-Intel-CXX.cmake new file mode 100644 index 0000000000..bcc3d78774 --- /dev/null +++ b/Modules/Platform/Linux-Intel-CXX.cmake @@ -0,0 +1,13 @@ +SET (CMAKE_CXX_FLAGS_INIT "") +SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g") +SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG") +SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG") +SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g") + +FIND_PROGRAM(XIAR xiar) +IF(XIAR) + SET(CMAKE_CXX_CREATE_STATIC_LIBRARY + "${XIAR} cr " + "${XIAR} -s ") +ENDIF(XIAR) +MARK_AS_ADVANCED(XIAR) diff --git a/Modules/Platform/Linux-Intel-Fortran.cmake b/Modules/Platform/Linux-Intel-Fortran.cmake new file mode 100644 index 0000000000..06de82b243 --- /dev/null +++ b/Modules/Platform/Linux-Intel-Fortran.cmake @@ -0,0 +1,14 @@ +SET(CMAKE_DL_LIBS "dl") +SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "-fPIC") +SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-shared") +SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-i_dynamic") +SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "-Wl,-rpath,") +SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ":") +SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-Wl,-soname,") +SET(CMAKE_Fortran_MODDIR_FLAG "-module ") + +SET (CMAKE_Fortran_FLAGS_INIT "") +SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "-g") +SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "-Os") +SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "-O3") +SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "-O2 -g") diff --git a/Modules/Platform/SunOS.cmake b/Modules/Platform/SunOS.cmake index f6fdf77d43..cccd0d4ba0 100644 --- a/Modules/Platform/SunOS.cmake +++ b/Modules/Platform/SunOS.cmake @@ -62,6 +62,12 @@ ELSE(CMAKE_COMPILER_IS_GNUCXX) ENDIF(CMAKE_COMPILER_IS_GNUCXX) INCLUDE(Platform/UnixPaths) +# Add the compiler's implicit link directories. +IF("${CMAKE_C_COMPILER_ID} ${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro) + LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES + /opt/SUNWspro/lib /opt/SUNWspro/prod/lib /usr/ccs/lib) +ENDIF("${CMAKE_C_COMPILER_ID} ${CMAKE_CXX_COMPILER_ID}" MATCHES SunPro) + IF(NOT CMAKE_COMPILER_IS_GNUCC) SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE " -E > ") SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE " -S -o ") diff --git a/Modules/Platform/Windows-ifort.cmake b/Modules/Platform/Windows-ifort.cmake index 295fa3e911..2bf4753cf5 100644 --- a/Modules/Platform/Windows-ifort.cmake +++ b/Modules/Platform/Windows-ifort.cmake @@ -42,7 +42,7 @@ ENDIF(CMAKE_GENERATOR MATCHES "Visual Studio 7" OR CMAKE_GENERATOR MATCHES "Visu # 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_INIT "/W1 /nologo /fpp") 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") -- cgit v1.2.1