rticommunity / rticonnextdds-examples

This repository includes examples on how to use specific features of RTI Connext DDS.
Other
129 stars 140 forks source link

Win32 builds under a Win64 host #336

Open EdgarGrimbergNOV opened 3 years ago

EdgarGrimbergNOV commented 3 years ago

Information

What is the current behavior?

If I want to compile under Win64 for a Win32 target, and I only have the i86Win32 package installed, using the provided FindRTIConnectDDS.cmake, I get the error:

CMake Warning at C:/RTI/rti_connext_dds-6.0.0/resource/cmake/FindRTIConnextDDS.cmake:481 (message): header_files is not installed for i86Win32 under C:/RTI/rti_connext_dds-6.0.0 Call Stack (most recent call first): C:/RTI/rti_connext_dds-6.0.0/resource/cmake/FindRTIConnextDDS.cmake:953 (connextdds_check_component_field_version) CMakeLists.txt:50 (find_package)

Steps to reproduce the issue

Create a dummy CMakeLists.txt and add to it:

set(RTI_VERSION "6.0.0")

set(RTI_HOME "C:/RTI")
set(RTI_LIB "i86Win32VS2017")

#we are running on Win64, but buildig for Win32
set(CONNEXTDDS_ARCH "i86Win32")

set(ENV{NDDS_HOME} ${RTI_HOME}/rti_connext_dds-${RTI_VERSION})
set(NDDS_RESOURCE_CMAKE ${RTI_HOME}/rti_connext_dds-${RTI_VERSION}/resource/cmake/)
set(CONNEXTDDS_DIR $ENV{NDDS_HOME})

set(CMAKE_MODULE_PATH
    ${CMAKE_MODULE_PATH}
    ${NDDS_RESOURCE_CMAKE}
)
find_package(RTIConnextDDS
            EXACT ${RTI_VERSION}
            REQUIRED
            COMPONENTS
            core)

What is the expected behavior?

No errors running cmake.

Suggested solutions

The cmake file FindRTIConnextDDS.cmake has a section that is setting some platform specific definitions. Search for the comment: Platform-specific Definitions to find it. Under that section, the list connextdds_host_arch is being set with values guess from the CMAKE_HOST... , ignoring the supplied CONNEXTDDS_ARCH value.

EdgarGrimbergNOV commented 3 years ago

Some more output: cmake ../src/ -G Ninja -DCONNEXTDDS_ARCH=i86Win32 --log-level=debug

results in:

-- RTI Connext DDS architecture: i86Win32 
--   DEBUG get_all_library_variables called
--   DEBUG ====================================================================
--   DEBUG      library_names: nddsc;nddscore
--   DEBUG      result_var_name: CONNEXTDDS_C_API
--   DEBUG              [release/static]Library name: nddscz
--   DEBUG              [release/static]Library name: nddscorez
--   DEBUG      CONNEXTDDS_C_API_LIBRARIES_RELEASE_STATIC = libnddsc_release_static-NOTFOUND;libnddscore_release_static-NOTFOUND

and

--   DEBUG ====================================================================
--   DEBUG connextdds_check_component_field_version called
--   DEBUG ====================================================================
--   DEBUG      field_name: header_files
--   DEBUG      rti_architectures: [java;x64Win64]
-- VERBOSE Checking version for header_files
-- VERBOSE ~~~~~~~START Component info:~~~~~~~
-- VERBOSE      <header_files>
-- VERBOSE              <installation>
-- VERBOSE                  <architecture>i86Win32</architecture>
-- VERBOSE                  <version>6.0.0</version>
-- VERBOSE                  <licensed>unlicensed</licensed>
-- VERBOSE              </installation>
-- VERBOSE          </header_files>
-- VERBOSE ~~~~~~~FINISH Component info:~~~~~~~
CMake Warning at C:/RTI/rti_connext_dds-6.0.0/resource/cmake/FindRTIConnextDDS.cmake:678 (message):
  header_files is not installed for i86Win32 under
  C:/RTI/rti_connext_dds-6.0.0

if I try with cmake ../src/ -G Ninja -DCONNEXTDDS_ARCH=i86Win32VS2017 --log-level=debug, I get the libs, but still no header files:

--   DEBUG get_all_library_variables called 
--   DEBUG ====================================================================
--   DEBUG      library_names: nddsc;nddscore
--   DEBUG      result_var_name: CONNEXTDDS_C_API
--   DEBUG              [release/static]Library name: nddscz
--   DEBUG              [release/static]Library name: nddscorez
--   DEBUG      CONNEXTDDS_C_API_LIBRARIES_RELEASE_STATIC = C:/RTI/rti_connext_dds-6.0.0/lib/i86Win32VS2017/nddscz.lib;C:/RTI/rti_connext_dds-6.0.0/lib/i86Win32VS2017/nddscorez.lib

and

--   DEBUG ====================================================================
--   DEBUG connextdds_check_component_field_version called
--   DEBUG ====================================================================
--   DEBUG      field_name: header_files
--   DEBUG      rti_architectures: [java;x64Win64]
-- VERBOSE Checking version for header_files
-- VERBOSE ~~~~~~~START Component info:~~~~~~~
-- VERBOSE      <header_files>
-- VERBOSE              <installation>
-- VERBOSE                  <architecture>i86Win32</architecture>
-- VERBOSE                  <version>6.0.0</version>
-- VERBOSE                  <licensed>unlicensed</licensed>
-- VERBOSE              </installation>
-- VERBOSE          </header_files>
-- VERBOSE ~~~~~~~FINISH Component info:~~~~~~~
CMake Warning at C:/RTI/rti_connext_dds-6.0.0/resource/cmake/FindRTIConnextDDS.cmake:678 (message):
  header_files is not installed for i86Win32VS2017 under
  C:/RTI/rti_connext_dds-6.0.0