revert 4211e7a93 to restore bot builds #4980

This commit is contained in:
Andrej730
2024-07-05 14:54:01 +05:00
parent 74e27a27b5
commit 84d58cc572
+10 -15
View File
@@ -33,28 +33,24 @@ IF(NOT "$ENV{PYTHON_LIBRARY}" STREQUAL "")
MESSAGE(STATUS "Looking for Python library file in: ${PYTHON_LIBRARY}") MESSAGE(STATUS "Looking for Python library file in: ${PYTHON_LIBRARY}")
ENDIF() ENDIF()
# TODO: Is still a problem after we moved to FIND_PACKAGE(Python)? # NOTE PYTHONLIBS_FOUND and PYTHONINTERP_FOUND cannot seem to be trusted so
# NOTE Python_Development_FOUND and Python_Interpreter_FOUND cannot seem to be trusted so
# we need further checks to see whether the packages were actually found or not. # we need further checks to see whether the packages were actually found or not.
FIND_PACKAGE(Python COMPONENTS Development) FIND_PACKAGE(PythonLibs)
IF(NOT Python_Development_FOUND OR "${Python_INCLUDE_DIRS}" STREQUAL "") IF(NOT PYTHONLIBS_FOUND OR "$PYTHON_INCLUDE_DIRS}" STREQUAL "")
MESSAGE(FATAL_ERROR "BUILD_IFCPYTHON enabled, but unable to find Python lib or header. Disable BUILD_IFCPYTHON or fix Python paths to proceed.") MESSAGE(FATAL_ERROR "BUILD_IFCPYTHON enabled, but unable to find Python lib or header. Disable BUILD_IFCPYTHON or fix Python paths to proceed.")
ENDIF() ENDIF()
INCLUDE_DIRECTORIES(${Python_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
SET(CMAKE_SWIG_FLAGS ${SWIG_DEFINES}) SET(CMAKE_SWIG_FLAGS ${SWIG_DEFINES})
# NOTE Workaround for most likely missing debug Python libraries on Windows (requires Python built from the source). # NOTE Workaround for most likely missing debug Python libraries on Windows (requires Python built from the source).
# Python 3.5 intaller and onwards will have an option to install the debug libraries too. # Python 3.5 intaller and onwards will have an option to install the debug libraries too.
IF(WIN32) # NOTE PYTHON_DEBUG_LIBRARIES appears to be a deprecated variable
STRING(REPLACE ";" ";" Python_LIBRARIES_LIST "${Python_LIBRARIES}") IF (WIN32 AND NOT PYTHON_DEBUG_LIBRARIES)
LIST(FIND Python_LIBRARIES_LIST "debug" debug_index) MESSAGE(STATUS "PYTHON_DEBUG_LIBRARIES not found, defining SWIG_PYTHON_INTERPRETER_NO_DEBUG workaround for IfcWrap.")
IF(debug_index EQUAL -1)
MESSAGE(STATUS "Python debug libraries are not found, defining SWIG_PYTHON_INTERPRETER_NO_DEBUG workaround for IfcWrap.")
ADD_DEFINITIONS(-DSWIG_PYTHON_INTERPRETER_NO_DEBUG) ADD_DEFINITIONS(-DSWIG_PYTHON_INTERPRETER_NO_DEBUG)
ENDIF() ENDIF()
ENDIF()
if (WITH_CGAL) if (WITH_CGAL)
set(LIBSVGFILL libsvgfill) set(LIBSVGFILL libsvgfill)
@@ -66,7 +62,7 @@ if("$ENV{LDFLAGS}" MATCHES ".undefined.suppress")
# On osx there is some state in the python dylib. With `-Wl,undefined,suppress` we can ignore the missing symbols at compile time. # On osx there is some state in the python dylib. With `-Wl,undefined,suppress` we can ignore the missing symbols at compile time.
SWIG_LINK_LIBRARIES(ifcopenshell_wrapper ${IFCOPENSHELL_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${LIBSVGFILL}) SWIG_LINK_LIBRARIES(ifcopenshell_wrapper ${IFCOPENSHELL_LIBRARIES} ${OPENCASCADE_LIBRARIES} ${Boost_LIBRARIES} ${LIBSVGFILL})
else() else()
SWIG_LINK_LIBRARIES(ifcopenshell_wrapper ${IFCOPENSHELL_LIBRARIES} ${Python_LIBRARIES} ${LIBSVGFILL}) SWIG_LINK_LIBRARIES(ifcopenshell_wrapper ${IFCOPENSHELL_LIBRARIES} ${PYTHON_LIBRARIES} ${LIBSVGFILL})
endif() endif()
if ((NOT WIN32) AND BUILD_SHARED_LIBS) if ((NOT WIN32) AND BUILD_SHARED_LIBS)
SET_INSTALL_RPATHS(${SWIG_MODULE_ifcopenshell_wrapper_REAL_NAME} "${IFCDIRS};${OCC_LIBRARY_DIR}") SET_INSTALL_RPATHS(${SWIG_MODULE_ifcopenshell_wrapper_REAL_NAME} "${IFCDIRS};${OCC_LIBRARY_DIR}")
@@ -74,8 +70,8 @@ endif()
# Try to find the Python interpreter to get the site-packages # Try to find the Python interpreter to get the site-packages
# directory in which the wrapper can be installed. # directory in which the wrapper can be installed.
FIND_PACKAGE(Python COMPONENTS Interpreter) FIND_PACKAGE(PythonInterp)
IF((Python_Interpreter_FOUND AND NOT "${PYTHON_EXECUTABLE}" STREQUAL "") OR PYTHON_MODULE_INSTALL_DIR) IF((PYTHONINTERP_FOUND AND NOT "${PYTHON_EXECUTABLE}" STREQUAL "") OR PYTHON_MODULE_INSTALL_DIR)
# Find Python interpreter and get its version # Find Python interpreter and get its version
EXECUTE_PROCESS( EXECUTE_PROCESS(
COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))" COMMAND ${PYTHON_EXECUTABLE} -c "import sysconfig; print(sysconfig.get_config_var('EXT_SUFFIX'))"
@@ -83,7 +79,6 @@ IF((Python_Interpreter_FOUND AND NOT "${PYTHON_EXECUTABLE}" STREQUAL "") OR PYTH
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_STRIP_TRAILING_WHITESPACE
) )
SET_TARGET_PROPERTIES(${SWIG_MODULE_ifcopenshell_wrapper_REAL_NAME} PROPERTIES SUFFIX ${PYTHON_EXTENSION_SUFFIX}) SET_TARGET_PROPERTIES(${SWIG_MODULE_ifcopenshell_wrapper_REAL_NAME} PROPERTIES SUFFIX ${PYTHON_EXTENSION_SUFFIX})
if (PYTHON_MODULE_INSTALL_DIR) if (PYTHON_MODULE_INSTALL_DIR)
set(python_package_dir "${PYTHON_MODULE_INSTALL_DIR}") set(python_package_dir "${PYTHON_MODULE_INSTALL_DIR}")
else() else()