Skip to content

Commit

Permalink
Pass Xerces Path to ACE/TAO in CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
iguessthislldo committed Apr 10, 2024
1 parent 0511b83 commit ae0fdd8
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 5 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]
Expand All @@ -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:
Expand All @@ -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/[email protected]
Expand Down Expand Up @@ -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/[email protected]
Expand All @@ -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:
Expand All @@ -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/[email protected]
Expand Down
4 changes: 4 additions & 0 deletions cmake/ace_group.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
19 changes: 14 additions & 5 deletions cmake/build_ace_tao.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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=$<CONFIG>,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=$<CONFIG>,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"
Expand Down

0 comments on commit ae0fdd8

Please sign in to comment.