Having an uninstall target is unjustified extra maintenance burden for
no benefit.
Instead, it is recommended to install to a CMAKE_INSTALL_PREFIX that the
user can easily remove e.g.: by deleting a directory as a
non-privileged user.
Now that speed-dreams-data is available as a submodule, this allows the
build system to choose it for in-tree builds. Therefore, CMake will
perform in the following order:
1. Do not search the speed-dreams-data package if SD_ASSUME_DATADIR is
set.
2. Otherwise, do an in-tree build if the submodule has been updated.
3. Otherwise, search for the speed-dreams-data package on standard
locations and CMAKE_PREFIX_PATH and/or CMAKE_FIND_ROOT_PATH.
4. Otherwise, return an error message.
SD_HAS_DATADIR was rendered redundant, so it has been removed. However,
SD_DATADIR_INSTALL_PREFIX was introduced because it would not equal
SD_DATADIR_ABS for in-tree builds, where an installed version of the
speed-dreams-data package is not required.
In-tree builds now allow to generate NSIS installers with both code and
data.
The existing scripts for Debian and NSIS packaging were too complex and
dealt unnecessarily with lower level details that should be already
handled by CMake and CPack.
- Packaging-related scripts have been moved to the new cpack/ directory.
There, CPack variables common to all generators are defined in
cpack/common.cmake, and then generator-specific variables are defined
independently (e.g.: cpack/debian.cmake and cpack/nsis.cmake).
- Packaging is now optionally done at a second stage, by running
`cpack -G <generator>` on the build directory. This removes the
requirement to branch based on the system name, and instead all CPack
variables are assigned unconditionally.
- Since now only one version of the game is packaged, there is no need
to maintain the complex scripts in packaging/ and packaging/windows that
used to deal with all variants (e.g.: "wip-cars-and-tracks",
"hq-cars-and-tracks", etc.).
- The use of CPACK_NSIS_EXTRA_INSTALL_COMMANDS,
CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS and CPACK_NSIS_CREATE_ICONS_EXTRA
should not be required, let alone modifying the HKLM registry manually,
since CPack already provides everything required to set up the
installer, the uninstaller and shortcuts.
- $INSTDIR is not required, since NSIS would already prepend the
target installation directory.
- PROJECT_VERSION_METADATA is not a standard CMake variable.
CMAKE_PROJECT_VERSION_TWEAK is instead meant for this purpose. [1]
- OPTION_PACKAGING and OPTION_ALL_IN_ONE_PACKAGING were removed since
packaging will always be available, yet optional. Packagers must then
run CPack on a second stage, as described above.
- Outdated comments were removed to avoid confusion.
TODO:
- Add shortcut to track editor on NSIS.
- dmg packaging was not revamped because of lacking compatible
hardware, but still it has been moved to cpack/dmg.cmake.
- Windows portable packaging (OPTION_PORTABLE_PACKAGING) has been left
out since it required 7z and relied on several hacks to work.
Furthermore, portable versions of the game were already not released on
the latest release, either. [2]
[1]: https://cmake.org/cmake/help/latest/variable/CMAKE_PROJECT_VERSION_TWEAK.html
[2]: https://sourceforge.net/projects/speed-dreams/files/2.3.0/
Commit 744677c3a6f3e6c1c463fe55b7b5408355ffe89b from speed-dreams-data
replaced the definition for SD_DATADIR from an absolute path to a
relative path. This was done in order to allow a relative path to be
looked up first by GfApplication::parseOptions() (as required by Windows
and macOS builds), and then look SD_DATADIR_ABS if not found (as
required by in-tree builds).
Now that the project has been migrated from SVN to Git,
the complex logic to determine the project version is now no longer
needed, since Git can achieve the same effect with git-describe(1). [1]
TODO: CPack-related code should be also updated accordingly.
[1]: https://git-scm.com/docs/git-describe
Since the migration from SVN to Git, the data/ directory was put into a
separate repository, so that the engine repository should never install
anything there.
Otherwise, if the speed-dreams-data package is not found, SD_DATADIR
would expand to "/", which is a valid directory that the game would
attempt to look up.
This command line tool was meant to generate a XML file (typically,
version.xml) containing the version numbers for a list of files defined
by the SD_INSTALL_FILES CMake macro. Then, the game would read this XML
file and copy files around if an update was needed.
Unfortunately, this introduced a circular dependency between the engine
and data repositories, as the engine repository would rely on the data
directory to know the file list, and the data repository would rely on
the xmlversion executable to be available, and therefore the engine
repository.
Ultimately, none of this was needed: it is much simpler to define a
static, line-separated list of files in the data repository, and then
let the game figure out the versioning by itself. This renders
xmlversion entirely redundant, and therefore breaks the circular
dependency. As a bonus, some overly complex CMake stuff could be
removed.
So far, the game assets were located in the same repository as the game
engine. Since data and engine are split into different repositories, now
this project requires users to assign the CMAKE_PREFIX_PATH variable [1]
to indicate the location, only in the case of non-standard locations.
[1]: https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html
Robot clones were shared library duplicates with a different name that
the game would rely on to perform different actions based on the car
category.
Not only this was a hacky solution, but it also involved around 50
extra libraries loaded into the game, which means higher resource
consumption and slower startup time, as well as making driver management
more difficult to the much higher of directories involved in
data/drivers/.
Now, only 1 shared library per robot is defined.
Former-commit-id: 4c5141000bc9b46363a16c0928e90b14f40a430a
Former-commit-id: 773f3d6987da3f6ef8e78e0f0276e2d4bf2b07f2
Some flavours of MinGW are built with the `posix` thread model, which
require to copy libwinpthread-1.dll to the `bin/` directory, as opposed
to those configured with the `win32` thread model.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9612 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: d1c08685c33951fb150b94a0343e0d46d001ce4e
Former-commit-id: c146217ce9bef791e0cfb41a8ac2bea4e4a07346
For some unknown reason, this library was missing from the list, but is
required when rendering fonts from OpenSceneGraph.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9611 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: 50b82dd90ada1f8a40c50c264f33a342e13e56ae
Former-commit-id: d167abf1e2cbfd4feedbf22b731d0a28947f8194
If the user configures the project with a CMAKE_PREFIX_PATH, subprojects
such as xmlversion would not be configured correctly because its
CMAKE_ARGS would expand -DCMAKE_PREFIX_PATH to:
${PROJECT_SOURCE_DIR}/3rdParty ${CMAKE_PREFIX_PATH}
And this whitespace-separated list would be refused when configuring
xmlversion.
This has one side effect: the user is now required to always assign
CMAKE_PREFIX_PATH when configuring the project, and therefore not rely
on the 3rdParty directory to be available from the root directory.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9605 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: 9a7d683b5eb19de60403aafb2a89dd46b276b6db
Former-commit-id: 33e2c0fdfe057572b5b4f6e00339b1926cf96602
These libraries must be installed into the bin/ directory in order to
run the speed-dreams-2 executable.
Note that MinGW is distributed with several flavours and therefore might
define different names for libgcc. [1] libstdc++-6.dll has also been
found on different directories depending on the flavour. On the other
hand, libssp might not be available on some distributions, so it remains
optional.
[1]: https://wiki.unvanquished.net/wiki/MinGW
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9602 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: 84c850bd58150fc67bdd124c0a353815185f86b0
Former-commit-id: 602c3a1227936c9da5b727c9e10ae6c90526227d
Otherwise, libenet.dll would not be installed into the bin/ directory
and speed-dreams-2 would be unable to run.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9601 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: de8b4de35a2665ad6163522097efbd2ab2b923d3
Former-commit-id: 59e37f3174600adff65a134079558a45354e35bd
These libraries are defined by the FreeSOLID project and required by
the speed-dreams-2 executable. However, for some unknown reason,
upstream does not install() them, so it must be patched.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9600 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: d40c860e1a5494c4e23022c1ce7d22b86ecd3455
Former-commit-id: 771b4a9d1612100acad3a9756553b922f7bb351e
xmlversion is meant to be a build-time tool, which means it must never
be cross-compiled. Since toolchain settings are shared among all
libraries within a project, the only way in CMake to build an executable
using the host toolchain (instead of the cross-toolchain) is to define
it inside of an ExternalProject.
xmlversion also depends on several in-house libraries that must be also
build with the host toolchain, so those libraries shall be both
cross-compiled and natively compiled.
On the other hand, since a known install prefix is assigned to
xmlversion, _XMLVER_EXE, _XMLVER_DIR and _XMLVER_NAME no longer need to
be calculated.
Note that CMAKE_FIND_ROOT_PATH must not be passed to the ExternalProject
since xmlversion must never be cross-compiled.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9594 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: d3332d5a3d388b6a6f0179b72e509606ec0055aa
Former-commit-id: 31997c4074f9e9395cb1ccfd9f7487e02584eaf4
This library is not defined by the x86_64-w64-mingw32 toolchain, and it
is not required by the project, either.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9593 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: 5718cd2dbc3fc0d79246c65e65fae91b4f530bb7
Former-commit-id: 982e5f5388d65fce31ec9928d53a2976c75f5cae
Otherwise, target_link_libraries would be unable to find the library
path when using a target name e.g.: rhash::rhash.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9592 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: ac76245db02518aa3d922d3655827259bbabfa54
Former-commit-id: 0b2d4fddd88c70ed19861d3e2d53bce395e92947
ADD_INTERFACE_INCLUDEDIR relied on legacy CMake macros such as
INCLUDE_DIRECTORIES. Nowadays, targets do not specify their
dependencies' include directories, but just call target_link_libraries
so that CMake takes care of the rest.
Of course, that requires every target to define their own include
directories, if any, via target_include_directories.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9591 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: f1d7ea3cb16eb1a23d600b219da8c64502e10c00
Former-commit-id: f5f7e5f86e3e984e60f794115da53fb97f7a9b22
The intention behind this overly complicated code was to find the
path to the top-level directory, which can be easily achieved via
CMAKE_SOURCE_DIR.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9590 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: c760749883682a7879fc8cf1b5ab36719d1bab97
Former-commit-id: 0f212d66bfb33d92f4270fba3d3e2122e67f6c25
Otherwise, builds that do not rely on standard search paths (e.g.:
Windows builds using a relative 3rdParty/ directory) would not be able
to find SDL2 libraries or header files.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9589 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: b9ebe31b7b7de7dad0c7e3dc903e7acb893a3883
Former-commit-id: 09665c149ad79678cb3ac11bc5ed79ed9aea0cdb
This macro, along with _FIND_3RDPARTY_DEPENDENCY and
_FIND_3RDPARTY_DEPENDENCIES, was meant to tell find_package() and
friends about non-standard paths to find libraries when building for
Windows.
However, the same effect can be achieved via the standard CMake
variables CMAKE_PREFIX_PATH [1] and CMAKE_FIND_ROOT_PATH [2].
If cross-compiling, CMAKE_FIND_ROOT_PATH must be assigned when
configuring the project. This means the project must now be configured
with:
cmake -B <build-dir> -DCMAKE_FIND_ROOT_PATH=<root-dir>/3rdParty ...
[1]: https://cmake.org/cmake/help/latest/variable/CMAKE_PREFIX_PATH.html
[2]: https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_ROOT_PATH.html
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9588 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: 9a28c7ff755e57080c1f6075dc9b7585146681b9
Former-commit-id: b406ba92a1955da3523eff392606d04d752bfdd0
When calling find_package(CURL), different files might be inspected:
- $CMAKE_PREFIX/Modules/FindCURL.cmake
- 3rdParty/lib/cmake/CURL/CURLConfig.cmake
Which file is selected is decided by CMake depending on the context.
Unfortunately, whereas the former defines CURL_LIBRARY, the latter
does not.
However, both define the CURL::libcurl target, from which the library
location can be retrieved with get_property() so as to achieve the
same effect.
Fixing this also makes CURL_NO_CURL_CMAKE redundant.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9582 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: 470e785d15589e41bf6f5d1b3c42318bb5ef645e
Former-commit-id: 5f8c279fc814833acdb26ade8979f67950033a8b
Whereas Windows systems are case-insensitive, POSIX systems could fail
to find libssgAux accordingly.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9560 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: ecfbe7fddc04996fa305c4411089f98a7c2fc67e
Former-commit-id: d7ef6b509885f1a216f5c41ae708ad2c35ba5a64
These properties are not transmitted with git-svn(1) [1], which might
then cause failed patches when modifying lines close to these
properties.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9554 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: 6ed21e1fe12d01a370842418c35722c75117a30a
Former-commit-id: 8ecd21b7c0211cd000b10b3f0032980f63c06398
This SVN-specific keyword [1] did not expand as expected on Git
repositories migrated from SVN via git-svn(1) [2]. Because of this,
applying patches with modifications would sometimes fail because, even
if these lines were not modified, they could be part of the context
lines, thus heavily confusing Git.
Since it is already expected to migrate from SVN to Git sometime soon,
this would also make $Id$ redundant.
[1]: https://svnbook.red-bean.com/en/1.7/svn.advanced.props.special.keywords.html
[2]: https://git-scm.com/docs/git-svn
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9550 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: 7acf9a9675a0496a85ecd61210b8c29c89f9517a
Former-commit-id: 1878bb38889e4dddc83ef762b6b384f0f0a4ecc5
Findminizip.cmake does not define MINIZIP_LIBRARY, but
minizip_LIBRARIES. Ideally, minizip::minizip should be used instead, but
that seems not to work for some unknown reason.
git-svn-id: https://svn.code.sf.net/p/speed-dreams/code/trunk@9531 30fe4595-0a0c-4342-8851-515496e4dcbd
Former-commit-id: c06a8fe688535315e10a1ece4175eda032d1b850
Former-commit-id: 053d6039517c16770d0b9a8994c72ba58f0c2da1