diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2002-11-08 20:46:08 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2002-11-08 20:46:08 (GMT) |
commit | f5d95fb078ec48755762931fe2882ed1cbe1171e (patch) | |
tree | 945dca55d34b543db452c586aba0de863cf25cec /Modules/CMakeSystemSpecificInformation.cmake | |
parent | c72462ffb1c75573e0d67a7101438a62bfc2fda1 (diff) | |
download | CMake-f5d95fb078ec48755762931fe2882ed1cbe1171e.zip CMake-f5d95fb078ec48755762931fe2882ed1cbe1171e.tar.gz CMake-f5d95fb078ec48755762931fe2882ed1cbe1171e.tar.bz2 |
Complete rework of makefile generators expect trouble
Diffstat (limited to 'Modules/CMakeSystemSpecificInformation.cmake')
-rw-r--r-- | Modules/CMakeSystemSpecificInformation.cmake | 67 |
1 files changed, 55 insertions, 12 deletions
diff --git a/Modules/CMakeSystemSpecificInformation.cmake b/Modules/CMakeSystemSpecificInformation.cmake index 101af54..4d76f89 100644 --- a/Modules/CMakeSystemSpecificInformation.cmake +++ b/Modules/CMakeSystemSpecificInformation.cmake @@ -11,29 +11,34 @@ # 1. set default values that will work for most system + +# suffix that needs to be added onto a library to link it .lib on windows +# not used on most unix systems +SET(CMAKE_LINK_LIBRARY_SUFFIX "") + SET(CMAKE_STATIC_LIBRARY_PREFIX "lib") SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a") -SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic -SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "") # -pic -SET(CMAKE_SHARED_LIBRARY_CREATE_FLAGS "") # -shared SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") # .so +SET(CMAKE_DL_LIBS "-ldl") +SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic +SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared") # -shared SET(CMAKE_SHARED_LIBRARY_LINK_FLAGS "") # +s, flag for exe link to use shared lib SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG "") # -rpath SET(CMAKE_SHARED_LIBRARY_RUNTIME_FLAG_SEP "") # : or empty SET(CMAKE_LIBRARY_PATH_FLAG "-L") SET(CMAKE_LINK_LIBRARY_FLAG "-l") -IF(CMAKE_COMPILER_IS_GNUGXX) +IF(CMAKE_COMPILER_IS_GNUCXX) SET(CMAKE_SHARED_LIBRARY_C_FLAGS "-fPIC") # -pic SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "-fPIC") # -pic -ENDIF(CMAKE_COMPILER_IS_GNUGXX) +ENDIF(CMAKE_COMPILER_IS_GNUCXX) SET (CMAKE_SKIP_RPATH "NO" CACHE BOOL "If set, runtime paths are not added when using shared libraries.") - +MARK_AS_ADVANCED(CMAKE_SKIP_RPATH) # 2. now include SystemName.cmake file to set the system specific information -SET(CMAKE_SYSTEM_INFO_FILE ${CMAKE_ROOT}/Modules/${CMAKE_SYSTEM_NAME}.cmake) +SET(CMAKE_SYSTEM_INFO_FILE ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}.cmake) IF(EXISTS ${CMAKE_SYSTEM_INFO_FILE}) INCLUDE(${CMAKE_SYSTEM_INFO_FILE}) ELSE(EXISTS ${CMAKE_SYSTEM_INFO_FILE}) @@ -50,17 +55,17 @@ IF(CMAKE_C_COMPILER) SET(CMAKE_BASE_NAME gcc) ENDIF(CMAKE_COMPILER_IS_GNUGCC) SET(CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE - ${CMAKE_ROOT}/Modules/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) + ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) INCLUDE(${CMAKE_SYSTEM_AND_C_COMPILER_INFO_FILE} OPTIONAL) ENDIF(CMAKE_C_COMPILER) IF(CMAKE_CXX_COMPILER) GET_FILENAME_COMPONENT(CMAKE_BASE_NAME ${CMAKE_CXX_COMPILER} NAME_WE) # since the gnu compiler has several names force gcc - IF(CMAKE_COMPILER_IS_GNUGXX) + IF(CMAKE_COMPILER_IS_GNUCXX) SET(CMAKE_BASE_NAME g++) - ENDIF(CMAKE_COMPILER_IS_GNUGXX) + ENDIF(CMAKE_COMPILER_IS_GNUCXX) SET(CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE - ${CMAKE_ROOT}/Modules/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) + ${CMAKE_ROOT}/Modules/Platform/${CMAKE_SYSTEM_NAME}-${CMAKE_BASE_NAME}.cmake) INCLUDE(${CMAKE_SYSTEM_AND_CXX_COMPILER_INFO_FILE} OPTIONAL) ENDIF(CMAKE_CXX_COMPILER) @@ -71,7 +76,7 @@ ENDIF(CMAKE_CXX_COMPILER) IF(NOT CMAKE_MODULE_EXISTS) SET(CMAKE_SHARED_MODULE_C_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS) SET(CMAKE_SHARED_MODULE_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_CXX_FLAGS}) - SET(CMAKE_SHARED_MODULE_CREATE_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_FLAGS}) + SET(CMAKE_SHARED_MODULE_CREATE_C_FLAGS ${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS}) SET(CMAKE_SHARED_MODULE_PREFIX ${CMAKE_SHARED_LIBRARY_PREFIX}) SET(CMAKE_SHARED_MODULE_SUFFIX ${CMAKE_SHARED_LIBRARY_SUFFIX}) SET(CMAKE_SHARED_MODULE_LINK_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_FLAGS}) @@ -79,6 +84,28 @@ IF(NOT CMAKE_MODULE_EXISTS) SET(CMAKE_SHARED_MODULE_RUNTIME_FLAG_SEP ${CMAKE_SHARED_MODULE_RUNTIME_FLAG_SEP}) ENDIF(NOT CMAKE_MODULE_EXISTS) + +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) + +IF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS) + SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_C_FLAGS}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_CXX_FLAGS) + +IF(NOT CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) + SET(CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS ${CMAKE_SHARED_LIBRARY_LINK_FLAGS}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS) + +IF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG) + SET(CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG ${CMAKE_SHARED_LIBRARY_RUNTIME_FLAG}) +ENDIF(NOT CMAKE_SHARED_LIBRARY_RUNTIME_CXX_FLAG) + +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) + + # include default rules that work for most unix like systems and compilers # this file will not set anything if it is already set INCLUDE(${CMAKE_ROOT}/Modules/CMakeDefaultMakeRuleVariables.cmake) @@ -86,3 +113,19 @@ INCLUDE(${CMAKE_ROOT}/Modules/CMakeDefaultMakeRuleVariables.cmake) IF(CMAKE_USER_MAKE_RULES_OVERRIDE) INCLUDE(${CMAKE_USER_MAKE_RULES_OVERRIDE}) ENDIF(CMAKE_USER_MAKE_RULES_OVERRIDE) + +FIND_PROGRAM(CMAKE_MAKE_PROGRAM NAMES nmake gmake make ) + +SET(CMAKE_VERBOSE_MAKEFILE FALSE CACHE BOOL "If this value is on, makefiles will be generated without the .SILENT directive, and all commands will be echoed to the console during the make. This is useful for debugging only.") +# default build type is none +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.") +MARK_AS_ADVANCED( +CMAKE_VERBOSE_MAKEFILE +CMAKE_CXX_FLAGS +CMAKE_CXX_FLAGS_RELEASE +CMAKE_CXX_FLAGS_RELWITHDEBINFO +CMAKE_CXX_FLAGS_MINSIZEREL +CMAKE_CXX_FLAGS_DEBUG +CMAKE_C_FLAGS +) |