-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
28 lines (23 loc) · 891 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
cmake_minimum_required(VERSION 3.10.0)
project(ezy)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
file(GLOB_RECURSE SOURCES "src/*.c")
if (UNIX AND NOT APPLE)
FIND_LIBRARY(OPENGL_LIB OpenGL)
FIND_LIBRARY(XLL_LIB X11)
FIND_LIBRARY(XLI_LIB Xi)
FIND_LIBRARY(XCURSOR_LIB Xcursor)
FIND_LIBRARY(MATH_LIB m)
FIND_LIBRARY(ALSA_LIB asound)
FIND_LIBRARY(THREAD_LIB pthread)
SET(EXTRA_LIBS ${COCOA_LIB} ${OPENGL_LIB} ${XLL_LIB} ${XLI_LIB} ${XCURSOR_LIB} ${CMAKE_DL_LIBS} ${MATH_LIB} ${ALSA_LIB} ${THREAD_LIB})
elseif(UNIX AND APPLE)
list(APPEND SOURCES "src/core/libs.m")
FIND_LIBRARY(COCOA_LIBRARY Cocoa)
FIND_LIBRARY(OPENGL_LIBRARY OpenGL)
FIND_LIBRARY(AUDIO_LIBRARY AudioToolbox)
SET(EXTRA_LIBS ${COCOA_LIBRARY} ${OPENGL_LIBRARY} ${AUDIO_LIBRARY})
endif()
add_executable(ezy ${SOURCES})
set_property(TARGET ezy PROPERTY C_STANDARD 99)
target_link_libraries(ezy ${EXTRA_LIBS})