Hi Florian,
I think that maybe the packaging step should go to the superbuild script. What happen if you include CPack there ?
I think this makes a lot of sense, but I actually attempted this before putting CPack in Main.
-
If I try this I end up with nothing in the package and the cpack folder is completely empty. I tried it again just now and I got the same result.
-
I think that’s because the SuperBuild CMakeLists.txt doesn’t have anything except
ExternalProject_Addcommands:
# The Superbuild project's CMakeLists.txt
cmake_minimum_required (VERSION 2.6)
project(SUPERBUILD_ROOT)
include(ExternalProject)
include(CPack)
set(CPACK_GENERATOR NSIS)
ExternalProject_Add(extern
GIT_REPOSITORY "[extern's git repository]"
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/extern-install
)
ExternalProject_Add(Main
GIT_REPOSITORY "[main's git repository]"
CMAKE_ARGS
-DSUPERBUILD_EXTERN_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/extern-install/lib/cmake/Extern
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/Main-install
DEPENDS
extern
)
If it is necessary to put install commands in this, then, well, it seems to me that we’d end up in the exact same situation that Main is in, where we can’t install imported targets.
Let me know if you have any other suggestions, thanks,
EDIT:
Yep, looking at the source, the install of imported targets is actively forbidden in CMake 3.17, (1), CMake 3.13.5 (which is what I’m using) does something… else (2)?