diff options
author | Brad King <brad.king@kitware.com> | 2006-04-11 20:55:49 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-04-11 20:55:49 (GMT) |
commit | 08289893b8590be41d0541af7644e737035aee54 (patch) | |
tree | 8ad52af77e4837c0f7fd936b6c52ca083f66c0c0 /Modules | |
parent | e380bad5f6fbe37048e3f06e125e2938da9ffc68 (diff) | |
download | CMake-08289893b8590be41d0541af7644e737035aee54.zip CMake-08289893b8590be41d0541af7644e737035aee54.tar.gz CMake-08289893b8590be41d0541af7644e737035aee54.tar.bz2 |
ENH: Split CMAKE_STANDARD_LIBRARIES into per-language variables CMAKE_<lang>_STANDARD_LIBRARIES. This is needed to get programmable language support working with Visual Studio generators. It makes sense anyway.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/CMakeCInformation.cmake | 6 | ||||
-rw-r--r-- | Modules/CMakeCXXInformation.cmake | 5 | ||||
-rw-r--r-- | Modules/CMakeFortranInformation.cmake | 5 | ||||
-rw-r--r-- | Modules/Platform/Windows-bcc32.cmake | 8 | ||||
-rw-r--r-- | Modules/Platform/Windows-cl.cmake | 16 | ||||
-rw-r--r-- | Modules/Platform/Windows-icl.cmake | 5 | ||||
-rw-r--r-- | Modules/Platform/Windows-ifort.cmake | 7 | ||||
-rw-r--r-- | Modules/Platform/Windows-wcl386.cmake | 4 |
8 files changed, 27 insertions, 29 deletions
diff --git a/Modules/CMakeCInformation.cmake b/Modules/CMakeCInformation.cmake index 242d796..230d49e 100644 --- a/Modules/CMakeCInformation.cmake +++ b/Modules/CMakeCInformation.cmake @@ -53,6 +53,12 @@ IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) "Flags used by the compiler during Release with Debug Info builds.") ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) +IF(CMAKE_C_STANDARD_LIBRARIES_INIT) + SET(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES_INIT}" + CACHE STRING "Libraries linked by defalut with all C applications.") + MARK_AS_ADVANCED(CMAKE_C_STANDARD_LIBRARIES) +ENDIF(CMAKE_C_STANDARD_LIBRARIES_INIT) + INCLUDE(CMakeCommonLanguageInclude) # now define the following rule variables diff --git a/Modules/CMakeCXXInformation.cmake b/Modules/CMakeCXXInformation.cmake index 6e16e4a..8d05933 100644 --- a/Modules/CMakeCXXInformation.cmake +++ b/Modules/CMakeCXXInformation.cmake @@ -104,6 +104,11 @@ IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) ENDIF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) +IF(CMAKE_CXX_STANDARD_LIBRARIES_INIT) + SET(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES_INIT}" + CACHE STRING "Libraries linked by defalut with all C++ applications.") + MARK_AS_ADVANCED(CMAKE_CXX_STANDARD_LIBRARIES) +ENDIF(CMAKE_CXX_STANDARD_LIBRARIES_INIT) INCLUDE(CMakeCommonLanguageInclude) diff --git a/Modules/CMakeFortranInformation.cmake b/Modules/CMakeFortranInformation.cmake index 9dd0649..80a8e7a 100644 --- a/Modules/CMakeFortranInformation.cmake +++ b/Modules/CMakeFortranInformation.cmake @@ -129,6 +129,11 @@ IF(NOT CMAKE_Fortran_LINK_EXECUTABLE) "<CMAKE_Fortran_COMPILER> <CMAKE_Fortran_LINK_FLAGS> <LINK_FLAGS> <FLAGS> <OBJECTS> -o <TARGET> <LINK_LIBRARIES>") ENDIF(NOT CMAKE_Fortran_LINK_EXECUTABLE) +IF(CMAKE_Fortran_STANDARD_LIBRARIES_INIT) + SET(CMAKE_Fortran_STANDARD_LIBRARIES "${CMAKE_Fortran_STANDARD_LIBRARIES_INIT}" + CACHE STRING "Libraries linked by defalut with all Fortran applications.") + MARK_AS_ADVANCED(CMAKE_Fortran_STANDARD_LIBRARIES) +ENDIF(CMAKE_Fortran_STANDARD_LIBRARIES_INIT) IF(NOT CMAKE_NOT_USING_CONFIG_FLAGS) SET (CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG_INIT}" CACHE STRING diff --git a/Modules/Platform/Windows-bcc32.cmake b/Modules/Platform/Windows-bcc32.cmake index 2f334e0..3bc4f01 100644 --- a/Modules/Platform/Windows-bcc32.cmake +++ b/Modules/Platform/Windows-bcc32.cmake @@ -95,9 +95,5 @@ SET (CMAKE_MODULE_LINKER_FLAGS_INIT ${CMAKE_SHARED_LINKER_FLAGS_INIT}) SET (CMAKE_MODULE_LINKER_FLAGS_DEBUG_INIT ${CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT}) SET (CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO_INIT ${CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT}) - -SET (CMAKE_STANDARD_LIBRARIES "import32.lib" CACHE STRING - "Libraries linked by defalut with all applications.") - -MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES) - +SET (CMAKE_C_STANDARD_LIBRARIES_INIT "import32.lib") +SET (CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") diff --git a/Modules/Platform/Windows-cl.cmake b/Modules/Platform/Windows-cl.cmake index fceb68a..1021f78 100644 --- a/Modules/Platform/Windows-cl.cmake +++ b/Modules/Platform/Windows-cl.cmake @@ -211,8 +211,7 @@ IF(MSVC80) SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG") 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_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib " CACHE STRING - "Libraries linked by defalut with all applications.") + 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 ") ELSE(MSVC80) IF(CMAKE_USING_VC_FREE_TOOLS) MESSAGE(STATUS "Using FREE VC TOOLS, NO DEBUG available") @@ -227,10 +226,7 @@ ELSE(MSVC80) SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MT /O1 /Ob1") SET (CMAKE_C_FLAGS_RELEASE_INIT "/MT /O2 /Ob2") SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MT /Zi /O2 /Ob1") - SET (CMAKE_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib advapi32.lib rpcrt4.lib" CACHE STRING - "Libraries linked by defalut with all applications.") - SET (CMAKE_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib advapi32.lib rpcrt4.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib" CACHE STRING - "Libraries linked by defalut with all applications.") + SET (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib advapi32.lib rpcrt4.lib") ELSE(CMAKE_USING_VC_FREE_TOOLS) SET(CMAKE_BUILD_TYPE_INIT Debug) SET (CMAKE_CXX_FLAGS_INIT "/DWIN32 /D_WINDOWS /W3 /Zm1000 /GX /GR") @@ -243,15 +239,11 @@ ELSE(MSVC80) SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "/MD /O1 /Ob1 /D NDEBUG") 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_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib" CACHE STRING - "Libraries linked by defalut with all applications.") + SET (CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib") ENDIF(CMAKE_USING_VC_FREE_TOOLS) ENDIF(MSVC80) - -MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES) - - +SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") diff --git a/Modules/Platform/Windows-icl.cmake b/Modules/Platform/Windows-icl.cmake index bad8949..d09eb1c 100644 --- a/Modules/Platform/Windows-icl.cmake +++ b/Modules/Platform/Windows-icl.cmake @@ -60,9 +60,8 @@ SET (CMAKE_C_FLAGS_RELEASE_INIT "/MD /O2") SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "/MD /Zi /O2") -SET (CMAKE_STANDARD_LIBRARIES "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib" CACHE STRING - "Libraries linked by defalut with all applications.") -MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES) +SET(CMAKE_C_STANDARD_LIBRARIES_INIT "kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib") +SET(CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") diff --git a/Modules/Platform/Windows-ifort.cmake b/Modules/Platform/Windows-ifort.cmake index a152864..1b3459d 100644 --- a/Modules/Platform/Windows-ifort.cmake +++ b/Modules/Platform/Windows-ifort.cmake @@ -43,13 +43,8 @@ SET (CMAKE_Fortran_FLAGS_DEBUG_INIT "/debug:full") SET (CMAKE_Fortran_FLAGS_MINSIZEREL_INIT "/O2 /D NDEBUG") SET (CMAKE_Fortran_FLAGS_RELEASE_INIT "/MD /O1 /D NDEBUG") SET (CMAKE_Fortran_FLAGS_RELWITHDEBINFO_INIT "/O1 /debug:full /D NDEBUG") -SET (CMAKE_STANDARD_LIBRARIES "user32.lib" CACHE STRING - "Libraries linked by defalut with all applications.") - - -MARK_AS_ADVANCED(CMAKE_STANDARD_LIBRARIES) - +SET (CMAKE_Fortran_STANDARD_LIBRARIES_INIT "user32.lib") # executable linker flags SET (CMAKE_LINK_DEF_FILE_FLAG "/DEF:") diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake index afc32dd..89c2697 100644 --- a/Modules/Platform/Windows-wcl386.cmake +++ b/Modules/Platform/Windows-wcl386.cmake @@ -22,8 +22,8 @@ SET (CMAKE_C_FLAGS_DEBUG_INIT "-br -bm -od") SET (CMAKE_C_FLAGS_MINSIZEREL_INIT "-br -bm -os -dNDEBUG") SET (CMAKE_C_FLAGS_RELEASE_INIT "-br -bm -ot -dNDEBUG") SET (CMAKE_C_FLAGS_RELWITHDEBINFO_INIT "-br -bm -ot -dNDEBUG") -SET (CMAKE_STANDARD_LIBRARIES "library clbrdll.lib library plbrdll.lib library kernel32.lib library user32.lib library gdi32.lib library winspool.lib library comdlg32.lib library advapi32.lib library shell32.lib library ole32.lib library oleaut32.lib library uuid.lib library odbc32.lib library odbccp32.lib" CACHE STRING - "Libraries linked by defalut with all applications.") +SET (CMAKE_C_STANDARD_LIBRARIES_INIT "library clbrdll.lib library plbrdll.lib library kernel32.lib library user32.lib library gdi32.lib library winspool.lib library comdlg32.lib library advapi32.lib library shell32.lib library ole32.lib library oleaut32.lib library uuid.lib library odbc32.lib library odbccp32.lib") +SET (CMAKE_CXX_STANDARD_LIBRARIES_INIT "${CMAKE_C_STANDARD_LIBRARIES_INIT}") SET(CMAKE_C_LINK_EXECUTABLE "wlink ${CMAKE_START_TEMP_FILE} ${CMAKE_WLINK_QUIET} name <TARGET> option caseexact file {<OBJECTS>} <LINK_LIBRARIES> ${CMAKE_END_TEMP_FILE}") |