diff options
Diffstat (limited to 'Modules/Platform')
-rw-r--r-- | Modules/Platform/AIX-GNU.cmake | 2 | ||||
-rw-r--r-- | Modules/Platform/AIX-XL-ASM.cmake | 2 | ||||
-rw-r--r-- | Modules/Platform/AIX-XL-C.cmake | 6 | ||||
-rw-r--r-- | Modules/Platform/AIX-XL-CXX.cmake | 6 | ||||
-rw-r--r-- | Modules/Platform/AIX-XL-Fortran.cmake | 6 | ||||
-rw-r--r-- | Modules/Platform/AIX-XL.cmake | 28 | ||||
-rw-r--r-- | Modules/Platform/AIX.cmake | 2 | ||||
-rw-r--r-- | Modules/Platform/Darwin.cmake | 3 | ||||
-rw-r--r-- | Modules/Platform/HP-UX-HP-ASM.cmake | 6 | ||||
-rw-r--r-- | Modules/Platform/HP-UX-HP-C.cmake | 11 | ||||
-rw-r--r-- | Modules/Platform/HP-UX-HP-CXX.cmake | 16 | ||||
-rw-r--r-- | Modules/Platform/HP-UX-HP-Fortran.cmake | 7 | ||||
-rw-r--r-- | Modules/Platform/HP-UX-HP.cmake | 34 | ||||
-rw-r--r-- | Modules/Platform/HP-UX.cmake | 65 | ||||
-rw-r--r-- | Modules/Platform/Windows-GNU.cmake | 1 | ||||
-rw-r--r-- | Modules/Platform/Windows-Intel-ASM.cmake | 2 |
16 files changed, 117 insertions, 80 deletions
diff --git a/Modules/Platform/AIX-GNU.cmake b/Modules/Platform/AIX-GNU.cmake index 79c06ba..543f3e8 100644 --- a/Modules/Platform/AIX-GNU.cmake +++ b/Modules/Platform/AIX-GNU.cmake @@ -19,5 +19,7 @@ endif() set(__AIX_COMPILER_GNU 1) macro(__aix_compiler_gnu lang) + set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:") + set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS} -Wl,-G") endmacro() diff --git a/Modules/Platform/AIX-XL-ASM.cmake b/Modules/Platform/AIX-XL-ASM.cmake new file mode 100644 index 0000000..ea0944b --- /dev/null +++ b/Modules/Platform/AIX-XL-ASM.cmake @@ -0,0 +1,2 @@ +include(Platform/AIX-XL) +__aix_compiler_xl(ASM) diff --git a/Modules/Platform/AIX-XL-C.cmake b/Modules/Platform/AIX-XL-C.cmake index 2de30d5..5e437fa 100644 --- a/Modules/Platform/AIX-XL-C.cmake +++ b/Modules/Platform/AIX-XL-C.cmake @@ -1,4 +1,2 @@ -SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared -SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib -SET(CMAKE_SHARED_LIBRARY_C_FLAGS " ") -SET(CMAKE_SHARED_MODULE_C_FLAGS " ") +include(Platform/AIX-XL) +__aix_compiler_xl(C) diff --git a/Modules/Platform/AIX-XL-CXX.cmake b/Modules/Platform/AIX-XL-CXX.cmake index 648cb31..ef38a5f 100644 --- a/Modules/Platform/AIX-XL-CXX.cmake +++ b/Modules/Platform/AIX-XL-CXX.cmake @@ -1,4 +1,2 @@ -SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared -SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib -SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS " ") -SET(CMAKE_SHARED_MODULE_CXX_FLAGS " ") +include(Platform/AIX-XL) +__aix_compiler_xl(CXX) diff --git a/Modules/Platform/AIX-XL-Fortran.cmake b/Modules/Platform/AIX-XL-Fortran.cmake index 8292e78..6d4f655 100644 --- a/Modules/Platform/AIX-XL-Fortran.cmake +++ b/Modules/Platform/AIX-XL-Fortran.cmake @@ -1,4 +1,2 @@ -SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared -SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib -SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS " ") -SET(CMAKE_SHARED_MODULE_Fortran_FLAGS " ") +include(Platform/AIX-XL) +__aix_compiler_xl(Fortran) diff --git a/Modules/Platform/AIX-XL.cmake b/Modules/Platform/AIX-XL.cmake new file mode 100644 index 0000000..1f94152 --- /dev/null +++ b/Modules/Platform/AIX-XL.cmake @@ -0,0 +1,28 @@ + +#============================================================================= +# Copyright 2002-2011 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# This module is shared by multiple languages; use include blocker. +if(__AIX_COMPILER_XL) + return() +endif() +set(__AIX_COMPILER_XL 1) + +macro(__aix_compiler_xl lang) + set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "-Wl,-blibpath:") + set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") + set(CMAKE_SHARED_LIBRARY_CREATE_${lang}_FLAGS "-G -Wl,-brtl,-bnoipath") # -shared + set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,-brtl,-bnoipath,-bexpall") # +s, flag for exe link to use shared lib + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS " ") + set(CMAKE_SHARED_MODULE_${lang}_FLAGS " ") +endmacro() diff --git a/Modules/Platform/AIX.cmake b/Modules/Platform/AIX.cmake index 0ab0cce..a9f773e 100644 --- a/Modules/Platform/AIX.cmake +++ b/Modules/Platform/AIX.cmake @@ -9,8 +9,6 @@ SET(CMAKE_DL_LIBS "-lld") # When our own RPATH is to be added it may be inserted before the # "always" paths. SET(CMAKE_PLATFORM_REQUIRED_RUNTIME_PATH /usr/lib /lib) -SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-blibpath:") -SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") # Files named "libfoo.a" may actually be shared libraries. SET_PROPERTY(GLOBAL PROPERTY TARGET_ARCHIVES_MAY_BE_SHARED_LIBS 1) diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake index a99ff4a..c11c8fb 100644 --- a/Modules/Platform/Darwin.cmake +++ b/Modules/Platform/Darwin.cmake @@ -68,7 +68,8 @@ IF(NOT _CMAKE_OSX_SDKS) FIND_PROGRAM(CMAKE_XCODE_SELECT xcode-select) IF(CMAKE_XCODE_SELECT) EXECUTE_PROCESS(COMMAND ${CMAKE_XCODE_SELECT} "-print-path" - OUTPUT_VARIABLE OSX_DEVELOPER_ROOT) + OUTPUT_VARIABLE OSX_DEVELOPER_ROOT + OUTPUT_STRIP_TRAILING_WHITESPACE) FILE(GLOB _CMAKE_OSX_SDKS "${OSX_DEVELOPER_ROOT}/SDKs/*") ENDIF(CMAKE_XCODE_SELECT) ENDIF(NOT _CMAKE_OSX_SDKS) diff --git a/Modules/Platform/HP-UX-HP-ASM.cmake b/Modules/Platform/HP-UX-HP-ASM.cmake new file mode 100644 index 0000000..0a85905 --- /dev/null +++ b/Modules/Platform/HP-UX-HP-ASM.cmake @@ -0,0 +1,6 @@ +include(Platform/HP-UX-HP) +__hpux_compiler_hp(ASM) + +set(CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS "-E -b +nodefaultrpath -L/usr/lib") + +set(CMAKE_ASM_CREATE_SHARED_LIBRARY "ld <CMAKE_SHARED_LIBRARY_CREATE_ASM_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_ASM_FLAG><TARGET_SONAME> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") diff --git a/Modules/Platform/HP-UX-HP-C.cmake b/Modules/Platform/HP-UX-HP-C.cmake new file mode 100644 index 0000000..d83e01b --- /dev/null +++ b/Modules/Platform/HP-UX-HP-C.cmake @@ -0,0 +1,11 @@ +include(Platform/HP-UX-HP) +__hpux_compiler_hp(C) + +set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-E -b +nodefaultrpath -L/usr/lib") + +set(CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") +set(CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") +set(CMAKE_C_COMPILE_OBJECT "<CMAKE_C_COMPILER> <DEFINES> -Aa -Ae <FLAGS> -o <OBJECT> -c <SOURCE>") + +# use ld directly to create shared libraries for hp cc +set(CMAKE_C_CREATE_SHARED_LIBRARY "ld <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") diff --git a/Modules/Platform/HP-UX-HP-CXX.cmake b/Modules/Platform/HP-UX-HP-CXX.cmake new file mode 100644 index 0000000..8f3c70c --- /dev/null +++ b/Modules/Platform/HP-UX-HP-CXX.cmake @@ -0,0 +1,16 @@ +include(Platform/HP-UX-HP) +__hpux_compiler_hp(CXX) + +set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "+Z -Wl,-E,+nodefaultrpath -b -L/usr/lib") + +set(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") +set(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE + "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE>" + "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>" + "rm -f `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.o" + ) + +set(CMAKE_CXX_FLAGS_DEBUG_INIT "-g") +set(CMAKE_CXX_FLAGS_MINSIZEREL_INIT "+O3 -DNDEBUG") +set(CMAKE_CXX_FLAGS_RELEASE_INIT "+O2 -DNDEBUG") +set(CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g") diff --git a/Modules/Platform/HP-UX-HP-Fortran.cmake b/Modules/Platform/HP-UX-HP-Fortran.cmake new file mode 100644 index 0000000..5a3ab19 --- /dev/null +++ b/Modules/Platform/HP-UX-HP-Fortran.cmake @@ -0,0 +1,7 @@ +include(Platform/HP-UX-HP) +__hpux_compiler_hp(Fortran) + +set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-E -b -L/usr/lib") + +set(CMAKE_Fortran_CREATE_SHARED_LIBRARY + "ld <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG><TARGET_SONAME> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") diff --git a/Modules/Platform/HP-UX-HP.cmake b/Modules/Platform/HP-UX-HP.cmake new file mode 100644 index 0000000..5e70d31 --- /dev/null +++ b/Modules/Platform/HP-UX-HP.cmake @@ -0,0 +1,34 @@ + +#============================================================================= +# Copyright 2002-2011 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# This module is shared by multiple languages; use include blocker. +if(__HPUX_COMPILER_HP) + return() +endif() +set(__HPUX_COMPILER_HP 1) +set(_Wl_C "") +set(_Wl_CXX "-Wl,") +set(_Wl_Fortran "") +set(_Wl_ASM "") + +macro(__hpux_compiler_hp lang) + set(CMAKE_SHARED_LIBRARY_${lang}_FLAGS "+Z") + set(CMAKE_SHARED_LIBRARY_LINK_${lang}_FLAGS "-Wl,+s,-E,+nodefaultrpath") + set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG "${_Wl_${lang}}+b") + set(CMAKE_SHARED_LIBRARY_RUNTIME_${lang}_FLAG_SEP ":") + set(CMAKE_SHARED_LIBRARY_SONAME_${lang}_FLAG "${_Wl_${lang}}+h") + set(CMAKE_EXECUTABLE_RUNTIME_${lang}_FLAG "-Wl,+b") + + set(CMAKE_${lang}_FLAGS_INIT "") +endmacro() diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake index 9d357c9..ab3dc22 100644 --- a/Modules/Platform/HP-UX.cmake +++ b/Modules/Platform/HP-UX.cmake @@ -15,57 +15,6 @@ SET(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1) # specifying the file path. SET(CMAKE_PLATFORM_USES_PATH_WHEN_NO_SONAME 1) -# fortran -IF(CMAKE_COMPILER_IS_GNUG77) -ELSE(CMAKE_COMPILER_IS_GNUG77) - # use ld directly to create shared libraries for hp cc - SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY - "ld <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG><TARGET_SONAME> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") - SET(CMAKE_SHARED_LIBRARY_Fortran_FLAGS "+Z") # -pic - SET(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "-E -b -L/usr/lib") # -shared - SET(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-Wl,+s,-E,+nodefaultrpath") # +s, flag for exe link to use shared lib - SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG "+b") # -rpath - SET(CMAKE_SHARED_LIBRARY_RUNTIME_Fortran_FLAG_SEP ":") # : or empty - SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "+h") - SET(CMAKE_EXECUTABLE_RUNTIME_Fortran_FLAG "-Wl,+b") # -rpath -ENDIF(CMAKE_COMPILER_IS_GNUG77) - -# C compiler -IF(CMAKE_COMPILER_IS_GNUCC) -ELSE(CMAKE_COMPILER_IS_GNUCC) - # hp cc - # use ld directly to create shared libraries for hp cc - SET(CMAKE_C_CREATE_SHARED_LIBRARY - "ld <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>") - SET(CMAKE_SHARED_LIBRARY_C_FLAGS "+Z") # -pic - SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-E -b +nodefaultrpath -L/usr/lib") # -shared - SET(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "-Wl,+s,-E,+nodefaultrpath") # +s, flag for exe link to use shared lib - SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "+b") # -rpath - SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":") # : or empty - SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "+h") - SET(CMAKE_EXECUTABLE_RUNTIME_C_FLAG "-Wl,+b") # -rpath - SET(CMAKE_C_FLAGS_INIT "") - SET(CMAKE_C_COMPILE_OBJECT - "<CMAKE_C_COMPILER> <DEFINES> -Aa -Ae <FLAGS> -o <OBJECT> -c <SOURCE>") -ENDIF(CMAKE_COMPILER_IS_GNUCC) - -# CXX compiler -IF(CMAKE_COMPILER_IS_GNUCXX) -ELSE(CMAKE_COMPILER_IS_GNUCXX) - # for hp aCC - SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "+Z") # -pic - SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "+Z -Wl,-E,+nodefaultrpath -b -L/usr/lib") # -shared - SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "-Wl,+s,-E,+nodefaultrpath") # +s, flag for exe link to use shared lib - SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG "-Wl,+b") # -rpath - SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG_SEP ":") # : or empty - SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,+h") - SET(CMAKE_EXECUTABLE_RUNTIME_CXX_FLAG "-Wl,+b") # -rpath - SET (CMAKE_CXX_FLAGS_INIT "") - SET (CMAKE_CXX_FLAGS_DEBUG_INIT "-g") - SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "+O3 -DNDEBUG") - SET (CMAKE_CXX_FLAGS_RELEASE_INIT "+O2 -DNDEBUG") - SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-g") -ENDIF(CMAKE_COMPILER_IS_GNUCXX) # set flags for gcc support INCLUDE(Platform/UnixPaths) @@ -81,20 +30,6 @@ LIST(APPEND CMAKE_SYSTEM_LIBRARY_PATH /usr/lib/hpux64) LIST(APPEND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES /usr/lib/hpux32 /usr/lib/hpux64) -IF(NOT CMAKE_COMPILER_IS_GNUCC) - SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") - SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <DEFINES> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>") -ENDIF(NOT CMAKE_COMPILER_IS_GNUCC) - -IF(NOT CMAKE_COMPILER_IS_GNUCXX) - SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>") - SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE - "<CMAKE_CXX_COMPILER> <DEFINES> <FLAGS> -S <SOURCE>" - "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>" - "rm -f `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.o" - ) -ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX) - # Initialize C and CXX link type selection flags. These flags are # used when building a shared library, shared module, or executable # that links to other libraries to select whether to use the static or diff --git a/Modules/Platform/Windows-GNU.cmake b/Modules/Platform/Windows-GNU.cmake index 271236c..1d3e4b5 100644 --- a/Modules/Platform/Windows-GNU.cmake +++ b/Modules/Platform/Windows-GNU.cmake @@ -43,6 +43,7 @@ endif() set(CMAKE_DL_LIBS "") set(CMAKE_LIBRARY_PATH_FLAG "-L") set(CMAKE_LINK_LIBRARY_FLAG "-l") +set(CMAKE_LINK_DEF_FILE_FLAG "") # Empty string: passing the file is enough set(CMAKE_LINK_LIBRARY_SUFFIX "") set(CMAKE_CREATE_WIN32_EXE "-mwindows") diff --git a/Modules/Platform/Windows-Intel-ASM.cmake b/Modules/Platform/Windows-Intel-ASM.cmake new file mode 100644 index 0000000..31d08c7 --- /dev/null +++ b/Modules/Platform/Windows-Intel-ASM.cmake @@ -0,0 +1,2 @@ +include(Platform/Windows-Intel) +__windows_compiler_intel(ASM) |