Debian Codegraph @

CMakeLists.txt

raw
1 cmake_minimum_required(VERSION 3.7)
2
3 project(pt2-clone)
4
5 find_package(SDL2 REQUIRED)
6 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${pt2-clone_SOURCE_DIR}/release/other/")
7
8 if((CMAKE_CXX_COMPILER_ID MATCHES "Clang") OR (CMAKE_CXX_COMPILER_ID MATCHES "GNU"))
9 add_compile_options(-O3)
10 add_compile_options(-ffast-math)
11 endif()
12
13 file(GLOB pt2-clone_SRC
14 "${pt2-clone_SOURCE_DIR}/src/*.c"
15 "${pt2-clone_SOURCE_DIR}/src/modloaders/*.c"
16 "${pt2-clone_SOURCE_DIR}/src/smploaders/*.c"
17 "${pt2-clone_SOURCE_DIR}/src/gfx/*.c"
18 )
19
20 add_executable(pt2-clone ${pt2-clone_SRC})
21
22 target_include_directories(pt2-clone SYSTEM
23 PRIVATE ${SDL2_INCLUDE_DIRS})
24
25 if("${SDL2_LIBRARIES}" STREQUAL "")
26 message(WARNING "SDL2_LIBRARIES wasn't set, manually setting to SDL2::SDL2")
27 set(SDL2_LIBRARIES "SDL2::SDL2")
28 endif()
29
30 target_link_libraries(pt2-clone
31 PRIVATE m ${SDL2_LIBRARIES})
32
33 install(TARGETS pt2-clone
34 RUNTIME DESTINATION bin)