31 lines
901 B
CMake
31 lines
901 B
CMake
cmake_minimum_required (VERSION 3.1)
|
|
project(xdgcfg
|
|
VERSION 0.3.0
|
|
LANGUAGES CXX
|
|
)
|
|
|
|
include(GNUInstallDirs)
|
|
find_package(PkgConfig REQUIRED)
|
|
pkg_check_modules(LIBXDG_BASEDIR REQUIRED libxdg-basedir)
|
|
pkg_check_modules(LIBCONFIG REQUIRED libconfig++)
|
|
|
|
set(CMAKE_CXX_STANDARD 14)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
|
|
|
set(CMAKE_CXX_FLAGS_DEBUG
|
|
"${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -Wpedantic -ftrapv \
|
|
-fsanitize=undefined -g -Og -fno-omit-frame-pointer")
|
|
|
|
include_directories(${LIBXDG_BASEDIR_INCLUDE_DIRS})
|
|
include_directories(${LIBCONFIG_INCLUDE_DIRS})
|
|
|
|
link_directories(${LIBXDG_BASEDIR_LIBRARY_DIRS})
|
|
link_directories(${LIBCONFIG_LIBRARY_DIRS})
|
|
|
|
add_executable(example src/example.cpp)
|
|
target_link_libraries(example
|
|
${LIBXDG_BASEDIR_LIBRARIES} ${LIBCONFIG_LIBRARIES} stdc++fs)
|
|
|
|
install(FILES src/xdgcfg.hpp DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
|