nappgui_src icon indicating copy to clipboard operation
nappgui_src copied to clipboard

CMake install support for VCPKG

Open frang75 opened this issue 2 years ago • 6 comments

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 avatar Jan 08 '24 19:01 frang75

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

@ragsaq, @SamuelMarks

frang75 avatar Jan 08 '24 19:01 frang75

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}.

ragsaq avatar May 12 '24 20:05 ragsaq

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

frang75 avatar May 13 '24 13:05 frang75

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).

ragsaq avatar May 13 '24 17:05 ragsaq

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

SamuelMarks avatar May 13 '24 18:05 SamuelMarks

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

frang75 avatar May 13 '24 19:05 frang75