summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2006-02-18 20:37:23 (GMT)
committerBrad King <brad.king@kitware.com>2006-02-18 20:37:23 (GMT)
commit81677b31300f058830889e5603bf06ccd9221691 (patch)
tree35946600211458cb15f8269b2a5a607f43ecfc64 /Modules
parent9ba02838701e2513414f258dec9d63566ee9b481 (diff)
downloadCMake-81677b31300f058830889e5603bf06ccd9221691.zip
CMake-81677b31300f058830889e5603bf06ccd9221691.tar.gz
CMake-81677b31300f058830889e5603bf06ccd9221691.tar.bz2
ENH: Generate import libraries for DLLs on Cygwin and MinGW.
Diffstat (limited to 'Modules')
-rw-r--r--Modules/Platform/CYGWIN.cmake14
-rw-r--r--Modules/Platform/Windows-bcc32.cmake4
-rw-r--r--Modules/Platform/Windows-gcc.cmake12
-rw-r--r--Modules/Platform/Windows-wcl386.cmake2
-rw-r--r--Modules/Platform/Windows.cmake2
5 files changed, 30 insertions, 4 deletions
diff --git a/Modules/Platform/CYGWIN.cmake b/Modules/Platform/CYGWIN.cmake
index cfd1fb0..09c148d 100644
--- a/Modules/Platform/CYGWIN.cmake
+++ b/Modules/Platform/CYGWIN.cmake
@@ -1,7 +1,9 @@
SET(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "-shared -Wl,--export-all-symbols -Wl,--enable-auto-import")
SET(CMAKE_DL_LIBS "-lgdi32" )
-SET(CMAKE_SHARED_LIBRARY_PREFIX "lib")
+SET(CMAKE_SHARED_LIBRARY_PREFIX "cyg")
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll")
+SET(CMAKE_IMPORT_LIBRARY_PREFIX "lib")
+SET(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a")
# no pic for gcc on cygwin
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "")
SET(CMAKE_SHARED_LIBRARY_CXX_FLAGS "")
@@ -9,3 +11,13 @@ SET(CMAKE_EXECUTABLE_SUFFIX ".exe") # .exe
SET(CMAKE_FIND_LIBRARY_PREFIXES "cyg" "lib")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".dll.a" ".a")
+
+SET(CMAKE_C_CREATE_SHARED_MODULE
+ "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+SET(CMAKE_CXX_CREATE_SHARED_MODULE
+ "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+
+SET(CMAKE_C_CREATE_SHARED_LIBRARY
+ "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> -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> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> -Wl,--out-implib,<TARGET_IMPLIB> <OBJECTS> <LINK_LIBRARIES>")
diff --git a/Modules/Platform/Windows-bcc32.cmake b/Modules/Platform/Windows-bcc32.cmake
index 8265cf9..2f334e0 100644
--- a/Modules/Platform/Windows-bcc32.cmake
+++ b/Modules/Platform/Windows-bcc32.cmake
@@ -29,7 +29,7 @@ SET (CMAKE_MANGLE_OBJECT_FILE_NAMES "ON")
# create a shared C++ library
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
"<CMAKE_CXX_COMPILER> ${CMAKE_START_TEMP_FILE}-e<TARGET> -tWD <LINK_FLAGS> -tWR <LINK_LIBRARIES> <OBJECTS>${CMAKE_END_TEMP_FILE}"
- "implib -c -w <TARGET_BASE>.lib <TARGET_BASE>.dll"
+ "implib -c -w <TARGET_IMPLIB> <TARGET>"
)
SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
@@ -37,7 +37,7 @@ SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
# create a C shared library
SET(CMAKE_C_CREATE_SHARED_LIBRARY
"<CMAKE_C_COMPILER> ${CMAKE_START_TEMP_FILE}-e<TARGET> -tWD <LINK_FLAGS> -tWR <LINK_LIBRARIES> <OBJECTS>${CMAKE_END_TEMP_FILE}"
- "implib -c -w <TARGET_BASE>.lib <TARGET_BASE>.dll"
+ "implib -c -w <TARGET_IMPLIB> <TARGET>"
)
# create a C shared module just copy the shared library rule
diff --git a/Modules/Platform/Windows-gcc.cmake b/Modules/Platform/Windows-gcc.cmake
index 779d1e5..83a9c22 100644
--- a/Modules/Platform/Windows-gcc.cmake
+++ b/Modules/Platform/Windows-gcc.cmake
@@ -5,6 +5,8 @@ SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") # lib
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") # .so
SET(CMAKE_SHARED_MODULE_PREFIX "lib") # lib
SET(CMAKE_SHARED_MODULE_SUFFIX ".dll") # .so
+SET(CMAKE_IMPORT_LIBRARY_PREFIX "lib")
+SET(CMAKE_IMPORT_LIBRARY_SUFFIX ".dll.a")
SET(CMAKE_EXECUTABLE_SUFFIX ".exe") # .exe
SET(CMAKE_DL_LIBS "")
SET(CMAKE_SHARED_LIBRARY_C_FLAGS "") # -pic
@@ -20,3 +22,13 @@ IF(MINGW)
SET(CMAKE_FIND_LIBRARY_PREFIXES "lib" "")
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".dll" ".dll.a" ".a")
ENDIF(MINGW)
+
+SET(CMAKE_C_CREATE_SHARED_MODULE
+ "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+SET(CMAKE_CXX_CREATE_SHARED_MODULE
+ "<CMAKE_CXX_COMPILER> <CMAKE_SHARED_LIBRARY_CXX_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET> <OBJECTS> <LINK_LIBRARIES>")
+
+SET(CMAKE_C_CREATE_SHARED_LIBRARY
+ "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> <CMAKE_SHARED_LIBRARY_SONAME_C_FLAG><TARGET_SONAME> -o <TARGET_BASE>.dll -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> <CMAKE_SHARED_LIBRARY_SONAME_CXX_FLAG><TARGET_SONAME> -o <TARGET_BASE>.dll -Wl,--out-implib,<TARGET_IMPLIB> <OBJECTS> <LINK_LIBRARIES>")
diff --git a/Modules/Platform/Windows-wcl386.cmake b/Modules/Platform/Windows-wcl386.cmake
index fb81be5..afc32dd 100644
--- a/Modules/Platform/Windows-wcl386.cmake
+++ b/Modules/Platform/Windows-wcl386.cmake
@@ -40,7 +40,7 @@ SET(CMAKE_C_COMPILE_OBJECT
SET(CMAKE_CXX_CREATE_SHARED_LIBRARY
"wlink ${CMAKE_START_TEMP_FILE} system nt_dll ${CMAKE_WLINK_QUIET} name <TARGET> option caseexact file {<OBJECTS>} <LINK_LIBRARIES>"
- "wlib -q -n -b <TARGET_BASE>.lib +<TARGET_BASE>.dll ${CMAKE_END_TEMP_FILE}")
+ "wlib -q -n -b <TARGET_IMPLIB> +<TARGET> ${CMAKE_END_TEMP_FILE}")
SET(CMAKE_CXX_CREATE_SHARED_MODULE ${CMAKE_CXX_CREATE_SHARED_LIBRARY})
# create a C shared library
diff --git a/Modules/Platform/Windows.cmake b/Modules/Platform/Windows.cmake
index a79a489..43605fb 100644
--- a/Modules/Platform/Windows.cmake
+++ b/Modules/Platform/Windows.cmake
@@ -2,6 +2,8 @@ SET(CMAKE_STATIC_LIBRARY_PREFIX "")
SET(CMAKE_STATIC_LIBRARY_SUFFIX ".lib")
SET(CMAKE_SHARED_LIBRARY_PREFIX "") # lib
SET(CMAKE_SHARED_LIBRARY_SUFFIX ".dll") # .so
+SET(CMAKE_IMPORT_LIBRARY_PREFIX "")
+SET(CMAKE_IMPORT_LIBRARY_SUFFIX ".lib")
SET(CMAKE_EXECUTABLE_SUFFIX ".exe") # .exe
SET(CMAKE_LINK_LIBRARY_SUFFIX ".lib")
SET(CMAKE_DL_LIBS "")