976550ef [nostalgia/sample_project] Add missing type descriptors 1fb0a866 [nostalgia/core] Fix CompactPalette TypeName and TypeVersion eb46aeeb [nfde] Fix compiler warnings on Gtk build 9244b735 [nostalgia] Fix non-Linux non-Apple systems not to build GLFW for Wayland 3fba36b4 [nfde] Make only option BUILD_SHARED_LIBS if not already set 6ddb6b42 Merge commit '5461f6700dac79e9e71e3966f8a1270706c385ba' 5461f670 Squashed 'deps/nfde/' changes from 28ade5a5c..5786fabce 1ecc7aa7 Merge commit '26c8cc348eacea01237cd64e1a68d0df8141e848' 26c8cc34 Squashed 'deps/glfw/' changes from 7d5a16ce7..7b6aead9f fc25c12d Merge commit 'ae51a422787bc3b720ff1748c0219c8f33363427' ae51a422 Squashed 'deps/imgui/' changes from f33737806..2db79d086 6c71e1e2 [nostalgia/core/studio,studio] Give TileSheetEditor Ctrl-A and Ctrl-G for selection 2ede01e7 [nostalgia/core/studio] Fix build deacd4ab [nostalgia/core/studio] Fix PaletteEditor add/remove color commands git-subtree-dir: deps/nostalgia git-subtree-split: 976550ef6fa269cf1e367e880f148b0ad7b1b163
56 lines
1.6 KiB
CMake
56 lines
1.6 KiB
CMake
cmake_minimum_required(VERSION 3.5)
|
|
project(nativefiledialog-extended VERSION 1.1.1)
|
|
|
|
set(nfd_ROOT_PROJECT OFF)
|
|
if (CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_SOURCE_DIR)
|
|
set(nfd_ROOT_PROJECT ON)
|
|
endif ()
|
|
|
|
if(NOT DEFINED BUILD_SHARED_LIBS)
|
|
option(BUILD_SHARED_LIBS "Build a shared library instead of static" OFF)
|
|
endif()
|
|
option(NFD_BUILD_TESTS "Build tests for nfd" ${nfd_ROOT_PROJECT})
|
|
option(NFD_INSTALL "Generate install target for nfd" ${nfd_ROOT_PROJECT})
|
|
|
|
set(nfd_PLATFORM Undefined)
|
|
if(WIN32)
|
|
set(nfd_PLATFORM PLATFORM_WIN32)
|
|
elseif(APPLE)
|
|
set(nfd_PLATFORM PLATFORM_MACOS)
|
|
elseif(UNIX AND NOT APPLE)
|
|
set(nfd_PLATFORM PLATFORM_UNIX)
|
|
endif()
|
|
|
|
message("nfd Platform: ${nfd_PLATFORM}")
|
|
|
|
set(nfd_COMPILER Undefined)
|
|
if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_SIMULATE_ID STREQUAL "MSVC")
|
|
# This is clang-cl, which has different compiler options
|
|
set(nfd_COMPILER COMPILER_CLANGCL)
|
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
|
|
set(nfd_COMPILER COMPILER_MSVC)
|
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
|
set(nfd_COMPILER COMPILER_GNU)
|
|
endif()
|
|
|
|
message("nfd Compiler: ${nfd_COMPILER}")
|
|
|
|
# Use latest C++ by default (should be the best one), but let user override it
|
|
if(NOT DEFINED CMAKE_CXX_STANDARD)
|
|
if(CMAKE_VERSION VERSION_LESS "3.8")
|
|
set (CMAKE_CXX_STANDARD 14)
|
|
elseif(CMAKE_VERSION VERSION_LESS "3.12")
|
|
set (CMAKE_CXX_STANDARD 17)
|
|
elseif(CMAKE_VERSION VERSION_LESS "3.20")
|
|
set (CMAKE_CXX_STANDARD 20)
|
|
else()
|
|
set (CMAKE_CXX_STANDARD 23)
|
|
endif()
|
|
endif()
|
|
|
|
add_subdirectory(src)
|
|
|
|
if(${NFD_BUILD_TESTS})
|
|
add_subdirectory(test)
|
|
endif()
|