I'm trying to compile a short test program for my raspberry pi in CLion. I've set up two toolchains, one that compiles with gcc and g++ so I can test the program locally, and one that compiles with the raspberry pi cross compiler using arm-linux-gnueabihf-gcc and arm-linux-gnueabihf-c++ (from the official raspberry pi cross compiler).
When I compile with my local toolchain, no errors occur and it works as expected. When I switch to the raspberry pi toolchain, I get this error:
/home/[username]/CLionProjects/untitled/main.cpp:1:10: fatal error: ncurses.h: No such file or directory
I thought this may be an issue with my CmakeLists.txt file, but it compiles without any issues with the local toolchain. Both toolchains work without ncurses, I tested them with a simple hello world program using std::cout rather than ncurses, and they compiled and ran on their respective devices.
cmake_minimum_required(VERSION 3.13)
project(untitled)
set(CMAKE_CXX_STANDARD 14)
set(CURSES_USE_NCURSES TRUE)
find_package(Curses REQUIRED)
include_directories(${CURSES_INCLUDE_DIR})
set(CMAKE_CXX_FLAGS "-lncurses")
set(CMAKE_C_STANDARD "%{CMAKE_C_FLAGS} -Wall -Werror -lpdcurses")
set(SOURCE_FILES main.cpp)
add_executable(untitled ${SOURCE_FILES})
target_link_libraries(untitled ncurses)
I've also included the following lines in my FindCurses.cmake file per this question
set(CMAKE_INCLUDE_PATH "/usr/include/ncurses.h")
set(CMAKE_LIBRARY_PATH "/lib/x86_64-linux-gnu/libncurses.so")
I'm not sure what I'm doing wrong here and would appreciate any and all help.