summaryrefslogtreecommitdiffstats
path: root/Modules/Platform
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2006-10-13 14:52:34 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2006-10-13 14:52:34 (GMT)
commit72b38e3aa7ba5fa4a70144e05de36bc99fda173a (patch)
tree744005aab47678a2a742267a01799a8f53dd0cf7 /Modules/Platform
parent8883613cc022d0ae2c96d84adf79dd82b74df658 (diff)
downloadCMake-72b38e3aa7ba5fa4a70144e05de36bc99fda173a.zip
CMake-72b38e3aa7ba5fa4a70144e05de36bc99fda173a.tar.gz
CMake-72b38e3aa7ba5fa4a70144e05de36bc99fda173a.tar.bz2
ENH: merge changes from the main tree to the 2.4 branch
Diffstat (limited to 'Modules/Platform')
-rw-r--r--Modules/Platform/AIX.cmake24
-rw-r--r--Modules/Platform/CYGWIN.cmake13
-rw-r--r--Modules/Platform/Darwin.cmake13
-rw-r--r--Modules/Platform/FreeBSD.cmake10
-rw-r--r--Modules/Platform/HP-UX.cmake33
-rw-r--r--Modules/Platform/IRIX.cmake16
-rw-r--r--Modules/Platform/IRIX64.cmake16
-rw-r--r--Modules/Platform/Linux.cmake11
-rw-r--r--Modules/Platform/QNX.cmake13
-rw-r--r--Modules/Platform/SunOS.cmake37
-rw-r--r--Modules/Platform/UnixPaths.cmake38
-rw-r--r--Modules/Platform/Windows-cl.cmake31
-rw-r--r--Modules/Platform/Windows-gcc.cmake11
-rw-r--r--Modules/Platform/gcc.cmake6
14 files changed, 260 insertions, 12 deletions
diff --git a/Modules/Platform/AIX.cmake b/Modules/Platform/AIX.cmake
index be02529..b83a9b6 100644
--- a/Modules/Platform/AIX.cmake
+++ b/Modules/Platform/AIX.cmake
@@ -31,3 +31,27 @@ ELSE(CMAKE_COMPILER_IS_GNUCC)
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-O -DNDEBUG")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-g")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
+
+IF(NOT CMAKE_COMPILER_IS_GNUCC)
+ SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <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> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
+
+
+# since .a can be a static or shared library on AIX, we can not do this.
+# at some point if we wanted it, we would have to figure out if a .a is
+# static or shared, then we could add this back:
+
+# Initialize C 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 shared
+# versions of the libraries.
+#FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
+# SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-bstatic")
+# SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-bdynamic")
+#ENDFOREACH(type)
diff --git a/Modules/Platform/CYGWIN.cmake b/Modules/Platform/CYGWIN.cmake
index c7ccd98..fe34bfc 100644
--- a/Modules/Platform/CYGWIN.cmake
+++ b/Modules/Platform/CYGWIN.cmake
@@ -27,4 +27,17 @@ SET(CMAKE_C_CREATE_SHARED_LIBRARY
"<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> <OBJECTS> <LINK_LIBRARIES>")
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
"<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> <OBJECTS> <LINK_LIBRARIES>")
+
+# Shared libraries on cygwin can be named with their version number.
+SET(CMAKE_SHARED_LIBRARY_NAME_WITH_VERSION 1)
+
+# Initialize C 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 shared
+# versions of the libraries.
+FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
+ SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+ SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+ENDFOREACH(type)
+
INCLUDE(Platform/UnixPaths)
diff --git a/Modules/Platform/Darwin.cmake b/Modules/Platform/Darwin.cmake
index 884690a..e26c6f2 100644
--- a/Modules/Platform/Darwin.cmake
+++ b/Modules/Platform/Darwin.cmake
@@ -45,8 +45,15 @@ IF(NOT XCODE)
# soname computation.
SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-install_name")
SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-install_name")
+ SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-install_name")
ENDIF(NOT XCODE)
+# Xcode does not support -isystem yet.
+IF(XCODE)
+ SET(CMAKE_INCLUDE_SYSTEM_FLAG_C)
+ SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+ENDIF(XCODE)
+
SET(CMAKE_MacOSX_Content_COMPILE_OBJECT "\"${CMAKE_COMMAND}\" -E copy_if_different <SOURCE> <OBJECT>")
SET(CMAKE_C_CREATE_SHARED_LIBRARY_FORBIDDEN_FLAGS -w)
@@ -55,6 +62,8 @@ SET(CMAKE_C_CREATE_SHARED_LIBRARY
"<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> -install_name <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
"<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> -install_name <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
+SET(CMAKE_Fortran_CREATE_SHARED_LIBRARY
+ "<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> -install_name <TARGET_INSTALLNAME_DIR><TARGET_SONAME> <OBJECTS> <LINK_LIBRARIES>")
SET(CMAKE_CXX_CREATE_SHARED_MODULE
"<CMAKE_CXX_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_CXX_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
@@ -62,6 +71,10 @@ SET(CMAKE_CXX_CREATE_SHARED_MODULE
SET(CMAKE_C_CREATE_SHARED_MODULE
"<CMAKE_C_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_C_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+SET(CMAKE_Fortran_CREATE_SHARED_MODULE
+ "<CMAKE_Fortran_COMPILER> <LANGUAGE_COMPILE_FLAGS> <CMAKE_SHARED_MODULE_CREATE_Fortran_FLAGS> <LINK_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+
+
SET(CMAKE_PLATFORM_IMPLICIT_INCLUDE_DIRECTORIES /usr/local/include)
# default to searching for frameworks first
diff --git a/Modules/Platform/FreeBSD.cmake b/Modules/Platform/FreeBSD.cmake
index 7ce5345..3970acf 100644
--- a/Modules/Platform/FreeBSD.cmake
+++ b/Modules/Platform/FreeBSD.cmake
@@ -8,4 +8,14 @@ IF(EXISTS /usr/include/dlfcn.h)
SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,-soname,")
ENDIF(EXISTS /usr/include/dlfcn.h)
+
+# Initialize C 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 shared
+# versions of the libraries.
+FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
+ SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+ SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+ENDFOREACH(type)
+
INCLUDE(Platform/UnixPaths)
diff --git a/Modules/Platform/HP-UX.cmake b/Modules/Platform/HP-UX.cmake
index 8c149ed..f7fd3f0 100644
--- a/Modules/Platform/HP-UX.cmake
+++ b/Modules/Platform/HP-UX.cmake
@@ -71,3 +71,36 @@ ELSE(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
# set flags for gcc support
INCLUDE(Platform/UnixPaths)
+
+IF(NOT CMAKE_COMPILER_IS_GNUCC)
+ SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <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> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
+ "<CMAKE_CXX_COMPILER> <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
+# shared versions of the libraries. Note that C modules and shared
+# libs are built using ld directly so we leave off the "-Wl," portion.
+FOREACH(type SHARED_LIBRARY SHARED_MODULE)
+ SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-a archive")
+ SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-a default")
+ENDFOREACH(type)
+FOREACH(type EXE)
+ SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-a,archive")
+ SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-a,default")
+ENDFOREACH(type)
+FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
+ SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Wl,-a,archive")
+ SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Wl,-a,default")
+ENDFOREACH(type)
+
diff --git a/Modules/Platform/IRIX.cmake b/Modules/Platform/IRIX.cmake
index 776bb4a..5452280 100644
--- a/Modules/Platform/IRIX.cmake
+++ b/Modules/Platform/IRIX.cmake
@@ -15,3 +15,19 @@ IF(NOT CMAKE_COMPILER_IS_GNUCXX)
ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
# set flags for gcc support
INCLUDE(Platform/UnixPaths)
+
+IF(NOT CMAKE_COMPILER_IS_GNUCC)
+ SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE
+ "<CMAKE_C_COMPILER> <FLAGS> -S <SOURCE>"
+ "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
+ )
+ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
+
+IF(NOT CMAKE_COMPILER_IS_GNUCXX)
+ SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
+ "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE>"
+ "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
+ )
+ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
diff --git a/Modules/Platform/IRIX64.cmake b/Modules/Platform/IRIX64.cmake
index fbd35a6..1229947 100644
--- a/Modules/Platform/IRIX64.cmake
+++ b/Modules/Platform/IRIX64.cmake
@@ -44,3 +44,19 @@ IF(NOT CMAKE_COMPILER_IS_GNUCC)
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2")
ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
INCLUDE(Platform/UnixPaths)
+
+IF(NOT CMAKE_COMPILER_IS_GNUCC)
+ SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE
+ "<CMAKE_C_COMPILER> <FLAGS> -S <SOURCE>"
+ "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
+ )
+ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
+
+IF(NOT CMAKE_COMPILER_IS_GNUCXX)
+ SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
+ "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE>"
+ "mv `basename \"<SOURCE>\" | sed 's/\\.[^./]*$$//'`.s <ASSEMBLY_SOURCE>"
+ )
+ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
diff --git a/Modules/Platform/Linux.cmake b/Modules/Platform/Linux.cmake
index 6ae2ed5..498e491 100644
--- a/Modules/Platform/Linux.cmake
+++ b/Modules/Platform/Linux.cmake
@@ -7,4 +7,15 @@ SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,-soname,")
+SET(CMAKE_SHARED_LIBRARY_SONAME_Fortran_FLAG "-Wl,-soname,")
+
+# Initialize C 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 shared
+# versions of the libraries.
+FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
+ SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+ SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+ENDFOREACH(type)
+
INCLUDE(Platform/UnixPaths)
diff --git a/Modules/Platform/QNX.cmake b/Modules/Platform/QNX.cmake
index 740aff7..e85b571 100644
--- a/Modules/Platform/QNX.cmake
+++ b/Modules/Platform/QNX.cmake
@@ -1,6 +1,10 @@
# GCC is the default compiler on QNX 6.3.
INCLUDE(${CMAKE_ROOT}/Modules/Platform/gcc.cmake)
+# The QNX GCC does not seem to have -isystem so remove the flag.
+SET(CMAKE_INCLUDE_SYSTEM_FLAG_C)
+SET(CMAKE_INCLUDE_SYSTEM_FLAG_CXX)
+
SET(CMAKE_DL_LIBS "")
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
@@ -9,3 +13,12 @@ SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG "-Wl,-rpath,")
SET(CMAKE_SHARED_LIBRARY_RUNTIME_C_FLAG_SEP ":")
SET(CMAKE_SHARED_LIBRARY_SONAME_C_FLAG "-Wl,-soname,")
SET(CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG "-Wl,-soname,")
+
+# Initialize C 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 shared
+# versions of the libraries.
+FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
+ SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+ SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+ENDFOREACH(type)
diff --git a/Modules/Platform/SunOS.cmake b/Modules/Platform/SunOS.cmake
index 0d3f183..aa1e933 100644
--- a/Modules/Platform/SunOS.cmake
+++ b/Modules/Platform/SunOS.cmake
@@ -61,3 +61,40 @@ ELSE(CMAKE_COMPILER_IS_GNUCXX)
ENDIF(CMAKE_CXX_COMPILER)
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
INCLUDE(Platform/UnixPaths)
+
+IF(NOT CMAKE_COMPILER_IS_GNUCC)
+ SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <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> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+ENDIF(NOT CMAKE_COMPILER_IS_GNUCXX)
+
+# Initialize C 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 shared
+# versions of the libraries.
+IF(CMAKE_COMPILER_IS_GNUCC)
+ FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
+ SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+ SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+ ENDFOREACH(type)
+ELSE(CMAKE_COMPILER_IS_GNUCC)
+ FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
+ SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Bstatic")
+ SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Bdynamic")
+ ENDFOREACH(type)
+ENDIF(CMAKE_COMPILER_IS_GNUCC)
+IF(CMAKE_COMPILER_IS_GNUCXX)
+ FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
+ SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Wl,-Bstatic")
+ SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Wl,-Bdynamic")
+ ENDFOREACH(type)
+ELSE(CMAKE_COMPILER_IS_GNUCXX)
+ FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
+ SET(CMAKE_${type}_LINK_STATIC_CXX_FLAGS "-Bstatic")
+ SET(CMAKE_${type}_LINK_DYNAMIC_CXX_FLAGS "-Bdynamic")
+ ENDFOREACH(type)
+ENDIF(CMAKE_COMPILER_IS_GNUCXX)
diff --git a/Modules/Platform/UnixPaths.cmake b/Modules/Platform/UnixPaths.cmake
index 5515a30..b6232e9 100644
--- a/Modules/Platform/UnixPaths.cmake
+++ b/Modules/Platform/UnixPaths.cmake
@@ -1,6 +1,32 @@
-SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH} /usr/include
- /usr/local/include /usr/local /opt/local/include /usr/X11R6/include /usr/include/X11 /usr/pkg/include)
-SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH} /lib /usr/lib /usr/local/lib
- /usr/lib/w32api /usr/X11R6/lib /opt/local/lib /opt/csw/lib /opt/lib /usr/pkg/lib)
-SET(CMAKE_SYSTEM_PROGRAM_PATH ${CMAKE_SYSTEM_PROGRAM_PATH} /bin /usr/bin /usr/local/bin
- /usr/pkg/bin /sbin)
+SET(CMAKE_SYSTEM_INCLUDE_PATH ${CMAKE_SYSTEM_INCLUDE_PATH}
+ # Standard
+ /include /usr/include /usr/local/include
+
+ # Windows API on Cygwin
+ /usr/include/w32api
+
+ # X11
+ /usr/X11R6/include /usr/include/X11
+
+ # Other
+ /opt/local/include /usr/pkg/include
+ )
+
+SET(CMAKE_SYSTEM_LIBRARY_PATH ${CMAKE_SYSTEM_LIBRARY_PATH}
+ # Standard
+ /lib /usr/lib /usr/local/lib
+
+ # Windows API on Cygwin
+ /usr/lib/w32api
+
+ # X11
+ /usr/X11R6/lib /usr/lib/X11
+
+ # Other
+ /opt/local/lib /usr/pkg/lib
+ /opt/csw/lib /opt/lib
+ )
+
+SET(CMAKE_SYSTEM_PROGRAM_PATH ${CMAKE_SYSTEM_PROGRAM_PATH}
+ /bin /usr/bin /usr/local/bin /usr/pkg/bin /sbin
+ )
diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake
index ba306ad..0005aa4 100644
--- a/Modules/Platform/Windows-cl.cmake
+++ b/Modules/Platform/Windows-cl.cmake
@@ -24,7 +24,7 @@ SET(CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
SET(CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_C_CREATE_SHARED_LIBRARY}")
# create a C++ static library
-SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
+SET(CMAKE_CXX_CREATE_STATIC_LIBRARY "link /lib ${CMAKE_CL_NOLOGO} <LINK_FLAGS> /out:<TARGET> <OBJECTS> ")
# create a C static library
SET(CMAKE_C_CREATE_STATIC_LIBRARY "${CMAKE_CXX_CREATE_STATIC_LIBRARY}")
@@ -44,6 +44,18 @@ SET(CMAKE_C_LINK_EXECUTABLE
SET(CMAKE_CXX_LINK_EXECUTABLE
"<CMAKE_CXX_COMPILER> ${CMAKE_CL_NOLOGO} ${CMAKE_START_TEMP_FILE} <FLAGS> <OBJECTS> /Fe<TARGET> /Fd<TARGET_PDB> -link <CMAKE_CXX_LINK_FLAGS> <LINK_FLAGS> <LINK_LIBRARIES>${CMAKE_END_TEMP_FILE}")
+SET(CMAKE_C_CREATE_PREPROCESSED_SOURCE
+ "<CMAKE_C_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> -E <SOURCE>${CMAKE_END_TEMP_FILE}")
+
+SET(CMAKE_CXX_CREATE_PREPROCESSED_SOURCE
+ "<CMAKE_CXX_COMPILER> > <PREPROCESSED_SOURCE> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> /TP -E <SOURCE>${CMAKE_END_TEMP_FILE}")
+
+SET(CMAKE_C_CREATE_ASSEMBLY_SOURCE
+ "<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> /FAs /FoNUL /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
+
+SET(CMAKE_CXX_CREATE_ASSEMBLY_SOURCE
+ "<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE} ${CMAKE_CL_NOLOGO} <FLAGS> /TP /FAs /FoNUL /Fa<ASSEMBLY_SOURCE> /c <SOURCE>${CMAKE_END_TEMP_FILE}")
+
SET(CMAKE_CREATE_WIN32_EXE /subsystem:windows)
SET(CMAKE_CREATE_CONSOLE_EXE /subsystem:console)
@@ -198,16 +210,20 @@ ENDIF(CMAKE_FORCE_WIN64)
IF(MSVC80)
# for 2005 make sure the manifest is put in the dll with mt
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}"
- "mt ${CMAKE_CL_NOLOGO} /manifest <TARGET>.manifest /outputresource:<TARGET>\;#2")
+ "$(CMAKE_COMMAND) -DTARGET=<TARGET> -DCMAKE_CL_NOLOGO=${CMAKE_CL_NOLOGO} -P \"${CMAKE_ROOT}/Modules/CMakeVCManifest.cmake\""
+ )
SET(CMAKE_CXX_CREATE_SHARED_MODULE "${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
# create a C shared library
SET(CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_CXX_CREATE_SHARED_LIBRARY}")
# create a C shared module just copy the shared library rule
SET(CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_C_CREATE_SHARED_LIBRARY}")
SET(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE}"
- "mt ${CMAKE_CL_NOLOGO} /manifest <TARGET>.manifest /outputresource:<TARGET>\;#2")
+ "$(CMAKE_COMMAND) -DTARGET=<TARGET> -DCMAKE_CL_NOLOGO=${CMAKE_CL_NOLOGO} -P \"${CMAKE_ROOT}/Modules/CMakeVCManifest.cmake\""
+ )
SET(CMAKE_C_LINK_EXECUTABLE "${CMAKE_C_LINK_EXECUTABLE}"
- "mt ${CMAKE_CL_NOLOGO} /manifest <TARGET>.manifest /outputresource:<TARGET>\;#2")
+ "$(CMAKE_COMMAND) -DTARGET=<TARGET> -DCMAKE_CL_NOLOGO=${CMAKE_CL_NOLOGO} -P \"${CMAKE_ROOT}/Modules/CMakeVCManifest.cmake\""
+ )
+
SET(CMAKE_BUILD_TYPE_INIT Debug)
SET (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /EHsc /GR")
SET (CMAKE_CXX_FLAGS_DEBUG_INIT "/D_DEBUG /MDd /Zi /Ob0 /Od /RTC1")
@@ -220,6 +236,7 @@ IF(MSVC80)
SET (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2 /Ob2 /D NDEBUG")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2 /Ob1 /D NDEBUG")
SET (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib ")
+ SET (CMAKE_EXE_LINKER_FLAGS_INIT "${CMAKE_EXE_LINKER_FLAGS_INIT} /MANIFEST")
ELSE(MSVC80)
IF(CMAKE_USING_VC_FREE_TOOLS)
MESSAGE(STATUS "Using FREE VC TOOLS, NO DEBUG available")
@@ -257,9 +274,11 @@ SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}")
SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:")
# set the stack size and the machine type
IF(CMAKE_CL_64)
- SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /machine:x64")
+ SET (CMAKE_EXE_LINKER_FLAGS_INIT
+ "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:x64")
ELSE(CMAKE_CL_64)
- SET (CMAKE_EXE_LINKER_FLAGS_INIT "/STACK:10000000 /machine:I386")
+ SET (CMAKE_EXE_LINKER_FLAGS_INIT
+ "${CMAKE_EXE_LINKER_FLAGS_INIT} /STACK:10000000 /machine:I386")
ENDIF(CMAKE_CL_64)
# add /debug and /INCREMENTAL:YES to DEBUG and RELWITHDEBINFO also add pdbtyp
diff --git a/Modules/Platform/Windows-gcc.cmake b/Modules/Platform/Windows-gcc.cmake
index b3bf19f..a5152b3 100644
--- a/Modules/Platform/Windows-gcc.cmake
+++ b/Modules/Platform/Windows-gcc.cmake
@@ -34,3 +34,14 @@ SET(CMAKE_C_CREATE_SHARED_LIBRARY
"<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> <OBJECTS> <LINK_LIBRARIES>")
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
"<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> <OBJECTS> <LINK_LIBRARIES>")
+
+# Initialize C 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 shared
+# versions of the libraries.
+IF(MSYS OR MINGW)
+ FOREACH(type SHARED_LIBRARY SHARED_MODULE EXE)
+ SET(CMAKE_${type}_LINK_STATIC_C_FLAGS "-Wl,-Bstatic")
+ SET(CMAKE_${type}_LINK_DYNAMIC_C_FLAGS "-Wl,-Bdynamic")
+ ENDFOREACH(type)
+ENDIF(MSYS OR MINGW)
diff --git a/Modules/Platform/gcc.cmake b/Modules/Platform/gcc.cmake
index 6543f5c..7d3235b 100644
--- a/Modules/Platform/gcc.cmake
+++ b/Modules/Platform/gcc.cmake
@@ -4,6 +4,9 @@ IF(CMAKE_COMPILER_IS_GNUCC)
SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
SET (CMAKE_C_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+ SET (CMAKE_C_CREATE_PREPROCESSED_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ SET (CMAKE_C_CREATE_ASSEMBLY_SOURCE "<CMAKE_C_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+ SET (CMAKE_INCLUDE_SYSTEM_FLAG_C "-isystem ")
ENDIF(CMAKE_COMPILER_IS_GNUCC)
IF(CMAKE_COMPILER_IS_GNUCXX)
@@ -12,5 +15,8 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
SET (CMAKE_CXX_FLAGS_MINSIZEREL_INIT "-Os -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELEASE_INIT "-O3 -DNDEBUG")
SET (CMAKE_CXX_FLAGS_RELWITHDEBINFO_INIT "-O2 -g")
+ SET (CMAKE_CXX_CREATE_PREPROCESSED_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
+ SET (CMAKE_CXX_CREATE_ASSEMBLY_SOURCE "<CMAKE_CXX_COMPILER> <FLAGS> -S <SOURCE> -o <ASSEMBLY_SOURCE>")
+ SET (CMAKE_INCLUDE_SYSTEM_FLAG_CXX "-isystem ")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)