diff options
author | Josh Blum <josh@joshknows.com> | 2010-12-27 13:56:09 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2010-12-27 13:56:09 -0800 |
commit | 3017907fd83d32e89e91f43a5d2b94d4155beddd (patch) | |
tree | fa1aa7154145481db51a4074e7319aced0ac4eb1 | |
parent | 2dfec0af4a159b4f886180a0f7448ce37a75aac1 (diff) | |
download | uhd-3017907fd83d32e89e91f43a5d2b94d4155beddd.tar.gz uhd-3017907fd83d32e89e91f43a5d2b94d4155beddd.tar.bz2 uhd-3017907fd83d32e89e91f43a5d2b94d4155beddd.zip |
cmake: changes to finding python interp, some other tweaks
-rw-r--r-- | host/config/Python.cmake | 28 | ||||
-rw-r--r-- | host/docs/CMakeLists.txt | 14 | ||||
-rw-r--r-- | host/examples/CMakeLists.txt | 2 |
3 files changed, 31 insertions, 13 deletions
diff --git a/host/config/Python.cmake b/host/config/Python.cmake index 847e7bff3..49f74ae88 100644 --- a/host/config/Python.cmake +++ b/host/config/Python.cmake @@ -18,13 +18,33 @@ ######################################################################## # Setup Python ######################################################################## -IF(NOT DEFINED PYTHON_EXECUTABLE) - INCLUDE(FindPythonInterp) +#this allows the user to override PYTHON_EXECUTABLE +IF(PYTHON_EXECUTABLE) + SET(PYTHONINTERP_FOUND TRUE) + +#otherwise if not set, try to automatically find it +ELSE(PYTHON_EXECUTABLE) + + #use the built-in find script + FIND_PACKAGE(PythonInterp) + + #and if that fails use the find program routine IF(NOT PYTHONINTERP_FOUND) - MESSAGE(FATAL_ERROR "Error: Python interpretor required by the build system.") + FIND_PROGRAM(PYTHON_EXECUTABLE python) + IF(PYTHON_EXECUTABLE) + SET(PYTHONINTERP_FOUND TRUE) + ENDIF(PYTHON_EXECUTABLE) ENDIF(NOT PYTHONINTERP_FOUND) -ENDIF(NOT DEFINED PYTHON_EXECUTABLE) + +ENDIF(PYTHON_EXECUTABLE) + +#make the path to the executable appear in the cmake gui +SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE} CACHE PYTHON_EXECUTABLE "python interpreter") + +IF(NOT PYTHONINTERP_FOUND) + MESSAGE(FATAL_ERROR "Error: Python interpretor required by the build system.") +ENDIF(NOT PYTHONINTERP_FOUND) MACRO(PYTHON_CHECK_MODULE desc mod cmd have) MESSAGE(STATUS "") diff --git a/host/docs/CMakeLists.txt b/host/docs/CMakeLists.txt index d6a7801bf..54e0d589c 100644 --- a/host/docs/CMakeLists.txt +++ b/host/docs/CMakeLists.txt @@ -38,17 +38,15 @@ SET(manual_sources MESSAGE(STATUS "") MESSAGE(STATUS "Checking for rst2html (docutils)") FIND_PROGRAM(RST2HTML rst2html) -IF(${RST2HTML} STREQUAL "RST2HTML-NOTFOUND") - MESSAGE(STATUS "Checking for rst2html (docutils) - not found") - MESSAGE(STATUS " Disabled generation of HTML manual.") - SET(HAVE_RST2HTML FALSE) -ELSE(${RST2HTML} STREQUAL "RST2HTML-NOTFOUND") +IF(RST2HTML) MESSAGE(STATUS "Checking for rst2html (docutils) - found") MESSAGE(STATUS " Enabled generation of HTML manual.") - SET(HAVE_RST2HTML TRUE) -ENDIF(${RST2HTML} STREQUAL "RST2HTML-NOTFOUND") +ELSE(RST2HTML) + MESSAGE(STATUS "Checking for rst2html (docutils) - not found") + MESSAGE(STATUS " Disabled generation of HTML manual.") +ENDIF(RST2HTML) -LIBUHD_REGISTER_COMPONENT("Manual" ENABLE_MANUAL ON "HAVE_RST2HTML" OFF) +LIBUHD_REGISTER_COMPONENT("Manual" ENABLE_MANUAL ON "RST2HTML" OFF) IF(ENABLE_MANUAL) #setup rst2html options diff --git a/host/examples/CMakeLists.txt b/host/examples/CMakeLists.txt index ce2ca9640..ac131b217 100644 --- a/host/examples/CMakeLists.txt +++ b/host/examples/CMakeLists.txt @@ -40,7 +40,7 @@ ENDFOREACH(example_source) ######################################################################## # ASCII Art DFT - requires curses, so this part is optional ######################################################################## -INCLUDE(FindCurses) +FIND_PACKAGE(Curses) IF(CURSES_FOUND) INCLUDE_DIRECTORIES(${CURSES_INCLUDE_DIR}) |