proper dependency handling support, for Windows and GNU/Linux for now

This commit is contained in:
Sebastian Krzyszkowiak 2012-09-20 01:46:29 +02:00
parent 6528e49774
commit 2a2f22750c
6 changed files with 75 additions and 7 deletions

2
lib/.gitignore vendored
View file

@ -1,2 +0,0 @@
win32
linux-i386

View file

@ -1,8 +1,16 @@
IF(MINGW)
IF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/win32" AND IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/win32")
IF(${PACKAGE_BUILD})
IF(WIN32)
FILE(GLOB files "${CMAKE_CURRENT_SOURCE_DIR}/win32/*.dll")
INSTALL(FILES ${files} DESTINATION ${BIN_INSTALL_DIR})
ENDIF(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/win32" AND IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/win32")
ENDIF(MINGW)
ENDIF(WIN32)
# TODO: handle libraries in Linux and Mac OS X versions
IF(UNIX)
FILE(GLOB files "${CMAKE_SOURCE_DIR}/lib/linux-x86/*.so*")
INSTALL(FILES ${files} DESTINATION ${LIB_INSTALL_DIR}/superderpy)
ENDIF(UNIX)
ENDIF(${BUILD_PACKAGE})
# TODO: handle libraries in Mac OS X version if needed
# TODO: handle other architectures

55
lib/README.txt Normal file
View file

@ -0,0 +1,55 @@
This directory is used for distributing library binaries together with
Super Derpy packages.
It's optional - Super Derpy will build correctly without any file placed there,
but they're important when trying to create redistributable packages supposed
to run on systems without Allegro installed.
To include those files in Super Derpy build, run cmake with -DPACKAGE_BUILD=1
-------------------------------------------------------------------------------
When building for Windows, place all run-time DLLs in "win32" directory.
This is the list of DLLs included with official release:
* allegro-5.1.dll
* allegro_audio-5.1.dll
* allegro_image-5.1.dll
* allegro_ttf-5.1.dll
* allegro_acodec-5.1.dll
* allegro_font-5.1.dll
* allegro_primitives-5.1.dll
* libgcc_s_dw2-1.dll
* libstdc++-6.dll
* freetype6.dll
* libogg-0.dll
* zlib1.dll
As there's no standard way of installing packages in Windows, including those
files may be a good idea even when building just for yourself, unless you
made all those libraries registered in your system.
-------------------------------------------------------------------------------
When building for GNU/Linux, place all shared libraries in "linux-x86"
directory.
This is the list of shared libraries included with official release:
* liballegro.so.5.1
* liballegro_acodec.so.5.1
* liballegro_audio.so.5.1
* liballegro_font.so.5.1
* liballegro_image.so.5.1
* liballegro_primitives.so.5.1
* liballegro_ttf.so.5.1
Please note that while Windows version contains also DLLs with dependences from
Allegro, on GNU/Linux there's no need to provide them, as FreeType, libogg or
zlib are commonly available in distribition repositiories. Allegro 5 is not,
that's why it's included here until proper packages make it into the most
common distributions.
If you're on GNU/Linux, and you're not packaging but only building for
yourself, there's no need to place any files here.
-------------------------------------------------------------------------------
TODO: Support Mac OS X (if it's needed at all) and other architectures
than x86.

1
lib/linux-x86/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.so*

1
lib/win32/.gitignore vendored Normal file
View file

@ -0,0 +1 @@
*.dll

View file

@ -34,6 +34,11 @@ if(MINGW)
set(LINK_FLAGS -Wl,-subsystem,windows)
endif(MINGW)
IF(${PACKAGE_BUILD})
SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
SET(CMAKE_INSTALL_RPATH "\$ORIGIN/../lib/superderpy:\$ORIGIN")
ENDIF(${BUILD_PACKAGE})
add_executable(superderpy ${SRC_LIST})
include_directories(${ALLEGRO5_INCLUDE_DIR} ${ALLEGRO5_FONT_INCLUDE_DIR} ${ALLEGRO5_TTF_INCLUDE_DIR} ${ALLEGRO5_PRIMITIVES_INCLUDE_DIR} ${ALLEGRO5_AUDIO_INCLUDE_DIR} ${ALLEGRO5_ACODEC_INCLUDE_DIR} ${ALLEGRO5_IMAGE_INCLUDE_DIR})