summaryrefslogtreecommitdiff
path: root/Modules/CMakeSystemSpecificInformation.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-11-11 12:31:46 -0500
committerBill Hoffman <bill.hoffman@kitware.com>2002-11-11 12:31:46 -0500
commitd1051bb575b2f1e568ac9fe4599a0bf0eea66392 (patch)
tree5c16ebb0dc8c21698c38333eca4f5058492953c0 /Modules/CMakeSystemSpecificInformation.cmake
parent5b9a880bfbf215159d6960f82f0e78c419c95f8e (diff)
downloadcmake-d1051bb575b2f1e568ac9fe4599a0bf0eea66392.tar.gz
clean up flags with _init flags
Diffstat (limited to 'Modules/CMakeSystemSpecificInformation.cmake')
-rw-r--r--Modules/CMakeSystemSpecificInformation.cmake41
1 files changed, 34 insertions, 7 deletions
diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake
index c641f19707..0002aea264 100644
--- a/Modules/CMakeSystemSpecificInformation.cmake
+++ b/Modules/CMakeSystemSpecificInformation.cmake
@@ -85,6 +85,9 @@ IF(NOT CMAKE_MODULE_EXISTS)
ENDIF(NOT CMAKE_MODULE_EXISTS)
+# Create a set of shared library variable specific to C++
+# For 90% of the systems, these are the same flags as the C versions
+# so if these are not set just copy the flags from the c version
IF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
SET(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS})
ENDIF(NOT CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS)
@@ -105,6 +108,26 @@ 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)
# include default rules that work for most unix like systems and compilers
# this file will not set anything if it is already set
@@ -121,18 +144,21 @@ SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will
SET (CMAKE_BUILD_TYPE "" CACHE STRING
"Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
-# Add these settings to the cache.
-SET (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}" CACHE STRING
+# 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_INIT}" CACHE STRING
"Flags used by the compiler during all build types.")
-SET (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
+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}" CACHE STRING
+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}" CACHE STRING
+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}" CACHE STRING
+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 "${CMAKE_C_FLAGS}" CACHE STRING
+SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_INIT}" CACHE STRING
"Flags for C compiler.")
MARK_AS_ADVANCED(
@@ -144,3 +170,4 @@ CMAKE_CXX_FLAGS_MINSIZEREL
CMAKE_CXX_FLAGS_DEBUG
CMAKE_C_FLAGS
)
+SET(CMAKE_SYSTEM_SPECIFIC_INFORMATION_LOADED 1)