Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0031667Community[OCCT] OCCT:Configurationpublic2020-07-16 12:022020-10-26 22:52
Assigned Tobugmaster 
PlatformLinuxOSUbuntuOS Version18.04
Product Version 
Target Version[OCCT] 7.6.0*Fixed in Version 
Summary0031667: Configuration, CMake - Dependencies between targets are not specified for static builds and not public
DescriptionIn 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.
TagsNo tags attached.
Test case number
Attached Files

- Relationships

-  Notes
git (administrator)
2020-07-16 12:11

Branch CR31667 has been created by craffael.

SHA-1: 61f7249b4c822ef0f9c4a2060feb7d895b04590f

Detailed log of new commits:

Author: craffael
Date: Thu Jul 16 11:12:39 2020 +0200

    31667: target_link_libraries with public interface for cmake >= 3
craffael (reporter)
2020-10-26 22:52

@utverdov may I ask what is the reason that this has been postponed to 7.6.0?

- Issue History
Date Modified Username Field Change
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
Powered by Mantis Bugtracker