Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How do I use PDCurses after having installed it? #11027

Closed
miss-programgamer opened this issue Apr 25, 2020 · 6 comments · Fixed by #31453
Closed

How do I use PDCurses after having installed it? #11027

miss-programgamer opened this issue Apr 25, 2020 · 6 comments · Fixed by #31453
Assignees
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist

Comments

@miss-programgamer
Copy link

miss-programgamer commented Apr 25, 2020

My question is fairly straightforward: After having installed pdcurses via vcpkg, how do I actually use it in one of my project's CmakeLists.txt? I can't seem to find_package it under the names PDCurses, Curses, PDC, or similar. The portfile doesn't make it clear what the package is named either:

https://github.com/microsoft/vcpkg/blob/master/ports/pdcurses/portfile.cmake

Plus, when I install other packages, a short snippet for how they should be included into projects is printed. For instance, SDL2 tells you to do find_package(SDL2 CONFIG REQUIRED) and then target_link_libraries(main PRIVATE SDL2::SDL2 SDL2::SDL2main). This instruction is conspicuously missing when I install PDCurses.

I've confirmed that this is not a CMake configuration issue by doing a clean reconfigure and finding SDL2, which DOES work.

So, again, how do I include PDCurses?

@miss-programgamer miss-programgamer added the category:question This issue is a question label Apr 25, 2020
@JackBoosY
Copy link
Contributor

Because PDCurses did not export any cmake files.
Therefore, you need to add some custom code, for example:

find_path(pdcurses_INCLUDES curses.h)
find_library(pdcurses pdcurses REQUIRED)

target_include_directories(${PROJECT} PRIVATE ${pdcurses_INCLUDES})
target_link_libraries(${PROJECT} PRIVATE pdcurses)

@JackBoosY JackBoosY added the category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist label Apr 26, 2020
@miss-programgamer
Copy link
Author

Well, that's disappointing. At least you solved my problem, so thanks.

For future readers though, it should actually be the following:

find_path(PDC_INCLUDES curses.h)
find_library(PDC_LIBS pdcurses REQUIRED)

target_include_directories(${PROJECT} PRIVATE ${PDC_INCLUDES})
target_link_libraries(${PROJECT} PRIVATE ${PDC_LIBS})

@JackBoosY
Copy link
Contributor

@programgamer-real This is because the official does not support this feature, can you make this request to the official?

@miss-programgamer
Copy link
Author

miss-programgamer commented Apr 27, 2020

@JackBoosY Sure, should I make a new issue for this?

@JackBoosY
Copy link
Contributor

@programgamer-real Yes, could you report it to the official?

@JackBoosY JackBoosY removed the category:question This issue is a question label Aug 24, 2020
@Cheney-W Cheney-W assigned LilyWangLL and unassigned JackBoosY Dec 6, 2022
@DeepspaceFreelancer
Copy link

For me these were the lines:

find_path(pdcurses_INCLUDES curses.h)
find_library(pdcurses pdcurses REQUIRED)
include_directories(${pdcurses_INCLUDES})

and for linking:

target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE pdcurses)

Used this for include in the main.cpp:

#include <pdcurses.h>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category:port-feature The issue is with a library, which is requesting new capabilities that didn’t exist
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants