[CMAKE]
authorAmine Khaldi <amine.khaldi@reactos.org>
Wed, 28 Jul 2010 12:58:37 +0000 (12:58 +0000)
committerAmine Khaldi <amine.khaldi@reactos.org>
Wed, 28 Jul 2010 12:58:37 +0000 (12:58 +0000)
- We won't be using mkdir to create folders since cmake has a command for it.
- Split nci generated files into separate targets, so that modules can depend on each one of them separately if needed.
- Add win32ksys to build.

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

CMakeLists.txt
lib/CMakeLists.txt
lib/ntdllsys/CMakeLists.txt
lib/win32ksys/CMakeLists.txt [new file with mode: 0644]
toolchain-mingw32.cmake

index 27b1767..12ddd5d 100644 (file)
@@ -83,19 +83,15 @@ set(nci_output
 
 # stupid nci tool can't create folders itself, se we're gonna create them for it
 set(nci_folders
-  dll\\ntdll\\def
-  lib\\ntdllsys\\ntdll
-  lib\\win32ksys
-  ntoskrnl\\include\\internal
-  ntoskrnl\\ex
-  subsystems\\win32\\win32k\\include
+  ${CMAKE_CURRENT_BINARY_DIR}/dll/ntdll/def
+  ${CMAKE_CURRENT_BINARY_DIR}/lib/ntdllsys/ntdll
+  ${CMAKE_CURRENT_BINARY_DIR}/lib/win32ksys
+  ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl/include/internal
+  ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl/ex
+  ${CMAKE_CURRENT_BINARY_DIR}/subsystems/win32/win32k/include
 )
 
-ADD_CUSTOM_COMMAND(
-  OUTPUT ${nci_folders}
-  COMMAND mkdir ${MKDIR_ARG} ${nci_folders}
-  WORKING_DIRECTORY ${REACTOS_BINARY_DIR}
-)
+file(MAKE_DIRECTORY ${nci_folders})
 
 ADD_CUSTOM_COMMAND(
   OUTPUT ${nci_output}
@@ -105,7 +101,8 @@ ADD_CUSTOM_COMMAND(
 
 SET_SOURCE_FILES_PROPERTIES(${nci_output} PROPERTIES GENERATED TRUE)
 
-ADD_CUSTOM_TARGET(nci_resources ALL DEPENDS ${nci_output})
+ADD_CUSTOM_TARGET(ntdll_S ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/ntdllsys/ntdll.S)
+ADD_CUSTOM_TARGET(win32k_S ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/win32ksys/win32k.S)
 
 endif()
 
index 380f934..5777534 100644 (file)
@@ -21,6 +21,7 @@ add_subdirectory(rtl)
 add_subdirectory(sdk)
 add_subdirectory(smlib)
 add_subdirectory(tdilib)
+add_subdirectory(win32ksys)
 
 else()
 
index 4d7afa6..0344f51 100644 (file)
@@ -10,4 +10,4 @@ set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o <OBJ
 set_source_files_properties(${REACTOS_BINARY_DIR}/lib/ntdllsys/ntdll.S PROPERTIES GENERATED TRUE)
 
 add_library(ntdllsys ${REACTOS_BINARY_DIR}/lib/ntdllsys/ntdll.S)
-add_dependencies(ntdllsys nci_resources)
+add_dependencies(ntdllsys ntdllsys_S)
diff --git a/lib/win32ksys/CMakeLists.txt b/lib/win32ksys/CMakeLists.txt
new file mode 100644 (file)
index 0000000..ab8f672
--- /dev/null
@@ -0,0 +1,13 @@
+
+get_directory_property(defines COMPILE_DEFINITIONS)
+
+foreach(arg ${defines})
+  set(result_defs "${result_defs} -D${arg}")
+endforeach(arg ${defines})
+
+set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -x assembler-with-cpp -o <OBJECT> ${result_defs} -D__ASM__ <FLAGS> -c <SOURCE>")
+
+set_source_files_properties(${REACTOS_BINARY_DIR}/lib/win32ksys/win32k.S PROPERTIES GENERATED TRUE)
+
+add_library(win32ksys ${REACTOS_BINARY_DIR}/lib/win32ksys/win32k.S)
+add_dependencies(win32ksys win32k_S)
index 3695f4d..7deaee2 100644 (file)
@@ -4,10 +4,8 @@ SET(ARCH i386)
 # Choose the right MinGW prefix
 if (CMAKE_HOST_SYSTEM_NAME MATCHES Windows)
 set(MINGW_PREFIX "")
-set(MKDIR_ARG "")
 else()
 set(MINGW_PREFIX "mingw32-")
-set(MKDIR_ARG "-p")
 endif()
 
 # the name of the target operating system