0

I need to install a software that needs cmake. Every step till make install work fine. Then at make install this is the error:

CMake Error at Source/kwsys/cmake_install.cmake:46 (file):
  file cannot create directory: /usr/local/doc/cmake-3.18/cmsys.  Maybe need
  administrative privileges.
Call Stack (most recent call first):
  cmake_install.cmake:47 (include)

make: *** [install] Error 1

I don't have administrative privileges, so i can't just add sudo. I am new to working with this, so please be a little bit easy to understand

Christian Fritz
  • 15,980
  • 3
  • 38
  • 58
sebis
  • 1
  • 3

2 Answers2

0

When running cmake, you can tell CMake to install the software in some other location that you have access to. Just set the CMAKE_INSTALL_PREFIX variable to point to that location. So, your cmake command line might change from:

cmake ..

to this:

cmake -DCMAKE_INSTALL_PREFIX=/home/username/software/ ..

See this response for another way to do this in the CMake file itself.

squareskittles
  • 11,997
  • 7
  • 31
  • 48
0

You can also use the good old DESTDIR (ed work, at least, with Makefile generator, and don't need to reconfigure).
ref: https://www.gnu.org/prep/standards/html_node/DESTDIR.html

cmake --build build --target install -- DESTDIR=/home/username/software/

which should install in /home/username/software/usr/local/[bin|lib|include]/...

Mizux
  • 3,747
  • 2
  • 17
  • 27