make C++ compiler and pandoc entirely optional

Sun, 03 Sep 2023 09:10:16 +0200

author
Mike Becker <universe@uap-core.de>
date
Sun, 03 Sep 2023 09:10:16 +0200
changeset 752
aaad6674a1a3
parent 751
9c104f2f1327
child 753
24dc84788dee

make C++ compiler and pandoc entirely optional

CMakeLists.txt file | annotate | diff | comparison | revisions
docs/src/CMakeLists.txt file | annotate | diff | comparison | revisions
     1.1 --- a/CMakeLists.txt	Sun Jul 09 12:43:13 2023 +0200
     1.2 +++ b/CMakeLists.txt	Sun Sep 03 09:10:16 2023 +0200
     1.3 @@ -1,5 +1,5 @@
     1.4  cmake_minimum_required(VERSION 3.14)
     1.5 -project(ucx VERSION 3.0 DESCRIPTION "UAP Common Extensions")
     1.6 +project(ucx VERSION 3.0 DESCRIPTION "UAP Common Extensions" LANGUAGES C)
     1.7  
     1.8  # Configuration
     1.9  cmake_policy(SET CMP0077 NEW)
    1.10 @@ -15,8 +15,15 @@
    1.11  add_subdirectory(src)
    1.12  
    1.13  # Tests
    1.14 -enable_testing()
    1.15 -add_subdirectory(tests)
    1.16 +include(CheckLanguage)
    1.17 +check_language(CXX)
    1.18 +if (CMAKE_CXX_COMPILER)
    1.19 +    enable_language(CXX)
    1.20 +    enable_testing()
    1.21 +    add_subdirectory(tests)
    1.22 +else ()
    1.23 +    message(STATUS "No C++ compiler found - tests are not compiled.")
    1.24 +endif ()
    1.25  
    1.26  # Web Documentation
    1.27  add_subdirectory(docs/src)
     2.1 --- a/docs/src/CMakeLists.txt	Sun Jul 09 12:43:13 2023 +0200
     2.2 +++ b/docs/src/CMakeLists.txt	Sun Sep 03 09:10:16 2023 +0200
     2.3 @@ -34,7 +34,7 @@
     2.4  if (NOT EXISTS ${PANDOC_EXECUTABLE})
     2.5      find_program(PANDOC_EXECUTABLE pandoc)
     2.6      if(NOT EXISTS ${PANDOC_EXECUTABLE})
     2.7 -        message(WARNING "Pandoc not found, docs-html target will not be generated.")
     2.8 +        message(STATUS "Pandoc not found, docs-html target will not be generated.")
     2.9          return()
    2.10      endif()
    2.11  endif()

mercurial