Can’t configure with cmake in Mac OS X 10.8 and Xcode 4.4

Eneko
enekochan
Published in
2 min readJul 27, 2012

I just did a clean install of Mac OS X 10.8 Mountain Lion and Xcode 4.4 so when I was ready to compile (again…) OpenCV 2.4.2 I got this error executing “cmake ..”:

$ cmake ..
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:/Users/enekochan/compilaciones/OpenCV-2.4.2/build/CMakeFiles/CMakeCXXCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:/Users/enekochan/compilaciones/OpenCV-2.4.2/build/CMakeFiles/CMakeCCompiler.cmake
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!

New versions of Xcode (4.4 and above) don’t install themselves in /Developer so I thought it could be a path issue, but the real problem is that the terminal utilities are not included in the normal install of Xcode anymore. You can install them and agree ther terms from the command line:

sudo xcode-select --install
sudo xcodebuild -license

Or download them separately from https://developer.apple.com/downloads/ (you need an Apple ID). Then look for the latest “Command Line Tools” for your system:

Install it and you will be able to compile from the terminal.

Source: http://www.cmake.org/pipermail/cmake/2009-February/027317.html

--

--