2018-07-12 18:48:51 +00:00
|
|
|
#ifndef SOLVESPACE_CONFIG_H
|
|
|
|
#define SOLVESPACE_CONFIG_H
|
2015-03-29 00:33:46 +00:00
|
|
|
|
2016-04-23 22:53:21 +00:00
|
|
|
#define PACKAGE_VERSION "@solvespace_VERSION_MAJOR@.@solvespace_VERSION_MINOR@~@solvespace_GIT_HASH@"
|
2015-03-29 00:33:46 +00:00
|
|
|
|
Implement a resource system.
Currently, icons, fonts, etc are converted to C structures at compile
time and are hardcoded to the binary. This presents several problems:
* Cross-compilation is complicated. Right now, it is necessary
to be able to run executables for the target platform; this
happens to work with wine-binfmt installed, but is rather ugly.
* Icons can only have one resolution. On OS X, modern software is
expected to take advantage of high-DPI ("Retina") screens and
use so-called @2x assets when ran in high-DPI mode.
* Localization is complicated. Win32 and OS X provide built-in
support for loading the resource appropriate for the user's
locale.
* Embedding strings can only be done as raw strings, using C++'s
R"(...)" literals. This precludes embedding sizable strings,
e.g. JavaScript libraries as used in Three.js export, and makes
git history less useful. Not embedding the libraries means we
have to rely on external CDNs, which requires an Internet
connection and adds a glaring point of failure.
* Linux distribution guidelines are violated. All architecture-
independent data, especially large data such as fonts, is
expected to be in /usr/share, not in the binary.
* Customization is impossible without recompilation. Minor
modifications like adding a few missing vector font characters
or adjusting localization require a complete development
environment, which is unreasonable to expect from users of
a mechanical CAD.
As such, this commit adds a resource system that bundles (and
sometimes builds) resources with the executable. Where they go is
platform-dependent:
* on Win32: into resources of the executable, which allows us to
keep distributing one file;
* on OS X: into the app bundle;
* on other *nix: into /usr/share/solvespace/ or ../res/ (relative
to the executable path), the latter allowing us to run freshly
built executables without installation.
It also subsides the platform-specific resources that are in src/.
The resource system is not yet used for anything; this will be added
in later commits.
2016-04-21 15:54:18 +00:00
|
|
|
/* Non-OS X *nix only */
|
|
|
|
#define UNIX_DATADIR "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_DATAROOTDIR@/solvespace"
|
|
|
|
|
2015-03-18 17:02:11 +00:00
|
|
|
/* Do we have the si library on win32, or libspnav on *nix? */
|
|
|
|
#cmakedefine HAVE_SPACEWARE
|
|
|
|
|
2018-07-11 02:14:39 +00:00
|
|
|
/* What OpenGL version do we use? */
|
2016-11-19 04:27:25 +00:00
|
|
|
#define HAVE_OPENGL @OPENGL@
|
|
|
|
|
2018-07-11 02:14:39 +00:00
|
|
|
/* Do we have backtrace() function, and if yes, in which library? */
|
|
|
|
#cmakedefine HAVE_BACKTRACE
|
|
|
|
#define BACKTRACE_HEADER @BACKTRACE_HEADER@
|
|
|
|
|
2015-03-29 00:33:46 +00:00
|
|
|
#endif
|