-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
45 lines (36 loc) · 1.32 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cmake_minimum_required(VERSION 3.21)
set(VCPKG_OVERLAY_PORTS "${CMAKE_CURRENT_SOURCE_DIR}/vcpkg-ports/commsdsl")
file(READ vcpkg.json VCPKG_MANIFEST_STR)
string(JSON VCPKG_PROJ_VERSION GET ${VCPKG_MANIFEST_STR} "version")
project(protodoc
VERSION ${VCPKG_PROJ_VERSION}
HOMEPAGE_URL "https://github.com/mathisloge/protocol-doc-generation"
LANGUAGES CXX
)
include(GNUInstallDirs)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/")
include(CTest)
option(BUILD_SHARED_LIBS "build libprotodoc static(OFF) or shared(ON) tests" ON)
if(BUILD_TESTING AND BUILD_SHARED_LIBS)
message(WARNING "We need to build static when using the tests")
set(BUILD_SHARED_LIBS OFF)
endif()
set(m_output_dir "${CMAKE_CURRENT_BINARY_DIR}/out")
find_package(LibXml2 CONFIG REQUIRED) # needed for LibCommsdsl
find_package(LibCommsdsl CONFIG REQUIRED)
find_package(spdlog CONFIG REQUIRED)
find_package(inja CONFIG REQUIRED)
find_package(nlohmann_json CONFIG REQUIRED)
find_package(cpp-json-schema CONFIG REQUIRED)
include(GNUInstallDirs)
include(GetGitRevisionDescription)
get_git_head_revision(GIT_REFSPEC GIT_REF)
message(STATUS "GIT_REF: ${GIT_REF}")
message(STATUS "GIT_REFSPEC: ${GIT_REFSPEC}")
add_subdirectory(lib)
add_subdirectory(app)
if(BUILD_TESTING)
add_subdirectory(tests)
endif()
include(install)
include(pack)