From 5ce335bbb1848eba0574d567d80eea17194b0025 Mon Sep 17 00:00:00 2001 From: maelstrom Date: Mon, 21 Jul 2025 22:41:34 +0200 Subject: [PATCH] wip --- CMakeLists.txt | 4 +-- CMakePresets.json | 21 -------------- CMakeUserPresets.json | 13 --------- cmake/FindStb.cmake | 30 ------------------- core/CMakeLists.txt | 19 +----------- core/deps.cmake | 63 ++++++++++++++++++++++++++++++++++++++++ vcpkg-configuration.json | 17 ----------- vcpkg.json | 20 ------------- 8 files changed, 66 insertions(+), 121 deletions(-) delete mode 100644 CMakePresets.json delete mode 100644 CMakeUserPresets.json delete mode 100644 cmake/FindStb.cmake create mode 100644 core/deps.cmake delete mode 100755 vcpkg-configuration.json delete mode 100755 vcpkg.json diff --git a/CMakeLists.txt b/CMakeLists.txt index 2f452a5..7a72dae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib ) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) add_subdirectory(core) -add_subdirectory(client) -add_subdirectory(editor) +#add_subdirectory(client) +#add_subdirectory(editor) install(FILES $ TYPE BIN) \ No newline at end of file diff --git a/CMakePresets.json b/CMakePresets.json deleted file mode 100644 index f6fda18..0000000 --- a/CMakePresets.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 2, - "configurePresets": [ - { - "name": "vcpkg", - "generator": "Visual Studio 17 2022", - "binaryDir": "${sourceDir}/build", - "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" - } - }, - { - "name": "vcpkg-linux", - "generator": "Ninja", - "binaryDir": "${sourceDir}/build", - "cacheVariables": { - "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake" - } - } - ] -} \ No newline at end of file diff --git a/CMakeUserPresets.json b/CMakeUserPresets.json deleted file mode 100644 index a314c3f..0000000 --- a/CMakeUserPresets.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "version": 2, - "configurePresets": [ - { - "name": "default", - "inherits": "vcpkg", - "environment": { - "VCPKG_ROOT": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\vcpkg\\vcpkg.exe" - } - } - ] -} - \ No newline at end of file diff --git a/cmake/FindStb.cmake b/cmake/FindStb.cmake deleted file mode 100644 index f77b1e7..0000000 --- a/cmake/FindStb.cmake +++ /dev/null @@ -1,30 +0,0 @@ -# Distributed under the OSI-approved BSD 3-Clause License. -# Copyright Stefano Sinigardi - -#.rst: -# FindStb -# ------------ -# -# Find the Stb include headers. -# -# Result Variables -# ^^^^^^^^^^^^^^^^ -# -# This module defines the following variables: -# -# ``Stb_FOUND`` -# True if Stb library found -# -# ``Stb_INCLUDE_DIR`` -# Location of Stb headers -# - -include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake) -include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake) - -if(NOT Stb_INCLUDE_DIR) - find_path(Stb_INCLUDE_DIR NAMES stb_image.h PATHS ${Stb_DIR} PATH_SUFFIXES include stb include/stb) -endif() - -find_package_handle_standard_args(Stb DEFAULT_MSG Stb_INCLUDE_DIR) -mark_as_advanced(Stb_INCLUDE_DIR) \ No newline at end of file diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index 6882117..7cdc4c2 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -1,21 +1,4 @@ -find_package(OpenGL REQUIRED COMPONENTS OpenGL) - -find_package(GLEW REQUIRED) -include_directories(${GLEW_INCLUDE_DIRS}) - -find_package(OpenGL) -find_package(glm CONFIG REQUIRED) -find_package(ReactPhysics3D REQUIRED) -find_package(pugixml 1.15 REQUIRED) -find_package(Freetype) - -find_package(Stb REQUIRED) -include_directories(${Stb_INCLUDE_DIR}) - -# PkgConfig packages -find_package(PkgConfig REQUIRED) -pkg_check_modules(LUAJIT REQUIRED luajit) -link_directories(${LUAJIT_LIBRARY_DIRS}) +include(${CMAKE_CURRENT_SOURCE_DIR}/deps.cmake) ### Autogen file(GLOB_RECURSE AUTOGEN_SOURCES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/src" "src/objects/*.h" "src/datatypes/*.h" "src/enum/*.h") diff --git a/core/deps.cmake b/core/deps.cmake new file mode 100644 index 0000000..e85ddd4 --- /dev/null +++ b/core/deps.cmake @@ -0,0 +1,63 @@ +# Declare/fetch packages + +include(FetchContent) +FetchContent_Declare( + glew + GIT_REPOSITORY https://github.com/Perlmint/glew-cmake + GIT_TAG glew-cmake-2.2.0 +) + +FetchContent_Declare( + glm + GIT_REPOSITORY https://github.com/g-truc/glm + GIT_TAG 1.0.1 +) + +FetchContent_Declare( + ReactPhysics3D + GIT_REPOSITORY https://github.com/DanielChappuis/reactphysics3d + GIT_TAG v0.10.2 +) + +FetchContent_Declare( + pugixml + GIT_REPOSITORY https://github.com/zeux/pugixml + GIT_TAG v1.15 +) + +FetchContent_Declare( + freetype + GIT_REPOSITORY https://gitlab.freedesktop.org/freetype/freetype + GIT_TAG VER-2-13-3 +) + +FetchContent_Declare( + stb + GIT_REPOSITORY https://github.com/natanaeljr/stb-cmake-package + GIT_TAG 1a4828e0cf649fb873c7b5f45b5d22d411a44ae4 # v0.9.0 +) + +FetchContent_Declare( + luajit + GIT_REPOSITORY https://github.com/zhaozg/luajit-cmake + GIT_TAG 300c0b3f472be2be158f5b2e6385579ba5c6c0f9 +) + +FetchContent_MakeAvailable(glew glm ReactPhysics3D pugixml freetype stb luajit) + +# Find/include packages + +find_package(OpenGL REQUIRED COMPONENTS OpenGL) +# find_package(glew REQUIRED) +include_directories(${GLEW_INCLUDE_DIRS}) +# find_package(glm CONFIG REQUIRED) +# find_package(ReactPhysics3D REQUIRED) +# find_package(pugixml 1.15 REQUIRED) +# find_package(Freetype) +# find_package(Stb REQUIRED) +include_directories(${Stb_INCLUDE_DIR}) + +# PkgConfig packages +# find_package(PkgConfig REQUIRED) +# pkg_check_modules(LUAJIT REQUIRED luajit) +link_directories(${LUAJIT_LIBRARY_DIRS}) \ No newline at end of file diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json deleted file mode 100755 index 32d5985..0000000 --- a/vcpkg-configuration.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "default-registry": { - "kind": "git", - "baseline": "0c4cf19224a049cf82f4521e29e39f7bd680440c", - "repository": "https://github.com/microsoft/vcpkg" - }, - "registries": [ - { - "kind": "artifact", - "location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip", - "name": "microsoft" - } - ], - "overlay-ports": [ - "./vcpkg-overlays" - ] -} diff --git a/vcpkg.json b/vcpkg.json deleted file mode 100755 index c375df5..0000000 --- a/vcpkg.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "dependencies": [ - "glew", - "glfw3", - "glm", - { "name": "pugixml", "version>=": "1.15" }, - "sdl2", - "stb", - "reactphysics3d", - "pkgconf", - "luajit", - "freetype" - ], - "overrides": [ - { - "name": "sdl2", - "version": "2.32.4" - } - ] -}