cmake fixes for external OndselSolver building (#18379)

* Assembly: fix building with external OndselSolver

This commit pairs with f35b075e271e9cb3451f3439f7dc0274841a0838.
It solves two issues:

- remove hardcoded includes of 3rdparty files
- add missing include_directories()

* Assembly: add check for external OndselSolver includes
This commit is contained in:
efferre79
2024-12-13 17:46:46 +01:00
committed by GitHub
parent 85eaa2d373
commit 70ec5a7583
4 changed files with 17 additions and 6 deletions

View File

@@ -33,7 +33,7 @@
#include <App/PropertyLinks.h>
#include "SimulationGroup.h"
#include <3rdParty/OndselSolver/OndselSolver/enum.h>
#include <OndselSolver/enum.h>
namespace MbD
{

View File

@@ -7,11 +7,6 @@ include_directories(
${OCC_INCLUDE_DIR}
${PYTHON_INCLUDE_DIRS}
)
if (NOT FREECAD_USE_EXTERNAL_ONDSELSOLVER)
include_directories(
${CMAKE_SOURCE_DIR}/src/3rdParty/OndselSolver
)
endif ()
link_directories(${OCC_LIBRARY_DIR})
set(Assembly_LIBS

View File

@@ -1,3 +1,14 @@
if (NOT FREECAD_USE_EXTERNAL_ONDSELSOLVER)
include_directories(
${CMAKE_SOURCE_DIR}/src/3rdParty/OndselSolver
)
else ()
check_include_file_cxx(OndselSolver/enum.h HAVE_ONDSELSOLVER_H)
if (NOT HAVE_ONDSELSOLVER_H)
message(FATAL_ERROR "FREECAD_USE_EXTERNAL_ONDSELSOLVER is set but the required system includes are not available")
endif ()
endif ()
add_subdirectory(App)
if(BUILD_GUI)

View File

@@ -5,6 +5,11 @@ target_include_directories(Assembly_tests_run PUBLIC
${Python3_INCLUDE_DIRS}
${XercesC_INCLUDE_DIRS}
)
if (NOT FREECAD_USE_EXTERNAL_ONDSELSOLVER)
target_include_directories(Assembly_tests_run PUBLIC
${CMAKE_SOURCE_DIR}/src/3rdParty/OndselSolver
)
endif ()
target_link_directories(Assembly_tests_run PUBLIC ${OCC_LIBRARY_DIR})
target_link_libraries(Assembly_tests_run