-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
55 lines (43 loc) · 1.28 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
46
47
48
49
50
51
52
53
54
55
cmake_minimum_required(VERSION 3.9)
project(Example CXX)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_BINARY_DIR})
list(APPEND CMAKE_PREFIX_PATH ${CMAKE_BINARY_DIR})
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/conan-io/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/0.18.1/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake"
TLS_VERIFY ON)
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_configure(REQUIRES python-sphinx/4.4.0
GENERATORS cmake)
conan_cmake_autodetect(settings)
conan_cmake_install(PATH_OR_REFERENCE .)
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)
option(SPHINX_HTML "Build html help with Sphinx" ON)
find_package(python-sphinx)
add_custom_command(
OUTPUT
${CMAKE_SOURCE_DIR}/doc/index.rst
${CMAKE_SOURCE_DIR}/doc/conf.py
COMMAND python3::sphinx-quickstart
doc
-p example
-a author
-l en
-r 1.0
--no-sep
--no-batchfile
--no-makefile
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMENT "Building sphinx-quickstart..."
)
add_custom_target(quickstart
DEPENDS ${CMAKE_SOURCE_DIR}/doc/index.rst
)
include(SphinxMacros)
add_sphinx(documentation
SOURCEDIR doc
OUTPUTDIR doc
)