2 cmake_minimum_required(VERSION 2.8)
8 if(NOT CMAKE_CROSSCOMPILING)
10 add_definitions(-DTARGET_i386)
12 add_definitions(-Dinline=__inline)
16 ${REACTOS_SOURCE_DIR}/tools/unicode
21 ${REACTOS_BINARY_DIR}/include)
23 add_subdirectory(tools)
27 export(TARGETS widl nci buildno gendib cabman cdmake mkhive spec2def geninc FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
29 export(TARGETS nci buildno gendib cabman cdmake mkhive spec2def geninc FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
34 if(NOT DEFINED REACTOS_BUILD_TOOLS_DIR)
35 set(REACTOS_BUILD_TOOLS_DIR ${REACTOS_SOURCE_DIR}/build)
38 set(IMPORT_EXECUTABLES "${REACTOS_BUILD_TOOLS_DIR}/ImportExecutables.cmake" CACHE FILEPATH "Host executables")
39 include(${IMPORT_EXECUTABLES})
41 endif(NOT CMAKE_CROSSCOMPILING)
43 # Compiler specific definitions and macros
51 include(CMakeMacros.cmake)
53 set(CMAKE_INCLUDE_CURRENT_DIR ON)
54 set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
55 set(CMAKE_SHARED_LIBRARY_PREFIX "")
57 set(CMAKE_SKIP_PREPROCESSED_SOURCE_RULES TRUE)
58 set(CMAKE_SKIP_ASSEMBLY_SOURCE_RULES TRUE)
60 set(CMAKE_COLOR_MAKEFILE OFF)
62 set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
64 add_definitions(-D__REACTOS__)
66 if(CMAKE_CROSSCOMPILING)
70 ${REACTOS_BINARY_DIR}/boot/ros_livecd.txt
71 ${REACTOS_BINARY_DIR}/boot/ros_livecd_target.txt
72 ${REACTOS_BINARY_DIR}/boot/ros_minicd.txt
73 ${REACTOS_BINARY_DIR}/boot/ros_minicd_target.txt
74 ${REACTOS_BINARY_DIR}/boot/ros_cab.txt
75 ${REACTOS_BINARY_DIR}/boot/ros_cab_target.txt)
77 #Some useful variables
78 set(LIVECD_DIR "${REACTOS_BINARY_DIR}/boot/livecd")
79 set(BOOTCD_DIR "${REACTOS_BINARY_DIR}/boot/bootcd")
81 # Activate support for assembly source files
84 # Activate language support for resource files
89 add_definitions(-DDBG=1 -D_SEH_ENABLE_TRACE)
91 add_definitions(-DDBG=0)
95 add_definitions(-DKDBG=1)
97 add_definitions(-DKDBG=0)
101 add_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502 -D_WIN32_WINDOWS=0x502 -D_SETUPAPI_VER=0x502)
104 add_definitions(-D_M_IX86 -D_X86_ -D__i386__)
107 add_definitions(-DUSE_COMPILER_EXCEPTIONS -D_USE_32BIT_TIME_T)
113 ${REACTOS_BINARY_DIR}/include
114 ${REACTOS_BINARY_DIR}/include/dxsdk
115 ${REACTOS_BINARY_DIR}/include/psdk
116 ${REACTOS_BINARY_DIR}/include/reactos
121 include/reactos/libs)
124 include_directories(include/crt/msc)
126 include_directories(include/crt/mingw32)
129 add_subdirectory(include/psdk)
130 add_subdirectory(include/dxsdk)
131 add_subdirectory(include/reactos/idl)
132 add_subdirectory(include/reactos/wine)
133 add_subdirectory(include/reactos/mc)
134 add_subdirectory(include/asm)
136 include(baseaddress.cmake)
138 add_subdirectory(base)
139 add_subdirectory(boot)
140 add_subdirectory(dll)
141 add_subdirectory(drivers)
142 add_subdirectory(hal)
143 add_subdirectory(lib)
144 add_subdirectory(media)
145 add_subdirectory(modules)
146 add_subdirectory(ntoskrnl)
147 add_subdirectory(subsystems)
149 # nci generated intermediate files
151 list(APPEND nci_output
152 ${REACTOS_BINARY_DIR}/ntoskrnl/include/internal/napi.h
153 ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/include/napi.h
154 ${REACTOS_BINARY_DIR}/lib/ntdllsys/ntdll.S
155 ${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S
156 ${REACTOS_BINARY_DIR}/lib/win32ksys/win32k.S
157 ${REACTOS_BINARY_DIR}/dll/ntdll/def/ntsys.pspec)
159 list(APPEND nci_folders
160 ${CMAKE_CURRENT_BINARY_DIR}/dll/ntdll/def
161 ${CMAKE_CURRENT_BINARY_DIR}/lib/ntdllsys/ntdll
162 ${CMAKE_CURRENT_BINARY_DIR}/lib/win32ksys
163 ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl/include/internal
164 ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl/ex
165 ${CMAKE_CURRENT_BINARY_DIR}/subsystems/win32/win32k/include)
167 file(MAKE_DIRECTORY ${nci_folders})
171 COMMAND native-nci -arch ${ARCH} ${REACTOS_SOURCE_DIR}/ntoskrnl/sysfuncs.lst ${REACTOS_SOURCE_DIR}/subsystems/win32/win32k/w32ksvc.db ${nci_output}
172 DEPENDS native-nci ${nci_folders})
174 set_source_files_properties(${nci_output} PROPERTIES GENERATED TRUE)
176 add_custom_target(ntdll_S ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/ntdllsys/ntdll.S)
177 add_custom_target(win32k_S ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/win32ksys/win32k.S)
178 add_custom_target(ntsys_pspec ALL DEPENDS ${REACTOS_BINARY_DIR}/dll/ntdll/def/ntsys.pspec)
179 add_custom_target(kernel_napi ALL DEPENDS ${REACTOS_BINARY_DIR}/ntoskrnl/include/internal/napi.h)
180 add_custom_target(subsystem_napi ALL DEPENDS ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/include/napi.h)
181 add_custom_target(kernel_zw ALL DEPENDS ${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S)
183 file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/include/reactos)
186 OUTPUT ${REACTOS_BINARY_DIR}/include/reactos/buildno.h
187 COMMAND native-buildno ${REACTOS_BINARY_DIR}/include/reactos/buildno.h
188 DEPENDS ${REACTOS_SOURCE_DIR}/include/reactos/version.h)
190 add_custom_target(buildno_header ALL DEPENDS ${REACTOS_BINARY_DIR}/include/reactos/buildno.h)
192 file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/dib)
194 list(APPEND OUTPUT_FILES
195 ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/dib/dib8gen.c
196 ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/dib/dib16gen.c
197 ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/dib/dib32gen.c)
200 OUTPUT ${OUTPUT_FILES}
201 COMMAND native-gendib ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/dib
202 DEPENDS native-gendib)
204 add_custom_target(gendib_generated ALL DEPENDS ${OUTPUT_FILES})
206 file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/importlibs)
209 include(ros_cd.cmake)