diff --git a/PyIlmBase/CMakeLists.txt b/PyIlmBase/CMakeLists.txt index 25aec6e8d4..d7d2b113aa 100644 --- a/PyIlmBase/CMakeLists.txt +++ b/PyIlmBase/CMakeLists.txt @@ -23,7 +23,7 @@ project(PyIlmBase VERSION ${PYILMBASE_VERSION} LANGUAGES C CXX) include(config/PyIlmBaseSetup.cmake) # we have a strong dependence on IlmBase being an exact match -find_package(IlmBase ${OPENEXR_VERSION} EXACT REQUIRED CONFIG) +find_package(IlmBase ${PYILMBASE_VERSION} EXACT REQUIRED CONFIG) # we are building a python extension, so of course we depend on # python as well. Except we don't know which version... diff --git a/PyIlmBase/config/ModuleDefine.cmake b/PyIlmBase/config/ModuleDefine.cmake index d7564c24e3..abf3f06aa0 100644 --- a/PyIlmBase/config/ModuleDefine.cmake +++ b/PyIlmBase/config/ModuleDefine.cmake @@ -18,7 +18,7 @@ function(PYILMBASE_ADD_LIBRARY_PRIV libname) ) endif() set_target_properties(${libname} PROPERTIES - OUTPUT_NAME "${PYILMBASE_OUTPUT_OUTROOT}${libname}${PYILMBASE_LIB_SUFFIX}" + OUTPUT_NAME "${PYILMBASE_CURLIB_OUTROOT}${libname}${PYILMBASE_LIB_SUFFIX}" ) target_compile_features(${libname} PUBLIC cxx_std_${OPENEXR_CXX_STANDARD}) if(PYILMBASE_CURLIB_PRIV_EXPORT AND BUILD_SHARED_LIBS) diff --git a/PyIlmBase/config/NumPyLocate.cmake b/PyIlmBase/config/NumPyLocate.cmake index 5d4ed67f7a..97f72803fc 100644 --- a/PyIlmBase/config/NumPyLocate.cmake +++ b/PyIlmBase/config/NumPyLocate.cmake @@ -4,24 +4,24 @@ if(TARGET Python2::Interpreter) execute_process( COMMAND ${Python2_EXECUTABLE} -c - "from __future__ import print_function\ntry: import numpy; print(numpy.get_include(), end='')\nexcept:pass\n" + "from __future__ import print_function\ntry: import numpy; print(numpy.get_include(), end='')\nexcept: import sys; sys.exit(1)\n" RESULT_VARIABLE _NUMPY2_RESULT OUTPUT_VARIABLE py_ilmbase_numpy2_path OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT _NUMPY2_RESULT MATCHES 0) - set(NumPy_Py2_FOUND 0 CACHE INTERNAL "Python2 numpy libraries not found") + set(NumPy_Py2_FOUND FALSE CACHE INTERNAL "Python2 numpy libraries not found") message(WARNING "Unable to import numpy using python ${Python2_VERSION}") else() execute_process( COMMAND ${Python2_EXECUTABLE} -c - "from __future__ import print_function\ntry: import numpy; print(numpy.__version__, end='')\nexcept:pass\n" + "from __future__ import print_function\ntry: import numpy; print(numpy.__version__, end='')\nexcept: import sys; sys.exit(1)\n" RESULT_VARIABLE _NUMPY2_RESULT OUTPUT_VARIABLE py_ilmbase_numpy2_version OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT _NUMPY2_RESULT MATCHES 0) - set(NumPy_Py2_FOUND 0 CACHE INTERNAL "Python2 numpy libraries not found") + set(NumPy_Py2_FOUND FALSE CACHE INTERNAL "Python2 numpy libraries not found") message(WARNING "Found numpy module in python ${Python2_VERSION}, but no version information") else() find_path(NumPy_Py2_INCLUDE_DIRS numpy/arrayobject.h @@ -29,14 +29,14 @@ if(TARGET Python2::Interpreter) NO_DEFAULT_PATH ) if(NumPy_Py2_INCLUDE_DIRS) - set(NumPy_Py2_FOUND 1 CACHE INTERNAL "Python2 numpy found") + set(NumPy_Py2_FOUND TRUE CACHE INTERNAL "Python2 numpy found") set(NumPy_Py2_VERSION ${py_ilmbase_numpy2_version}) add_library(NumPy_Py2 INTERFACE IMPORTED GLOBAL) target_include_directories(NumPy_Py2 INTERFACE ${NumPy_Py2_INCLUDE_DIRS}) add_library(Python2::IlmBaseNumPy ALIAS NumPy_Py2) message(STATUS "Found NumPy ${NumPy_Py2_VERSION} for Python ${Python2_VERSION}: ${NumPy_Py2_INCLUDE_DIRS}") else() - set(NumPy_Py2_FOUND 0 CACHE INTERNAL "Python2 numpy libraries not found") + set(NumPy_Py2_FOUND FALSE CACHE INTERNAL "Python2 numpy libraries not found") message(WARNING "Found numpy version ${py_ilmbase_numpy2_version} in python ${Python2_VERSION}, but unable to locate header files") endif() endif() @@ -46,24 +46,24 @@ endif() if(TARGET Python3::Interpreter) execute_process( COMMAND ${Python3_EXECUTABLE} -c - "from __future__ import print_function\ntry: import numpy; print(numpy.get_include(), end='')\nexcept:pass\n" + "from __future__ import print_function\ntry: import numpy; print(numpy.get_include(), end='')\nexcept: import sys; sys.exit(1)\n" RESULT_VARIABLE _NUMPY3_RESULT OUTPUT_VARIABLE py_ilmbase_numpy3_path OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT _NUMPY3_RESULT MATCHES 0) - set(NumPy_Py3_FOUND 0 CACHE INTERNAL "Python3 numpy libraries not found") + set(NumPy_Py3_FOUND FALSE CACHE INTERNAL "Python3 numpy libraries not found") message(WARNING "Unable to import numpy using python ${Python3_VERSION}") else() execute_process( COMMAND ${Python3_EXECUTABLE} -c - "from __future__ import print_function\ntry: import numpy; print(numpy.__version__, end='')\nexcept:pass\n" + "from __future__ import print_function\ntry: import numpy; print(numpy.__version__, end='')\nexcept: import sys; sys.exit(1)\n" RESULT_VARIABLE _NUMPY3_RESULT OUTPUT_VARIABLE py_ilmbase_numpy3_version OUTPUT_STRIP_TRAILING_WHITESPACE) if(NOT _NUMPY3_RESULT MATCHES 0) - set(NumPy_Py3_FOUND 0 CACHE INTERNAL "Python3 numpy libraries not found") + set(NumPy_Py3_FOUND FALSE CACHE INTERNAL "Python3 numpy libraries not found") message(WARNING "Found numpy module in python ${Python3_VERSION}, but no version information") else() find_path(NumPy_Py3_INCLUDE_DIRS numpy/arrayobject.h @@ -71,14 +71,14 @@ if(TARGET Python3::Interpreter) NO_DEFAULT_PATH ) if(NumPy_Py3_INCLUDE_DIRS) - set(NumPy_Py3_FOUND 1 CACHE INTERNAL "Python3 numpy found") + set(NumPy_Py3_FOUND TRUE CACHE INTERNAL "Python3 numpy found") set(NumPy_Py3_VERSION ${py_ilmbase_numpy3_version}) add_library(NumPy_Py3 INTERFACE IMPORTED GLOBAL) target_include_directories(NumPy_Py3 INTERFACE ${NumPy_Py3_INCLUDE_DIRS}) add_library(Python3::IlmBaseNumPy ALIAS NumPy_Py3) message(STATUS "Found NumPy ${NumPy_Py3_VERSION} for Python ${Python3_VERSION}: ${NumPy_Py3_INCLUDE_DIRS}") else() - set(NumPy_Py3_FOUND 0 CACHE INTERNAL "Python3 numpy libraries not found") + set(NumPy_Py3_FOUND FALSE CACHE INTERNAL "Python3 numpy libraries not found") message(WARNING "Found numpy version ${py_ilmbase_numpy3_version} in python ${Python3_VERSION}, but unable to locate header files") endif() endif()