3

I'm trying to build a curses program that uses CMake on Windows with MinGW and PDCurses. I'm using CMake 3.7.1, and all my MinGW packages are up-to-date. Specifically, i have mingw32-libpdcurses 3.4-1 (both dev and dll) and mingw32-pdcurses 3.4-1 (bin, doc and lic) installed.

My full CMakeLists.txt is below, but using find_package(Curses REQUIRED) gives an error: Could NOT find Curses (missing: CURSES_LIBRARY). This other question deals with a similar situation; the answer's author says he hasn't tested PDCurses on MinGW, but that it should work.

(I had the same results using CMake 3.6.3, which is bundled with CLion).

My CMakeLists.txt:

cmake_minimum_required(VERSION 3.3)
project(PROJECT_NAME)

if(WIN32)
    set(PATH "C:\\MinGW")
endif()

find_package(Curses REQUIRED)
include_directories(${CURSES_INCLUDE_DIR})

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -g -Wall")

set(SOURCE_FILES src/init.c etc...)

add_executable(project_name ${SOURCE_FILES})
target_link_libraries(project_name ${CURSES_LIBRARIES} m)

Am I doing something wrong? Are there any workarounds?

Thanks a lot!

zale
  • 1,248
  • 11
  • 26
  • Try MinGW-w64, also I think CMake looks for libncurses.a so it won't find pdcurses unless you rename the file. – makos Sep 13 '18 at 08:21

0 Answers0