[CMake] Patch to install dlls correctly when cross-compiling

Toni Timonen ttimonen at movial.fi
Mon Sep 4 04:09:30 EDT 2006


Hi,

When cross-compiling windows dlls with mingw compiler using linux, the
dlls are not installed to the correct location (and the import library
is not installed at all). It seems that some things about the platform
are fixed at runtime.

The patch attached fixes this issue with INSTALL(TARGETS ..).


-- 
Toni Timonen
040-5111863,GPG 0x7984A4FD
-------------- next part --------------
Index: Source/cmInstallCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmInstallCommand.cxx,v
retrieving revision 1.15
diff -u -r1.15 cmInstallCommand.cxx
--- Source/cmInstallCommand.cxx	29 Aug 2006 19:04:29 -0000	1.15
+++ Source/cmInstallCommand.cxx	31 Aug 2006 16:59:24 -0000
@@ -385,7 +385,9 @@
         // platforms.  All windows platforms are DLL platforms
         // including cygwin.  Currently no other platform is a DLL
         // platform.
-#if defined(_WIN32) || defined(__CYGWIN__)
+if(this->Makefile->IsOn("WIN32") ||
+   this->Makefile->IsOn("CYGWIN") ||
+   this->Makefile->IsOn("MINGW")) {
         // This is a DLL platform.
         if(archive_destination)
           {
@@ -405,7 +407,7 @@
                                          runtime_configurations,
                                          runtime_component.c_str()));
           }
-#else
+} else {
         // This is a non-DLL platform.
         if(library_destination)
           {
@@ -424,7 +426,7 @@
           this->SetError(e.str().c_str());
           return false;
           }
-#endif
+}
         }
         break;
       case cmTarget::STATIC_LIBRARY:


More information about the CMake mailing list