summaryrefslogtreecommitdiffstats
path: root/Modules/CMakeSystemSpecificInformation.cmake
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2002-10-22 19:04:52 (GMT)
committerBill Hoffman <bill.hoffman@kitware.com>2002-10-22 19:04:52 (GMT)
commit0692323fe0f0bbbb5ba325e21d0f155717436f84 (patch)
treed03a5a9aaa78883ea133af31974cc48eed996901 /Modules/CMakeSystemSpecificInformation.cmake
parent0e8052b101e363f23e825388a083ca18a1de3383 (diff)
downloadCMake-0692323fe0f0bbbb5ba325e21d0f155717436f84.zip
CMake-0692323fe0f0bbbb5ba325e21d0f155717436f84.tar.gz
CMake-0692323fe0f0bbbb5ba325e21d0f155717436f84.tar.bz2
*** empty log message ***
Diffstat (limited to 'Modules/CMakeSystemSpecificInformation.cmake')
-rw-r--r--Modules/CMakeSystemSpecificInformation.cmake45
1 files changed, 41 insertions, 4 deletions
diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake
index 1615d9f..3fcaf5e 100644
--- a/Modules/CMakeSystemSpecificInformation.cmake
+++ b/Modules/CMakeSystemSpecificInformation.cmake
@@ -8,11 +8,25 @@
# 1. set default values that will work for most system
-SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
- "${CMAKE_CXX_COMPILE} ${CMAKE_SHARED_LIBRARY_CREATE_FLAGS} ${CMAKE_CXX_LINK_SHARED_OUT_FLAG} <TARGET> <OBJECTS>")
+SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
+SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "") # -pic
+# for gnu compiler always
+
+SET(CMAKE_SHARED_LIBRARY_CREATE_FLAGS "") # -shared
+SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
+SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so
+SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "") # +s, or some flag that an exe needs to use a shared lib
+SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "") # -rpath
+SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP "") # : or empty
-SET(CMAKE_CXX_CREATE_AR_LIBRARY
- "${CMAKE_AR} ${CMAKE_AR_FLAGS} <TARGET> <OBJECTS>")
+IF(CMAKE_COMPILER_IS_GNUGXX)
+ SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic
+ SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fPIC") # -pic
+ENDIF(CMAKE_COMPILER_IS_GNUGXX)
+
+
+SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL
+ "If set, runtime paths are not added when using shared libraries.")
# 2. now include SystemName.cmake file to set the system specific information
SET(CMAKE_SYSTEM_INFO_FILE ${CMAKE_ROOT}/Modules/${CMAKE_SYSTEM_NAME}.cmake)
@@ -25,6 +39,29 @@ ELSE(EXISTS ${CMAKE_SYSTEM_INFO_FILE})
ENDIF(EXISTS ${CMAKE_SYSTEM_INFO_FILE})
+
+# Set up default values for things that have not been set either
+# in SYSTEM.cmake or SYSTEM-compiler.cmake
+
+IF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
+ SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
+ "${CMAKE_CXX_COMPILE} ${CMAKE_SHARED_LIBRARY_CREATE_FLAGS} "
+ "${CMAKE_CXX_LINK_SHARED_OUT_FLAG} <TARGET> <OBJECTS>")
+ENDIF(NOT CMAKE_CXX_CREATE_SHARED_LIBRARY)
+
+
+IF(NOT CMAKE_CXX_CREATE_STATIC_LIBRARY)
+ SET(CMAKE_CXX_CREATE_STATIC_LIBRARY
+ "${CMAKE_CXX_AR} ${CMAKE_AR_FLAGS} <TARGET> <OBJECTS>")
+ENDIF(NOT CMAKE_CXX_CREATE_STATIC_LIBRARY)
+
+
+IF(NOT CMAKE_CXX_COMPILE)
+ SET(CMAKE_CXX_COMPILE
+ "${CMAKE_CXX_COMPILER} -o <OBJECT> ${CMAKE_CXX_FLAGS} -c <SOURCE>")
+ENDIF(NOT CMAKE_CXX_COMPILE)
+
+
# 3. include optional systemname-compiler.cmake files
IF(CMAKE_C_COMPILER)
INCLUDE(${CMAKE_ROOT}/Modules/${CMAKE_SYSTEM_NAME}-${CMAKE_C_COMPILER}.cmake OPTIONAL)