Skip to content

Instantly share code, notes, and snippets.

@edalorzo
Created November 4, 2021 07:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edalorzo/d14855aee2ff6f53f753e9de6c38187e to your computer and use it in GitHub Desktop.
Save edalorzo/d14855aee2ff6f53f753e9de6c38187e to your computer and use it in GitHub Desktop.
Configure PDCurses with CMake
cmake_minimum_required(VERSION 3.20)
project(MyProject)
set(CMAKE_CXX_STANDARD 20)
set(CURSES_LIBRARIES "libs")
include_directories("include")
link_directories("${CMAKE_SOURCE_DIR}/lib")
find_library(PDCURSES NAMES "pdcurses" HINTS "${CMAKE_SOURCE_DIR}/lib")
add_executable(MyProject main.cpp)
target_link_libraries(MyProject PDCURSES)
add_custom_command(TARGET MyProject POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"${PROJECT_SOURCE_DIR}/pdcurses.dll"
$<TARGET_FILE_DIR:MyProject>)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment