From fc495c1c129650d746838c8216d0dfd1be346052 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Insaurralde=20Avalos?= Date: Mon, 23 Oct 2023 10:45:41 -0300 Subject: [PATCH] Add OndselSolver as git submodule also update github actions to pull submodules --- .github/workflows/sub_buildUbuntu2004.yml | 2 ++ .github/workflows/sub_buildUbuntu2204.yml | 2 ++ .github/workflows/sub_buildWindows.yml | 2 ++ .github/workflows/sub_lint.yml | 2 ++ .gitmodules | 3 +++ .../InitializeFreeCADBuildOptions.cmake | 1 + src/3rdParty/CMakeLists.txt | 10 +++++++++- src/3rdParty/OndselSolver | 1 + 8 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 .gitmodules create mode 160000 src/3rdParty/OndselSolver diff --git a/.github/workflows/sub_buildUbuntu2004.yml b/.github/workflows/sub_buildUbuntu2004.yml index b908fa1dc9..e479eb1c75 100644 --- a/.github/workflows/sub_buildUbuntu2004.yml +++ b/.github/workflows/sub_buildUbuntu2004.yml @@ -73,6 +73,8 @@ jobs: steps: - name: Checking out source code uses: actions/checkout@v3 + with: + submodules: true - name: Install FreeCAD dependencies run: | sudo apt-get update -qq diff --git a/.github/workflows/sub_buildUbuntu2204.yml b/.github/workflows/sub_buildUbuntu2204.yml index d73bd73e91..f1bf5fc0a3 100644 --- a/.github/workflows/sub_buildUbuntu2204.yml +++ b/.github/workflows/sub_buildUbuntu2204.yml @@ -71,6 +71,8 @@ jobs: steps: - name: Checking out source code uses: actions/checkout@v3 + with: + submodules: true - name: Install FreeCAD dependencies run: | sudo apt-get update -qq diff --git a/.github/workflows/sub_buildWindows.yml b/.github/workflows/sub_buildWindows.yml index fe50eb06bb..b32887b1ef 100644 --- a/.github/workflows/sub_buildWindows.yml +++ b/.github/workflows/sub_buildWindows.yml @@ -64,6 +64,8 @@ jobs: steps: - name: Checking out source code uses: actions/checkout@v3 + with: + submodules: true - name: Make needed directories, files and initializations id: Init run: | diff --git a/.github/workflows/sub_lint.yml b/.github/workflows/sub_lint.yml index c2c44918df..7495198fea 100644 --- a/.github/workflows/sub_lint.yml +++ b/.github/workflows/sub_lint.yml @@ -199,6 +199,8 @@ jobs: steps: - name: Check out code uses: actions/checkout@v3 + with: + submodules: true - name: Make needed directories, files and initializations id: Init run: | diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000000..0f84846b75 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "src/3rdParty/OndselSolver"] + path = src/3rdParty/OndselSolver + url = https://github.com/Ondsel-Development/OndselSolver.git diff --git a/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake b/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake index 2e70b36152..9bd1ca2617 100644 --- a/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake +++ b/cMake/FreeCAD_Helpers/InitializeFreeCADBuildOptions.cmake @@ -9,6 +9,7 @@ macro(InitializeFreeCADBuildOptions) option(FREECAD_USE_EXTERNAL_SMESH "Use system installed smesh instead of the bundled." OFF) option(FREECAD_USE_EXTERNAL_KDL "Use system installed orocos-kdl instead of the bundled." OFF) option(FREECAD_USE_EXTERNAL_FMT "Use system installed fmt library if available instead of fetching the source." ON) + option(FREECAD_USE_EXTERNAL_ONDSELSOLVER "Use system installed OndselSolver instead of git submodule." OFF) option(FREECAD_USE_FREETYPE "Builds the features using FreeType libs" ON) option(FREECAD_BUILD_DEBIAN "Prepare for a build of a Debian package" OFF) option(BUILD_WITH_CONDA "Set ON if you build FreeCAD with conda" OFF) diff --git a/src/3rdParty/CMakeLists.txt b/src/3rdParty/CMakeLists.txt index 4f2be684e1..a88b4ec3a5 100644 --- a/src/3rdParty/CMakeLists.txt +++ b/src/3rdParty/CMakeLists.txt @@ -4,4 +4,12 @@ if (BUILD_SMESH AND NOT FREECAD_USE_EXTERNAL_SMESH) endif() add_subdirectory(lazy_loader) -add_subdirectory(libE57Format) \ No newline at end of file +add_subdirectory(libE57Format) + +if (BUILD_ASSEMBLY AND NOT FREECAD_USE_EXTERNAL_ONDSELSOLVER) + if( NOT EXISTS "${CMAKE_SOURCE_DIR}/src/3rdParty/OndselSolver/CMakeLists.txt" ) + message( SEND_ERROR "The OndselSolver git submodule is not available. Please run + git submodule update --init" ) + endif() + add_subdirectory(OndselSolver) +endif() \ No newline at end of file diff --git a/src/3rdParty/OndselSolver b/src/3rdParty/OndselSolver new file mode 160000 index 0000000000..84762ac74e --- /dev/null +++ b/src/3rdParty/OndselSolver @@ -0,0 +1 @@ +Subproject commit 84762ac74ec6fe73a710f91ba3697a5034221537