Skip to content

Commit

Permalink
Handle case where CMake can't find Python interpreter
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanMeans committed Feb 28, 2020
1 parent ea3ebe3 commit c3caae7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
14 changes: 2 additions & 12 deletions CMakeLists-CODA.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,18 @@ endif()

ExternalProject_Add_Step(coda-oss
waf-configure
COMMAND ${Python_EXECUTABLE} waf configure --prefix=${CODA_INSTALL_DIR} "${configure_flags}"
COMMAND ${PYTHON} waf configure --prefix=${CODA_INSTALL_DIR} "${configure_flags}"
DEPENDERS build
ALWAYS 0
WORKING_DIRECTORY ${CODA_DIR})

foreach(module ${coda_modules})
ExternalProject_Add_Step(coda-oss
waf-build-${module}
COMMAND ${Python_EXECUTABLE} waf install --target=${module}
COMMAND ${PYTHON} waf install --target=${module}
DEPENDEES waf-configure
DEPENDERS build
ALWAYS 0
WORKING_DIRECTORY ${CODA_DIR})
endforeach()

#if(Python_NumPy_FOUND)
# ExternalProject_Add_Step(coda-oss
# waf-build-numpyutils
# COMMAND ${Python_EXECUTABLE} waf install --target=numpyutils-c++
# DEPENDEES waf-configure
# DEPENDERS build
# ALWAYS 0
# WORKING_DIRECTORY ${CODA_DIR})
#
#endif()
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,15 @@ endif()
find_package(Python COMPONENTS Interpreter Development NumPy)
list(APPEND coda_modules except-c++ io-c++ sys-c++ mt-c++ str-c++ math-c++
xml.lite-c++ JPEG J2K)

if (Python_NumPy_FOUND)
list(APPEND coda_modules numpyutils-c++)
endif()
if (Python_FOUND)
set(PYTHON ${Python_EXECUTABLE})
else()
set(PYTHON python)
endif()

include(CMakeLists-CODA.txt)

Expand Down

0 comments on commit c3caae7

Please sign in to comment.