2016-03-09 20:27 GMT+01:00 Eric Noulard <eric.noul...@gmail.com>: > > > 2016-03-09 19:50 GMT+01:00 Winfried <winku...@arcor.de>: > >> Yes, when using 'bin' instead of '/usr/bin' ( with PROGRAMS and without >> RUNTIME) it works. >> >> But nevertheless it's a bit sad because I used the absolute paths with >> consideration for two reasons: >> >> 1. As I mentioned it's a Qt/KDE program (still version 3 at the moment). >> Depending on the target distro the application shall be stored at the >> usual >> place for that distribution (SuSE: /opt/kde3, Debian/Ubuntu: /usr/local, >> ...) But those compilers and their shell scripts have nothing to do with >> Qt/KDE stuff and should normally be installed at /usr/bin regardless where >> the other binaries go to. >> > > I do not get your point? If you build an installer (using CPack) which has > relative path in it (./bin) or is relocatable (.rpm or .deb) then you may > perfectly > chose the prefix **at install time** be it /opt/kde3 or /usr or /opt .... >
Sorry rereading your message I think now I get it. You want 2 prefixes for your applications /opt/kde3 or /usr/local for you KDE app and /usr/ for binaries and shell scripts. For doing that with CPack I suggest you build a multi-component package and configure your CPack generator (RPM, STGZ, etc...) to build 1 package file per component: see: https://cmake.org/Wiki/CMake:Component_Install_With_CPack#CPack_Generator_specific_behavior and/or: https://cmake.org/cmake/help/v3.4/module/CPackComponent.html > >> 2. I planned to make possible a second LOCAL install for development >> purposes parallel to the system installation. For such a local >> installation >> the installer shall be able to flexibly decide where to install the >> application data by setting an environment variable. >> > > Precisely, you need a relocatable installer. > Building an installer using relative install path makes it easier to build > a relocatable installer. > > E.g. CPack RPM may perfectly handle absolute install path like files > put in /etc/ but then the whole package will be relocatable but the > absolutely installed file. > > For RPM see rpm --prefix or --relocate > > >> >> Im not sure if this is possible if absolute paths are not usable. >> > > This is possible indeed, you should build relocatable package with CPack. > > >> >> Missing documentation: >> The variant 'install( PROGRAMS ...)' is not yet documented at >> 'https://cmake.org/cmake/help/v3.4/command/install.html'. >> Could someone from Kitware please add it? >> > > The documentation for install(PROGRAMS is documented in the same paragraph > as install(FILES... > see: > https://cmake.org/cmake/help/v3.4/command/install.html#installing-files > > "The PROGRAMS form is identical to the FILES form except that the default > permissions for the installed file also include OWNER ...." > > > > >> >> Btw, please also add a sentence like "Following C-tradition the first >> position in a string is '0' " to the documentation of 'FIND'. >> >> J. Caleb Wherry wrote >> > To Eric's point: your destination for these files should probably be >> "bin" >> > and not "/usr/bin". That way from CPack you can set the " >> > CPACK_INSTALL_PREFIX" to point to the actual place you want to install >> > your >> > project. >> > >> > But everything still comes down to this: if your above prefix is "/usr" >> > then someone needs write access to that directory. Typically on unix >> with >> > makefiles the install step is run with "sudo" so that it can write to >> that >> > location. If you are doing an actual install to the system, then you >> have >> > to run it with sudo (or give you current user elevated permissions). >> > >> > -Caleb >> > >> > On Wed, Mar 9, 2016 at 11:31 AM, Winfried < >> >> > winkus4u@ >> >> > > wrote: >> > >> >> Hi J Decker, >> >> >> >> sorry I've missed your answer, while I wrote mine. >> >> >> >> Now I used install( PROGRAMS ... instead of FILES >> >> but I can't see any difference in the output. The error message is >> >> exactly >> >> the same as in my last reply. >> >> To be sure that it is not a cache problem, I deleted the 'build' dir >> and >> >> made a completely new build by: >> >> cmake .. >> >> make >> >> make package >> >> >> >> >> >> >> >> >> >> -- >> >> View this message in context: >> >> >> http://cmake.3232098.n2.nabble.com/Howto-install-executables-that-aren-t-targets-tp7592951p7592957.html >> >> Sent from the CMake mailing list archive at Nabble.com. >> >> -- >> >> >> >> 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 >> >> >> > >> > >> > >> > -- >> > J. Caleb Wherry >> > *Scientific Software Engineer* >> > >> > <http://www.calebwherry.com> >> > http://www.calebwherry.com >> > +1 (615) 708-5651 >> >> > calebwherry@ >> >> > >> > -- >> > >> > 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 >> >> >> >> >> >> -- >> View this message in context: >> http://cmake.3232098.n2.nabble.com/Howto-install-executables-that-aren-t-targets-tp7592951p7592959.html >> Sent from the CMake mailing list archive at Nabble.com. >> -- >> >> 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 >> > > > > -- > Eric > -- Eric
-- 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