frang75 / nappgui_src

SDK for building cross-platform desktop apps in ANSI-C
https://www.nappgui.com
MIT License
442 stars 43 forks source link

CMake install support for VCPKG #85

Open frang75 opened 4 months ago

frang75 commented 4 months ago

Add a new option in NAppGUI CMake scripts for generate the install structure required by vcpkg.

cmake -S . -B build -DCMAKE_INSTALL_TYPE=vcpkg
cmake --build build  ....
cmake --install build ....
frang75 commented 4 months ago

More background in https://github.com/frang75/nappgui_src/issues/11

@ragsaq, @SamuelMarks

ragsaq commented 4 days ago

I'm trying to install nappgui with vcpkg. I have success in windows and linux (not perfect)

Working example (no resources):

hellocpp

Broken example (with resources):

products

to do this, I created a vcpkg port for nappgui and patched some of the files so that inc -> include and the cmake targets go to the shared folder.

To fix the products project, we need to use nap_desktop_app(Products "osapp;inet" NRC_PACKED) but I can't get this to work successfully because of path errors.


Can we refactor the prj so that we can import the correct nappgui cmake functions without doing include("${NAPPGUI_ROOT_PATH}/prj/NAppProject.cmake")?

Ideally, find_package(nappgui REQUIRED) can define the path to include, so that if we change the folder structure, we always do include("${NAPPGUI_PRJ_PATH}/NAppProject.cmake") and it works.

I couldn't get nappgui::osapp and similar to work in the hello example instad of ${NAPPGUI_INCLUDES}.

frang75 commented 3 days ago

Hi! Thanks for report! I'll resume the support for VCPKG asap.

ragsaq commented 3 days ago

Thank you! wxwidgets also is in vcpkg and they also have a nrc binary to compile resources. maybe you can have a look at how they structure things. qt too but I've had difficulty getting that to work (qt is too complicated - too many files).

SamuelMarks commented 3 days ago

PS: @ragsaq there's also https://www.ryanliptak.com/blog/zig-is-a-windows-resource-compiler/ - so if we try real hard nappgui might be cross-compilable from say a Linux, *BSD, or macOS host

PPS: @frang75 Great to hear. Also did you think more RE: putting things in folders to aid both vcpkg and future FFI efforts? - https://github.com/frang75/nappgui_src/issues/11#issuecomment-1870637460

frang75 commented 3 days ago

Hi @SamuelMarks. Yes the group headers in folders was done in 1.4.0 version. https://nappgui.com/en/guide/build.html#h3