Skip to content

Commit

Permalink
Always make idlc_generate available in install
Browse files Browse the repository at this point in the history
With cross-builds, and now therefore also static builds, one does need IDLC.  Installing
Generate.cmake unconditionally means one can always write

  idlc_generate(TARGET konijn FILES wortel.idl)

and one only has to make sure that CMake can find "idlc" and the backend library.  Adding
the host build to the CMAKE_PREFIX_PATH as in:

  cmake -DCMAKE_PREFIX_PATH=.../target-install\;.../host-install

results in CMake finding the CycloneDDS package for the target in the target-install
directory while also looking (and finding) idlc and the backend somewhere in the
host-install directory.

Signed-off-by: Erik Boasson <[email protected]>
  • Loading branch information
eboasson committed Mar 28, 2024
1 parent 085bd87 commit 0bf9627
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ install(
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig"
COMPONENT dev
)
install(
FILES "${CycloneDDS_SOURCE_DIR}/cmake/Modules/Generate.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/idlc"
COMPONENT dev)

# Generated file paths
# although the following files are generated, they are checked into source
Expand Down
4 changes: 1 addition & 3 deletions PackageConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,4 @@
@PACKAGE_INIT@

include("${CMAKE_CURRENT_LIST_DIR}/@[email protected]")
if(TARGET CycloneDDS::idlc)
include("${CMAKE_CURRENT_LIST_DIR}/idlc/Generate.cmake")
endif()
include("${CMAKE_CURRENT_LIST_DIR}/idlc/Generate.cmake")
5 changes: 0 additions & 5 deletions src/tools/idlc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,6 @@ if (INSTALL_PDB)
)
endif()

install(
FILES "${CycloneDDS_SOURCE_DIR}/cmake/Modules/Generate.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/idlc"
COMPONENT dev)

include("${CycloneDDS_SOURCE_DIR}/cmake/Modules/Generate.cmake")

if(BUILD_TESTING)
Expand Down

0 comments on commit 0bf9627

Please sign in to comment.