d99kris / nchat

Terminal-based Telegram / WhatsApp client for Linux and macOS
MIT License
619 stars 43 forks source link

Build Fails on Mac OS #51

Closed bobTheBuilder7 closed 2 years ago

bobTheBuilder7 commented 2 years ago

I have os version Mac OS Monterey 12.1, Apple M1

I am following all the build instructions, however I am getting this error CMake Error at /opt/homebrew/Cellar/cmake/3.22.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:230 (message): Could NOT find Curses (missing: CURSES_INCLUDE_PATH) Call Stack (most recent call first): /opt/homebrew/Cellar/cmake/3.22.1/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:594 (_FPHSA_FAILURE_MESSAGE) /opt/homebrew/Cellar/cmake/3.22.1/share/cmake/Modules/FindCurses.cmake:268 (FIND_PACKAGE_HANDLE_STANDARD_ARGS) CMakeLists.txt:120 (find_package)

Help me please to solve it))

d99kris commented 2 years ago

Hi @bobTheBuilder7 Could you check the output of command brew --prefix ncurses on your system?

Assuming it is not /usr/local/opt/ncurses, could you try edit CMakeLists.txt and change this line:

set(CMAKE_PREFIX_PATH /usr/local/opt/ncurses)

to contain the actual path you got from brew --prefix ncurses, perhaps something like:

set(CMAKE_PREFIX_PATH /opt/ncurses)
bobTheBuilder7 commented 2 years ago

I got /opt/homebrew/opt/ncurses

I changed the CMakeLists.txt, and everything worked. Thanks.

d99kris commented 2 years ago

Cool, thanks for sharing. I'll see if I can update that file to dynamically detect the ncurses install path.

d99kris commented 2 years ago

In the above commit I've added dynamic detection of ncurses prefix on macOS, so going forward no local changes should be needed to build on systems like yours.