Page MenuHomePhabricator

External projects must define project name and list of dependencies
Closed, ResolvedPublic

Description

Projects such as GDCM define the project name and dependencies before checking whether the directory name is set:

set(proj GDCM)
set(proj_DEPENDENCIES )
set(GDCM_DEPENDS ${proj})
if(NOT DEFINED GDCM_DIR)

However, external projects PCRE, Numpy, Python, SWIG, ZLIB are the wrong way round:

if(NOT PCRE_DIR)

set(proj PCRE)
set(${proj}_DEPENDENCIES "")
set(${proj}_DEPENDS ${proj})

This means that, in this example, if you intend to pass in a pre-compiled PCRE, and you set PCRE_DIR, then in the call to

mitkMacroEmptyExternalProject(${proj} "${proj_DEPENDENCIES}")

the ${proj} variable is still set to the project name of the previous project (CppUnit) in this case, and the same problem for the proj_DEPENDENCIES variable.

This means, that 3rd party super builds cannot pass in pre-compiled libraries.

Event Timeline

Add to this, SWIG.cmake does not call mitkMacroEmptyExternalProject at all, and Python should do similar for both the source and build targets.

Thank you, Matt. Had to remove a trailing whitespace in your first commit but I kept you as the author of course. Awaiting green dashboard to merge this fix.

[23d196]: Merge branch 'bug-19339-external-projects-must-set-name-and-dependenci

Merged commits:

2015-09-26 08:10:13 Matt Clarkson [51bcb4]
Consistent use of proj variables


2015-09-30 13:55:24 Matt Clarkson [0d11b4]
Set proj and _DEPENDS and _DEPENDENCIES before checking directory