-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
29 lines (27 loc) · 1.07 KB
/
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
28
29
cmake_minimum_required(VERSION 3.6)
project(libgral)
if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
add_library(gral gral_windows.cpp)
target_link_libraries(gral d2d1 dwrite mfplat mfuuid winmm)
target_compile_definitions(gral PUBLIC GRAL_WINDOWS)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
find_library(COCOA Cocoa)
find_library(CARBON Carbon)
find_library(AUDIO_TOOLBOX AudioToolbox)
find_library(CORE_MIDI CoreMIDI)
add_library(gral gral_macos.m)
target_link_libraries(gral ${COCOA} ${CARBON} ${AUDIO_TOOLBOX} ${CORE_MIDI})
target_compile_definitions(gral PUBLIC GRAL_MACOS)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK REQUIRED IMPORTED_TARGET gtk+-3.0>=3.20)
pkg_check_modules(ALSA REQUIRED IMPORTED_TARGET alsa)
add_library(gral gral_linux.c)
target_link_libraries(gral PkgConfig::GTK PkgConfig::ALSA m)
target_compile_definitions(gral PUBLIC GRAL_LINUX)
endif()
target_include_directories(gral PUBLIC ${PROJECT_SOURCE_DIR})
option(BUILD_DEMOS "build the demo applications")
if(BUILD_DEMOS)
add_subdirectory(demos)
endif()