I have a CMake project that builds and installs several external libraries and 
tools using the ExternalProject_Add. Works very well, however I would like to 
add the capability to install the external projects in a directory that 
requires sudo without forcing the user to also build, config, etc. as sudo. I 
discovered that if I have the INSTALL_DIR parameter in the ExternalProject_Add 
command set to a directory that requires sudo to create, cmake fails because it 
attempts to  create the directory and of course it can't without 'sudo cmake 
... '

Has anyone done this? I'm not sure where to start. I have set the 
EP_STEP_TARGETS property to define targets for each step and I wanted to do 
something like this, 'make eproj-download eproj-config eproj-build; sudo make 
eproj-install', but the error with INSTALL_DIR has prevented that solution. I 
could remove the INSTALL_DIR definition and rely on the INSTALL_COMMAND to 
create these directories, but I'm reluctant to do that.



Lori A. Pritchett-Sheats
Los Alamos National Laboratory
CCS-2, Computational Physics
505-665-6675
--

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://www.cmake.org/mailman/listinfo/cmake

Reply via email to