[CMake] [cmake-developers] productbuild: Installing to absolute system path or to user home path

David Cole DLRdave at aol.com
Thu Oct 31 13:18:44 EDT 2019


According to the docs, the INSTALL command uses the absolute path if
it is given as the DESTINATION, so .... it should work.
https://cmake.org/cmake/help/latest/command/install.html

Did you try using a double quoted string, instead of escaping the
space with a backslash?

I think this should work for the absolute one:
INSTALL( ... DESTINATION "/abs/path/to/some folder")

For the one in the home directory, I'm not sure if a string that
starts with "~" is considered absolute or not, so it may or may not
end up where you expect it. Can you resolve it before hand with a
get_filename_component call, (or otherwise), and pass in a string that
begins with "/" ...?


Hope this helps,
David C.


On Mon, Oct 28, 2019 at 4:36 PM Roman Wüger <roman.wueger at gmx.at> wrote:
>
> 
>
> Hello,
>
>
>
> I tried to install a file/directory with productbuild on macOS which is generated with CPack
>
> The most of the files are installed correctly, but I have two problems:
>
>
>
> If I want to install to “/Library/Application\ Support/Adobe/Lightroom/Modules”
> If I want to install to the users modules folder “~/Library/Application\ Support/Adobe/Lightroom/Modules”
>
>
>
> How can I archive these two?
>
>
>
> I already tried the following with no luck:
>
> install(DIRECTORY $<TARGET_FILE_DIR:${PROJECT_NAME}>/${CMAKE_PROJECT_NAME}.lrplugin
>
>                 DESTINATION /Library/Application\ Support/Adobe/Lightroom/Modules)
>
>
>
> install(DIRECTORY $<TARGET_FILE_DIR:${PROJECT_NAME}>/${CMAKE_PROJECT_NAME}.lrplugin
>
>                 DESTINATION ~/Library/Application\ Support/Adobe/Lightroom/Modules)
>
>
>
> Best Regards
>
> Roman
>
> --
>
> 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:
> https://cmake.org/mailman/listinfo/cmake-developers


More information about the CMake mailing list