CMake can't find Curses

waffleShirt picture waffleShirt · Jan 13, 2011 · Viewed 49.2k times · Source

I am trying to compile the openlase library from www.marcansoft.com and have been running into problems with CMake. CMake is returning an error stating that it cannot find Curses, and after a lot of looking I am still stumped as to what the issue is. I have checked that I have the various ncurses packages installed but still the error persists. Im not very familiar with CMake but I was able to resolve other dependency issues that arose before this one. The following is the output in terminal.

tom@SILVER:~/dev/openlase$ cmake ./
-- Found JACK 
CMake Error at /usr/share/cmake-2.8/Modules/FindPackageHandleStandardArgs.cmake:70 (MESSAGE):
  Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
Call Stack (most recent call first):
  /usr/share/cmake-2.8/Modules/FindCurses.cmake:159 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  examples/27c3_slides/CMakeLists.txt:3 (find_package)


-- Configuring incomplete, errors occurred!

Any help would be greatly appreciated.

  • Tom

Answer

rnordeen picture rnordeen · Feb 7, 2013

Here is what fixed my problems on Ubuntu 12.04 x86_64 (64 bit) (Thanks syslogic )

For whatever reason (1:00 am maybe?) setting CURSES_USE_NCURSES TRUE didn't seem to work. So I went with a hack job.

Verified it's installed:

$ sudo apt-get install libncurses5-dev

You will see something to the effect: libncurses5-dev is already the newest version.

So find the library and include.

$ locate libncurses.so

Note location, mine: /usr/lib/x86_64-linux-gnu/libncurses.so

$ locate curses.h

Note location again, mine: /usr/include

In: <cmake source dir>/Modules/FindCurses.cmake

add at the top, right after the comments

set( CMAKE_INCLUDE_PATH "/usr/include")
set( CMAKE_LIBRARY_PATH "/usr/lib/x86_64-linux-gnu/libncurses.so")

then rinse repeat the build process

./bootstrap
make 
sudo make install

ccmake should now be installed.

Your pal,