Comments to your
PR:
I was able to build FreeCAD without using this PR. The only change I had to make was extending PCL_INCLUDE_DIRS to find the header files for pcl-1.9. The rest was only switching on or off some options in the cmake-gui.
Code: Select all
IF(DEFINED ENV{FREECAD_LIBPACK_DIR})
set(FREECAD_LIBPACK_DIR $ENV{FREECAD_LIBPACK_DIR} CACHE PATH "Directory of the FreeCAD LibPack")
MESSAGE(STATUS "Found libpack env variable: ${FREECAD_LIBPACK_DIR}")
IF(EXISTS ${FREECAD_LIBPACK_DIR}/lib/Qt5Core.lib)
OPTION(BUILD_QT5 "Build with Qt5." ON)
ELSE()
OPTION(BUILD_QT5 "Build with Qt5." OFF)
ENDIF()
ELSE()
set(FREECAD_LIBPACK_DIR ${CMAKE_SOURCE_DIR} CACHE PATH "Directory of the FreeCAD LibPack")
ENDIF()
This makes sense as it avoids to run cmake configure multiple times.
Code: Select all
# FIXME: --> for now disable fem
if(EXISTS ${FREECAD_LIBPACK_DIR}/LipPackVersion.txt)
SET(BUILD_SMESH OFF)
SET(BUILD_FEM OFF)
SET(BUILD_FEM_NETGEN OFF)
endif()
Currently, the libpack lacks of either the med stuff or the external smesh so that at the moment FEM cannot be built. But IMO there should be no such check in the CMakeLists.txt that automatically disables certain modules. Sure, it's a minor inconvenience to run configure twice but this is because the libpack is not yet complete and once done this check is not needed anyway.
I didn't need these changes either. Your libpack lacks of some cmake config files that are used to tell cmake which libraries must be used. The clbundler mechanism uses this line:
Code: Select all
set(OCE_DIR ${FREECAD_LIBPACK_DIR}/lib/cmake CACHE PATH "" FORCE)
where it searches for requested config files.
In the top-level CMakeLists.txt file we request the OpenCasCade package which then loads the file FindOpenCasCade.cmake. Depending on whether the Community Edition (OCE) or the official version is requested it use this line
or this line
Code: Select all
find_package(OpenCASCADE CONFIG QUIET)
Internally cmake looks for the files OCEConfig.cmake or OpenCASCADEConfig.cmake which are expected to be in $FREECAD_LIBPACK_DIR/lib/cmake. With attached zip file you should be able to extend your libpack without the need to touch FindOpenCasCade.cmake.
The changes you made are way too specific to your libpack. Again the recommended way is to put the cmake config files to the libpack so that the general mechanism is able to find all needed information.
At the moment my local build lacks of shiboken/PySide support but this is what I look next.