diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b86a22c..d0632c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1021,6 +1021,49 @@ jobs: run: | echo "LD_LIBRARY_PATH=$GITHUB_WORKSPACE/.local/lib:$LD_LIBRARY_PATH" >> "$GITHUB_ENV" + - name: Find Package Integration Workflow + uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0 + if: ${{ matrix.build-cmake || matrix.is-earliest }} + with: + source-dir: boost-root/libs/${{ steps.patch.outputs.module }}/test/cmake_test + build-dir: __build_cmake_install_test__ + generator: ${{ matrix.generator }} + generator-toolset: ${{ matrix.generator-toolset }} + build-type: ${{ matrix.build-type }} + cxxstd: ${{ matrix.latest-cxxstd }} + cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }} + ccflags: ${{ matrix.ccflags }} + cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }} + cxxflags: ${{ matrix.cxxflags }} + shared: ${{ matrix.shared }} + install: false + cmake-version: '>=3.15' + extra-args: | + -D BOOST_CI_INSTALL_TEST=ON + -D CMAKE_PREFIX_PATH=${{ steps.patch.outputs.workspace_root }}/.local + ref-source-dir: boost-root/libs/capy + trace-commands: true + + - name: Subdirectory Integration Workflow + uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0 + if: ${{ matrix.build-cmake || matrix.is-earliest }} + with: + source-dir: boost-root/libs/${{ steps.patch.outputs.module }}/test/cmake_test + build-dir: __build_cmake_subdir_test__ + generator: ${{ matrix.generator }} + generator-toolset: ${{ matrix.generator-toolset }} + build-type: ${{ matrix.build-type }} + cxxstd: ${{ matrix.latest-cxxstd }} + cc: ${{ steps.setup-cpp.outputs.cc || matrix.cc }} + ccflags: ${{ matrix.ccflags }} + cxx: ${{ steps.setup-cpp.outputs.cxx || matrix.cxx }} + cxxflags: ${{ matrix.cxxflags }} + shared: ${{ matrix.shared }} + install: false + cmake-version: '>=3.15' + extra-args: -D BOOST_CI_INSTALL_TEST=OFF + ref-source-dir: boost-root/libs/capy/test/cmake_test + - name: Root Project CMake Workflow uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.0 if: ${{ matrix.build-cmake || matrix.is-earliest }} diff --git a/test/cmake_test/CMakeLists.txt b/test/cmake_test/CMakeLists.txt new file mode 100644 index 0000000..34176f5 --- /dev/null +++ b/test/cmake_test/CMakeLists.txt @@ -0,0 +1,49 @@ +# +# Copyright (c) 2023 Christian Mazakas +# Copyright (c) 2022 alandefreitas (alandefreitas@gmail.com) +# +# Distributed under the Boost Software License, Version 1.0. +# https://www.boost.org/LICENSE_1_0.txt +# + +cmake_minimum_required(VERSION 3.5...3.16) + +project(cmake_subdir_test LANGUAGES CXX) +set(__ignore__ ${CMAKE_C_COMPILER}) +set(__ignore__ ${CMAKE_C_FLAGS}) + +if(BOOST_CI_INSTALL_TEST) + find_package(Boost CONFIG REQUIRED COMPONENTS capy) +else() + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) + add_subdirectory(../.. boostorg/capy) + + set(deps + # Primary dependencies + + assert + config + core + system + throw_exception + + # Secondary dependencies + + compat + variant2 + winapi + mp11 + predef + ) + + foreach(dep IN LISTS deps) + add_subdirectory(../../../${dep} boostorg/${dep} EXCLUDE_FROM_ALL) + endforeach() +endif() + +add_executable(main main.cpp) +target_link_libraries(main Boost::capy) + +enable_testing() +add_test(NAME main COMMAND main) +add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure -C $) diff --git a/test/cmake_test/main.cpp b/test/cmake_test/main.cpp new file mode 100644 index 0000000..468fe70 --- /dev/null +++ b/test/cmake_test/main.cpp @@ -0,0 +1,13 @@ +// +// Copyright (c) 2025 Mohammad Nejati +// +// Distributed under the Boost Software License, Version 1.0. +// https://www.boost.org/LICENSE_1_0.txt +// + +#include + +int +main() +{ +}