2017-11-21 23:24:51 -06:00
|
|
|
cmake_minimum_required(VERSION 3.9)
|
|
|
|
|
2017-12-06 16:07:36 -06:00
|
|
|
project(erc-test)
|
2017-11-21 23:24:51 -06:00
|
|
|
|
2017-12-02 13:05:53 -06:00
|
|
|
set(CMAKE_BUILD_TYPE Debug)
|
|
|
|
|
2017-12-18 14:26:53 -06:00
|
|
|
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --analyze")
|
|
|
|
|
|
|
|
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)
|
|
|
|
set(opengl_library /System/Library/Frameworks/OpenGL.framework)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT opengl_library)
|
|
|
|
message(FATAL_ERROR "This CMake file is not yet educated as to where OpenGL resides on your platform. Sorry!")
|
|
|
|
endif()
|
|
|
|
|
2017-11-21 23:24:51 -06:00
|
|
|
include_directories(../include /usr/local/include)
|
|
|
|
|
|
|
|
link_directories(/usr/local/lib)
|
|
|
|
|
|
|
|
include(../sources.cmake)
|
|
|
|
|
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)
|
|
|
|
|
2017-12-02 13:05:53 -06:00
|
|
|
# test_sources should also include the main source file, so we don't need to
|
|
|
|
# make any particular effort to include it in add_executable().
|
|
|
|
file(GLOB test_sources "*.c")
|
|
|
|
|
2017-12-06 16:07:36 -06:00
|
|
|
add_executable(erc-test ${sources} ${test_sources})
|
2017-11-21 23:24:51 -06:00
|
|
|
|
2017-12-02 13:05:53 -06:00
|
|
|
# Our unit-testing library
|
2017-12-06 16:07:36 -06:00
|
|
|
target_link_libraries(erc-test criterion)
|
2017-12-16 22:45:39 -06:00
|
|
|
|
|
|
|
# Graphics
|
2017-12-17 20:20:11 -06:00
|
|
|
target_link_libraries(erc-test)
|