Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
9337964266 | |||
49b2117f13 | |||
3da87609f4 | |||
32e0a46a7f |
|
@ -1,6 +1,7 @@
|
|||
# Support version 3.1 and above, but use policy settings up to 3.14.
|
||||
cmake_minimum_required(VERSION 3.1...3.14)
|
||||
# Ranges are supported from 3.12, set policy to current for 3.1 - 3.11.
|
||||
# Support version 3.6 and above, but use policy settings up to 3.14.
|
||||
# 3.6 is needed because of IMPORTED_TARGET in pkg_check_modules().
|
||||
cmake_minimum_required(VERSION 3.6...3.14)
|
||||
# Ranges are supported from 3.12, set policy to current for < 3.12.
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.12)
|
||||
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
||||
endif()
|
||||
|
@ -18,9 +19,7 @@ endif()
|
|||
# All custom build switches.
|
||||
option(WITH_EXAMPLES "Compile examples." NO)
|
||||
option(WITH_TESTS "Compile tests." NO)
|
||||
|
||||
# Build shared libs by default but allow overriding.
|
||||
set(BUILD_SHARED_LIBS YES CACHE BOOL "Build shared libs.")
|
||||
option(BUILD_SHARED_LIBS "Build shared libraries." YES)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED YES)
|
||||
|
@ -46,7 +45,6 @@ else()
|
|||
endif()
|
||||
|
||||
add_subdirectory(src)
|
||||
add_subdirectory(include)
|
||||
add_subdirectory(pkg-config)
|
||||
add_subdirectory(cmake)
|
||||
|
||||
|
|
26
LICENSE
Normal file
26
LICENSE
Normal file
|
@ -0,0 +1,26 @@
|
|||
Copyright (c) 2019 tastytea <tastytea@tastytea.de>. All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice,
|
||||
this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the copyright holder nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software without
|
||||
specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
||||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
|
||||
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
||||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
|
||||
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
@ -1,3 +1,5 @@
|
|||
/* This file is part of xdgcfg. */
|
||||
|
||||
#include <iostream>
|
||||
#include <libconfig.h++>
|
||||
#include "xdgcfg.hpp"
|
||||
|
|
|
@ -1,3 +0,0 @@
|
|||
include(GNUInstallDirs)
|
||||
|
||||
install(FILES "xdgcfg.hpp" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
|
@ -1,5 +1,7 @@
|
|||
/* Public Domain / CC-0
|
||||
* Author: tastytea <tastytea@tastytea.de>
|
||||
/* Copyright © 2019 tastytea <tastytea@tastytea.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the BSD-3-Clause license.
|
||||
*/
|
||||
|
||||
#ifndef XDGCFG_HPP
|
||||
|
|
|
@ -4,11 +4,13 @@ find_package(PkgConfig REQUIRED)
|
|||
pkg_check_modules(libxdg-basedir REQUIRED IMPORTED_TARGET libxdg-basedir)
|
||||
pkg_check_modules(libconfig++ REQUIRED IMPORTED_TARGET libconfig++)
|
||||
|
||||
add_library(${PROJECT_NAME} "xdgcfg.cpp" "../include/xdgcfg.hpp")
|
||||
set(${PROJECT_NAME}_public_headers "../include/xdgcfg.hpp")
|
||||
add_library(${PROJECT_NAME} "xdgcfg.cpp" "${${PROJECT_NAME}_public_headers}")
|
||||
|
||||
set_target_properties(xdgcfg PROPERTIES
|
||||
VERSION ${PROJECT_VERSION}
|
||||
SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR})
|
||||
SOVERSION ${${PROJECT_NAME}_VERSION_MAJOR}
|
||||
PUBLIC_HEADER "${${PROJECT_NAME}_public_headers}")
|
||||
|
||||
target_include_directories(${PROJECT_NAME}
|
||||
PUBLIC
|
||||
|
@ -22,4 +24,5 @@ target_link_libraries(${PROJECT_NAME}
|
|||
install(TARGETS ${PROJECT_NAME}
|
||||
EXPORT "${PROJECT_NAME}Targets"
|
||||
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}")
|
||||
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
|
||||
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
/* Public Domain / CC-0
|
||||
* Author: tastytea <tastytea@tastytea.de>
|
||||
/* Copyright © 2019 tastytea <tastytea@tastytea.de>
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify it
|
||||
* under the terms of the BSD-3-Clause license.
|
||||
*/
|
||||
|
||||
#include <basedir.h>
|
||||
|
|
Reference in New Issue
Block a user