From ae0fdd817943bdba36f3635869b9e0124bfa813e Mon Sep 17 00:00:00 2001 From: Fred Hornsey Date: Wed, 10 Apr 2024 12:49:46 -0500 Subject: [PATCH] Pass Xerces Path to ACE/TAO in CMake --- .github/workflows/cmake.yml | 26 ++++++++++++++++++++++++++ cmake/ace_group.cmake | 4 ++++ cmake/build_ace_tao.cmake | 19 ++++++++++++++----- 3 files changed, 44 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 009c364a54e..1624df2fefd 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -288,6 +288,8 @@ jobs: -DBUILD_SHARED_LIBS=TRUE^ -DOPENDDS_ACE_TAO_SRC=${{ github.workspace }}\OpenDDS\build\ACE_TAO^ -DOPENDDS_MPC=${{ github.workspace }}\MPC^ + -DOPENDDS_XERCES3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows^ + -DOPENDDS_OPENSSL=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows^ -DOPENDDS_BUILD_TESTS=TRUE^ -DOPENDDS_CMAKE_VERBOSE=all - uses: ammaraskar/msvc-problem-matcher@0.3.0 @@ -307,6 +309,15 @@ jobs: runs-on: windows-2022 steps: + - name: setup for run-vcpkg + shell: bash + run: | + echo '{ "name": "opendds", "version-string": "github-actions", "dependencies": [ "openssl", "xerces-c" ] }' > vcpkg.json + - name: install openssl & xerces-c + uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: '${{ env.VCPKG_GIT_COMMIT }}' + runVcpkgInstall: true - name: Checkout OpenDDS uses: actions/checkout@v4 with: @@ -333,6 +344,8 @@ jobs: -DBUILD_SHARED_LIBS=FALSE^ -DOPENDDS_ACE_TAO_SRC=${{ github.workspace }}\OpenDDS\build\ACE_TAO^ -DOPENDDS_MPC=${{ github.workspace }}\MPC^ + -DOPENDDS_XERCES3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows^ + -DOPENDDS_OPENSSL=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows^ -DOPENDDS_BUILD_TESTS=TRUE^ -DOPENDDS_CMAKE_VERBOSE=all - uses: ammaraskar/msvc-problem-matcher@0.3.0 @@ -388,6 +401,8 @@ jobs: -DBUILD_SHARED_LIBS=TRUE^ -DOPENDDS_ACE_TAO_SRC=${{ github.workspace }}\OpenDDS\build\ACE_TAO^ -DOPENDDS_MPC=${{ github.workspace }}\MPC^ + -DOPENDDS_XERCES3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows^ + -DOPENDDS_OPENSSL=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows^ -DOPENDDS_BUILD_TESTS=TRUE^ -DOPENDDS_CMAKE_VERBOSE=all - uses: ammaraskar/msvc-problem-matcher@0.3.0 @@ -407,6 +422,15 @@ jobs: runs-on: windows-2022 steps: + - name: setup for run-vcpkg + shell: bash + run: | + echo '{ "name": "opendds", "version-string": "github-actions", "dependencies": [ "openssl", "xerces-c" ] }' > vcpkg.json + - name: install openssl & xerces-c + uses: lukka/run-vcpkg@v11 + with: + vcpkgGitCommitId: '${{ env.VCPKG_GIT_COMMIT }}' + runVcpkgInstall: true - name: Checkout OpenDDS uses: actions/checkout@v4 with: @@ -433,6 +457,8 @@ jobs: -DBUILD_SHARED_LIBS=FALSE^ -DOPENDDS_ACE_TAO_SRC=${{ github.workspace }}\OpenDDS\build\ACE_TAO^ -DOPENDDS_MPC=${{ github.workspace }}\MPC^ + -DOPENDDS_XERCES3=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows^ + -DOPENDDS_OPENSSL=${{ env.VCPKG_INSTALLED_DIR }}/x64-windows^ -DOPENDDS_BUILD_TESTS=TRUE^ -DOPENDDS_CMAKE_VERBOSE=all - uses: ammaraskar/msvc-problem-matcher@0.3.0 diff --git a/cmake/ace_group.cmake b/cmake/ace_group.cmake index a9d2218368b..40856e1c401 100644 --- a/cmake/ace_group.cmake +++ b/cmake/ace_group.cmake @@ -46,6 +46,10 @@ if(OPENDDS_XERCES3) if(NOT XercesC_FOUND) message(FATAL_ERROR "Could not find XercesC") endif() + if(NOT IS_DIRECOTRY "${OPENDDS_XERCES3}") + get_filename_component(_opendds_xerces3 "${XercesC_INCLUDE_DIRS}" DIRECTORY) + set(OPENDDS_XERCES3 "${_opendds_xerces3}" CACHE PATH "" FORCE) + endif() endif() function(_opendds_vs_force_static) diff --git a/cmake/build_ace_tao.cmake b/cmake/build_ace_tao.cmake index 843d63935ed..ef5af418f3c 100644 --- a/cmake/build_ace_tao.cmake +++ b/cmake/build_ace_tao.cmake @@ -66,6 +66,9 @@ if(_OPENDDS_MPC_TYPE STREQUAL gnuace) endforeach() set(make_cmd "${CMAKE_COMMAND}" -E env "ACE_ROOT=${OPENDDS_ACE}" "TAO_ROOT=${OPENDDS_TAO}") + if(OPENDDS_XERCES3) + list(APPEND make_cmd "XERCESCROOT=${OPENDDS_XERCES3}") + endif() if(CMAKE_GENERATOR STREQUAL "Unix Makefiles") list(APPEND make_cmd "$(MAKE)") else() @@ -123,15 +126,21 @@ elseif(_OPENDDS_MPC_TYPE MATCHES "^vs") endif() endforeach() + set(_msbuild_cmd "${CMAKE_COMMAND}" -E env "ACE_ROOT=${OPENDDS_ACE}" "TAO_ROOT=${OPENDDS_TAO}") + if(OPENDDS_XERCES3) + list(APPEND _msbuild_cmd "XERCESCROOT=${OPENDDS_XERCES3}") + endif() + list(APPEND _msbuild_cmd + MSBuild "${sln}" + "-property:Configuration=$,Platform=${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}" + "-maxcpucount" + ) + ExternalProject_Add(build_ace_tao SOURCE_DIR "${OPENDDS_ACE_TAO_SRC}" CONFIGURE_COMMAND "${CMAKE_COMMAND}" -E echo "Already configured" BUILD_IN_SOURCE TRUE - BUILD_COMMAND - "${CMAKE_COMMAND}" -E env "ACE_ROOT=${OPENDDS_ACE}" "TAO_ROOT=${OPENDDS_TAO}" - MSBuild "${sln}" - "-property:Configuration=$,Platform=${CMAKE_VS_PLATFORM_TOOLSET_HOST_ARCHITECTURE}" - "-maxcpucount" + BUILD_COMMAND ${_msbuild_cmd} BUILD_BYPRODUCTS ${byproducts} USES_TERMINAL_BUILD TRUE # Needed for Ninja to show the ACE/TAO build INSTALL_COMMAND "${CMAKE_COMMAND}" -E echo "No install step"