I have an open source project that is using CMake and CPack to build our distributables - deb, rpm, tarballs, and hopefully DMG and a Windows Installer in the future. Due to our various target platforms, we are stuck with CMake 3.5 for the time being (as it’s the provided version on those platforms). I’m working through adding some documentation files to our Linux builds (Deb, RPM, and tarballs for now) - man pages, authors file, etc. I initially did this using:
INSTALL(FILES “${PROJECT_SOURCE_DIR}/…/ChangeLog” TYPE DOC)
When I loaded it into our CI environment I discovered that I used something that does’t come into play until CMake 3.14 - the TYPE
parameter as some of our environments failed to recognize the parameter. I’ve since updated to detect the CMake version and switch to the following:
INSTALL(FILES “${PROJECT_SOURCE_DIR}/…/ChangeLog” DESTINATION “/usr/share/myApplication/doc”)
However, now when I run “make package” I’m getting permission denied errors from CPACK as it seems it is trying to do a “make install” automatically before packaging the files. I’d really like to be able to get these files packages up; is there a way to do this without granting admin privileges? I’d rather not do “make install” to build the packages.
BTW - I’d love to be able to use a CMake variable for the destination instead of hard-coding one; but nothing was apparent while looking through the docs.
Please advise.