From b214cdf3a1ed74aef34cf2cd782a1d5985203eec Mon Sep 17 00:00:00 2001 From: Orange Date: Tue, 28 Oct 2025 01:09:47 +0300 Subject: [PATCH 1/3] removed useless option --- .github/workflows/cmake-multi-platform.yml | 4 +- .idea/vcs.xml | 2 - CMakeLists.txt | 7 +-- CMakePresets.json | 50 ++++++++++++++-------- 4 files changed, 34 insertions(+), 29 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 01cca253..22253d6f 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -40,7 +40,7 @@ jobs: git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT" - name: Configure (cmake --preset) shell: bash - run: cmake --preset linux-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DOMATH_BUILD_VIA_VCPKG=ON -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" + run: cmake --preset linux-release-vcpkg -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DOMATH_BUILD_VIA_VCPKG=ON -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" - name: Build shell: bash @@ -75,7 +75,7 @@ jobs: - name: Configure (cmake --preset) shell: bash - run: cmake --preset windows-release -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DOMATH_BUILD_VIA_VCPKG=ON -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" + run: cmake --preset windows-release-vcpkg -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DOMATH_BUILD_VIA_VCPKG=ON -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" - name: Build shell: bash diff --git a/.idea/vcs.xml b/.idea/vcs.xml index 455d6bf0..35eb1ddf 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -2,7 +2,5 @@ - - \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 324a95e4..f270e36f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,13 +23,8 @@ option(OMATH_SUPRESS_SAFETY_CHECKS "Supress some safety checks in release build option(OMATH_USE_UNITY_BUILD "Will enable unity build to speed up compilation" OFF) option(OMATH_ENABLE_LEGACY "Will enable legacy classes that MUST be used ONLY for backward compatibility" ON) -option(OMATH_BUILD_VIA_VCPKG "Will enable building using vcpkg, vcpkg will override some options that were set in vcpkg.json file, and search for dependencies using vcpkg" OFF) -if (OMATH_BUILD_VIA_VCPKG AND NOT CMAKE_TOOLCHAIN_FILE) - message(FATAL_ERROR "[${PROJECT_NAME}] CMAKE_TOOLCHAIN_FILE IS EMPTY! Please set env variable called 'VCPKG_ROOT' to vcpkg root folder here is an example: 'C:/vcpkg' or '/home/user/vcpkg' ") -endif () - -if (OMATH_BUILD_VIA_VCPKG AND VCPKG_MANIFEST_FEATURES) +if (VCPKG_MANIFEST_FEATURES) foreach (omath_feature IN LISTS VCPKG_MANIFEST_FEATURES) if (omath_feature STREQUAL "imgui") set(OMATH_IMGUI_INTEGRATION ON) diff --git a/CMakePresets.json b/CMakePresets.json index 3aced04b..5e493b52 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -9,8 +9,6 @@ "installDir": "${sourceDir}/cmake-build/install/${presetName}", "cacheVariables": { "CMAKE_CXX_COMPILER": "cl.exe", - "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", - "VCPKG_INSTALLED_DIR": "${sourceDir}/cmake-build/vcpkg_installed", "CMAKE_MAKE_PROGRAM": "Ninja" }, "condition": { @@ -19,6 +17,17 @@ "rhs": "Windows" } }, + { + "name": "windows-base-vcpkg", + "hidden": true, + "inherits": "windows-base", + "cacheVariables": { + "OMATH_BUILD_VIA_VCPKG": "ON", + "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", + "VCPKG_INSTALLED_DIR": "${sourceDir}/cmake-build/vcpkg_installed", + "VCPKG_MANIFEST_FEATURES": "tests;imgui;avx2" + } + }, { "name": "windows-debug", "displayName": "Debug", @@ -30,17 +39,15 @@ { "name": "windows-debug-vcpkg", "displayName": "Debug", - "inherits": "windows-base", + "inherits": "windows-base-vcpkg", "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "OMATH_BUILD_VIA_VCPKG": "ON", - "VCPKG_MANIFEST_FEATURES": "tests;imgui;avx2" + "CMAKE_BUILD_TYPE": "Debug" } }, { "name": "windows-release-vcpkg", "displayName": "Release", - "inherits": "windows-base", + "inherits": "windows-base-vcpkg", "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", "OMATH_BUILD_VIA_VCPKG": "ON" @@ -62,8 +69,6 @@ "installDir": "${sourceDir}/cmake-build/install/${presetName}", "cacheVariables": { "CMAKE_CXX_COMPILER": "clang++", - "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", - "VCPKG_INSTALLED_DIR": "${sourceDir}/cmake-build/vcpkg_installed", "CMAKE_MAKE_PROGRAM": "ninja" }, "condition": { @@ -72,6 +77,17 @@ "rhs": "Linux" } }, + { + "name": "linux-base-vcpkg", + "hidden": true, + "inherits": "linux-base", + "cacheVariables": { + "OMATH_BUILD_VIA_VCPKG": "ON", + "CMAKE_TOOLCHAIN_FILE": "$env{VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake", + "VCPKG_INSTALLED_DIR": "${sourceDir}/cmake-build/vcpkg_installed", + "VCPKG_MANIFEST_FEATURES": "tests;imgui;avx2" + } + }, { "name": "linux-debug", "displayName": "Linux Debug", @@ -83,10 +99,9 @@ { "name": "linux-debug-vcpkg", "displayName": "Linux Debug", - "inherits": "linux-base", + "inherits": "linux-base-vcpkg", "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "OMATH_BUILD_VIA_VCPKG": "ON" + "CMAKE_BUILD_TYPE": "Debug" } }, { @@ -100,10 +115,9 @@ { "name": "linux-release-vcpkg", "displayName": "Linux Release", - "inherits": "linux-debug", + "inherits": "linux-base-vcpkg", "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release", - "OMATH_BUILD_VIA_VCPKG": "ON" + "CMAKE_BUILD_TYPE": "Release" } }, { @@ -134,8 +148,7 @@ "displayName": "Darwin Debug", "inherits": "darwin-base", "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "OMATH_BUILD_VIA_VCPKG": "ON" + "CMAKE_BUILD_TYPE": "Debug" } }, { @@ -151,8 +164,7 @@ "displayName": "Darwin Release", "inherits": "darwin-debug", "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release", - "OMATH_BUILD_VIA_VCPKG": "ON" + "CMAKE_BUILD_TYPE": "Release" } } ] From ea7b812645bf3ac98baf39fa78269a4e85c72969 Mon Sep 17 00:00:00 2001 From: Orange Date: Tue, 28 Oct 2025 01:11:02 +0300 Subject: [PATCH 2/3] removed --- .github/workflows/cmake-multi-platform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 22253d6f..5f4bc67c 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -40,7 +40,7 @@ jobs: git clone https://github.com/microsoft/vcpkg "$VCPKG_ROOT" - name: Configure (cmake --preset) shell: bash - run: cmake --preset linux-release-vcpkg -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DOMATH_BUILD_VIA_VCPKG=ON -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" + run: cmake --preset linux-release-vcpkg -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" - name: Build shell: bash @@ -75,7 +75,7 @@ jobs: - name: Configure (cmake --preset) shell: bash - run: cmake --preset windows-release-vcpkg -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DOMATH_BUILD_VIA_VCPKG=ON -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" + run: cmake --preset windows-release-vcpkg -DOMATH_BUILD_TESTS=ON -DOMATH_BUILD_BENCHMARK=OFF -DVCPKG_MANIFEST_FEATURES="imgui;avx2;tests" - name: Build shell: bash From 64385757afea847d15f0d86bb273455792d2e4b9 Mon Sep 17 00:00:00 2001 From: Orange Date: Tue, 28 Oct 2025 01:15:36 +0300 Subject: [PATCH 3/3] fix --- .github/workflows/cmake-multi-platform.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake-multi-platform.yml b/.github/workflows/cmake-multi-platform.yml index 5f4bc67c..2c01dd4f 100644 --- a/.github/workflows/cmake-multi-platform.yml +++ b/.github/workflows/cmake-multi-platform.yml @@ -44,7 +44,7 @@ jobs: - name: Build shell: bash - run: cmake --build cmake-build/build/linux-release --target unit_tests omath + run: cmake --build cmake-build/build/linux-release-vcpkg --target unit_tests omath - name: Run unit_tests shell: bash @@ -79,7 +79,7 @@ jobs: - name: Build shell: bash - run: cmake --build cmake-build/build/windows-release --target unit_tests omath + run: cmake --build cmake-build/build/windows-release-vcpkg --target unit_tests omath - name: Run unit_tests.exe shell: bash