Force CMake to use specific build type libraries when linking against the imported targets
lulivi opened this issue · comments
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
- Compile a library against an imported target passing the CMAKE_BUILD_TYPE=Debug.
- 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.