1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-10-31 13:07:14 +00:00
erc-c/tests/CMakeLists.txt

37 lines
902 B
CMake
Raw Normal View History

2017-11-22 05:24:51 +00:00
cmake_minimum_required(VERSION 3.9)
2017-12-06 22:07:36 +00:00
project(erc-test)
2017-11-22 05:24:51 +00:00
2017-12-02 19:05:53 +00:00
set(CMAKE_BUILD_TYPE Debug)
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-22 05:24:51 +00:00
include_directories(../include /usr/local/include)
link_directories(/usr/local/lib)
include(../sources.cmake)
2017-12-06 22:07:36 +00:00
foreach(src ${erc_sources})
2017-11-22 05:24:51 +00:00
string(CONCAT relsrc ../src/ ${src})
list(APPEND sources ${relsrc})
endforeach(src)
2017-12-02 19:05:53 +00: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 22:07:36 +00:00
add_executable(erc-test ${sources} ${test_sources})
2017-11-22 05:24:51 +00:00
2017-12-02 19:05:53 +00:00
# Our unit-testing library
2017-12-06 22:07:36 +00:00
target_link_libraries(erc-test criterion)
# Graphics
target_link_libraries(erc-test ${opengl_library} glfw)