2019-10-20 10:47:16 +00:00
|
|
|
set(SRCS
|
|
|
|
include/nfd.h
|
|
|
|
src/common.h
|
|
|
|
src/nfd_common.c
|
|
|
|
src/nfd_common.h
|
|
|
|
)
|
|
|
|
|
|
|
|
add_library(nativefiledialog ${SRCS})
|
|
|
|
target_include_directories(nativefiledialog PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/include" "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
|
|
|
target_include_directories(nativefiledialog INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
target_sources(nativefiledialog PRIVATE src/nfd_win.cpp)
|
|
|
|
elseif(APPLE)
|
2020-02-14 13:58:10 +00:00
|
|
|
target_sources(nativefiledialog PRIVATE src/nfd_cocoa.m)
|
2019-10-20 10:47:16 +00:00
|
|
|
else()
|
2020-12-29 14:06:41 +00:00
|
|
|
FIND_PACKAGE(PkgConfig REQUIRED)
|
|
|
|
PKG_CHECK_MODULES(GTK3 REQUIRED gtk+-3.0)
|
|
|
|
if(GTK3_FOUND)
|
2019-10-20 10:47:16 +00:00
|
|
|
message("Using GTK for nativefiledialog")
|
|
|
|
target_sources(nativefiledialog PRIVATE src/nfd_gtk.c)
|
2020-12-29 14:06:41 +00:00
|
|
|
target_include_directories(nativefiledialog PRIVATE ${GTK3_INCLUDE_DIRS})
|
|
|
|
target_link_libraries(nativefiledialog PRIVATE ${GTK3_LIBRARIES})
|
2019-10-20 10:47:16 +00:00
|
|
|
else()
|
|
|
|
message(WARNING "Unknown platform for nativefiledialog")
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|