[CMake] Howto install executables that aren't targets

Winfried winkus4u at arcor.de
Wed Mar 9 13:50:36 EST 2016


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.

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.

Im not sure if this is possible if absolute paths are not usable. 

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?

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.


More information about the CMake mailing list