Skip to content

Commit

Permalink
Fallback default system provided Boost Python
Browse files Browse the repository at this point in the history
User provided Python version via OPENEXR_PYTHON_MAJOR and
OPENEXR_PYTHON_MINOR parameters, failing that fallback onto
the system's default "python" whichever that may be.

Signed-off-by: Thanh Ha <thanh.ha@linuxfoundation.org>
  • Loading branch information
zxiiro authored and nickrasmussen committed Aug 8, 2018
1 parent da96e37 commit a174497
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,13 @@ if (OPENEXR_BUILD_PYTHON_LIBS)

find_package(Boost COMPONENTS python${OPENEXR_PYTHON_MAJOR}${OPENEXR_PYTHON_MINOR})
if(NOT Boost_PYTHON${OPENEXR_PYTHON_MAJOR}${OPENEXR_PYTHON_MINOR}_FOUND)
message(WARNING "Make boost Python${OPENEXR_PYTHON_MAJOR}${OPENEXR_PYTHON_MINOR} available to CMake's search path, and re-run configuration")
message(FATAL_ERROR "boost Python is a required dependency when OPENEXR_BUILD_PYTHON_LIBS is set")
message(WARNING "user provided Boost Python${OPENEXR_PYTHON_MAJOR}${OPENEXR_PYTHON_MINOR} was not found. Trying default path...")

find_package(Boost COMPONENTS python)
if(NOT Boost_PYTHON_FOUND)
message(WARNING "Make boost Python available to CMake's search path, and re-run configuration")
message(FATAL_ERROR "boost Python is a required dependency when OPENEXR_BUILD_PYTHON_LIBS is set")
endif()
endif()

find_package(NumPy)
Expand Down

0 comments on commit a174497

Please sign in to comment.