forked from mlabbe/nativefiledialog
-
Notifications
You must be signed in to change notification settings - Fork 5
/
CMakeLists.txt
27 lines (23 loc) · 828 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
include(CheckIncludeFile)
set(SOURCES src/nfd_common.c)
macro(REQUIRE_INCLUDE_FILE path name)
CHECK_INCLUDE_FILE(${path} ${name})
if (NOT ${name})
message(FATAL_ERROR "${path} not found")
endif ()
endmacro()
# add specific implementations
if (WIN32)
REQUIRE_INCLUDE_FILE(windows.h HAS_WINDOWS)
list(APPEND SOURCES src/nfd_win.cpp)
elseif (APPLE)
REQUIRE_INCLUDE_FILE(AppKit/AppKit.h HAS_APPKIT)
list(APPEND SOURCES src/nfd_cocoa.m)
elseif (UNIX)
REQUIRE_INCLUDE_FILE(gtk/gtk.h HAS_GTK)
list(APPEND SOURCES src/nfd_gtk.c)
elseif (UNIX)
message(FATAL_ERROR "Cannot detect your system, please report to https://github.com/aarcangeli/nativefiledialog-cmake/issues")
endif ()
add_library(nativefiledialog ${SOURCES})
target_include_directories(nativefiledialog PUBLIC src/include)