|
NvDialog 0.10.1
A cross-platform modal dialogs library for C/C++ that uses the native OS theme.
|
This document will provide you with all the necessary information / documentation to build NvDialog on your machine. These steps have been verified to work on all supported platforms, thanks to usage of cross-platform tools.
You can also download prebuilt binaries of NvDialog at the releases page. This can be useful if you are looking to package NvDialog with your application without extra compilation.
Before proceeding, download and install the following:
Before continuing, you must acquire the source code somehow. How you will do that depends on what version you want to use:
Each one will be explained below seperately:
Open a terminal, and cd to the directory you want to store the source code. Then type the following two commands:
You can also have NvDialog as a submodule. Just use git submodule add https://github.com/tseli0s/nvdialog.git in your source code tree.
Go to https://github.com/tseli0s/nvdialog/releases/latest and download the source code as a zip file. Extract the archive where you want to store the source code.
Same as the git one, but you must change the second command to this:
Go to the directory the source code is located. You must have files like CMakeLists.txt, Makefile, CHANGELOG.md and others. > Don't confuse the said directory with the directory named src/. Source code in this case means the entire NvDialog folder.
Then, generate the build files, necessary to build the source code:
You can optionally tweak NvDialog's default settings using the -D<var>=<value> CMake flag.
Finally, building the source code is relatively simple:
The build takes at most 1 minute.
If you want to install NvDialog on your computer (You probably do), then run this command as well:
For older Linux distros that don't have a recent enough version of CMake, there's a Makefile provided. You can just run make && sudo make install and it should do the exact same thing. The downside is that the Makefile doesn't support any options - You will have to modify it manually to tweak any build time functionality.
This is a table of features that NvDialog supports enabling at compile time. You can enable features (Or set them appropriately) using the -D<feature>=<value> cmake flag. | Feature | Default | Description | | — | — | — | | NVD_USE_GTK4 | OFF | Sets the Linux backend to use libadwaita | | CROSS_COMPILE_FOR_WIN32 | OFF | Cross compile from a Unix system for a Windows host | | NVDIALOG_MAXBUF | 4096 | Amount of bytes NvDialog will allocate by default on static buffers | | NVD_BUILD_STATIC | OFF | Build NvDialog as a static library instead, that will be packaged with your executable |