Skip to content

Instantly share code, notes, and snippets.

@edalorzo
Created November 4, 2021 07:48
Show Gist options
  • Select an option

  • Save edalorzo/d14855aee2ff6f53f753e9de6c38187e to your computer and use it in GitHub Desktop.

Select an option

Save edalorzo/d14855aee2ff6f53f753e9de6c38187e to your computer and use it in GitHub Desktop.

Revisions

  1. edalorzo created this gist Nov 4, 2021.
    18 changes: 18 additions & 0 deletions CmakeLists.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    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>)