tags:

views:

343

answers:

1

I am getting the following error from CMakeSetup on our source tree:

CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_FIND_LIBRARY_PREFIXES

Deleting the cache doesn't help, so something in one of the CMakeLists must be the problem. The weird part is, if I copy in a CMakeCache.txt from an old version of the tree, and edit it so that the paths match, CMake will then configure successfully... and, even after deleting that fixed cache, it continues to configure successfully.

Any idea what I should look for?

There are two variables missing from the bad CMakeCache.txt when it's generated: Project_BINARY_DIR and Project_SOURCE_DIR.

+2  A: 

Is your Project declared at the top and in your base CMakeLists.txt file or at the very least this has to be declared before it is needed, of which at the top is easiest. It appears this is a bug in cmake. http://www.mail-archive.com/[email protected]/msg13392.html

i.e.

PROJECT(inkscape)

SET(INKSCAPE_VERSION 0.46+devel)
SET(PROJECT_NAME inkscape)
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.6)
SET(CMAKE_INCLUDE_CURRENT_DIR TRUE)

...
verbalshadow
Thanks, adding PROJECT precisely fixed the problem in the broken versions of my source tree.
UltraNurd