Software revision follow the <major>.<minor>.<patch> scheme :
We may use "Alpha", "beta" and "release candidate" version (not always) ; in such cases, we use the following naming scheme :
Finally, as a last precaution, we may include the corresponding SVN revision in the version name, as in :
In the SVN repository, we define 3 main folders in order to cope with releases :
See source:trunk/INSTALL.txt for the 2.x series (source:tags/1.4.0/INSTALL for the 1.4.0).
Build times examples for trunk@3276 (elapsed time for the 'make' command, or equivalent ; not considered the 'cmake' or 'make install' build steps, which may also take a long time, especially under Windows).
CPU | Disk | OS | Compiler | Build configuration | Parallel jobs | Elapsed time (mm:ss) |
---|---|---|---|---|---|---|
AMD 64 x 2 4600+ (2.4 GHz) DDR2 800 | Western Digital Raptor 74 Gb (10000 rpm, cache 8 Mb) | Linux Mandriva 2010.0 64 bits | GCC 4.4.1 | Debug, full contents | 1 | 02:11 |
2 | 01:09 | |||||
Western Digital Caviar Black 500 Gb (7200 rpm, cache 32 Mb) | Windows XP SP2 32 bits | MSVC 2005 Pro | ||||
Debug, full contents | 1 | 03:18 | ||||
2 | 01:38 | |||||
Intel Core2 Duo E8400 (3 GHz) DDR3 1066 | Hitashi Deskstar 160 Gb (7200 rpm, cache 8 Mb) | Windows XP SP2 32 bits | MSVC 2005 Pro | Debug, Official contents | 1 | 01:54 |
2 | 01:08 | |||||
Intel Xeon 3250 (2.66 GHz) DDR3 1066 | Western Digital Caviar Blue 250 Gb (7200 rpm, cache 8 Mb) | Windows XP SP3 32 bits | MSVC 2005 Pro | Debug, Official contents | 2 | 01:04 |
4 | 01:00 | |||||
6 | 00:54 | |||||
8 | 00:50 |
Same for trunk@4791m (MinGW port pre-release)
CPU | Disk | OS | Compiler | Build configuration | Parallel jobs | Elapsed time (mm:ss) |
---|---|---|---|---|---|---|
Intel Xeon 3250 (2.66 GHz) DDR3 1066 | Western Digital Caviar Blue 250 Gb (7200 rpm, cache 8 Mb) | Windows XP SP3 32 bits | MSVC 2005 Pro | Debug, Official contents | 1 | 01:46 |
2 | 01:05 | |||||
4 | 00:48 | |||||
8 | 00:55 | |||||
MinGW Gcc 4.7.0 | Release, Official contents | 1 | 04:25 | |||
2 | 01:56 | |||||
4 | 01:26 | |||||
Debug, Official contents | 1 | 03:25 | ||||
2 | 01:45 | |||||
4 | 01:06 | |||||
AMD 64 x 2 4600+ (2.4 GHz) DDR2 800 | Western Digital Veloci-raptor 150 Gb (10000 rpm, cache 16 Mb) | Linux Mint Debian Edition April 2012 | GCC 4.6.0 | Release, official contents | 1 | TODO |
2 | TODO | |||||
Western Digital Caviar Black 500 Gb (7200 rpm, cache 32 Mb) | Windows XP SP2 32 bits | MinGW 201204 Gcc 4.7.0 | Debug, full contents | 1 | TODO | |
2 | 02:15 | |||||
Release, official contents | 1 | 05:10 | ||||
2 | 02:33 |
Note:
freeze the source tree into a tag, inside the remote SVN server
svn copy https://speed-dreams.svn.sourceforge.net/svnroot/speed-dreams/trunk@3935 https://speed-dreams.svn.sourceforge.net/svnroot/speed-dreams/tags/2.0.0-b1
checkout the tag or switch your trunk/branch sandbox to the tag
alternative 1 : switch your trunk/branch sandbox to the tag (very quick, some seconds, few downloads)
cd mysandbox/trunk ./clobber.sh # if not there, cmake && make should generate it svn status -q # MANDATORY : make sure nothing is uncommitted ; fix it first if not ! rm CMakeLists.txt # will force SVN keyword substitution, to auto-generate the exact version name svn switch https://speed-dreams.svn.sourceforge.net/svnroot/speed-dreams/tags/2.0.0-b1
alternative 2 : checkout the tag (from far longer, as it downloads about 2 Gb)
cd mysandbox mkdir tags cd tags svn checkout https://speed-dreams.svn.sourceforge.net/svnroot/speed-dreams/tags/2.0.0-b1 2.0.0-b1 cd 2.0.0-b1
configure the build for the official contents and the Release (optimized) configuration (see above for more details, especially about external dependencies)
cmake -D OPTION_OFFICIAL_ONLY:BOOL=ON -D CMAKE_BUILT_TYPE:STRING=Release . # Note: Depending on your configuration, you migh also use '-D CMAKE_PREFIX_PATH:STRING=/usr/local'
build and install
make sudo make install
test the release (check cars, tracks, robots and modules-related contents ; check all race mode ; ...)
/usr/local/games/speed-dreams-2
make the needed changes to the code / artwork in your 2.0.0-b1 sandbox
Now, it's time for release package(s) ...
All the same as for Linux, but rather than the command line, you generally use graphical tools for dealing with SVN (ex: Tortoise SVN), compiling (MS Visual C++ 2005), ... etc ...
See the Windows chapter for more details about each build step in source:trunk/INSTALL.txt.
If you didn't "make the release" yet, please do it, as explained above in "How to make a release".
Below, we assume you did it, and so that you enjoy a 2.0.0-b1 SVN sandbox where CMake was run at least once as explained above (step 5 : configure the build ...).
These packages are the "reference" ones for any release, as all the binary packages can be rebuilt / must be "rebuildable" from them.
They contain only official contents (not the whole SVN repo. contents).
For official releases, we use the following multi-package scheme :
The small base package is designed to become at the end a quick-download-and-try one, a kind of demo one.
But for the moment, you need to download and extract all of these source packages before starting to build (due to the limitations of our current CMake build system).
To build these packages, things are simple :
run the packaging/sources/build.sh script, and give it the version of your packages
./packaging/sources/build.sh 2.0.0-b1-r3937
That's all : after some minutes, you've got all of the .tar.xz packages
To extract these packages :
mkdir sd-2.0.0-b1-r3937-src cd sd-2.0.0-b1-r3937-src for file in <packages folder>/*.xz; do tar xvfa $file; done
automatically generate the full-contents source package (unfortunately, the (our?) CMake source packager does not do any filtering) (as a .tar.bz2 file)
make package_source
extract it (we need to clean it up) :
tar xvfj speed-dreams-2.0.0-b1-r3937-src.tar.bz2
cleanup the resulting source tree from unofficial contents
cd speed-dreams-2.0.0-b1-r3937-src # Docs you can find online rm -fr doc/tutorials # Race modes rm src/raceman/networkrace.xml rm src/raceman/championship-mpa1.xml # Robots rm -fr src/drivers/bt rm -fr src/drivers/networkhuman rm -fr src/drivers/hymie rm -fr src/drivers/K1999 rm -fr src/drivers/simplix/simplix_mpa1 # Tracks rm -fr data/tracks/development rm -fr data/tracks/dirt/dirt-5 rm -fr data/tracks/circuit/bueno rm -fr data/tracks/gprix rm -fr data/tracks/karting rm -fr data/tracks/road/Salty rm -fr data/tracks/road/longday # Cars rm -fr data/cars/models/gtc-aichi-aidoru rm -fr data/cars/models/ls1-cavallo-570s1 rm -fr data/cars/models/ls1-marisatech-gt4r rm -fr data/cars/models/lancer09-wr rm -fr data/cars/models/lp1-* rm -fr data/cars/models/lp2-* rm -fr data/cars/models/mp1* rm -fr data/cars/models/mp10-* rm -fr data/cars/models/mpa1* rm -fr data/cars/models/nascar-* rm -fr data/cars/models/ref-boxer-gt3-rs-2010 rm data/tracks/dirt/garguree/garguree.ac rm data/tracks/dirt/dirt-2/dirt-2.ac rm data/tracks/dirt/dirt-1/dirt-1.ac rm data/tracks/dirt/mixed-1/mixed-1.ac rm data/tracks/speedway/manton/manton.acc rm data/tracks/speedway/newton/newton.acc rm data/tracks/road/alpine-2/alpine-2.ac rm data/tracks/road/e-track-2/e-track-2.ac rm data/tracks/road/charmey/charmey.ac rm data/tracks/road/prenzlau/prenzlau.ac rm data/tracks/road/street-1/street-1.ac rm data/tracks/road/e-track-1/e-track-1.ac rm data/tracks/circuit/chemisay/chemisay.ac rm data/tracks/circuit/forza/forza.ac rm data/tracks/circuit/aalborg/aalborg.ac rm data/tracks/circuit/karwada/karwada.ac rm data/tracks/circuit/corkscrew/corkscrew.ac rm data/tracks/circuit/migrants/migrants.ac rm data/tracks/circuit/ruudskogen/ruudskogen.ac
4. archive and compress (lzma) the resulting source tree
cd .. tar -c -v -f - speed-dreams-2.0.0-b1-r3937-src | 7zr a -m0=lzma -mx=9 -mfb=64 -md=32m xxx.tar.7z speed-dreams-2.0.0-b1-r3937-src.tar.7z
That's all :-)
To extract this package under Linux :
7zr x -so speed-dreams-2.0.0-b1-r3937-src.tar.7z | tar xvf -
Under Windows, you can use the excellent 7-Zip.
We don't build source packages under Windows, but if it is needed, here's how to.
You can use the Linux method, after installing MSYS or CygWin? (gives your a Linux shell and tool set under Windows).
Basically, you'll use the same procedure as for Linux, but through different tools :
to "archive and compress (lzma) the resulting source tree", you'll use 7-Zip in order to get the best possible compression ratio. Note however that the resulting source package will not be a compressed "tarball" (a .tar.7z file), but a compressed tree (a .7z file) ... meaning that one will have to use a different command in order to extract it under Linux :
7zr x -so speed-dreams-2.0.0-b1-r3937-src.7z
Here's how to build packages that suit for direct and automatic installation on various OSes : the kind that the end-users prefer (and the developers don't like to make ;-).
Whatever the target OS, you start from the "all-in-one" source package, or from the SVN release tag ... as you like.
Let's assume that you've got such a source tree, already built it with "official contents only" and as a "Release" configuration (optimized compilation).
We use this one for official releases :
After the "make a release" loop (build, install, test, change, loop until OK), you enter here a "make the packages" loop if it was not achieved earlier : at the end, you must be happy with your packages (official contents, the game works, ...).
Once OK about the contents of the packages, you have to tweak the last detail : the release name. As it is automatically built in the game binaries (splash screen, help screens, console log) and package file names from the actual SVN version of the tree, you have to commit your last changes (to the .nsi / .nsh files in the tags/2.0.0-b1/installer/windows folder) and generate the packages one last time.
Wait a minute : for the moment, this is not fully automatic, as you need to manually tweak the SVN revision in source:tags/2.0.0-b1/installer/windows/speed-dreams.nsh :
Then, you'll be done after :
We don't use it, for now, but in case it is useful to anyone, it is simple and automatically generates an executable package suitable for Windows XP, Vista and 7.
Simply build the "PACKAGE" project with MS Visual Studio.
Note: You can get different binary packages : run cmake GUI and check the PACKAGERS_BINARY variables.
Our CMake build system has some support for building Linux binary packages, based on what is configured to be built and installed (see above cmake command line options, especially the "official-only" stuff).
You can get different binary packages : run ccmake and check the PACKAGERS_BINARY variables.
To build the chosen package :
make package
Note: In order to get .deb binary packages for other platforms than Ubuntu 9.10, you'll need to change source:trunk/cmake/packagemaker.cmake
TO BE COMPLETED for each distro. ... volunteers are welcome :-)
To be completed, made more step-by-step precise.
...
...
...
Here's the description of this configuration.
You'll find also some hints about :
The whole game (executable, libraries, modules, and also tools) is built through a single "speed-dreams-2" CMake project, defined in the "master" (root) CMakeLists.txt (the directory of which is the target of the cmake command).
Basically, this master CMakeLists.txt :
The .cmake files are located in the "cmake" sub-folder :
Let's not talk here about the master one, but about the others (the ones you are the most likely to update or add).
There are 3 big types :
As already told, you nearly always must first include macros.cmake, through the INCLUDE command, using always a relative path.
You should normally always find the following overall scheme :
define the source files (often separating source and headers) needed for building the binary product,
for this, you use simple CMake lists ; example :
SET(TGF_HEADERS os.h tgf.h tgf.hpp modinfo.h osspec.h) SET(TGF_SOURCES application.cpp eventloop.cpp directory.cpp file.cpp filesetup.cpp formula.cpp hash.cpp module.cpp legacymodule.cpp modinfo.cpp os.cpp params.cpp profiler.cpp schedulespy.cpp tgf.cpp trace.cpp) SET(TGF_OTHER_SOURCES params.dtd)
define the name and type of the binary product to build from these sources (static or shared library, executable, ...),
for this, you use the ADD_LIBRARY or ADD_EXECUTABLE CMake command ; example :
# Note: Other sources needed for having them available in IDEs (no use for building). ADD_LIBRARY(tgf SHARED ${TGF_HEADERS} ${TGF_SOURCES} ${TGF_OTHER_SOURCES})
define the internal compile-time dependencies of the binary products,
for this, you use the ADD_SDLIB_INCLUDEDIR and/or ADD_INTERFACE_INCLUDEDIR macros (defined in trunk/cmake/internaldeps.cmake) ; example :
ADD_INTERFACE_INCLUDEDIR() ADD_SDLIB_INCLUDEDIR(portability math)
list the external (3rd party) compile-time dependencies of the binary products,
for this, you use the ADD_XX_INCLUDEDIR macros (one exists for each dependency, see trunk/cmake/thirdpartydeps.cmake) ; example :
ADD_PLIB_INCLUDEDIR() ADD_SDL_INCLUDEDIR()
list the internal link-time dependencies of the binary products,
for this, you use the ADD_SDLIB_LIBRARY macro (defined in trunk/cmake/internaldeps.cmake) ; example :
ADD_SDLIB_LIBRARY(tgf portability txml)
list the external (3rd party) link-time dependencies of the binary products,
for this, you use the ADD_XX_LIBRARY macros (one exists for each dependency, see trunk/cmake/thirdpartydeps.cmake) ; example :
ADD_DL_LIBRARY(tgf) ADD_SDL_LIBRARY(tgf) ADD_EXPAT_LIBRARY(tgf) # Ignored if not OPTION_3RDPARTY_EXPAT
explain where to install the binary product,
for this, you use the SD_INSTALL_FILES macro ; example :
SD_INSTALL_FILES(BIN TARGETS tgf) # Install CMake target "tgf" in the binary folder.
optionally, explain what data files to install, and where,
for this, you also use the SD_INSTALL_FILES macro ; example :
SD_INSTALL_FILES(INCLUDE FILES ${TGF_HEADERS}) SD_INSTALL_FILES(DATA config FILES params.dtd)
Notes:
No specific configuration, the above overall scheme perfectly fits.
Simple shared and static libraries are to be installed in the $SD_BINDIR folder, as specified by the "BIN" argument of the SD_INSTALL_FILES macro (a CMake cache variable / advanced option you can check / change at configure time).
See src/libs/tgf or tgfclient or portability for working examples.
The game main executable (src/main) has one specific configuration trick : it takes care of installing the 3rd party and MS CRT DLLs along with its binary file under Windows (this is done through the SD_INSTALL_CUSTOM_3RDPARTY macro, defined in trunk/cmake/customthirdparty.cmake).
Other executable (src/tools) don't care about that (assuming the main executable has been installed, and thus that their (same) 3rd party dependencies have been installed already).
Just like shared and static libraries, executables are to be installed in the $SD_BINDIR folder, as specified by the "BIN" argument of the SD_INSTALL_FILES macro.
Works just like a simple (but "shared") library, except that the shared library binary file name must not have the standard "lib" prefix under Linux / MinGW ;
that's why, as an example for modules/graphic/ssggraph :
IF(UNIX OR MINGW) SET_TARGET_PROPERTIES(ssggraph PROPERTIES PREFIX "") ENDIF()
Note also that the module binary has to be installed in $SD_LIBDIR/modules/<category>, as specified by the "LIB" argument of the SD_INSTALL_FILES macro ;
example :
SD_INSTALL_FILES(LIB modules/graphic TARGETS ssggraph)
See src/modules/<category>/* for working examples.
Robot modules are a bit more complicated, and their CMakeLists.txt does not follow the above detailed scheme.
A couple of macros actually make it simpler for the robot developer ; hence the following scheme :
define the source files needed for building the robot library,
for this, you use simple CMake lists ; example :
SET(ROBOT_SOURCES src/unitcarparam.cpp src/unitcarparam.h src/unitcharacteristic.cpp src/unitcharacteristic.h src/unitclothoid.cpp src/unitclothoid.h ...)
define the robot library interface to SD,
for this, you use simple CMake lists ; example :
# Simplix library displays at the same time a "legacy" (TORCS) and the modern "welcome" (SD) one ; # and it takes care of multiple sets of drivers (SC A, SC B, 36GP, LS1, MP5, ...) SET(ROBOT_INTERFACE LEGACY WELCOME simplix_sca simplix_scb simplix_36GP simplix_ls1 simplix_mp5 ...)
define the file names of the robot module DLL clones
for this, you use simple CMake lists ; example (1 clone for each car category here) :
SET(ROBOT_CLONES simplix_36GP simplix_sc simplix_trb1 simplix_ls1 simplix_ls2 simplix_mp5 simplix_lp1)
define the robot module (1 DLL, cloned as many times as needed),
for this, you use the ROBOT_MODULE macro (defined in trunk/cmake/robot.cmake) ; example :
# The ubiquitous robot module and its clones. ROBOT_MODULE(NAME simplix VERSION 3.3.0 SOVERSION 1.0.0 INTERFACE ${ROBOT_INTERFACE} SOURCES ${ROBOT_SOURCES} CLONENAMES ${ROBOT_CLONES})
then, for each DLL clone, define the data files to install and where,
for this, you use the ROBOT_DATA macro (defined in trunk/cmake/robot.cmake) ; example :
SET(ROBOT_SUBDIRS 0 1 2 3 4 5 6 7 8 9 36gp-ettore-t59 36gp-milano-12c36 36gp-silber-w25b 36gp-tridenti-6c34 36gp-tridenti-v8ri tracks) ROBOT_DATA(NAME simplix_36GP PREFIX simplix_36GP FILES simplix_36GP.xml default.xml logo.rgb readme.txt SUBDIRS ${ROBOT_SUBDIRS} PATTERNS *.xml logo.rgb *.png *.jpg)
Note: A robot module also has to be installed in $SD_LIBDIR/drivers/<robot>, but that's transparent in the CMakeLists.txt, thanks to the ROBOT_MODULE macro.
See src/drivers/simplix, or usr or kilo2008 for working examples.
We are dealing here with the CMakeLists.txt of the "data" tree under trunk.
The "sources" for a car are located in a dedicated folder (data/cars/models/<model name>) ; the CMakeLists.txt is very simple, as it only use 1 macro for installing everything needed : SD_INSTALL_CAR (defined in install.cmake).
Example:
SD_INSTALL_CAR(36gp-century-r11b readme.txt)
These car data files are actually installed in $SD_DATADIR/cars/models/<model name>.
The "sources" for a track are also located in a dedicated folder (data/tracks/<category>/<track name>) ; the CMakeLists.txt is very simple, as it only use 1 macro for installing everything needed : SD_INSTALL_TRACK (defined in install.cmake).
Example:
SD_INSTALL_TRACK(karwada circuit readme.txt)
These track data files are actually installed in $SD_DATADIR/tracks/<category>/<track name>.
For any other data source folder, we use the generic SD_INSTALL_FILE macro (defined in trunk/cmake/install.cmake).
Example (for the data/data/img folder) :
FILE(GLOB _PNG_FILES *.png) FILE(GLOB _JPG_FILES *.jpg) # Work-in-progress / unofficial contents (network menus background images). IF(OPTION_OFFICIAL_ONLY) FILE(GLOB _REMOVE_FILES splash-network*.jpg) LIST(REMOVE_ITEM _JPG_FILES ${_REMOVE_FILES} ) ENDIF(OPTION_OFFICIAL_ONLY) SD_INSTALL_FILES(DATA data/img FILES ${_PNG_FILES} ${_JPG_FILES})
Note that the files are to be installed in the specified sub-folder (after the "DATA" argument) of the $SD_DATADIR folder.
You basically only use the ADD_SUBDIRECTORY CMake command or the SD_ADD_SUBDIRECTORY macro, for each sub-directory to configure.
Example:
SD_ADD_SUBDIRECTORY(aalborg) SD_ADD_SUBDIRECTORY(brondehach) SD_ADD_SUBDIRECTORY(chemisay)
SD_ADD_SUBDIRECTORY prevents the configuration to fail if the target folder doesn't exists (and if OPTION_CHECK_CONTENTS CMake option if Off), so you should use it everywhere unless the target folder is really really a mandatory one (data ones are generally not, while most libraries and executables are).
Basically, a 3rd party dependency is a set / package of external libraries coming with their header files, in order you can compile and link a SD library or executable with them.
Here are the steps to complete :
checks.cmake : you have to add a block of code in the CHECK_LIBRARIES for detecting the new dependency ; a simple copy of the OpenAL one should be enough most of the time :
# OpenAL Find_Package(OpenAL) IF(OPENAL_FOUND) SET(HAVE_LIBOPENAL 1) MESSAGE(STATUS "Looking for library OpenAL - found") ELSE(OPENAL_FOUND) MESSAGE(STATUS "Looking for library OpenAL - NOT found") ENDIF(OPENAL_FOUND)
thirdpartydeps.cmake : now you have to create 2 macros for making it easy to compile and link a SD library or executable against the new libraries : ADD_<new dependency>INCLUDEDIR for the include directories, and ADD<new dependency>_LIBRARY for the target link libraries ; example, for the OpenAL library :
MACRO(ADD_OPENAL_INCLUDEDIR) FIND_PACKAGE(OpenAL) IF(OPENAL_FOUND) INCLUDE_DIRECTORIES(${OPENAL_INCLUDE_DIR}) ELSE(OPENAL_FOUND) MESSAGE(FATAL_ERROR "Cannot find OpenAL header files") ENDIF(OPENAL_FOUND) ENDMACRO(ADD_OPENAL_INCLUDEDIR) MACRO(ADD_OPENAL_LIBRARY TARGET) FIND_PACKAGE(OpenAL) IF(OPENAL_FOUND) TARGET_LINK_LIBRARIES(${TARGET} ${OPENAL_LIBRARIES}) ELSE(OPENAL_FOUND) MESSAGE(FATAL_ERROR "Cannot find OpenAL libraries") ENDIF(OPENAL_FOUND) ENDMACRO(ADD_OPENAL_LIBRARY TARGET)
customthirdparty.cmake : only useful under Windows, but, as SD must build also under these plate-forms, you'll need to do something here even if you're working under Linux ;
run-time installation : you'll generally need to add 1 _FIND_3RDPARTY_DLL line in the SD_INSTALL_CUSTOM_3RDPARTY macro for each DLL needed at run-time due to the new package (beware that some such DLLs may not appear in the link-time dependencies, like plugin DLLs, or simply 2nd level dependencies) ; example (for the PNG dependency) :
_FIND_3RDPARTY_DLL("${PNG_LIBRARY}" "png" "lib" _DLL_PATHNAME) LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}")
3rd party binary package : of course, you'll have to find a way to enable the developers to get the header and binary files for their build chain ; under Linux, it's mostly a question of dev package installation (easy) ; under Windows, it's more complicated : you'll probably have to enhance the 3rd party binary package(s) shipped here by compiling from source the new dependency ! Then, don't forget to update the source package, and the installation instructions.
Some dependencies feature multiple libraries, or even plug-ins.
When you need to add a new target link library / include dir. to an existing dependency, you have to :
detection for compile and link-time :
sometimes, add the new library to the calls to FindPackage(<dependency>), in macro. CHECK_LIBRARIES defined in check.cmake, and in macros ADD_<dependency>INCLUDEDIR and ADD<dependency>_LIBRARY in thirdpartydeps.cmake),
example (for OpenSceneGraph):
Find_Package(OpenSceneGraph REQUIRED osgDB osgViewer osgGA osgUtil osgFX)
always, add a call to _FIND_3RDPARTY_DEPENDENCY in the _FIND_3RDPARTY_DEPENDENCIES macro. defined in customthrirdparty.cmake
example (for OpenSceneGraph):
_FIND_3RDPARTY_DEPENDENCY(OSGFX osgFX/version "" osgFX ${ROOT_DIR} "")
installation for run-time :
DLLs associated with target link libraries : always, add the new library / include dir. to the call to the _FIND_3RDPARTY_DLL macro in the SD_INSTALL_CUSTOM_3RDPARTY macro. defined in customthrirdparty.cmake
example (for OpenSceneGraph):
# DLLs whose libs we link with. SET(_OSG_DLLS_NAME_HINTS "OpenThreads;osgDB;osgFX;osgGA;osgViewer;osgUtil;osg") # <===== sure here (new DLL name, without a pre- or suf-fix) FOREACH(_LIB_NAME ${OPENSCENEGRAPH_LIBRARIES}) FOREACH(_NAME_HINT ${_OSG_DLLS_NAME_HINTS}) IF("${_LIB_NAME}" MATCHES "${_NAME_HINT}\\.") _FIND_3RDPARTY_DLL("${_LIB_NAME}" "${_NAME_HINT}" "lib;ot12-;osg80-" _DLL_PATHNAME) # <==== May be here (possibly another DLL prefix) SET(_NAME_HINT_ "${_NAME_HINT}") # For later (see below DLLs we don't link with). SET(_LIB_NAME_ "${_LIB_NAME}") # For later (see below DLLs we don't link with). SET(_DLL_PATHNAME_ "${_DLL_PATHNAME}") # For later (see below plugins). BREAK() ENDIF() ENDFOREACH() LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") ENDFOREACH() Find_Package(OpenSceneGraph REQUIRED osgDB osgViewer osgGA osgUtil osgFX)
DLLs associated with non-target link libraries (2nd level dependencies, plug-ins, ...) : always, add the new library to the call to the _FIND_3RDPARTY_DLL macro in the SD_INSTALL_CUSTOM_3RDPARTY macro. defined in customthrirdparty.cmake
example, for OpenSceneGraph osgText, a DLL we need at run-time but don't link with):
# Other needed DLLs we don't link with. # We use _LIB_NAME_ as a template, and _NAME_HINT_ as the string to replace inside. SET(_EXTRA_OSG_DLLS_NAME_HINTS "osgText") # ';'-separated list <===== sure here (new DLL name, without a pre- or suf-fix) FOREACH(_NAME_HINT ${_EXTRA_OSG_DLLS_NAME_HINTS}) STRING(REPLACE "${_NAME_HINT_}" "${_NAME_HINT}" _LIB_NAME "${_LIB_NAME_}") _FIND_3RDPARTY_DLL("${_LIB_NAME}" "${_NAME_HINT}" ";lib;ot12-;osg80-" _DLL_PATHNAME) # <==== May be here (possibly another DLL prefix) LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_DLL_PATHNAME}") ENDFOREACH()
example, for OpenSceneGraph plug-ins :
# Plugins : Complete the list right below according to the actual needs. # TODO: Find a way to install them in the osgPlugins-xxx subdir (works as is, but ...) SET(_OSG_PLUGIN_NAME_HINTS "glsl;jpeg;png;rgb") # ';'-separated list <===== sure here (new plug-in name, without a pre- or suf-fix) GET_FILENAME_COMPONENT(_OSG_PLUGINS_DIR "${_DLL_PATHNAME_}" PATH) FILE(GLOB_RECURSE _OSG_PLUGIN_NAMES "${_OSG_PLUGINS_DIR}/*${CMAKE_SHARED_LIBRARY_SUFFIX}") FOREACH(_NAME_HINT ${_OSG_PLUGIN_NAME_HINTS}) FOREACH(_PLUGIN_NAME ${_OSG_PLUGIN_NAMES}) IF("${_PLUGIN_NAME}" MATCHES "osgPlugins.*/.*${_NAME_HINT}\\.") LIST(APPEND _THIRDPARTY_DLL_PATHNAMES "${_PLUGIN_NAME}") MESSAGE(STATUS "Will install 3rdParty plugin ${_PLUGIN_NAME}") BREAK() ENDIF() ENDFOREACH() ENDFOREACH()