diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 07d2c27..180b1fe 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -100,7 +100,7 @@ jobs: run: | cmake --build ${{github.workspace}}/_build --config Debug --parallel - - name: Install (Release) + - name: Install (Debug) shell: cmd run: | cmake --build ${{github.workspace}}/_build --config Debug --target INSTALL @@ -134,9 +134,19 @@ jobs: $module_path="${{github.workspace}}/thirdparty/asio-module" $module_path_posix=$module_path.Replace('\', '/') + if ( '${{ matrix.library_type }}' -eq 'static' ) + { + $use_udpcap = 'ON' + } + else + { + $use_udpcap = 'OFF' + } + cmake -B "${{github.workspace}}/samples/integration_test/_build" ` -A ${{ matrix.build_arch }} ` -DCMAKE_PREFIX_PATH="${{github.workspace}}/${{env.INSTALL_PREFIX}}" ` + -DINTEGRATION_TEST_INCLUDE_UDPCAP=$use_udpcap ` -DCMAKE_MODULE_PATH="$module_path_posix" working-directory: ${{ github.workspace }}/samples/integration_test diff --git a/cmake/ecaludpConfig.cmake.in b/cmake/ecaludpConfig.cmake.in index 806b5d6..dd1f703 100644 --- a/cmake/ecaludpConfig.cmake.in +++ b/cmake/ecaludpConfig.cmake.in @@ -3,4 +3,8 @@ include(CMakeFindDependencyMacro) find_dependency(asio) +if(@ECALUDP_ENABLE_NPCAP@) + find_dependency(udpcap) +endif() + INCLUDE("${CMAKE_CURRENT_LIST_DIR}/ecaludpTargets.cmake") \ No newline at end of file diff --git a/samples/integration_test/CMakeLists.txt b/samples/integration_test/CMakeLists.txt index 59fab1b..b4bb30d 100644 --- a/samples/integration_test/CMakeLists.txt +++ b/samples/integration_test/CMakeLists.txt @@ -18,6 +18,15 @@ cmake_minimum_required(VERSION 3.13) project(integration_test) +include("${CMAKE_CURRENT_LIST_DIR}/../../thirdparty/build-asio.cmake") + +################################################################################ +# Add udpcap for static compiling, again +if (INTEGRATION_TEST_INCLUDE_UDPCAP) + include("${CMAKE_CURRENT_LIST_DIR}/../../thirdparty/build-udpcap.cmake") +endif() +################################################################################ + find_package(Threads REQUIRED) find_package(ecaludp REQUIRED) diff --git a/samples/integration_test/CMakeWindows.bat b/samples/integration_test/CMakeWindows.bat new file mode 100644 index 0000000..e16233b --- /dev/null +++ b/samples/integration_test/CMakeWindows.bat @@ -0,0 +1,6 @@ +mkdir _build +cd _build + +cmake .. -A x64 -DCMAKE_PREFIX_PATH="../../_build_static/_install" -DINTEGRATION_TEST_INCLUDE_UDPCAP=ON +cd .. +pause \ No newline at end of file diff --git a/thirdparty/build-udpcap.cmake b/thirdparty/build-udpcap.cmake index d0d0d3b..19af0cf 100644 --- a/thirdparty/build-udpcap.cmake +++ b/thirdparty/build-udpcap.cmake @@ -16,7 +16,7 @@ set(UDPCAP_THIRDPARTY_ENABLED ON) set(UDPCAP_THIRDPARTY_USE_BUILTIN_ASIO OFF) # Add udpcap library from subdirectory -add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/udpcap" EXCLUDE_FROM_ALL) +add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/udpcap" thirdparty/udpcap EXCLUDE_FROM_ALL) add_library(udpcap::udpcap ALIAS udpcap) # Reset static / shared libs to old value