poaflocParser Of Arguments For Lines Of Commands |
git clone git://git.dimitrijedobrota.com/poafloc.git |
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING |
CMakeLists.txt (2032B)
0 cmake_minimum_required(VERSION 3.14)
2 include(cmake/prelude.cmake)
4 project(
5 poafloc
6 VERSION 2.0.0
7 DESCRIPTION "Parser Of Arguments For Lines Of Commands"
8 HOMEPAGE_URL "https://git.dimitrijedobrota.com/poafloc.git"
9 LANGUAGES CXX
10 )
12 include(cmake/project-is-top-level.cmake)
13 include(cmake/variables.cmake)
15 find_package(based 0.2.0 CONFIG REQUIRED)
17 # ---- Declare library ----
19 add_library(
20 poafloc_poafloc
21 source/poafloc.cpp
22 source/option.cpp
23 source/help.cpp
24 )
25 add_library(poafloc::poafloc ALIAS poafloc_poafloc)
26 target_link_libraries(poafloc_poafloc PUBLIC based::based)
28 include(GenerateExportHeader)
29 generate_export_header(
30 poafloc_poafloc
31 BASE_NAME poafloc
32 EXPORT_FILE_NAME export/poafloc/poafloc_export.hpp
33 CUSTOM_CONTENT_FROM_VARIABLE pragma_suppress_c4251
34 )
36 if(NOT BUILD_SHARED_LIBS)
37 target_compile_definitions(poafloc_poafloc PUBLIC POAFLOC_STATIC_DEFINE)
38 endif()
40 set_target_properties(
41 poafloc_poafloc PROPERTIES
42 CXX_VISIBILITY_PRESET hidden
43 VISIBILITY_INLINES_HIDDEN YES
44 VERSION "${PROJECT_VERSION}"
45 SOVERSION "${PROJECT_VERSION_MAJOR}"
46 EXPORT_NAME poafloc
47 OUTPUT_NAME poafloc
48 )
50 target_include_directories(
51 poafloc_poafloc ${warning_guard}
52 PUBLIC
53 "\$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
54 )
56 target_include_directories(
57 poafloc_poafloc SYSTEM
58 PUBLIC
59 "\$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/export>"
60 )
62 target_compile_features(poafloc_poafloc PUBLIC cxx_std_20)
64 # ---- Install rules ----
66 if(NOT CMAKE_SKIP_INSTALL_RULES)
67 include(cmake/install-rules.cmake)
68 endif()
70 # ---- Examples ----
72 if(PROJECT_IS_TOP_LEVEL)
73 option(BUILD_EXAMPLES "Build examples tree." "${poafloc_DEVELOPER_MODE}")
74 if(BUILD_EXAMPLES)
75 add_subdirectory(example)
76 endif()
77 endif()
79 # ---- Developer mode ----
81 if(NOT poafloc_DEVELOPER_MODE)
82 return()
83 elseif(NOT PROJECT_IS_TOP_LEVEL)
84 message(
85 AUTHOR_WARNING
86 "Developer mode is intended for developers of poafloc"
87 )
88 endif()
90 include(cmake/dev-mode.cmake)