View Issue Details

IDProjectCategoryView StatusLast Update
0002644Slicer4Core: Extensionspublic2018-03-02 11:00
Reportermarkus-van-tol Assigned Tojcfr  
PrioritylowSeverityfeatureReproducibilityN/A
Status closedResolutionfixed 
Product Version 
Target VersionSlicer 4.7.0Fixed in Version 
Summary0002644: Extensions built from template should create Config.cmake file
Description

Building extensions with the template results in extensions that cannot be used as dependencies for other extensions.
To make it reasonable to make extensions that depend on other, separate extensions, they should create a Config.cmake file, as Slicer itself does.
This would allow easy access of libraries created in extensions and would provide for the directory variables of extensions, as in Slicer.

Additional Information

An example of the issue is here:
https://github.com/mvantol/slicer-issue-examples/tree/master/extension_dependency
Shows an independent extension, and a dependent extension that attempts to access the logic of the independent one, but cannot.

TagsNo tags attached.

Activities

jcfr

jcfr

2012-10-15 12:24

administrator   ~0006549

Thanks Markus. This is very helpful.

When the build system will be fixed, to compile the provided example, a manual build would be done using the following:

cmake -DSlicer_DIR:PATH=/path/to/Slicer-Superbuild/Slicer-build -DIndependentExtension_DIR:PATH=/path/to/IndependentExtension-build ../DependentExtension

This what the extension build system is already doing. See [1] [2] and [3]. We now need to implement the mechanism (and/or provide helper) allowing to create an extension config file.

Thanks
Jc

[1] https://github.com/Slicer/Slicer/blob/master/Extensions/CMake/SlicerBlockBuildPackageAndUploadExtensions.cmake#L127
[2] https://github.com/Slicer/Slicer/blob/master/Extensions/CMake/SlicerBlockBuildPackageAndUploadExtensions.cmake#L209
[3] https://github.com/Slicer/Slicer/blob/master/Extensions/CMake/SlicerBlockBuildPackageAndUploadExtension.cmake#L146

jcfr

jcfr

2012-10-30 08:31

administrator   ~0006906

For reference: http://slicer-devel.65872.n3.nabble.com/Linking-an-extension-to-a-separately-compiled-extension-tp4026413p4026439.html

jcfr

jcfr

2012-11-02 13:02

administrator   ~0007025

When done, also update the following page: http://www.slicer.org/slicerWiki/index.php/Documentation/Nightly/Developers/Tutorials/CreateLoadableModule

The Config generated by default should expose variable like:

<MODULENAME>_MODULE_WIDGETS_INCLUDE_DIRS

<MODULENAME>_MODULE_LOGIC_INCLUDE_DIRS

<MODULENAME>_MODULE_MRML_INCLUDE_DIRS

jcfr

jcfr

2013-06-14 10:11

administrator   ~0008769

// -----------------------------------------------------------
In a nutshell, assuming you have ExtA depending on ExtB, you will have to make sure ExtB provide a config file so that your extension can do find_package(ExtB)

To see how to create a Config file, I would recommend to look at:
https://github.com/davidsansome/python-cmake-buildsystem/commit/3f504d8be5b41086f615494517ddd2cf66f4d365
https://github.com/commontk/DCMTK/commit/f461865d1759854db56e4c840991c81c77e45bb9
http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
// -----------------------------------------------------------
Source: Extension dependency discussion - http://slicer-devel.65872.n3.nabble.com/Extension-dependency-tt4028231.html#a4028265

// -----------------------------------------------------------
You could look at: https://github.com/davidsansome/python-cmake-buildsystem

More particularly this commit:

  • Export targets from both the installed and build tree [1]
  • Add generation of <PROJECT_NAME>Config.cmake [2]

[1] https://github.com/davidsansome/python-cmake-buildsystem/commit/73134d77881ae6648a8f98daaf8630130b7f54ea
[2] https://github.com/davidsansome/python-cmake-buildsystem/commit/3f504d8be5b41086f615494517ddd2cf66f4d365

This was based on the explanation of Alexander Neundorf. See http://www.cmake.org/pipermail/cmake/2013-February/053689.html

We should really update the following tutorial: http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
// -----------------------------------------------------------
Source: Discussion on CMake list - http://cmake.3232098.n2.nabble.com/CMakeModules-repository-at-GitHub-tt7583818.html#a7583832

lassoan

lassoan

2017-09-27 13:06

developer   ~0015183

@jcfr Has this been fixed already or there are still things to do?

jcfr

jcfr

2017-10-03 10:32

administrator   ~0015240

This is now fixed. @lassoan added support for it.

Issue History

Date Modified Username Field Change
2012-10-15 08:21 markus-van-tol New Issue
2012-10-15 08:21 markus-van-tol Status new => assigned
2012-10-15 08:21 markus-van-tol Assigned To => jcfr
2012-10-15 10:37 jcfr Target Version => Slicer 4.2.0 - coming release
2012-10-15 12:24 jcfr Note Added: 0006549
2012-10-26 13:28 jcfr Target Version Slicer 4.2.0 - coming release => Slicer 4.3.0
2012-10-30 08:31 jcfr Note Added: 0006906
2012-11-02 13:02 jcfr Note Added: 0007025
2012-11-02 13:02 jcfr Target Version Slicer 4.3.0 => Slicer 4.2.1
2012-11-16 09:55 jcfr Target Version Slicer 4.2.1 => Slicer 4.2.2
2012-12-06 14:38 jcfr Target Version Slicer 4.2.2 => Slicer 4.2.3
2013-02-12 09:37 jcfr Target Version Slicer 4.2.3 => Slicer 4.3.0
2013-06-14 10:11 jcfr Note Added: 0008769
2013-08-27 08:56 jcfr Target Version Slicer 4.3.0 => Slicer 4.4.0
2014-05-12 23:28 jcfr Status assigned => acknowledged
2014-05-12 23:28 jcfr Target Version Slicer 4.4.0 =>
2014-05-12 23:29 jcfr Status acknowledged => assigned
2014-05-12 23:29 jcfr Assigned To jcfr => matthew-woehlke
2014-05-12 23:29 jcfr Priority normal => low
2014-05-12 23:29 jcfr Target Version => Slicer 4.4.0
2014-07-30 19:04 jcfr Assigned To matthew-woehlke => jcfr
2014-07-30 19:04 jcfr Target Version Slicer 4.4.0 => Slicer 4.5.0-1
2015-11-02 05:54 jcfr Target Version Slicer 4.5.0-1 => Slicer 4.6.0
2016-10-12 04:33 jcfr Target Version Slicer 4.6.0 => Slicer 4.7.0
2017-09-27 13:06 lassoan Note Added: 0015183
2017-10-03 10:32 jcfr Status assigned => resolved
2017-10-03 10:32 jcfr Resolution open => fixed
2017-10-03 10:32 jcfr Note Added: 0015240
2018-03-02 11:00 jcfr Status resolved => closed