[CMake] SuperProject package/install

Rob McDonald rob.a.mcdonald at gmail.com
Wed Nov 11 14:04:13 EST 2015


All,

I have a SuperProject set up with ExternalProject_add the way some
other projects do.

The SuperProject has two EP's -- Libraries and Main.  Libraries has a
bunch of its own EP's.  Main is my core project.

When some users use this setup, they're confused at the end --
everything has worked, but the project hasn't been installed, and the
results of compilation are buried several directories deep.

My Main project has a 'package' target set up by CPack.  I'd like the
SuperProject to conclude by executing that build target, and then
copying the resulting file to the top-level build directory from the
SuperProject.  To complicate things, the target file name is not
fixed, it uses the version number -- which is not known to the
SuperProject level.

Right now, the Main ExternalProject_add INSTALL_COMMAND is "".  How
can I change this (or add another step) to build the package target (I
don't want to just hard-code make package, as it should work with MSVC
too).  I've tried things like '${CMAKE_COMMAND} cmake--build package'
but haven't had any luck.

Once I get package running, how can I get the system to copy the
resulting *.zip file out to the top level directory?  I'd like it to
end up in the CMake build directory at the top of the SuperProject,
but I haven't figured out how to make that happen yet.

Thanks,

Rob


More information about the CMake mailing list