85f1b72d8d85f5e504e7a0f2972a2f1b6bdc259a
[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 set(IMPORT_EXECUTABLES "${REACTOS_SOURCE_DIR}/build/ImportExecutables.cmake" CACHE FILEPATH "Host executables")
24 include(${IMPORT_EXECUTABLES})
25
26 # Debug Options
27 add_definitions(-DDBG=1 -D_SEH_ENABLE_TRACE -DKDBG=1)
28
29 # Version Options
30 add_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502 -D_WIN32_WINDOWS=0x502 -D_SETUPAPI_VER=0x502)
31
32 # Arch Options
33 add_definitions(-D_M_IX86 -D_X86_ -D__i386__)
34
35 # Other
36 add_definitions(-DUSE_COMPILER_EXCEPTIONS)
37 add_definitions(-D_USE_32BIT_TIME_T)
38
39 # Compiler Core
40 add_definitions(-gstabs+ -pipe -fms-extensions -fno-set-stack-executable)
41
42 # Tuning
43 add_definitions(-march=pentium -mtune=i686)
44
45 # Warnings
46 add_definitions(-Wall -Wno-char-subscripts -Wpointer-arith -Wno-multichar -Wno-error=uninitialized -Wno-unused-value)
47
48 # Optimizations
49 add_definitions(-Os -fno-strict-aliasing -ftracer -momit-leaf-frame-pointer -mpreferred-stack-boundary=2 -fno-optimize-sibling-calls)
50
51 include_directories(./include)
52 include_directories(./include/psdk)
53 include_directories(${REACTOS_BINARY_DIR}/include/psdk)
54 include_directories(${REACTOS_BINARY_DIR}/include/reactos)
55 include_directories(./include/crt)
56 include_directories(./include/crt/mingw32)
57 include_directories(./include/ddk)
58 include_directories(./include/ndk)
59 include_directories(./include/reactos)
60 include_directories(./include/reactos/libs)
61
62 add_subdirectory(include/psdk)
63 add_subdirectory(include/reactos/mc)
64
65 add_subdirectory(lib)
66
67 endif()