Closed jonathonl closed 7 years ago
Is there a better way of doing this or are there any ideas on how cget could support this in the future?
I have not tested it but this should work(run in the source directory):
cget build --target install
Also, you can specify the install directory with CMAKE_INSTALL_PREFIX
if you don't like the default:
cget build -DCMAKE_INSTALL_PREFIX=/usr/local --target install
Also, is setting CMAKE_PREFIX_PATH to the cget prefix path the recommended way of using cget with IDEs like CLion?
That is one way, although I am not very familiar with CLion. Cget provides a toolchain file in $CGET_PREFIX/cget/cget.cmake
that sets everything needed in cmake. So if you want to run cmake manually you can do:
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=$CGET_PREFIX/cget/cget.cmake ..
I don't know if there is a way in CLion to specify a toolchain file or not, but it is a better choice.
So cget build --target install
works, but -DCMAKE_INSTALL_PREFIX
is applied to dependencies when specified (nothing is installed into $CGET_PREFIX).
but -DCMAKE_INSTALL_PREFIX is applied to dependencies when specified
Thats right, as defines are applied to all packages including dependencies. It would probably be better not to have the user overwrite this when installing dependencies.
I merged a fix for this in master, so you can set CMAKE_INSTALL_PREFIX
and it won't apply to the dependencies.
I'm trying to figure out a sane way to allow sys admins to install just the library dependencies of an executable into the build tree, link to the libs statically and then install just the executable into a system path. In this scenario the install prefix for the dependencies is different than the install prefix for the executable. The following does the trick but is a little verbose.
Is there a better way of doing this or are there any ideas on how cget could support this in the future?
Also, is setting CMAKE_PREFIX_PATH to the cget prefix path the recommended way of using cget with IDEs like CLion?