[ros-diffs] [akhaldi] 50101: [CMAKE] - Add rostests to build when the folder exists. - Alter the importlib target macro to handle definition files along with spec files.

akhaldi at svn.reactos.org akhaldi at svn.reactos.org
Wed Dec 22 16:37:33 UTC 2010


Author: akhaldi
Date: Wed Dec 22 16:37:32 2010
New Revision: 50101

URL: http://svn.reactos.org/svn/reactos?rev=50101&view=rev
Log:
[CMAKE]
- Add rostests to build when the folder exists.
- Alter the importlib target macro to handle definition files along with spec files.

Added:
    branches/cmake-bringup/modules/CMakeLists.txt   (with props)
Modified:
    branches/cmake-bringup/CMakeLists.txt
    branches/cmake-bringup/gcc.cmake
    branches/cmake-bringup/msc.cmake

Modified: branches/cmake-bringup/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/CMakeLists.txt?rev=50101&r1=50100&r2=50101&view=diff
==============================================================================
--- branches/cmake-bringup/CMakeLists.txt [iso-8859-1] (original)
+++ branches/cmake-bringup/CMakeLists.txt [iso-8859-1] Wed Dec 22 16:37:32 2010
@@ -142,6 +142,7 @@
 add_subdirectory(hal)
 add_subdirectory(lib)
 add_subdirectory(media)
+add_subdirectory(modules)
 add_subdirectory(ntoskrnl)
 add_subdirectory(subsystems)
 

Modified: branches/cmake-bringup/gcc.cmake
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/gcc.cmake?rev=50101&r1=50100&r2=50101&view=diff
==============================================================================
--- branches/cmake-bringup/gcc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/gcc.cmake [iso-8859-1] Wed Dec 22 16:37:32 2010
@@ -192,23 +192,37 @@
     endforeach()
 endmacro()
 
-macro(add_importlib_target _spec_file)
-    get_filename_component(_name ${_spec_file} NAME_WE)
+macro(add_importlib_target _exports_file)
+
+    get_filename_component(_name ${_exports_file} NAME_WE)
+    get_filename_component(_extension ${_exports_file} EXT)
+
+    if (${_extension} STREQUAL ".spec")
+        if (${ARGC} GREATER 1)
+            set(DLLNAME_OPTION "-n=${ARGV1}")
+        else()
+            set(DLLNAME_OPTION "")
+        endif()
     
-    if (${ARGC} GREATER 1)
-        set(DLLNAME_OPTION "-n=${ARGV1}")
+        add_custom_command(
+            OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
+            COMMAND native-spec2def ${DLLNAME_OPTION} -d=${CMAKE_CURRENT_BINARY_DIR}/${_name}.def ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file}
+            COMMAND ${MINGW_PREFIX}dlltool --def ${CMAKE_CURRENT_BINARY_DIR}/${_name}.def --kill-at --output-lib=${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
+            DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file})
+        
+    elseif(${_extension} STREQUAL ".def")
+        add_custom_command(
+            OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
+            COMMAND ${MINGW_PREFIX}dlltool --def ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file} --kill-at --output-lib=${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
+            DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file})
     else()
-        set(DLLNAME_OPTION "")
+        message(FATAL_ERROR "Unsupported exports file extension: ${_extension}")
     endif()
     
-    add_custom_command(
-        OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
-        COMMAND native-spec2def ${DLLNAME_OPTION} -d=${CMAKE_CURRENT_BINARY_DIR}/${_name}.def ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}
-        COMMAND ${MINGW_PREFIX}dlltool --def ${CMAKE_CURRENT_BINARY_DIR}/${_name}.def --kill-at --output-lib=${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a
-        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file})
     add_custom_target(
         lib${_name}
         DEPENDS ${CMAKE_BINARY_DIR}/importlibs/lib${_name}.a)
+
 endmacro()
 
 macro(spec2def _dllname _spec_file)

Added: branches/cmake-bringup/modules/CMakeLists.txt
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/modules/CMakeLists.txt?rev=50101&view=auto
==============================================================================
--- branches/cmake-bringup/modules/CMakeLists.txt (added)
+++ branches/cmake-bringup/modules/CMakeLists.txt [iso-8859-1] Wed Dec 22 16:37:32 2010
@@ -1,0 +1,4 @@
+
+if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/rostests/)
+add_subdirectory(rostests)
+endif()

Propchange: branches/cmake-bringup/modules/CMakeLists.txt
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: branches/cmake-bringup/msc.cmake
URL: http://svn.reactos.org/svn/reactos/branches/cmake-bringup/msc.cmake?rev=50101&r1=50100&r2=50101&view=diff
==============================================================================
--- branches/cmake-bringup/msc.cmake [iso-8859-1] (original)
+++ branches/cmake-bringup/msc.cmake [iso-8859-1] Wed Dec 22 16:37:32 2010
@@ -139,14 +139,14 @@
 set(IDL_DLLDATA_ARG /dlldata )
 
 # Thanks MS for creating a stupid linker
-macro(add_importlib_target _spec_file)
-    get_filename_component(_name ${_spec_file} NAME_WE)
+macro(add_importlib_target _exports_file)
+    get_filename_component(_name ${_exports_file} NAME_WE)
 
     # Generate the asm stub file and the export def file
     add_custom_command(
         OUTPUT ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm ${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def
-        COMMAND native-spec2def -@ -r -d=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def -l=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file}
-        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_spec_file})
+        COMMAND native-spec2def -@ -r -d=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_exp.def -l=${CMAKE_BINARY_DIR}/importlibs/lib${_name}_stubs.asm ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file}
+        DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${_exports_file})
 
     # Assemble the stub file
     add_custom_command(




More information about the Ros-diffs mailing list