Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am new with building software using cmake.

I want to install VTK using cmake. I downloaded the .tar file and un-tared it. This leaves me with a directory that contains some cmake files and some other stuff.

Suppose I have un-tared all files in the directory /HOME/USER/SETUP_FILES/ and created a directory /HOME/USER/SETUP_FILES/BUILD

When I cd into /HOME/USER/SETUP_FILES/BUILD and execute cmake ../. I am able to configure the build.

In the configuration file, I can choose to define CMAKE_INSTALL_PREFIX

My first question is:

1) What should I enter there?

When I enter for example /HOME/USER/VTK_PROGRAM this folder is created (after make and make install) that contains a bin/ folder (along with some other folders).

However, in the /HOME/USER/SETUP_FILES/BUILD there is also a bin/ folder created.

My second question is:

2) I now have three folders with files. Which one(s) should I keep in order to have a working program:


Is it possible to merge the b) and c) folders?

share|improve this question
up vote 1 down vote accepted

If you conclude the installation with make install (or equivalent), only the last one is needed. The idea is that the build directory contains whatever files were created during the build process (including object files from which libraries and binaries are linked). The directory to which you install the application, contains only what is needed for it to run. This however doesn't have to be a subset of the build directory - it may contain some data files which are included in the source tarball but not necessarily copied into the build directory (although the might be).

Generally speaking, what ends up in the destination directory for install is usually what is packaged in regular distribution packages.

share|improve this answer

To define a variable with cmake, you do


(.. is where you find the CMakeList.txt)

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.