24

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
waffleShirt
  • 385
  • 1
  • 3
  • 11

6 Answers6

28

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,

rnordeen
  • 297
  • 3
  • 6
  • 2
    You can set the cmake variables instead of editing the cmake files: `cmake -DCURSES_LIBRARY=/usr/lib/x86_64-linux-gnu/libncurses.so -DCURSES_INCLUDE_PATH=/usr/include ./` – Kyle Jul 22 '19 at 23:43
15

Another way to fix it is to add these 2 lines to FindCurses.cmake (on top):

set(CURSES_LIBRARY "/opt/lib/libncurses.so")
set(CURSES_INCLUDE_PATH "/opt/include")
Martin Zeitler
  • 1
  • 19
  • 155
  • 216
  • 2
    This is what ultimately worked for me. Use "locate libncurses.so" to find the location of the .so file and replace it in the first SET given above. On Ubuntu mine was in "/lib/x86_64-linux-gnu/libncurses.so.5.9". FindCurses.cmake was located in /usr/share/cmake-2.8/Modules/FindCurses.cmake for me. – Deadron Aug 22 '14 at 02:07
7

Temporarily set CURSES_USE_NCURSES to TRUE to force the use of NCURSES, rather than letting CMake try to find CURSES.

waffleShirt
  • 385
  • 1
  • 3
  • 11
2

Do you have the corresponding -dev package installed too? On Ubuntu (and probably anything derived from Debian) it is libncurses5-dev. Other systems may use -devel or similar tags.

The compiler is looking for the library headers, and those aren't provided by the standard package. (The headers aren't needed at runtime, only when compiling software, so they make it easy to remove extra useless stuff for systems that aren't going to be doing any software compiling.)

sarnold
  • 102,305
  • 22
  • 181
  • 238
  • Just double checked now and that package was already installed and up to date. – waffleShirt Jan 13 '11 at 11:22
  • Cmake has several different library search paths: CMAKE_SYSTEM_LIBRARY_PATH is supposed to be Good Enough for system-supplied libraries, CMAKE_LIBRARY_PATH is for projects to supply their own paths. Perhaps your ncurses.h file isn't in the default location? You may need to add the directory containing it to your project's CMAKE_LIBRARY_PATH. – sarnold Jan 13 '11 at 11:43
  • 3
    Thanks for the help. I ended up just going into the FindCurses.cmake file and forcing it to use NCURSES instead of CURSES. Cleared everything up right away. – waffleShirt Jan 14 '11 at 23:37
  • For anyone interested FindCurses.cmake is in the Share directory for Cmake home. – ScottJShea Jan 09 '12 at 23:30
  • 1
    For anyone interested FindCurses.cmake is in the ../Share/cmake-2.x/Modules directory for Cmake home. (was a little vague the first time around...) – ScottJShea Jan 09 '12 at 23:36
1

The openlase wiki was not displaying all of the needed packages. Check there wiki pages on github for updated instructions. For curses the missing package was libncurses5-dev sudo apt-get install libncurses5-dev

0

Temporarily set CURSES_NEED_NCURSES to TRUE to force the use of NCURSES, rather than letting CMake try to find CURSES.

set(CURSES_NEED_NCURSES TRUE)

CURSES_USE_NCURSES is used by FindCurses.cmake internally, so setting that won't help.

JoeAndrieu
  • 804
  • 6
  • 6