I have just started having a go at developing a small KDE app as a test for myself and I have had some problems fathoming how to use cmake which I have largely overcome. Currently my app builds ok (i.e. cmake && make run without errors). However running ‘make install’ gives the following error:
kemra102@kaon:~/projects/kquickformat/build> make install
[ 0%] Built target kquickformat_automoc
Scanning dependencies of target kquickformat
[ 50%] Building CXX object src/CMakeFiles/kquickformat.dir/kquickformat_automoc.o
Linking CXX executable kquickformat
[100%] Built target kquickformat
Linking CXX executable CMakeFiles/CMakeRelink.dir/kquickformat
Install the project...
-- Install configuration: ""
-- Installing: /usr/local/bin/kquickformat
CMake Error at src/cmake_install.cmake:38 (FILE):
file INSTALL cannot copy file
"/home/kemra102/projects/kquickformat/build/src/CMakeFiles/CMakeRelink.dir/kquickformat"
to "/usr/local/bin/kquickformat".
Call Stack (most recent call first):
cmake_install.cmake:37 (INCLUDE)
make: *** [install] Error 1
Any ideas as nothing seems obvious to myself?
To install to default locations you usually need root privileges. So either use
sudo make install, or reruncmakespecifying an installation prefix where you have write permission. For example, I use:If you do that, remember also to set all Qt and KDE related environment variables, otherwise the application you installed will not be working properly or at all. I usually call a shell function that does something like: