2017-11-21 23:24:51 -06:00
|
|
|
cmake_minimum_required(VERSION 3.9)
|
|
|
|
|
|
|
|
# it me
|
2017-12-06 16:07:36 -06:00
|
|
|
project(erc)
|
2017-11-21 23:24:51 -06:00
|
|
|
|
|
|
|
include(sources.cmake)
|
|
|
|
|
2018-01-29 00:30:49 -06:00
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g")
|
|
|
|
|
2017-12-19 01:02:48 -06:00
|
|
|
if(DEFINED ENV{STATIC_ANALYSIS})
|
|
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --analyze")
|
|
|
|
endif()
|
2017-12-18 14:26:53 -06:00
|
|
|
|
|
|
|
if(CMAKE_C_FLAGS MATCHES "--analyze")
|
|
|
|
set(CMAKE_C_LINK_EXECUTABLE "echo 'Will not execute binary when running static analysis'")
|
|
|
|
endif()
|
|
|
|
|
2017-12-16 23:38:59 -06:00
|
|
|
if(APPLE)
|
2017-12-17 23:31:56 -06:00
|
|
|
set(sdl_library /Library/Frameworks/SDL2.framework)
|
|
|
|
set(sdl_headers /Library/Frameworks/SDL2.framework/Headers)
|
2017-12-16 23:38:59 -06:00
|
|
|
endif()
|
|
|
|
|
2017-12-17 23:31:56 -06:00
|
|
|
if(NOT sdl_library)
|
|
|
|
message(FATAL_ERROR "This CMake file is not yet educated as to where SDL2 resides on your platform. Sorry!")
|
2017-12-16 23:38:59 -06:00
|
|
|
endif()
|
|
|
|
|
2017-12-06 16:07:36 -06:00
|
|
|
foreach(src ${erc_sources})
|
2017-11-21 23:24:51 -06:00
|
|
|
string(CONCAT relsrc src/ ${src})
|
|
|
|
list(APPEND sources ${relsrc})
|
|
|
|
endforeach(src)
|
|
|
|
|
|
|
|
# our header files
|
2017-12-17 23:31:56 -06:00
|
|
|
include_directories(include /usr/local/include ${sdl_headers})
|
2017-11-21 23:24:51 -06:00
|
|
|
|
|
|
|
link_directories(/usr/local/lib)
|
|
|
|
|
2017-12-19 21:50:50 -06:00
|
|
|
add_definitions(-DINSTALL_PATH="../")
|
|
|
|
|
2017-11-21 23:24:51 -06:00
|
|
|
# our bullshit
|
2017-12-06 16:07:36 -06:00
|
|
|
add_executable(erc ${sources} src/main.c)
|
2017-12-16 22:45:39 -06:00
|
|
|
|
|
|
|
# Graphics
|
2017-12-17 23:31:56 -06:00
|
|
|
target_link_libraries(erc ${sdl_library})
|