add CMake dependency handling for portability
This commit is contained in:
12
code/.gitignore
vendored
12
code/.gitignore
vendored
@@ -7,16 +7,12 @@ build/
|
|||||||
|
|
||||||
# Dependencies: Tarballs immer committen, entpackte ignorieren
|
# Dependencies: Tarballs immer committen, entpackte ignorieren
|
||||||
|
|
||||||
deps
|
# exclude alle subdirs von depd without excluding the tarballs and single_includes
|
||||||
!deps/single_includes/
|
deps/*/*/
|
||||||
!deps/tarballs/*.tar.*
|
!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
|
# IDEs
|
||||||
.vscode/
|
.vscode/
|
||||||
|
|||||||
27
code/deps/Cmakelists.txt
Normal file
27
code/deps/Cmakelists.txt
Normal 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" )
|
||||||
|
|
||||||
|
|
||||||
BIN
code/deps/tarballs/CGAL-6.1.1.tar.xz
Normal file
BIN
code/deps/tarballs/CGAL-6.1.1.tar.xz
Normal file
Binary file not shown.
BIN
code/deps/tarballs/boost_1_90_0.tar.gz
Normal file
BIN
code/deps/tarballs/boost_1_90_0.tar.gz
Normal file
Binary file not shown.
BIN
code/deps/tarballs/eigen-3.4.0.tar.gz
Normal file
BIN
code/deps/tarballs/eigen-3.4.0.tar.gz
Normal file
Binary file not shown.
Reference in New Issue
Block a user