]> git.lizzy.rs Git - nothing.git/blob - CMakeLists.txt
5779f3540f0a610d7c6c6d5ee886417c741de3b6
[nothing.git] / CMakeLists.txt
1 cmake_minimum_required(VERSION 3.2)
2 project(nothing)
3
4 if(WIN32)
5   # Conan integration
6   include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
7   conan_basic_setup()
8 endif()
9
10 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH})
11
12 find_package(SDL2 REQUIRED)
13
14 include_directories(${SDL2_INCLUDE_DIR})
15
16 set(SOURCE_FILES
17   src/main.c
18   src/player.c
19   src/platforms.c
20   src/rect.c
21   src/point.c
22   src/camera.c
23 )
24
25 set(HEADER_FILES
26   src/player.h
27   src/platforms.h
28   src/rect.h
29   src/point.h
30   src/camera.h
31 )
32
33 add_executable(nothing ${SOURCE_FILES} ${HEADER_FILES})
34 target_link_libraries(nothing ${SDL2_LIBRARY})
35
36 if(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "CLANG"))
37   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -Wextra -pedantic -Wconversion -std=c11")
38   target_link_libraries(nothing m)
39 endif()
40 if(WIN32)
41   target_link_libraries(nothing Imm32 Version winmm)
42 endif()