diff --git a/.github/workflows/vcpkg.yml b/.github/workflows/vcpkg.yml index afb9447..c7d6d55 100644 --- a/.github/workflows/vcpkg.yml +++ b/.github/workflows/vcpkg.yml @@ -20,9 +20,11 @@ jobs: !${{github.workspace}}/vcpkg/buildtrees !${{github.workspace}}/vcpkg/packages !${{github.workspace}}/vcpkg/downloads + ${{ github.workspace }}/build/vcpkg_installed ${{ github.workspace }}/build/bin/Db*.solutions - key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json') }} + key: ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json', '**/vcpkg-configuration.json') }}-v1 restore-keys: | + ${{ runner.os }}-vcpkg-${{ hashFiles('**/vcpkg.json', '**/vcpkg-configuration.json') }}- ${{ runner.os }}-vcpkg- - name: Install dependencies (Ubuntu) @@ -62,10 +64,15 @@ jobs: vcpkgJsonGlob: '**/vcpkg.json' - name: Configure CMake - run: cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -DOPENMIND_BUILD_TESTS=OFF || cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake -DOPENMIND_BUILD_TESTS=OFF + run: | + cmake -B ${{github.workspace}}/build -G Ninja \ + -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/vcpkg/scripts/buildsystems/vcpkg.cmake \ + -DOPENMIND_BUILD_TESTS=ON \ + -DOPENMIND_USE_VCPKG=ON \ + -DCMAKE_BUILD_TYPE=Release - name: Build - run: cmake --build ${{github.workspace}}/build + run: cmake --build ${{github.workspace}}/build --config Release -j$(nproc) - name: Get number of CPU cores uses: SimenB/github-actions-cpu-cores@v2 diff --git a/CMakeLists.txt b/CMakeLists.txt index c66d007..afe9d6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,8 @@ -cmake_minimum_required (VERSION 3.8) +cmake_minimum_required (VERSION 3.8) + +project(skrypt) + +set(OPENMIND_USE_VCPKG ON) enable_language(CXX) set (CMAKE_CXX_STANDARD 23) @@ -33,7 +37,13 @@ include(FetchContent) FetchContent_Declare(openmind GIT_REPOSITORY https://github.com/ohhmm/openmind.git GIT_TAG main) -FetchContent_MakeAvailable(openmind) +FetchContent_MakeAvailable(openmind) + +# Add openmind's cmake modules to the module path +list(APPEND CMAKE_MODULE_PATH + "${CMAKE_BINARY_DIR}/_deps/openmind-src/cmake" + "${CMAKE_BINARY_DIR}/_deps/openmind-src/cmake/Modules" +) if(BUILD_TESTS OR OPENMIND_BUILD_TESTS) enable_testing() diff --git a/libskrypt/CMakeLists.txt b/libskrypt/CMakeLists.txt index 8783194..d10ad04 100644 --- a/libskrypt/CMakeLists.txt +++ b/libskrypt/CMakeLists.txt @@ -1,12 +1,13 @@ set(deplist math) +# Using Boost components from openmind +set(deplist ${deplist} Boost::filesystem Boost::program_options) + if(TARGET Boost::dll) set(deplist ${deplist} Boost::dll) elseif(Boost_DLL_LIBRARY) set(deplist ${deplist} ${Boost_DLL_LIBRARY}) -else() - set(deplist ${deplist} boost) endif() lib(${deplist}) diff --git a/libskrypt/tests/CMakeLists.txt b/libskrypt/tests/CMakeLists.txt index 93f0bf3..9fc2e12 100644 --- a/libskrypt/tests/CMakeLists.txt +++ b/libskrypt/tests/CMakeLists.txt @@ -1,2 +1,7 @@ -test() +# Configure test dependencies +set(TEST_DEPS libskrypt) +set(BOOST_TEST_LINK_LIBS Boost::unit_test_framework) + +# Configure tests with dependencies +test("${TEST_DEPS}") diff --git a/skrypt/skrypt.cpp b/skrypt/skrypt.cpp index 28d48a0..7cc7e63 100644 --- a/skrypt/skrypt.cpp +++ b/skrypt/skrypt.cpp @@ -8,7 +8,6 @@ using namespace omnn::math; #include #include #include -#include #include #include diff --git a/vcpkg-configuration.json b/vcpkg-configuration.json index a206725..9aca136 100644 --- a/vcpkg-configuration.json +++ b/vcpkg-configuration.json @@ -1,11 +1,11 @@ { - "default-registry": { - "kind": "git", - "baseline": "3508985146f1b1d248c67ead13f8f54be5b4f5da", - "repository": "https://github.com/ohhmm/vcpkg", - "reference": "openmind-port", - "packages": [ - "openmind" - ] - } -} \ No newline at end of file + "registries": [ + { + "kind": "git", + "repository": "https://github.com/ohhmm/vcpkg", + "baseline": "3508985146f1b1d248c67ead13f8f54be5b4f5da", + "reference": "openmind-port", + "packages": ["openmind"] + } + ] +} diff --git a/vcpkg.json b/vcpkg.json index 9321e7f..b289c2e 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -1,19 +1,21 @@ { "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", - "builtin-baseline": "3508985146f1b1d248c67ead13f8f54be5b4f5da", + "builtin-baseline": "a8954b904ad2a6939ecd8fc213e87702fa1243ea", "name": "skrypt", "version": "1.0.0", "description": "Sergii Kryvonos Relation Yarn Plausibility Tool", "dependencies": [ - "boost", "boost-chrono", "boost-compute", "boost-date-time", "boost-dll", "boost-filesystem", + "boost-gil", "boost-iostreams", + "boost-lambda", "boost-locale", "boost-multiprecision", + "boost-ublas", "boost-program-options", "boost-serialization", "boost-system", @@ -21,6 +23,7 @@ "boost-thread", "boost-uuid", "leveldb", + "tbb", { "name": "vcpkg-cmake", "host": true