diff options
author | Dimitri Stolnikov <horiz0n@gmx.net> | 2013-05-25 18:35:04 +0200 |
---|---|---|
committer | Dimitri Stolnikov <horiz0n@gmx.net> | 2013-05-25 18:35:04 +0200 |
commit | de74870c046eb16ff7dda615af9e7cb722601406 (patch) | |
tree | e0a4940ea7e65c4c4bb1e6d5a68e2c8f1d743a8b | |
parent | 79371104966594f64a18f2a55e4cb6f7ce7a9b39 (diff) |
cmake: make python support optional
-rw-r--r-- | CMakeLists.txt | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index e6685fc..520e1c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -141,7 +141,7 @@ set(GR_PKG_LIBEXEC_DIR ${GR_LIBEXEC_DIR}/${CMAKE_PROJECT_NAME}) set(GRC_BLOCKS_DIR ${GR_PKG_DATA_DIR}/grc/blocks) ######################################################################## -# Find gnuradio build dependencies +# Find build dependencies ######################################################################## find_package(Gruel) find_package(GnuradioCore) @@ -197,14 +197,37 @@ add_custom_target(uninstall ) ######################################################################## +# Enable python component +######################################################################## +find_package(PythonLibs) +find_package(SWIG) + +if(SWIG_FOUND) + message(STATUS "Minimum SWIG version required is 1.3.31") + set(SWIG_VERSION_CHECK FALSE) + if("${SWIG_VERSION}" VERSION_GREATER "1.3.30") + set(SWIG_VERSION_CHECK TRUE) + endif() +endif(SWIG_FOUND) + +include(GrComponent) +GR_REGISTER_COMPONENT("Python support" ENABLE_PYTHON + PYTHONLIBS_FOUND + SWIG_FOUND + SWIG_VERSION_CHECK +) + +######################################################################## # Add subdirectories ######################################################################## add_subdirectory(include/osmosdr) add_subdirectory(lib) -add_subdirectory(swig) -add_subdirectory(python) -add_subdirectory(grc) -add_subdirectory(apps) +if(ENABLE_PYTHON) + add_subdirectory(swig) + add_subdirectory(python) + add_subdirectory(grc) + add_subdirectory(apps) +endif(ENABLE_PYTHON) add_subdirectory(docs) ######################################################################## |