Added flag BUILD_DOCS for documentation in CMakeLists.txt

checksum-failure-logging
EricLiu2000 2019-07-29 14:30:50 -04:00
parent f1632aada5
commit ff1e65b292
1 changed files with 42 additions and 38 deletions

View File

@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.2)
project(libicsneo VERSION 0.2.0) project(libicsneo VERSION 0.2.0)
option(BUILD_TESTS "Build all tests." OFF) option(BUILD_TESTS "Build all tests." OFF)
option(BUILD_DOCS "Build documentation. Don't use in Visual Studio." OFF)
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
@ -36,6 +37,7 @@ if(DOXYGEN_FOUND)
endif() endif()
endif() endif()
if(BUILD_DOCS)
if(DOXYGEN_FOUND) if(DOXYGEN_FOUND)
message("Will build Doxygen based documentation") message("Will build Doxygen based documentation")
@ -67,7 +69,7 @@ if(DOXYGEN_FOUND)
"${ICSNEO_DOCS_DIR}/conf.py" "${ICSNEO_DOCS_DIR}/conf.py"
@ONLY) @ONLY)
add_custom_target(libicsneo_sphinx ALL add_custom_target(libicsneo_sphinx
${SPHINX_EXECUTABLE} ${SPHINX_EXECUTABLE}
-q -b html -q -b html
-c "${ICSNEO_DOCS_DIR}" -c "${ICSNEO_DOCS_DIR}"
@ -78,6 +80,8 @@ if(DOXYGEN_FOUND)
DEPENDS icsneocpp icsneoc icsneolegacy) DEPENDS icsneocpp icsneoc icsneolegacy)
endif() endif()
endif() endif()
endif()
if(WIN32) if(WIN32)
file(GLOB PLATFORM_SRC_EXTERNAL ${CMAKE_CURRENT_SOURCE_DIR}/platform/windows/*.cpp) file(GLOB PLATFORM_SRC_EXTERNAL ${CMAKE_CURRENT_SOURCE_DIR}/platform/windows/*.cpp)