Skip to content

Commit

Permalink
allow to build meta examples without building examples
Browse files Browse the repository at this point in the history
  • Loading branch information
karlnapf authored and vigsterkr committed Mar 10, 2016
1 parent e4cb036 commit 6a10c5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions CMakeLists.txt
Expand Up @@ -660,16 +660,20 @@ ENDIF()
# detect PYTHON
FIND_PACKAGE(PythonInterp REQUIRED)

OPTION(ENABLE_META_EXAMPLES "Generate API examples from meta-examples" ON)
OPTION(BUILD_META_EXAMPLES "Generate API examples from meta-examples" ON)
find_package(PLY)
find_package(PYPARSING)
IF(NOT PLY_FOUND AND NOT PYPARSING_FOUND)
message("-- Python module PYPARSING or PLY required for meta examples. Disabling.")
SET(ENABLE_META_EXAMPLES 0)
SET(BUILD_META_EXAMPLES 0)
ENDIF()
IF(BUILD_META_EXAMPLES)
# allow meta examples without adding examples dir
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/examples/meta)
ENDIF()

OPTION(ENABLE_COOKBOOK "Build Shogun API cookbook" ON)
IF(NOT ENABLE_META_EXAMPLES)
IF(NOT BUILD_META_EXAMPLES)
message("-- Meta examples are required for building cookbook. Disabling.")
SET(ENABLE_COOKBOOK 0)
ENDIF()
Expand Down
4 changes: 2 additions & 2 deletions examples/CMakeLists.txt
Expand Up @@ -49,8 +49,8 @@ IF (CmdLineStatic AND EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/undocumented/cmdline_st
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/undocumented/cmdline_static)
ENDIF()

IF(ENABLE_META_EXAMPLES)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/meta)
IF(BUILD_META_EXAMPLES)
# meta dir was added in root CMakeLists
add_custom_target(examples DEPENDS meta_examples)
ELSE()
add_custom_target(examples)
Expand Down

0 comments on commit 6a10c5e

Please sign in to comment.