[CMAKE]
authorAmine Khaldi <amine.khaldi@reactos.org>
Fri, 28 Jan 2011 11:25:24 +0000 (11:25 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Fri, 28 Jan 2011 11:25:24 +0000 (11:25 +0000)
- Properly handle setting the suffix variable. Fixes import libs creation.

svn path=/branches/cmake-bringup/; revision=50533

gcc.cmake
msc.cmake

index 708b07a..586565b 100644 (file)
--- a/gcc.cmake
+++ b/gcc.cmake
@@ -269,6 +269,14 @@ macro(add_importlib_target _exports_file)
     get_filename_component(_name ${_exports_file} NAME_WE)
     get_filename_component(_extension ${_exports_file} EXT)
     get_target_property(_suffix ${_name} SUFFIX)
+    if(${_suffix} STREQUAL "_suffix-NOTFOUND")
+        get_target_property(_type ${_name} TYPE)
+        if(${_type} MATCHES EXECUTABLE)
+            set(_suffix ".exe")
+        else()
+            set(_suffix ".dll")
+        endif()
+    endif()
 
     if (${_extension} STREQUAL ".spec")
 
index 0d08ffe..91d2886 100644 (file)
--- a/msc.cmake
+++ b/msc.cmake
@@ -139,6 +139,14 @@ endmacro()
 macro(add_importlib_target _exports_file)\r
     get_filename_component(_name ${_exports_file} NAME_WE)\r
     get_target_property(_suffix ${_name} SUFFIX)\r
+    if(${_suffix} STREQUAL "_suffix-NOTFOUND")\r
+        get_target_property(_type ${_name} TYPE)\r
+        if(${_type} MATCHES EXECUTABLE)\r
+            set(_suffix ".exe")\r
+        else()\r
+            set(_suffix ".dll")\r
+        endif()\r
+    endif()\r
 \r
     # Generate the asm stub file and the export def file\r
     add_custom_command(\r