add CMake dependency handling for portability

This commit is contained in:
Tarik Moussa
2026-02-16 08:13:46 +02:00
parent b7875f3b88
commit 1d20c3a195
5 changed files with 31 additions and 8 deletions

12
code/.gitignore vendored
View File

@@ -7,16 +7,12 @@ build/
# Dependencies: Tarballs immer committen, entpackte ignorieren
deps
!deps/single_includes/
# exclude alle subdirs von depd without excluding the tarballs and single_includes
deps/*/*/
!deps/tarballs/*.tar.*
!deps/single_includes/
!deps/Cmakelists.txt
deps/eigen/
deps/boost/
deps/cgal/
!deps/cgal/include/ # Falls einzelne Includes brauchst
!deps/eigen/Eigen/
!deps/boost/boost/
# IDEs
.vscode/

27
code/deps/Cmakelists.txt Normal file
View File

@@ -0,0 +1,27 @@
# deps/CMakeLists.txt
function(setup_dependency NAME SUBDIR)
if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${NAME}")
file(MAKE_DIRECTORY "${NAME}")
file(GLOB TARBALL "${CMAKE_CURRENT_SOURCE_DIR}/tarballs/${NAME}.tar.*")
message(STATUS "${CMAKE_CURRENT_SOURCE_DIR}")
if(NOT TARBALL)
message(FATAL_ERROR "❌ No '${NAME}*.tar.*' in deps/tarballs/")
else()
message(STATUS "${CMAKE_COMMAND} ${TARBALL}" )
execute_process(COMMAND "${CMAKE_COMMAND}" -E tar xf "${TARBALL}" "${NAME}/${SUBDIR}" RESULT_VARIABLE TAR_STATUS WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" )
message(STATUS "Extracting ${NAME}... Output: ${TAR_OUTPUT} Status: ${TAR_STATUS}")
if(NOT TAR_STATUS EQUAL 0)
message(FATAL_ERROR "❌ Extract failed: ${NAME}")
endif()
endif()
else()
message(STATUS "✅ ${NAME} already exists, skipping extraction.")
endif()
endfunction()
setup_dependency("CGAL-6.1.1" "include" )
setup_dependency("eigen-3.4.0" "Eigen" )
setup_dependency("boost_1_90_0" "boost" )

Binary file not shown.

Binary file not shown.

Binary file not shown.