Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage of mark_as_superbuild #70

Closed
KrisThielemans opened this issue Jan 13, 2018 · 1 comment · Fixed by #148
Closed

usage of mark_as_superbuild #70

KrisThielemans opened this issue Jan 13, 2018 · 1 comment · Fixed by #148

Comments

@KrisThielemans
Copy link
Member

KrisThielemans commented Jan 13, 2018

I don't think we use this properly.

SuperBuild.cmake should add some variables to all subprojects

Indeed, it tries to do this (could do it for more of them I think). However, it says

mark_as_superbuild(
   PROJECTS ALL_PROJECTS
   VARS CMAKE_GENERATOR:STRING CMAKE_GENERATOR_PLATFORM:STRING CMAKE_GENERATOR_TOOLSET:STRING
        CMAKE_C_COMPILER:FILEPATH CMAKE_CXX_COMPILER:FILEPATH
        CMAKE_INSTALL_PREFIX:PATH
)

I think this has to be

mark_as_superbuild(
   ALL_PROJECTS
 ..
)

No idea why it would work now... but I think it does as I put it in :-)

All the external projects use it to pass CMake variables on

code is

mark_as_superbuild(
    VARS
        ${externalProjName}_DIR:PATH
    LABELS
      "FIND_PACKAGE"
  )

This has 2 problems as far as I can see:

  • It is only correct if the project indeeds sets/need the *_DIR variable (many do not, e.g. GTEST_ROOT).
  • According to the doc, mark_as_superbuild adds this variable then only to the top-level project, which in our case is CCPPETMR, but not to the projects where they are actually needed.

The 2nd item seems to imply these lines are currently effectively ignored. Hence the need for us to specify all the variables by hand again.

I wonder if we should use ALL_PROJECTS here as well, although then we're going to add variables where we actually don't need/use them. A better way would be to know to which projects we need to add them, but then we introduce dependencies on "downstream" projects, which seems a bad idea.

Probably a better solution is to forget about mark_as_superbuild in the sub-projects, and to introduce a variable with all CMake args that need to be set if someone wants to use this project (but that seems exactly what mark_as_superbuild seems to aim to provide).

Summary

I'm confused...

Here's an old-ish post with some info. It refers to old Slicer stuff, but here's a recent link. Note that this also has some interesting stuff with unset and ExternalProject_SetIfNotDefined which might be relevant to #51.

@KrisThielemans KrisThielemans mentioned this issue Jan 13, 2018
Merged
KrisThielemans added a commit that referenced this issue Oct 7, 2018
Use `ALL_PROJECTS` as opposed to `PROJECTS ALL_PROJECTS`. This
seems to have the same effect though. See #70.
@KrisThielemans
Copy link
Member Author

Wrong usage in SuperBuild.cmake is/was fixed in #148

paskino pushed a commit that referenced this issue Oct 23, 2018
* Remove setting of FFTW3_ROOT_DIR CMake variable

Remove as it's ignored (see #147).
Note that it was wrongly spelled in External_Gadgetron.cmake

* pass SWIG_EXECUTABLE to all projects

* correct use of mark_as_superbuild

Use `ALL_PROJECTS` as opposed to `PROJECTS ALL_PROJECTS`. This
seems to have the same effect though. See #70.

* small corrections to FindACE.cmake

- Don't set ACE_DIR with makr_as_superbuild. Should have been ACE_ROOT, but
it isn't used anyway
- correct variable names

* some clean-up of Armadillo

extra comments and remove mark_as_superbuild as not used.

* correct setting of SWIG variables, adding SWIG_EXECUTABLE to the cache

This also allows people to change the executable if they want.

* correct diagnostics when using system ACE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant