[rm] 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.

[kk]  'package' is a target of your generated build environment.  You can 
specify to 'cmake --build' a target of your choosing.  Look at the '--build' 
docs here:
https://cmake.org/cmake/help/v3.3/manual/cmake.1.html

BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> --target package

[rm] Once I get package running, how can I get the system to copy the resulting 
*.zip file out to the top level directory? 

[kk]  Add a custom step to your external project, which depends on the 
build/install step to finish to copy whatever you want

ExternalProject_Add_Step( myEPname copyPackage
      COMMAND ${CMAKE_COMMAND} -E copy_directory ${myLibDir} 
${packageDir}/${LIB_DIR}
      COMMAND ${CMAKE_COMMAND} -E copy_directory <SOURCE_DIR>/include 
${packageDir}/include
      DEPENDEES build
    )

----------------------------------------------------------------------

Message: 1
Date: Wed, 11 Nov 2015 11:04:13 -0800
From: Rob McDonald <[email protected]>
To: CMake ML <[email protected]>
Subject: [CMake] SuperProject package/install
Message-ID:
        <caeppypgdedufmffryotncctmimt_cf8o7+ujzo1arbyidqy...@mail.gmail.com>
Content-Type: text/plain; charset=UTF-8

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
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to