rticommunity / rticonnextdds-cmake-utils

This repository provides modules and scripts that simplify the process of building and running RTI Connext applications using CMake.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Force CMake to use specific build type libraries when linking against the imported targets

lulivi opened this issue · comments

commented

Issue information

Field Value
Jira issue key INSTALL-749
OS(s) --
Connext version(s) --
Connext architecture(s) --

Description

Currently, the imported targets have the IMPORTED_LOCATION, IMPORTED_LOCATION_DEBUG and IMPORTED_LOCATION_RELEASE properties. This means that IMPORTED_LOCATION_DEBUG and IMPORTED_LOCATION_RELEASE overwrite the IMPORTED_LOCATION, for Release and Debug build types.

So when buildin with CMAKE_BUILD_TYPE=Debug, and linkin against a Connext imported target, we will be getting the library that matches the global build type.

Steps to reproduce the issue

  1. Compile a library against an imported target passing the CMAKE_BUILD_TYPE=Debug.
  2. It will be linked against the debug libraries of Connext.

Expected behavior

For the Connext libraries to be linked in release mode by default.

Suggested solutions

By default, don't add the IMPORTED_LOCATION_ properties to the imported targets and only do it when setting a special variable.