forked from DPriceDev/Megadrive-Maze
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
46 lines (36 loc) · 1.55 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
cmake_minimum_required(VERSION 3.10)
project(Megadrive-Maze)
set(HEADER_FILES
${CMAKE_CURRENT_SOURCE_DIR}/inc
${CMAKE_CURRENT_SOURCE_DIR}/res
${CMAKE_CURRENT_SOURCE_DIR}/depends/sgdk
${CMAKE_CURRENT_SOURCE_DIR}/depends/sgdk/inc
${CMAKE_CURRENT_SOURCE_DIR}/depends/sgdk/res)
set(SRC
${CMAKE_CURRENT_SOURCE_DIR}/src/main.c
${CMAKE_CURRENT_SOURCE_DIR}/src/level_one.c
${CMAKE_CURRENT_SOURCE_DIR}/src/joystick_handler.c
${CMAKE_CURRENT_SOURCE_DIR}/src/boot/rom_head.c
${CMAKE_CURRENT_SOURCE_DIR}/src/character.c
${CMAKE_CURRENT_SOURCE_DIR}/src/camera.c
${CMAKE_CURRENT_SOURCE_DIR}/src/world.c)
IF(CMAKE_BUILD_TYPE MATCHES Debug)
set(type debug)
ELSE()
set(type clean release)
ENDIF()
set(GDK ${CMAKE_CURRENT_SOURCE_DIR}/depends/sgdk)
set(GDK_WIN ${CMAKE_CURRENT_SOURCE_DIR}\\depends\\sgdk)
set(SGDK_COMPILE_COMMAND
${CMAKE_CURRENT_SOURCE_DIR}/depends/sgdk/bin/make.exe GDK=${GDK} GDK_WIN=${GDK_WIN}
-f ${CMAKE_CURRENT_SOURCE_DIR}/depends/sgdk/makelib.gen ${type})
set(PROJECT_COMPILE_COMMAND
${CMAKE_CURRENT_SOURCE_DIR}/depends/sgdk/bin/make.exe GDK=${GDK} GDK_WIN=${GDK_WIN}
-f ${CMAKE_CURRENT_SOURCE_DIR}/depends/sgdk/makefile.gen ${type})
add_custom_target(megadrive-maze ALL ${SGDK_COMPILE_COMMAND}
COMMAND ${PROJECT_COMPILE_COMMAND}
DEPENDS ${HEADER_FILES}
SOURCES ${SRC}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
add_executable(dummy ${SRC})
target_include_directories(dummy PUBLIC ${HEADER_FILES})