CMakeLists.txt (1468B)
1 cmake_minimum_required(VERSION 3.24) 2 3 include(cmake/prelude.cmake) 4 5 project( 6 stamd 7 VERSION 0.2.7 8 DESCRIPTION "Static Markdown Page Generator" 9 HOMEPAGE_URL "https://git.dimitrijedobrota.com/stamd.git" 10 LANGUAGES CXX 11 ) 12 13 include(cmake/project-is-top-level.cmake) 14 include(cmake/variables.cmake) 15 16 # ---- Declare dependencies ---- 17 18 find_package(md4c CONFIG REQUIRED) 19 find_package(poafloc 1 CONFIG REQUIRED) 20 find_package(hemplate 0.1 CONFIG REQUIRED) 21 22 23 # ---- Declare library ---- 24 25 add_library( 26 stamd_lib OBJECT 27 source/article.cpp 28 source/indexer.cpp 29 ) 30 31 target_link_libraries(stamd_lib PUBLIC hemplate::hemplate) 32 33 target_include_directories( 34 stamd_lib ${warning_guard} 35 PUBLIC 36 "\$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/source>" 37 ) 38 39 target_compile_features(stamd_lib PUBLIC cxx_std_20) 40 41 # ---- Declare executable ---- 42 43 add_executable(stamd_exe source/main.cpp) 44 add_executable(stamd::exe ALIAS stamd_exe) 45 46 set_property(TARGET stamd_exe PROPERTY OUTPUT_NAME stamd) 47 48 target_compile_features(stamd_exe PRIVATE cxx_std_20) 49 50 target_link_libraries(stamd_exe PRIVATE poafloc md4c::md4c-html stamd_lib) 51 52 # ---- Install rules ---- 53 54 if(NOT CMAKE_SKIP_INSTALL_RULES) 55 include(cmake/install-rules.cmake) 56 endif() 57 58 # ---- Developer mode ---- 59 60 if(NOT stamd_DEVELOPER_MODE) 61 return() 62 elseif(NOT PROJECT_IS_TOP_LEVEL) 63 message( 64 AUTHOR_WARNING 65 "Developer mode is intended for developers of stamd" 66 ) 67 endif() 68 69 include(cmake/dev-mode.cmake)