stamen

Static Menu Generator
git clone git://git.dimitrijedobrota.com/stamen.git
Log | Files | Refs | README | LICENSE | HACKING | CONTRIBUTING | CODE_OF_CONDUCT | BUILDING |

CMakeLists.txt (2257B)


1 cmake_minimum_required(VERSION 3.14) 2 3 include(cmake/prelude.cmake) 4 5 project( 6 stamen 7 VERSION 1.3.1 8 DESCRIPTION "Static menu generator" 9 HOMEPAGE_URL "https://git.dimitrijedobrota.com/stamen" 10 LANGUAGES C CXX 11 ) 12 13 include(cmake/project-is-top-level.cmake) 14 include(cmake/variables.cmake) 15 16 # ---- Declare library ---- 17 18 add_library( 19 stamen_stamen 20 source/stamen.cpp 21 ) 22 add_library(stamen::stamen ALIAS stamen_stamen) 23 24 include(GenerateExportHeader) 25 generate_export_header( 26 stamen_stamen 27 BASE_NAME stamen 28 EXPORT_FILE_NAME export/stamen/stamen_export.hpp 29 CUSTOM_CONTENT_FROM_VARIABLE pragma_suppress_c4251 30 ) 31 32 if(NOT BUILD_SHARED_LIBS) 33 target_compile_definitions(stamen_stamen PUBLIC STAMEN_STATIC_DEFINE) 34 endif() 35 36 set_target_properties( 37 stamen_stamen PROPERTIES 38 CXX_VISIBILITY_PRESET hidden 39 VISIBILITY_INLINES_HIDDEN YES 40 VERSION "${PROJECT_VERSION}" 41 SOVERSION "${PROJECT_VERSION_MAJOR}" 42 EXPORT_NAME stamen 43 OUTPUT_NAME stamen 44 ) 45 46 target_include_directories( 47 stamen_stamen ${warning_guard} 48 PUBLIC 49 "\$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>" 50 ) 51 52 target_include_directories( 53 stamen_stamen SYSTEM 54 PUBLIC 55 "\$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/export>" 56 ) 57 58 target_compile_features(stamen_stamen PUBLIC cxx_std_20) 59 60 # ---- Declare executable ---- 61 62 add_executable(stamen_exe source/generate.cpp) 63 add_executable(stamen::exe ALIAS stamen_exe) 64 65 find_package(poafloc 1.2 CONFIG REQUIRED) 66 find_package(cemplate 0.2 CONFIG REQUIRED) 67 68 target_link_libraries(stamen_exe PRIVATE stamen::stamen poafloc::poafloc cemplate::cemplate) 69 set_property(TARGET stamen_exe PROPERTY OUTPUT_NAME stamen) 70 71 target_compile_features(stamen_exe PRIVATE cxx_std_20) 72 73 # ---- Install rules ---- 74 75 if(NOT CMAKE_SKIP_INSTALL_RULES) 76 include(cmake/install-rules.cmake) 77 endif() 78 79 # ---- Examples ---- 80 81 if(PROJECT_IS_TOP_LEVEL) 82 option(BUILD_EXAMPLES "Build examples tree." "${stamen_DEVELOPER_MODE}") 83 if(BUILD_EXAMPLES) 84 add_subdirectory(example) 85 endif() 86 endif() 87 88 # ---- Developer mode ---- 89 90 if(NOT stamen_DEVELOPER_MODE) 91 return() 92 elseif(NOT PROJECT_IS_TOP_LEVEL) 93 message( 94 AUTHOR_WARNING 95 "Developer mode is intended for developers of stamen" 96 ) 97 endif() 98 99 include(cmake/dev-mode.cmake)