2022-10-06 18:53:51 +11:00
|
|
|
cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
|
2022-10-06 18:57:58 +11:00
|
|
|
project(padlab C)
|
2022-10-06 19:09:03 +11:00
|
|
|
set(CMAKE_C_STANDARD 99)
|
2022-10-06 18:57:58 +11:00
|
|
|
set(TARGET padlab)
|
2022-11-16 04:46:33 +11:00
|
|
|
|
|
|
|
find_package(SDL2 REQUIRED)
|
|
|
|
find_package(OpenGL)
|
|
|
|
|
2022-10-06 18:53:51 +11:00
|
|
|
set(SOURCES
|
2022-11-16 01:45:25 +11:00
|
|
|
maths.h
|
2022-11-16 04:46:33 +11:00
|
|
|
draw.h
|
2022-11-16 01:42:47 +11:00
|
|
|
stick.c stick.h
|
2022-10-06 18:53:51 +11:00
|
|
|
analogue.c)
|
|
|
|
|
2022-11-16 04:46:33 +11:00
|
|
|
if (OPENGL_FOUND)
|
|
|
|
list(APPEND SOURCES draw_opengl.c)
|
|
|
|
else()
|
|
|
|
list(APPEND SOURCES draw.c)
|
|
|
|
endif()
|
2020-02-23 12:01:51 +11:00
|
|
|
|
2022-10-06 18:53:51 +11:00
|
|
|
add_executable(${TARGET} ${SOURCES})
|
|
|
|
target_link_libraries(${TARGET} SDL2::SDL2 m)
|
2022-11-16 04:46:33 +11:00
|
|
|
if (OPENGL_FOUND)
|
|
|
|
target_link_libraries(${TARGET} OpenGL::GL)
|
|
|
|
endif()
|
2022-10-06 18:53:51 +11:00
|
|
|
target_compile_options(${TARGET} PRIVATE
|
|
|
|
-Wall -Wextra -pedantic -Wno-unused-parameter)
|