diff --git a/CMakeLists.txt b/CMakeLists.txt index 7ffe73920a9..184d55f34e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -304,6 +304,7 @@ STRING(REGEX REPLACE "[0-9]*.[0-9]*.([0-9]*)" "\\1" SHOGUN_VERSION_PATCH "${VERS SET(BUILD_STATIC "Build a statically linked binary" OFF) ################# EXAMPLES ################## OPTION(BUILD_EXAMPLES "Build Examples" ON) +OPTION(BUILD_META_EXAMPLES "Generate API examples from meta-examples" ON) # note the examples dir is added below after tests have been defined ################# DATATYPES ################# @@ -662,7 +663,6 @@ ENDIF() FIND_PACKAGE(PythonInterp REQUIRED) # Meta examples and dependencies -OPTION(BUILD_META_EXAMPLES "Generate API examples from meta-examples" ON) IF(BUILD_META_EXAMPLES) include(FindPythonModule) find_python_module(ply REQUIRED) @@ -1107,7 +1107,7 @@ ENDIF() IF(EXISTS ${CMAKE_SOURCE_DIR}/examples) IF(ENABLE_TESTING AND NOT BUILD_EXAMPLES) - message("Tests require (disabled) examples, enabling.") + message(STATUS "Tests require (disabled) examples, enabling.") ENDIF() IF(ENABLE_TESTING OR BUILD_EXAMPLES) add_subdirectory(${CMAKE_SOURCE_DIR}/examples) diff --git a/cmake/FindCtags.cmake b/cmake/FindCtags.cmake index ff2bc660988..764bace391f 100644 --- a/cmake/FindCtags.cmake +++ b/cmake/FindCtags.cmake @@ -12,7 +12,6 @@ find_program( CTAGS_EXECUTABLE NAMES ctags DOC "ctags executable" ) -mark_as_advanced( CTAGS_EXECUTABLE ) if( CTAGS_EXECUTABLE ) execute_process(COMMAND ${CTAGS_EXECUTABLE} --version @@ -21,12 +20,24 @@ if( CTAGS_EXECUTABLE ) OUTPUT_STRIP_TRAILING_WHITESPACE ) - if( ctags_version MATCHES "^Exuberant Ctags [0-9]" ) - string( REPLACE "Exuberant Ctags " "" CTAGS_VERSION_STRING "${ctags_version}" ) - string( REGEX REPLACE ",.*$" "" CTAGS_VERSION_STRING ${CTAGS_VERSION_STRING} ) - endif() + if (ctags_version STREQUAL "") + unset(CTAGS_EXECUTABLE CACHE) + MESSAGE(STATUS "The ctags found is not suitable for meta examples.") + else() + string(TOLOWER ${ctags_version} ctags_version) + if(NOT ctags_version MATCHES exuberant) + set(CTAGS_FLAVOR "GNU") + else() + set(CTAGS_FLAVOR "Exuberant") + string( REPLACE "Exuberant Ctags " "" CTAGS_VERSION_STRING "${ctags_version}" ) + string( REGEX REPLACE ",.*$" "" CTAGS_VERSION_STRING ${CTAGS_VERSION_STRING} ) + endif() + set(CTAGS_FLAVOR ${CTAGS_FLAVOR} CACHE STRING "Ctags executable flavour" FORCE) + message(STATUS "Ctags flavour: ${CTAGS_FLAVOR}") - unset( ctags_version ) + unset( ctags_version ) + mark_as_advanced( CTAGS_EXECUTABLE ) + endif() endif() # Handle the QUIETLY and REQUIRED arguments and set CTAGS_FOUND to TRUE if diff --git a/doc/cookbook/CMakeLists.txt b/doc/cookbook/CMakeLists.txt index 28ca0f72b17..48b2b839733 100644 --- a/doc/cookbook/CMakeLists.txt +++ b/doc/cookbook/CMakeLists.txt @@ -45,7 +45,7 @@ add_custom_target(cookbook_sphinx_linkcheck DEPENDS cookbook_sphinx_extensions cookbook_sphinx_templates cookbook_sphinx_static meta_examples) -add_custom_target(cookbook doc +add_custom_target(cookbook ${SPHINX_EXECUTABLE} -q -b html -c "${BINARY_BUILD_DIR}"