2010-07-25 05:53:51 +00:00
|
|
|
cmake_minimum_required(VERSION 2.8)
|
|
|
|
project(REACTOS)
|
|
|
|
|
2010-09-19 20:06:02 +00:00
|
|
|
# Compile options
|
|
|
|
include(config.cmake)
|
|
|
|
|
|
|
|
# Compiler specific definitions and macros
|
|
|
|
if(MSVC)
|
|
|
|
include(msc.cmake)
|
|
|
|
else()
|
|
|
|
include(gcc.cmake)
|
|
|
|
endif(MSVC)
|
|
|
|
|
|
|
|
# Generic macros
|
2010-08-04 06:41:07 +00:00
|
|
|
include(CMakeMacros.cmake)
|
|
|
|
|
2010-08-03 21:12:51 +00:00
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
|
|
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
|
2010-08-04 14:42:05 +00:00
|
|
|
set(CMAKE_SHARED_LIBRARY_PREFIX "")
|
2010-08-03 21:12:51 +00:00
|
|
|
|
2010-08-13 13:54:13 +00:00
|
|
|
set(CMAKE_SKIP_PREPROCESSED_SOURCE_RULES TRUE)
|
|
|
|
set(CMAKE_SKIP_ASSEMBLY_SOURCE_RULES TRUE)
|
2010-08-30 14:31:44 +00:00
|
|
|
|
2010-10-09 10:10:39 +00:00
|
|
|
set_property(GLOBAL PROPERTY RULE_MESSAGES OFF)
|
|
|
|
|
2010-07-25 05:53:51 +00:00
|
|
|
add_definitions(-D__REACTOS__)
|
|
|
|
|
|
|
|
if(NOT CMAKE_CROSSCOMPILING)
|
|
|
|
|
2010-07-25 19:18:15 +00:00
|
|
|
add_definitions(-DTARGET_i386)
|
|
|
|
|
|
|
|
include_directories(${REACTOS_SOURCE_DIR}/tools/unicode)
|
2010-08-13 13:54:13 +00:00
|
|
|
include_directories(include)
|
2010-09-19 00:15:45 +00:00
|
|
|
include_directories(include/host)
|
2010-08-13 13:54:13 +00:00
|
|
|
include_directories(include/reactos)
|
|
|
|
include_directories(include/reactos/wine)
|
2010-08-31 13:25:10 +00:00
|
|
|
include_directories(${REACTOS_BINARY_DIR}/include)
|
2010-07-25 19:18:15 +00:00
|
|
|
|
2010-07-25 05:53:51 +00:00
|
|
|
add_subdirectory(tools)
|
2010-07-25 23:54:32 +00:00
|
|
|
add_subdirectory(lib)
|
2010-07-25 20:04:16 +00:00
|
|
|
|
2010-09-19 20:06:02 +00:00
|
|
|
if(NOT MSVC)
|
2010-10-22 13:15:58 +00:00
|
|
|
export(TARGETS widl winebuild nci buildno gendib cdmake mkhive FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
|
2010-07-25 05:53:51 +00:00
|
|
|
else()
|
2010-10-22 13:15:58 +00:00
|
|
|
export(TARGETS winebuild nci buildno gendib cdmake mkhive FILE ${CMAKE_BINARY_DIR}/ImportExecutables.cmake NAMESPACE native- )
|
2010-09-19 20:06:02 +00:00
|
|
|
endif()
|
2010-07-25 05:53:51 +00:00
|
|
|
|
2010-09-19 00:15:45 +00:00
|
|
|
else()
|
2010-09-17 20:27:01 +00:00
|
|
|
|
2010-08-03 14:53:12 +00:00
|
|
|
# Activate support for assembly source files
|
2010-07-27 23:55:52 +00:00
|
|
|
enable_language(ASM)
|
|
|
|
|
2010-08-03 14:53:12 +00:00
|
|
|
# Activate language support for resource files
|
|
|
|
enable_language(RC)
|
|
|
|
|
2010-07-25 20:04:16 +00:00
|
|
|
set(IMPORT_EXECUTABLES "${REACTOS_SOURCE_DIR}/build/ImportExecutables.cmake" CACHE FILEPATH "Host executables")
|
|
|
|
include(${IMPORT_EXECUTABLES})
|
|
|
|
|
2010-08-30 14:31:44 +00:00
|
|
|
add_definitions(-DDBG=${DBG} -DKDBG=${KDBG})
|
|
|
|
|
2010-10-09 16:25:03 +00:00
|
|
|
if(DBG)
|
2010-08-30 14:31:44 +00:00
|
|
|
add_definitions(-D_SEH_ENABLE_TRACE)
|
2010-10-09 16:25:03 +00:00
|
|
|
endif(DBG)
|
2010-08-30 14:31:44 +00:00
|
|
|
|
2010-10-09 16:25:03 +00:00
|
|
|
if(DBG OR KDBG)
|
2010-08-30 14:31:44 +00:00
|
|
|
set(DBG_OR_KDBG true)
|
2010-10-09 16:25:03 +00:00
|
|
|
endif(DBG OR KDBG)
|
2010-07-25 22:16:45 +00:00
|
|
|
|
|
|
|
# Version Options
|
|
|
|
add_definitions(-DWINVER=0x502 -D_WIN32_IE=0x600 -D_WIN32_WINNT=0x502 -D_WIN32_WINDOWS=0x502 -D_SETUPAPI_VER=0x502)
|
|
|
|
|
|
|
|
# Arch Options
|
|
|
|
add_definitions(-D_M_IX86 -D_X86_ -D__i386__)
|
|
|
|
|
|
|
|
# Other
|
2010-07-25 19:18:15 +00:00
|
|
|
add_definitions(-DUSE_COMPILER_EXCEPTIONS)
|
|
|
|
add_definitions(-D_USE_32BIT_TIME_T)
|
|
|
|
|
2010-08-04 06:41:07 +00:00
|
|
|
include_directories(include)
|
|
|
|
include_directories(include/psdk)
|
|
|
|
include_directories(include/dxsdk)
|
2010-08-30 14:31:44 +00:00
|
|
|
include_directories(${REACTOS_BINARY_DIR}/include)
|
2010-07-27 00:48:07 +00:00
|
|
|
include_directories(${REACTOS_BINARY_DIR}/include/dxsdk)
|
2010-07-25 20:04:16 +00:00
|
|
|
include_directories(${REACTOS_BINARY_DIR}/include/psdk)
|
2010-07-25 23:05:32 +00:00
|
|
|
include_directories(${REACTOS_BINARY_DIR}/include/reactos)
|
2010-08-04 06:41:07 +00:00
|
|
|
include_directories(include/crt)
|
2010-09-19 00:15:45 +00:00
|
|
|
if(MSVC)
|
|
|
|
include_directories(include/crt/msc)
|
|
|
|
else()
|
2010-08-04 06:41:07 +00:00
|
|
|
include_directories(include/crt/mingw32)
|
2010-09-19 00:15:45 +00:00
|
|
|
endif(MSVC)
|
2010-08-04 06:41:07 +00:00
|
|
|
include_directories(include/ddk)
|
|
|
|
include_directories(include/ndk)
|
|
|
|
include_directories(include/reactos)
|
|
|
|
include_directories(include/reactos/libs)
|
2010-07-25 05:53:51 +00:00
|
|
|
|
2010-07-25 20:04:16 +00:00
|
|
|
add_subdirectory(include/psdk)
|
2010-07-27 00:48:07 +00:00
|
|
|
add_subdirectory(include/dxsdk)
|
2010-08-03 21:51:59 +00:00
|
|
|
add_subdirectory(include/reactos/idl)
|
2010-10-22 13:15:58 +00:00
|
|
|
add_subdirectory(include/reactos/wine)
|
2010-07-25 23:05:32 +00:00
|
|
|
add_subdirectory(include/reactos/mc)
|
2010-07-25 20:04:16 +00:00
|
|
|
|
2010-10-09 13:54:36 +00:00
|
|
|
#minicd target
|
|
|
|
set(BOOTCD_DIR "${REACTOS_BINARY_DIR}/boot/bootcd")
|
|
|
|
|
|
|
|
file(MAKE_DIRECTORY "${BOOTCD_DIR}")
|
|
|
|
file(MAKE_DIRECTORY "${BOOTCD_DIR}/loader")
|
|
|
|
file(MAKE_DIRECTORY "${BOOTCD_DIR}/reactos")
|
|
|
|
file(MAKE_DIRECTORY "${BOOTCD_DIR}/reactos/system32")
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${REACTOS_BINARY_DIR}/minicd.iso
|
|
|
|
COMMAND native-cdmake -v -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/boot/freeldr/bootsect/isoboot.bin ${BOOTCD_DIR} REACTOS ${REACTOS_BINARY_DIR}/minicd.iso
|
|
|
|
DEPENDS native-cdmake)
|
|
|
|
add_custom_target(minicd DEPENDS ${REACTOS_BINARY_DIR}/minicd.iso)
|
|
|
|
add_minicd(${REACTOS_SOURCE_DIR}/boot/bootdata/bootcd.ini "" freeldr.ini)
|
|
|
|
|
2010-10-22 13:15:58 +00:00
|
|
|
#livecd target
|
|
|
|
set(LIVECD_DIR "${REACTOS_BINARY_DIR}/boot/livecd")
|
|
|
|
|
|
|
|
file(MAKE_DIRECTORY "${LIVECD_DIR}")
|
|
|
|
file(MAKE_DIRECTORY "${LIVECD_DIR}/loader")
|
2010-10-23 10:38:48 +00:00
|
|
|
file(MAKE_DIRECTORY "${LIVECD_DIR}/Profiles")
|
|
|
|
file(MAKE_DIRECTORY "${LIVECD_DIR}/Profiles/All Users")
|
|
|
|
file(MAKE_DIRECTORY "${LIVECD_DIR}/Profiles/All Users/Desktop")
|
|
|
|
file(MAKE_DIRECTORY "${LIVECD_DIR}/Profiles/Default User")
|
|
|
|
file(MAKE_DIRECTORY "${LIVECD_DIR}/Profiles/Default User/Desktop")
|
|
|
|
file(MAKE_DIRECTORY "${LIVECD_DIR}/Profiles/Default User/My Documents")
|
2010-10-22 13:15:58 +00:00
|
|
|
file(MAKE_DIRECTORY "${LIVECD_DIR}/reactos")
|
|
|
|
file(MAKE_DIRECTORY "${LIVECD_DIR}/reactos/fonts")
|
|
|
|
file(MAKE_DIRECTORY "${LIVECD_DIR}/reactos/system32")
|
|
|
|
file(MAKE_DIRECTORY "${LIVECD_DIR}/reactos/system32/config")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${REACTOS_BINARY_DIR}/livecd.iso
|
|
|
|
COMMAND native-cdmake -v -j -m -b ${CMAKE_CURRENT_BINARY_DIR}/boot/freeldr/bootsect/isoboot.bin ${LIVECD_DIR} REACTOS ${REACTOS_BINARY_DIR}/livecd.iso
|
|
|
|
DEPENDS native-cdmake)
|
|
|
|
add_custom_target(livecd DEPENDS ${REACTOS_BINARY_DIR}/livecd.iso)
|
|
|
|
add_livecd(${REACTOS_SOURCE_DIR}/boot/bootdata/livecd.ini "" freeldr.ini)
|
|
|
|
|
2010-07-29 16:45:01 +00:00
|
|
|
add_subdirectory(base)
|
2010-08-31 18:40:19 +00:00
|
|
|
add_subdirectory(boot)
|
2010-07-28 23:21:13 +00:00
|
|
|
add_subdirectory(dll)
|
2010-08-31 10:34:15 +00:00
|
|
|
add_subdirectory(drivers)
|
2010-08-29 17:30:24 +00:00
|
|
|
add_subdirectory(hal)
|
2010-07-25 05:53:51 +00:00
|
|
|
add_subdirectory(lib)
|
2010-10-09 13:54:36 +00:00
|
|
|
add_subdirectory(media)
|
2010-08-30 14:31:44 +00:00
|
|
|
add_subdirectory(ntoskrnl)
|
2010-09-03 00:03:00 +00:00
|
|
|
add_subdirectory(subsystems)
|
2010-07-25 05:53:51 +00:00
|
|
|
|
2010-07-28 10:13:27 +00:00
|
|
|
# nci generated intermediate files
|
|
|
|
|
2010-09-04 16:59:33 +00:00
|
|
|
list(APPEND nci_output
|
2010-09-03 00:03:00 +00:00
|
|
|
${REACTOS_BINARY_DIR}/ntoskrnl/include/internal/napi.h
|
|
|
|
${REACTOS_BINARY_DIR}/subsystems/win32/win32k/include/napi.h
|
|
|
|
${REACTOS_BINARY_DIR}/lib/ntdllsys/ntdll.S
|
|
|
|
${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S
|
|
|
|
${REACTOS_BINARY_DIR}/lib/win32ksys/win32k.S
|
|
|
|
${REACTOS_BINARY_DIR}/dll/ntdll/def/ntsys.pspec)
|
|
|
|
|
2010-09-04 16:59:33 +00:00
|
|
|
list(APPEND nci_folders
|
2010-09-03 00:03:00 +00:00
|
|
|
${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)
|
2010-07-28 10:13:27 +00:00
|
|
|
|
2010-07-28 12:58:37 +00:00
|
|
|
file(MAKE_DIRECTORY ${nci_folders})
|
2010-07-28 10:13:27 +00:00
|
|
|
|
2010-09-03 00:03:00 +00:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${nci_output}
|
|
|
|
COMMAND native-nci -arch ${ARCH} ${REACTOS_SOURCE_DIR}/ntoskrnl/sysfuncs.lst ${REACTOS_SOURCE_DIR}/subsystems/win32/win32k/w32ksvc.db ${nci_output}
|
|
|
|
DEPENDS native-nci ${nci_folders})
|
2010-07-28 10:13:27 +00:00
|
|
|
|
2010-09-04 16:12:21 +00:00
|
|
|
set_source_files_properties(${nci_output} PROPERTIES GENERATED TRUE)
|
|
|
|
|
2010-09-03 00:03:00 +00:00
|
|
|
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)
|
|
|
|
add_custom_target(ntsys_pspec ALL DEPENDS ${REACTOS_BINARY_DIR}/dll/ntdll/def/ntsys.pspec)
|
|
|
|
add_custom_target(kernel_napi ALL DEPENDS ${REACTOS_BINARY_DIR}/ntoskrnl/include/internal/napi.h)
|
|
|
|
add_custom_target(subsystem_napi ALL DEPENDS ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/include/napi.h)
|
|
|
|
add_custom_target(kernel_zw ALL DEPENDS ${REACTOS_BINARY_DIR}/ntoskrnl/ex/zw.S)
|
2010-07-28 10:13:27 +00:00
|
|
|
|
2010-08-31 13:25:10 +00:00
|
|
|
file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/include/reactos)
|
|
|
|
|
2010-09-03 00:03:00 +00:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${REACTOS_BINARY_DIR}/include/reactos/buildno.h
|
|
|
|
COMMAND native-buildno ${REACTOS_BINARY_DIR}/include/reactos/buildno.h
|
|
|
|
DEPENDS ${REACTOS_SOURCE_DIR}/include/reactos/version.h)
|
|
|
|
|
|
|
|
add_custom_target(buildno_header ALL DEPENDS ${REACTOS_BINARY_DIR}/include/reactos/buildno.h)
|
|
|
|
|
|
|
|
file(MAKE_DIRECTORY ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/dib)
|
2010-07-27 23:55:52 +00:00
|
|
|
|
2010-09-03 00:03:00 +00:00
|
|
|
list(APPEND OUTPUT_FILES
|
|
|
|
${REACTOS_BINARY_DIR}/subsystems/win32/win32k/dib/dib8gen.c
|
|
|
|
${REACTOS_BINARY_DIR}/subsystems/win32/win32k/dib/dib16gen.c
|
|
|
|
${REACTOS_BINARY_DIR}/subsystems/win32/win32k/dib/dib32gen.c)
|
|
|
|
|
|
|
|
add_custom_command(
|
|
|
|
OUTPUT ${OUTPUT_FILES}
|
|
|
|
COMMAND native-gendib ${REACTOS_BINARY_DIR}/subsystems/win32/win32k/dib
|
|
|
|
DEPENDS native-gendib)
|
|
|
|
|
|
|
|
add_custom_target(gendib_generated ALL DEPENDS ${OUTPUT_FILES})
|
|
|
|
|
|
|
|
endif()
|
2010-09-19 20:06:02 +00:00
|
|
|
|