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 (1956B)
0 cmake_minimum_required(VERSION 3.14) 1 2 include(cmake/prelude.cmake) 3 4 project( 5 poafloc 6 VERSION 1.2.0 7 DESCRIPTION "Parser Of Arguments For Lines Of Commands" 8 HOMEPAGE_URL "https://git.dimitrijedobrota.com/poafloc.git" 9 LANGUAGES C CXX 10 ) 11 12 include(cmake/project-is-top-level.cmake) 13 include(cmake/variables.cmake) 14 15 # ---- Declare library ---- 16 17 add_library( 18 poafloc_poafloc 19 source/poafloc.cpp 20 source/c_bindings.cpp 21 source/help.cpp 22 source/trie.cpp 23 ) 24 add_library(poafloc::poafloc ALIAS poafloc_poafloc) 25 26 include(GenerateExportHeader) 27 generate_export_header( 28 poafloc_poafloc 29 BASE_NAME poafloc 30 EXPORT_FILE_NAME export/poafloc/poafloc_export.hpp 31 CUSTOM_CONTENT_FROM_VARIABLE pragma_suppress_c4251 32 ) 33 34 if(NOT BUILD_SHARED_LIBS) 35 target_compile_definitions(poafloc_poafloc PUBLIC POAFLOC_STATIC_DEFINE) 36 endif() 37 38 set_target_properties( 39 poafloc_poafloc PROPERTIES 40 CXX_VISIBILITY_PRESET hidden 41 VISIBILITY_INLINES_HIDDEN YES 42 VERSION "${PROJECT_VERSION}" 43 SOVERSION "${PROJECT_VERSION_MAJOR}" 44 EXPORT_NAME poafloc 45 OUTPUT_NAME poafloc 46 ) 47 48 target_include_directories( 49 poafloc_poafloc ${warning_guard} 50 PUBLIC 51 "\$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>" 52 ) 53 54 target_include_directories( 55 poafloc_poafloc SYSTEM 56 PUBLIC 57 "\$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/export>" 58 ) 59 60 target_compile_features(poafloc_poafloc PUBLIC cxx_std_20) 61 62 # ---- Install rules ---- 63 64 if(NOT CMAKE_SKIP_INSTALL_RULES) 65 include(cmake/install-rules.cmake) 66 endif() 67 68 # ---- Examples ---- 69 70 if(PROJECT_IS_TOP_LEVEL) 71 option(BUILD_EXAMPLES "Build examples tree." "${poafloc_DEVELOPER_MODE}") 72 if(BUILD_EXAMPLES) 73 add_subdirectory(example) 74 endif() 75 endif() 76 77 # ---- Developer mode ---- 78 79 if(NOT poafloc_DEVELOPER_MODE) 80 return() 81 elseif(NOT PROJECT_IS_TOP_LEVEL) 82 message( 83 AUTHOR_WARNING 84 "Developer mode is intended for developers of poafloc" 85 ) 86 endif() 87 88 include(cmake/dev-mode.cmake)