NvDialog 0.10.1
A cross-platform modal dialogs library for C/C++ that uses the native OS theme.
Loading...
Searching...
No Matches
nvdialog_build.h
Go to the documentation of this file.
1/************************************************************************************
2 * This file is NOT source code. It will just be used by Doxygen when
3 * generating documentation for the "Building NvDialog" page. It won't be
4 * installed, it won't be used within the library or by a user, and probably
5 * isn't of interest to anyone.
6 ************************************************************************************/
7
8/**
9 * @page building Building NvDialog
10 * @version v0.10.0
11 * @author Aggelos Tselios
12 *
13 * # Building NvDialog
14 * This document will provide you with all the necessary information /
15 * documentation to build NvDialog on your machine. These steps have been
16 * verified to work on all supported platforms, thanks to usage of
17 * cross-platform tools.
18 *
19 * You can also download prebuilt binaries of NvDialog at the [releases
20 * page](https://github.com/tseli0s/nvdialog/releases/). This can be useful if
21 * you are looking to package NvDialog with your application without extra compilation.
22 *
23 * ## Dependencies
24 * Before proceeding, download and install the following:
25 * - [CMake](https://cmake.org)
26 * - [ninja](https://ninja-build.org/)
27 * - A C compiler (e.g. gcc or clang)
28 * - If you want to generate the documentation locally:
29 * [doxygen](https://doxygen.nl)
30 *
31 * ## 1. Downloading the source code.
32 * Before continuing, you must acquire the source code somehow. How you will do
33 * that depends on what version you want to use:
34 * - The git development version is the one where all the development goes. You
35 * should avoid it unless you want early access to new features, since many things may stay broken there for
36 * some time
37 * - The releases provide you with the source code of each release. They're
38 * recommended for stability and future-proofness, as the final releases usually work
39 * with older versions.
40 * - Optionally, you can also download a specific branch if you're looking for
41 * an unfinished feature.
42 *
43 * Each one will be explained below seperately:
44 *
45 * ### Git
46 * Open a terminal, and `cd` to the directory you want to store the source code.
47 * Then type the following two commands:
48 * ```sh
49 * $ git clone --recursive --depth=1 https://github.com/tseli0s/nvdialog.git
50 * $ cd nvdialog/
51 * ```
52 *
53 * > You can also have NvDialog as a submodule. Just use `git submodule add
54 * https://github.com/tseli0s/nvdialog.git` in your source code tree.
55 *
56 * ## Releases
57 * Go to https://github.com/tseli0s/nvdialog/releases/latest and download the
58 * source code as a zip file. Extract the archive where you want to store the
59 * source code.
60 *
61 * ## Specific git branch
62 * Same as the git one, but you must change the second command to this:
63 * ```sh
64 * git clone --branch <branchname> --recursive
65 * https://github.com/tseli0s/nvdialog.git
66 * ```
67 *
68 * ## 2. Building
69 * Go to the directory the source code is located. You must have files like
70 * `CMakeLists.txt`, `Makefile`, `CHANGELOG.md` and others. > Don't confuse the
71 * said directory with the directory named `src/`. Source code in this case
72 * means the entire NvDialog folder.
73 *
74 * Then, generate the build files, necessary to build the source code:
75 * ```sh
76 * $ cmake . -B build/ -G "Ninja" -DCMAKE_BUILD_TYPE=Release
77 * ```
78 *
79 * > You can optionally tweak NvDialog's default settings using the
80 * `-D<var>=<value>` CMake flag.
81 *
82 * Finally, building the source code is relatively simple:
83 * ```sh
84 * ninja
85 * ```
86 * The build takes at most 1 minute.
87 *
88 * If you want to install NvDialog on your computer (You probably do), then run
89 * this command as well:
90 *
91 * ```sh
92 * $ sudo ninja install # sudo may be omitted on Windows and macOS
93 * ```
94 *
95 * ## Older distros
96 * For older Linux distros that don't have a recent enough version of CMake,
97 * there's a `Makefile` provided. You can just run `make && sudo make install`
98 * and it should do the exact same thing. The downside is that the Makefile
99 * doesn't support any options - You will have to modify it manually to tweak
100 * any build time functionality.
101 *
102 * ## Compile-time features:
103 * This is a table of features that NvDialog supports enabling at compile time.
104 * You can enable features (Or set them appropriately) using the
105 * `-D<feature>=<value>` cmake flag.
106 * | Feature | Default | Description |
107 * | --- | --- | --- |
108 * | CROSS_COMPILE_FOR_WIN32 | OFF | Cross compile from a Unix system for a Windows host |
109 * | NVD_BUILD_STATIC | ON | Build NvDialog as a static library instead, that will be packaged with your executable |
110 * | NVD_GENERATE_DOCS | OFF | Generate the documentation pages along with the source code (Requires doxygen) |
111 * | NVD_IMAGE_SUPPORT | ON | Include support for images in the library. |
112 * | NVD_USE_GNUSTEP | OFF | Use the GNUstep+Cocoa backend if available on non-macOS platforms. Experimental. |
113 */