1 cmake_minimum_required(VERSION 2.8)
7 # Compiler specific definitions and macros
15 include(CMakeMacros.cmake)
17 set(CMAKE_INCLUDE_CURRENT_DIR ON)
18 set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
19 set(CMAKE_SHARED_LIBRARY_PREFIX "")
21 set(CMAKE_SKIP_PREPROCESSED_SOURCE_RULES TRUE)
22 set(CMAKE_SKIP_ASSEMBLY_SOURCE_RULES TRUE)
24 set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
26 add_definitions(-D__REACTOS__)
28 if(NOT CMAKE_CROSSCOMPILING)
30 add_definitions(-DTARGET_i386)
33 ${REACTOS_SOURCE_DIR}/tools/unicode
38 ${REACTOS_BINARY_DIR}/include)
40 add_subdirectory(tools)
44 export(TARGETS widl winebuild nci buildno gendib cabman cdmake mkhive spec2pdef FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
46 export(TARGETS winebuild nci buildno gendib cabman cdmake mkhive spec2pdef FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
53 ${REACTOS_BINARY_DIR}/boot/ros_livecd.txt
54 ${REACTOS_BINARY_DIR}/boot/ros_livecd_target.txt
55 ${REACTOS_BINARY_DIR}/boot/ros_minicd.txt
56 ${REACTOS_BINARY_DIR}/boot/ros_minicd_target.txt
57 ${REACTOS_BINARY_DIR}/boot/ros_cab.txt
58 ${REACTOS_BINARY_DIR}/boot/ros_cab_target.txt)
60 #Some useful variables
61 set(LIVECD_DIR "${REACTOS_BINARY_DIR}/boot/livecd")
62 set(BOOTCD_DIR "${REACTOS_BINARY_DIR}/boot/bootcd")
64 # Activate support for assembly source files
67 # Activate language support for resource files
70 if(NOT DEFINED REACTOS_BUILD_TOOLS_DIR)
71 set(REACTOS_BUILD_TOOLS_DIR ${REACTOS_SOURCE_DIR}/build)
74 set(IMPORT_EXECUTABLES "${REACTOS_BUILD_TOOLS_DIR}/ImportExecutables.cmake" CACHE FILEPATH "Host executables")
75 include(${IMPORT_EXECUTABLES})
77 add_definitions(-DDBG=${DBG} -DKDBG=${KDBG})
80 add_definitions(-D_SEH_ENABLE_TRACE)
88 add_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502 -D_WIN32_WINDOWS=0x502 -D_SETUPAPI_VER=0x502)
91 add_definitions(-D_M_IX86 -D_X86_ -D__i386__)
94 add_definitions(-DUSE_COMPILER_EXCEPTIONS -D_USE_32BIT_TIME_T)
100 ${REACTOS_BINARY_DIR}/include
101 ${REACTOS_BINARY_DIR}/include/dxsdk
102 ${REACTOS_BINARY_DIR}/include/psdk
103 ${REACTOS_BINARY_DIR}/include/reactos
108 include/reactos/libs)
111 include_directories(include/crt/msc)
113 include_directories(include/crt/mingw32)
116 add_subdirectory(include/psdk)
117 add_subdirectory(include/dxsdk)
118 add_subdirectory(include/reactos/idl)
119 add_subdirectory(include/reactos/wine)
120 add_subdirectory(include/reactos/mc)
122 include(baseaddress.cmake)
124 add_subdirectory(base)
125 add_subdirectory(boot)
126 add_subdirectory(dll)
127 add_subdirectory(drivers)
128 add_subdirectory(hal)
129 add_subdirectory(lib)
130 add_subdirectory(media)
131 add_subdirectory(ntoskrnl)
132 add_subdirectory(subsystems)
134 # nci generated intermediate files
136 list(APPEND nci_output
137 ${REACTOS_BINARY_DIR}/ntoskrnl/include/internal/napi.h
138 ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/include/napi.h
139 ${REACTOS_BINARY_DIR}/lib/ntdllsys/ntdll.S
140 ${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S
141 ${REACTOS_BINARY_DIR}/lib/win32ksys/win32k.S
142 ${REACTOS_BINARY_DIR}/dll/ntdll/def/ntsys.pspec)
144 list(APPEND nci_folders
145 ${CMAKE_CURRENT_BINARY_DIR}/dll/ntdll/def
146 ${CMAKE_CURRENT_BINARY_DIR}/lib/ntdllsys/ntdll
147 ${CMAKE_CURRENT_BINARY_DIR}/lib/win32ksys
148 ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl/include/internal
149 ${CMAKE_CURRENT_BINARY_DIR}/ntoskrnl/ex
150 ${CMAKE_CURRENT_BINARY_DIR}/subsystems/win32/win32k/include)
152 file(MAKE_DIRECTORY ${nci_folders})
156 COMMAND native-nci -arch ${ARCH} ${REACTOS_SOURCE_DIR}/ntoskrnl/sysfuncs.lst ${REACTOS_SOURCE_DIR}/subsystems/win32/win32k/w32ksvc.db ${nci_output}
157 DEPENDS native-nci ${nci_folders})
159 set_source_files_properties(${nci_output} PROPERTIES GENERATED TRUE)
161 add_custom_target(ntdll_S ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/ntdllsys/ntdll.S)
162 add_custom_target(win32k_S ALL DEPENDS ${REACTOS_BINARY_DIR}/lib/win32ksys/win32k.S)
163 add_custom_target(ntsys_pspec ALL DEPENDS ${REACTOS_BINARY_DIR}/dll/ntdll/def/ntsys.pspec)
164 add_custom_target(kernel_napi ALL DEPENDS ${REACTOS_BINARY_DIR}/ntoskrnl/include/internal/napi.h)
165 add_custom_target(subsystem_napi ALL DEPENDS ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/include/napi.h)
166 add_custom_target(kernel_zw ALL DEPENDS ${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S)
168 file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/include/reactos)
171 OUTPUT ${REACTOS_BINARY_DIR}/include/reactos/buildno.h
172 COMMAND native-buildno ${REACTOS_BINARY_DIR}/include/reactos/buildno.h
173 DEPENDS ${REACTOS_SOURCE_DIR}/include/reactos/version.h)
175 add_custom_target(buildno_header ALL DEPENDS ${REACTOS_BINARY_DIR}/include/reactos/buildno.h)
177 file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/dib)
179 list(APPEND OUTPUT_FILES
180 ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/dib/dib8gen.c
181 ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/dib/dib16gen.c
182 ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/dib/dib32gen.c)
185 OUTPUT ${OUTPUT_FILES}
186 COMMAND native-gendib ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/dib
187 DEPENDS native-gendib)
189 add_custom_target(gendib_generated ALL DEPENDS ${OUTPUT_FILES})
192 include(ros_cd.cmake)