[CMAKE]
[reactos.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.8)
2 project(REACTOS)
3
4 add_definitions(-D__REACTOS__)
5
6 if(NOT CMAKE_CROSSCOMPILING)
7
8 add_definitions(-DTARGET_i386)
9 add_definitions(-fshort-wchar)
10
11 include_directories(${REACTOS_SOURCE_DIR}/tools/unicode)
12 include_directories(./include)
13 include_directories(./include/reactos)
14 include_directories(./include/reactos/wine)
15
16 add_subdirectory(tools)
17 add_subdirectory(lib)
18
19 export(TARGETS widl wmc FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
20
21 else()
22
23 # Activate support for asm source files
24 enable_language(ASM)
25
26 set(IMPORT_EXECUTABLES "${REACTOS_SOURCE_DIR}/build/ImportExecutables.cmake" CACHE FILEPATH "Host executables")
27 include(${IMPORT_EXECUTABLES})
28
29 # Debug Options
30 add_definitions(-DDBG=1 -D_SEH_ENABLE_TRACE -DKDBG=1)
31
32 # Version Options
33 add_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502 -D_WIN32_WINDOWS=0x502 -D_SETUPAPI_VER=0x502)
34
35 # Arch Options
36 add_definitions(-D_M_IX86 -D_X86_ -D__i386__)
37
38 # Other
39 add_definitions(-DUSE_COMPILER_EXCEPTIONS)
40 add_definitions(-D_USE_32BIT_TIME_T)
41
42 # Compiler Core
43 add_definitions(-gstabs+ -pipe -fms-extensions -fno-set-stack-executable)
44
45 # Tuning
46 add_definitions(-march=pentium -mtune=i686)
47
48 # Warnings
49 add_definitions(-Wall -Wno-char-subscripts -Wpointer-arith -Wno-multichar -Wno-error=uninitialized -Wno-unused-value)
50
51 # Optimizations
52 add_definitions(-Os -fno-strict-aliasing -ftracer -momit-leaf-frame-pointer -mpreferred-stack-boundary=2 -fno-optimize-sibling-calls)
53
54 include_directories(./include)
55 include_directories(./include/psdk)
56 include_directories(./include/dxsdk)
57 include_directories(${REACTOS_BINARY_DIR}/include/dxsdk)
58 include_directories(${REACTOS_BINARY_DIR}/include/psdk)
59 include_directories(${REACTOS_BINARY_DIR}/include/reactos)
60 include_directories(./include/crt)
61 include_directories(./include/crt/mingw32)
62 include_directories(./include/ddk)
63 include_directories(./include/ndk)
64 include_directories(./include/reactos)
65 include_directories(./include/reactos/libs)
66
67 add_subdirectory(include/psdk)
68 add_subdirectory(include/dxsdk)
69 add_subdirectory(include/reactos/mc)
70
71 add_subdirectory(lib)
72
73 endif()
74