Skip to content

Cross compiling a dependent application with cmake - host idlc and cycloneddsidlcxx #364

@Entropy512

Description

@Entropy512

This is somewhat of a continuation of the conversation in eclipse-cyclonedds/cyclonedds#794 (comment)

I'm trying to start from @stan-guer 's comment, adapting it to use cyclonedds-cxx:

if(CMAKE_CROSSCOMPILING)
  include("${Cyclone_HOST_PREFIX}/lib/cmake/CycloneDDS-CXX/idlcxx/Generate.cmake")
endif()

idlcxx_generate(TARGET messages FILES HelloWorldData.idl WARNINGS no-implicit-extensibility)

(yes, I'm starting with trying to cross-compile hello world as a standalone dependent app with some restructuring of the file tree - since the example is dependent on being built within the cyclonedds source tree)

I've set Cyclone_HOST_PREFIX in my toolchain file to where I installed the host-architecture build of cyclonedds and cyclonedds-cxx (In my case, ~/cyclonedds_host)

The question is - how do I add Cyclone_HOST_PREFIX to the search path so that find_library() works for cycloneddsidlcxx? I get the following:

CMake Error at /home/adodd/cyclonedds_host/lib/cmake/CycloneDDS-CXX/idlcxx/Generate.cmake:27 (find_library):
  Could not find _idlcxx_shared_lib using the following names:
  cycloneddsidlcxx
Call Stack (most recent call first):
  idl/CMakeLists.txt:5 (idlcxx_generate)

Adding Cyclone_HOST_PREFIX to CMAKE_FIND_ROOT_PATH does not work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions