CMake can't find Curses

后端 未结 6 1122
臣服心动
臣服心动 2021-02-12 13:54

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 Curse

相关标签:
6条回答
  • 2021-02-12 14:06

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

    0 讨论(0)
  • 2021-02-12 14:08

    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.

    0 讨论(0)
  • 2021-02-12 14:10

    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,

    0 讨论(0)
  • 2021-02-12 14:12

    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 讨论(0)
  • 2021-02-12 14:16

    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")
    
    0 讨论(0)
  • 2021-02-12 14:24

    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.)

    0 讨论(0)
提交回复
热议问题