What this CMake Error means? My variables are set to NOTFOUND


April 2019


1.2k time


I am trying to run some code from my university, but when I do "cmake .." inside "build" I get the following error:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: iceutil_lib linked by target "cppgui" in directory /Users/alej/Desktop/project1 linked by target "project1" in directory /Users/alej/Desktop/project1

-- Configuring incomplete, errors occurred!

Any of my friends are getting errors, can you help me?

1 answers


CMake tries to find all the libraries necessary to create the library or executable you are trying to build from the code from your university.

The found paths to those libraries are stored in special variables in CMake. By default, those variables carry the value <Library-Name>-NOTFOUND. This NOTFOUND flag is what makes CMake prompt the error message.

In general there are to possible reasons, why CMake did not find the library for you:

  • The library is not installed on your system
  • The library is installed somewhere where CMake did not look for it. In this case you can help CMake by putting the library installation path yourself into the respective CMake variables. To do this, open the file CMakeCache.txt with a text editor and search for ICEUTIL_LIB. Replace the blabla-NOTFOUND value with the actual (absolute) path of the library. There might be other variables with the ICEUTIL prefix. One of them might be named like ICEUTIL_HEADERS or ICEUTIL_INCLUDE_DIR. Replace the value of this one with the absolute path of where the .h files for ICEUTIL are found. If the include path is not set, CMake might run fine without errors, but later you will run into compiler errors saying include file not found.