-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
45 lines (34 loc) · 1.31 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
cmake_minimum_required(VERSION 3.16)
project(HomingAsteroids)
set(CMAKE_CXX_STANDARD 17)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/sdl2)
file(GLOB SOURCE_EXE_TOP
${PROJECT_SOURCE_DIR}/*.cpp
${PROJECT_SOURCE_DIR}/*.c)
file(GLOB_RECURSE SOURCE_EXE_NESTED
${PROJECT_SOURCE_DIR}/src/*.cpp
${PROJECT_SOURCE_DIR}/src/*.c)
if (WIN32)
if (MSVC)
set(SDL2_PATH "D:/SDL2-2.0.12MSVC/")
set(SDL2_IMAGE_PATH "D:/SDL2Image2.0.5MSVC/")
endif ()
if (MINGW)
if(CMAKE_SIZEOF_VOID_P EQUAL 4)
set(SDL2_PATH "D:/SDL2-2.0.10/i686-w64-mingw32/")
set(SDL2_IMAGE_PATH "D:/SDL2_image-2.0.5/i686-w64-mingw32/")
endif()
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
set(SDL2_PATH "D:/SDL2-2.0.10/x86_64-w64-mingw32/")
set(SDL2_IMAGE_PATH "D:/SDL2_image-2.0.5/x86_64-w64-mingw32/")
endif()
endif ()
endif()
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
#find_package(SDL2_gfx REQUIRED)
include_directories(${PROJECT_SOURCE_DIR}/include)
include_directories(${SDL2_INCLUDE_DIRS} ${SDL2_IMAGE_INCLUDE_DIRS})
set(SOURCE_EXE ${SOURCE_EXE_TOP} ${SOURCE_EXE_NESTED})
add_executable(HomingAsteroids ${SOURCE_EXE})
target_link_libraries(HomingAsteroids ${SDL2_LIBRARIES} ${SDL2_IMAGE_LIBRARIES})