Skip to content

False assumptions in cmake fail on Fedora #174

@J-Dunn

Description

@J-Dunn

/usr/lib64/cmake/opencascade/OpenCASCADEConfig.cmake

In stripping down the OpenCASCADE_INSTALL_PREFIX it assumes it is in either /usr/lib /usr/local/lib . On Fedora, it ends up with an empty "/" and then any calls to FindOCC crap out looking for files in //include/ :

CMake Error at cMake/FindOCC.cmake:71 (file):
file STRINGS file "//include/opencascade/Standard_Version.hxx" cannot be
read.
Call Stack (most recent call first):
cMake/FreeCAD_Helpers/SetupOpenCasCade.cmake:2 (find_package)
CMakeLists.txt:87 (SetupOpenCasCade)

Fedora uses a symlink /lib -> /usr/lib and it is the former which cmake picks up.
The following addition works around this but maybe someone should write a script which does not assume the answer before looking.



if (OpenCASCADE_INSTALL_PREFIX MATCHES "/libs/${CMAKE_ANDROID_ARCH_ABI}$")
  get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
  get_filename_component (OpenCASCADE_INSTALL_PREFIX "${OpenCASCADE_INSTALL_PREFIX}" PATH)
endif()

# Fedora installs in /lib not /usr/lib . Fix  script result
if (OpenCASCADE_INSTALL_PREFIX MATCHES "/")
 set (OpenCASCADE_INSTALL_PREFIX "/usr")
endif()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions