|Anonymous | Login||2021-01-20 07:20 MSK|
|My View | View Issues | Change Log | Roadmap|
|View Issue Details|
|ID||Project||Category||View Status||Date Submitted||Last Update|
|0031667||Community||[OCCT] OCCT:Configuration||public||2020-07-16 12:02||2020-10-26 22:52|
|Target Version||[OCCT] 7.6.0*||Fixed in Version|
|Summary||0031667: Configuration, CMake - Dependencies between targets are not specified for static builds and not public|
|Description||In the CMake buildsystem, the library dependencies of a toolkit target are only registered if BUILD_SHARD_LIBS=On and they are not added to the "public cmake interface" (i.e. the public keyword is missing in target_link_libraries).|
I understand that this may be the best option if cmake version 2 is used. But I would say nowadays most users are using Cmake 3 and in Cmake 3 you can declare the dependencies of a cmake library target as public. This has the big advantage, that dependencies are transitively included.
Example: Consider a cmake script which finds occt with find_package(...) and then links to the TKBrep target (with target_link_libraries). Until now this meant, that we also needed to link to TKMath, TKernel, TKG2d, TKG3d and TKGeomBase. With my proposed patch, it suffices to link to TKBrep only. The links to TKMath, TKernel, TKG2d, TKG3d and TKGeomBase are then automatically added thanks to the "PUBLIC" keyword in target_link_libraries.
The proposed patch only adds the public keyword if cmake 3 or higher is used. Otherwise we fallback to the original behavior.
|Tags||No tags attached.|
|Test case number|
Branch CR31667 has been created by craffael.
Detailed log of new commits:
Date: Thu Jul 16 11:12:39 2020 +0200
31667: target_link_libraries with public interface for cmake >= 3
|@utverdov may I ask what is the reason that this has been postponed to 7.6.0?|
|2020-07-16 12:02||craffael||New Issue|
|2020-07-16 12:02||craffael||Assigned To||=> craffael|
|2020-07-16 12:11||git||Note Added: 0093149|
|2020-07-16 12:15||craffael||Assigned To||craffael => bugmaster|
|2020-07-16 13:17||kgv||Product Version||=> 7.4.0|
|2020-07-16 13:17||kgv||Target Version||=> 7.5.0|
|2020-07-16 13:17||kgv||Summary||Dependencies between cmake targets are not specified for static builds and not public => Configuration, CMake - Dependencies between targets are not specified for static builds and not public|
|2020-07-16 13:19||kgv||Severity||minor => feature|
|2020-07-16 13:19||kgv||Product Version||7.4.0 =>|
|2020-09-11 15:40||utverdov||Target Version||7.5.0 => 7.6.0*|
|2020-10-26 22:52||craffael||Note Added: 0096285|
|Copyright © 2000 - 2021 MantisBT Team|