diff --git a/src/Mod/Assembly/App/AssemblyObject.h b/src/Mod/Assembly/App/AssemblyObject.h index 8ddf548a42..a5f7df556c 100644 --- a/src/Mod/Assembly/App/AssemblyObject.h +++ b/src/Mod/Assembly/App/AssemblyObject.h @@ -33,7 +33,7 @@ #include #include "SimulationGroup.h" -#include <3rdParty/OndselSolver/OndselSolver/enum.h> +#include namespace MbD { diff --git a/src/Mod/Assembly/App/CMakeLists.txt b/src/Mod/Assembly/App/CMakeLists.txt index b945f612c1..bf8e14e7ac 100644 --- a/src/Mod/Assembly/App/CMakeLists.txt +++ b/src/Mod/Assembly/App/CMakeLists.txt @@ -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 diff --git a/src/Mod/Assembly/CMakeLists.txt b/src/Mod/Assembly/CMakeLists.txt index e74cdbce46..42149923e3 100644 --- a/src/Mod/Assembly/CMakeLists.txt +++ b/src/Mod/Assembly/CMakeLists.txt @@ -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) diff --git a/tests/src/Mod/Assembly/CMakeLists.txt b/tests/src/Mod/Assembly/CMakeLists.txt index 1b1d32dc85..5b905d2e9a 100644 --- a/tests/src/Mod/Assembly/CMakeLists.txt +++ b/tests/src/Mod/Assembly/CMakeLists.txt @@ -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