View Issue Details

IDProjectCategoryView StatusLast Update
0027301Open CASCADEOCCT:Configurationpublic2016-04-20 15:51
ReportervsrAssigned Toabv 
PriorityurgentSeverityminor 
Status closedResolutionfixed 
Target Version7.0.0Fixed in Version7.0.0 
Summary0027301: CMake: export targets for OCCT
DescriptionCMake provides a way to export project's targets into the dedicated file, which can be then used in dependent project which build procedure is written with CMake.

Target files allow specifying inter-dependencies between project's libraries plus external dependencies - like libtool does, for instance.

This useful feature simplifies linking in dependent project - it is not mandatory to list all libraries to link the project, but only 1st level dependencies, while 2nd, 3rd, etc -level dependencies will be picked up automatically by CMake.

For example, I may only add explicitly linkage to TKMath, and linking to TKernel will be added automatically by CMake. This is especially useful for third-party libraries - you don't need to know which libraries OCCT is linked to.

This is done by:
a) Using EXPORT option with INSTALL(TARGETS ...) command (to specify target's group);
b) Using EXPORT(TARGETS ...) command to create targets file in a build tree;
c) Using INSTALL(EXPORT ...) to install targets file along with the project.

For more details, see
- Description of CMake's INSTALL command (in first turn, description of INSTALL(EXPORT ...) notation):
https://cmake.org/cmake/help/v2.8.11/cmake.html#command:install
- Description of CMake's EXPORT command:
https://cmake.org/cmake/help/v2.8.11/cmake.html#command:export

Example of usage:
https://cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
TagsNo tags attached.
Test case number

Relationships

parent of 0027344 closedbugmaster Configuration, CMake - bugs with detecting third-party products 
child of 0027290 closedbugmaster CMake configuration files for OCCT 

Activities

git

2016-03-30 10:50

administrator   ~0052156

Branch CR27301 has been created by ski.

SHA-1: 5c25be3ff39bf5cfc80efc2fb5924f64e7eb8d07


Detailed log of new commits:

Author: ski
Date: Wed Mar 30 10:50:48 2016 +0300

    0027301: CMake: export targets for OCCT
    
    Added possibility to create CMake target files for OCCT.

git

2016-03-30 12:24

administrator   ~0052170

Branch CR27301 has been updated forcibly by ski.

SHA-1: 905e44d78d5eca932ec2846f3f5fe0f959dce1bd

git

2016-03-30 15:17

administrator   ~0052189

Branch CR27301 has been updated by ski.

SHA-1: 4e7afde687c2715dbf907064a0e5e0c2a7adec0c


Detailed log of new commits:

Author: ski
Date: Wed Mar 30 15:12:03 2016 +0300

    Define destination for DRAWEXE executable during installation

Author: ski
Date: Wed Mar 30 15:06:40 2016 +0300

    Install generated by CMake config, version and target files to correct directory (depending on configuration)

Author: ski
Date: Wed Mar 30 14:42:44 2016 +0300

    Use relative paths in generated files OpenCASCADETarget-*.cmake

Author: ski
Date: Wed Mar 30 12:48:50 2016 +0300

    Use same logic for single/multi configuration generators

git

2016-03-30 18:17

administrator   ~0052207

Branch CR27301 has been updated by ski.

SHA-1: dfa2ce43d1f35ddf52f1e4f565d0ef9408f94d26


Detailed log of new commits:

Author: ski
Date: Wed Mar 30 18:07:49 2016 +0300

    Update generated OpenCASCADE Config file to contain correct build type and path to binaries and libraries

Author: ski
Date: Wed Mar 30 17:59:03 2016 +0300

    Remove unnecessary if statement

git

2016-03-30 18:28

administrator   ~0052208

Branch CR27301 has been updated forcibly by ski.

SHA-1: 920c7070142105e9ac4d23905d8ca378cc457ad5

git

2016-03-30 18:44

administrator   ~0052213

Branch CR27301_1 has been created by abv.

SHA-1: 3909db622b72929d497270b7e6be4f17fde66876


Detailed log of new commits:

Author: abv
Date: Wed Mar 30 17:26:39 2016 +0300

    0027301: CMake: export targets for OCCT
    
    Added possibility to create CMake target files for OCCT.
    Install generated by CMake config, version and target files to correct directory (depending on configuration).
    Define destination for DRAWEXE executable during installation.

git

2016-03-30 18:53

administrator   ~0052215

Branch CR27301_1 has been updated forcibly by abv.

SHA-1: 7dcea7a91701cfbd35ea656598afb68a6f73178a

git

2016-03-31 20:18

administrator   ~0052249

Branch CR27301_1 has been updated by ski.

SHA-1: 10ea4506388a71c093a394b64c730c117ee44ac4


Detailed log of new commits:

Author: ski
Date: Thu Mar 31 20:17:30 2016 +0300

    Updated installation path for OpenCASCADETarget file for single generator

Author: ski
Date: Thu Mar 31 19:56:05 2016 +0300

    Corrected misprint in OpenCASCADEConfig.cmake.in template

Author: ski
Date: Thu Mar 31 18:24:27 2016 +0300

    Use case-insensitive name for patching OpenCASCADETarget-*.cmake files

git

2016-04-01 15:14

administrator   ~0052296

Branch CR27301_1 has been updated by ski.

SHA-1: 0449e8b46d3902ddcfd9d1cfbe40f748a510815b


Detailed log of new commits:

Author: ski
Date: Fri Apr 1 15:13:51 2016 +0300

    Added list of available OpenCASCADE libraries for each module.
    Also it is possible now to use COMPOMENT agrument in find_package utility in dependent projects.

git

2016-04-05 00:15

administrator   ~0052366

Branch CR27301_2 has been created by abv.

SHA-1: 377939429c4b4694c9404a151406f08420146282


Detailed log of new commits:

Author: ski
Date: Mon Apr 4 19:51:24 2016 +0300

    0027301: CMake: export targets for OCCT
    
    Enabled creation of CMake target files (one per module) for OCCT at install time.
    Variables enumerating available OCCT modules and toolkits by module are added in CMake configuration file.
    Added check of availability of OCCT modules specified by OpenCASCADE_FIND_COMPONENTS variable.
    Location of CMake configuration and target files in Windows layout is changed to $INSTALL_DIR/cmake (thus common for all configurations), to be found by CMake find_package() function.

git

2016-04-05 07:41

administrator   ~0052367

Branch CR27301_2 has been updated by abv.

SHA-1: 96a9eb670798500c4cbdbc54af2cc5b2a9970d48


Detailed log of new commits:

Author: abv
Date: Tue Apr 5 07:41:07 2016 +0300

    Avoid unnecessary hacks on cmake files

git

2016-04-05 09:10

administrator   ~0052368

Branch CR27301_2 has been updated forcibly by abv.

SHA-1: 2ef27c65c84979bf3c289d4ddb7986b45da67c1f

abv

2016-04-05 09:16

manager   ~0052369

Sergey, I have reviwed and updated the patch, and it seems to work now for both single (Linux) and multiple (Windows) configurations. The main change is taking into account point (3) in 0027344: now CMake configuration and target files in Windows layout are installed to ./cmake folder for all configurations. This means that OpenCASCADEConfig.cmake cannot contain configuration-specific parameters, hence I removed setting of OpenCASCADE_BUILD_TYPE in multi-configuration mode.

Please review asap.

git

2016-04-05 15:54

administrator   ~0052399

Branch CR27301_2 has been updated forcibly by abv.

SHA-1: ada9ef40c2dad256a72b8e4bc429d37b1c929f68

ski

2016-04-05 18:20

developer   ~0052409

No remarks, please proceed.

git

2016-04-17 13:27

administrator   ~0052882

Branch CR27301 has been deleted by kgv.

SHA-1: 920c7070142105e9ac4d23905d8ca378cc457ad5

git

2016-04-17 14:42

administrator   ~0053224

Branch CR27301_2 has been deleted by kgv.

SHA-1: ada9ef40c2dad256a72b8e4bc429d37b1c929f68

git

2016-04-20 11:34

administrator   ~0053334

Branch CR27301_1 has been deleted by inv.

SHA-1: 0449e8b46d3902ddcfd9d1cfbe40f748a510815b

Related Changesets

occt: master ada9ef40

2016-04-04 16:51:24

abv


Committer: abv Details Diff
0027301: CMake: export targets for OCCT

Enabled creation of CMake target files (one per module) for OCCT at install time.
Variables enumerating available OCCT toolkits by module are added in CMake configuration file.
Added check of availability of OCCT modules specified by OpenCASCADE_FIND_COMPONENTS variable.
Location of CMake configuration and target files in Windows layout is changed to $INSTALL_DIR/cmake (thus common for all configurations), to be found by standard search logic of CMake find_package() function.
Affected Issues
0027301
mod - adm/cmake/occt_macros.cmake Diff File
mod - adm/cmake/occt_toolkit.cmake Diff File
mod - adm/templates/OpenCASCADEConfig.cmake.in Diff File
mod - CMakeLists.txt Diff File

Issue History

Date Modified Username Field Change
2016-03-23 14:13 vsr New Issue
2016-03-23 14:13 vsr Assigned To => bugmaster
2016-03-24 11:33 bugmaster Assigned To bugmaster => ski
2016-03-25 15:06 ski Relationship added child of 0027290
2016-03-25 15:06 ski Status new => assigned
2016-03-30 10:50 git Note Added: 0052156
2016-03-30 12:24 git Note Added: 0052170
2016-03-30 15:17 git Note Added: 0052189
2016-03-30 18:17 git Note Added: 0052207
2016-03-30 18:28 git Note Added: 0052208
2016-03-30 18:44 git Note Added: 0052213
2016-03-30 18:53 git Note Added: 0052215
2016-03-31 20:18 git Note Added: 0052249
2016-04-01 15:14 git Note Added: 0052296
2016-04-05 00:15 git Note Added: 0052366
2016-04-05 07:41 git Note Added: 0052367
2016-04-05 09:10 git Note Added: 0052368
2016-04-05 09:16 abv Note Added: 0052369
2016-04-05 09:16 abv Priority normal => urgent
2016-04-05 09:16 abv Status assigned => resolved
2016-04-05 09:17 abv Relationship added parent of 0027344
2016-04-05 15:54 git Note Added: 0052399
2016-04-05 18:20 ski Note Added: 0052409
2016-04-05 18:20 ski Assigned To ski => bugmaster
2016-04-05 18:20 ski Status resolved => reviewed
2016-04-05 18:22 bugmaster Status reviewed => tested
2016-04-05 18:22 bugmaster Target Version 7.1.0 => 7.0.0
2016-04-06 10:33 abv Changeset attached => occt master ada9ef40
2016-04-06 10:33 abv Assigned To bugmaster => abv
2016-04-06 10:33 abv Status tested => verified
2016-04-06 10:33 abv Resolution open => fixed
2016-04-17 13:27 git Note Added: 0052882
2016-04-17 14:42 git Note Added: 0053224
2016-04-20 11:34 git Note Added: 0053334
2016-04-20 15:42 aiv Fixed in Version => 7.0.0
2016-04-20 15:51 aiv Status verified => closed