Take the 2-minute tour ×

I am writing a script and started working with the install command (for copying files) and it is not working. CMake configure/generate does not show any errors (i.e. it does not stop and no warnings/errors show related to this command) and the command does not seem to be working because I don't see any files being copied.

Since I am new, I am wondering:

  • How can I tell that install failed (perhaps the source directory was wrong, or the destination directory was wrong)? It appears to be failing silently
  • Are there error codes I can check to see what went wrong?
  • Ans lastly when is install called? When I click configure? Or when the project is built?

I am on Windows.

share|improve this question
add comment

1 Answer

When you add an install command to your CMakeLists.txt, you get a new target created called "install".

In order to actually install the chosen files/targets, you need to build this install target. It's not automatically built as part of the "ALL" target.

For example, if you're using Visual Studio, the "INSTALL" target should appear in the "CMakePredefinedTargets" folder of the Solution Explorer. Just selecting this target and building it will cause the solution to be built and the selected items installed.

If any part of the build or install process fails, the notifications should then be apparent.

share|improve this answer
That makes a lot of sense. Either I am not looking hard enough or the documentation does a poor job at describing these details. –  Samaursa Mar 24 '13 at 1:07
This tutorial might help a bit? –  Fraser Mar 24 '13 at 2:19
It does! Thanks! –  Samaursa Mar 24 '13 at 15:51
add comment

Your Answer


