2008-05-05 20:43:39 +00:00
# most stuff should be implemented so far, mgoe should know the details (he has done all the work...)
# what is not working so far:
# * some other smaller stuff
# * nice INSTALL howto
2009-03-21 10:49:46 +00:00
# * Detect Python and install Python tools
# * Rewrite the pot-update
# * Test everything
2009-03-27 22:31:26 +00:00
# * Fix tiny gui with processing the data directory
# * Make translations work without installation
2009-04-14 09:14:17 +00:00
# * install .desktop files taking binary prefix and suffix into account
2008-05-01 20:12:38 +00:00
2009-03-20 19:59:51 +00:00
# set minimum version
cmake_minimum_required ( VERSION 2.6.0 )
2008-05-07 08:13:25 +00:00
if ( COMMAND cmake_policy )
cmake_policy ( SET CMP0005 OLD )
endif ( COMMAND cmake_policy )
2008-05-09 10:53:45 +00:00
set ( CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true )
2008-05-05 21:06:14 +00:00
# use our own version of FindBoost.cmake and other Find* scripts
2008-05-04 20:32:01 +00:00
set ( CMAKE_MODULE_PATH ${ CMAKE_SOURCE_DIR } /cmake )
2008-05-04 20:11:11 +00:00
2008-05-15 14:56:38 +00:00
find_package ( SDL 1.2.7 REQUIRED )
2009-08-01 14:37:08 +00:00
find_package ( Boost 1.35 REQUIRED COMPONENTS iostreams regex )
2008-07-14 19:26:59 +00:00
# yes, gettext is *required* even when NLS is deactivated (this is to compile
# src/gettext.cpp since it includes libintl.h)
find_package ( Gettext REQUIRED )
2009-08-01 18:28:18 +00:00
2008-06-18 20:02:26 +00:00
find_package ( X11 )
2008-05-05 22:22:28 +00:00
2009-04-13 14:41:32 +00:00
if ( NOT MSVC )
#needed to get some SDL defines in... (as of rev31694 -D_GNU_SOURCE=1 is required!)
set ( SDL_CONFIG "sdl-config" CACHE STRING "Path to sdl-config script" )
exec_program ( ${ SDL_CONFIG } ARGS "--cflags" OUTPUT_VARIABLE SDL_CFLAGS )
add_definitions ( ${ SDL_CFLAGS } )
endif ( NOT MSVC )
2008-12-24 11:11:03 +00:00
2009-03-24 14:28:52 +00:00
#check for some compiler/arch specific things and export defines accordingly...
INCLUDE ( SearchForStuff )
2008-05-13 09:11:18 +00:00
#
# Options
#
2008-05-04 17:27:28 +00:00
2008-05-13 09:11:18 +00:00
#Path options
2008-05-04 17:27:28 +00:00
set ( BINDIR "bin" CACHE STRING "Where to install binaries" )
2008-05-12 23:00:16 +00:00
set ( MANDIR "man" CACHE STRING "Where to install manpages" )
2008-05-08 19:19:15 +00:00
set ( DATAROOTDIR "${CMAKE_INSTALL_PREFIX}/share" CACHE STRING "Sets the root of data directories to a non-default location" )
2008-05-12 23:00:16 +00:00
set ( DOCDIR "${DATAROOTDIR}/doc/wesnoth" CACHE STRING "Sets the doc directory to a non-default location." )
2008-05-08 19:35:40 +00:00
set ( DATADIRNAME "wesnoth" CACHE STRING "change the name of the directory for the read-only architecture-independent game data" )
2009-02-28 16:44:37 +00:00
set ( EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}" CACHE STRING "change the dir where binaries are placed right at compile time" )
2008-05-08 20:32:54 +00:00
set ( LOCALEDIR "translations" CACHE STRING "change the name of the locale data directory to a non-default name" )
2008-05-04 17:27:28 +00:00
set ( PREFERENCES_DIR "" CACHE STRING "Use a non-default preferences directory (.wesnoth on unix)" )
2008-05-13 09:11:18 +00:00
2008-05-15 14:56:38 +00:00
#Game options
2009-03-03 00:04:00 +00:00
option ( ENABLE_FRIBIDI "Enable FriBIDi support" ON )
2008-09-03 15:46:56 +00:00
set ( GUI "normal" CACHE STRING "Set for GUI reductions for resolutions down to 320x240 (PDAs) (normal|tiny)" )
2008-05-04 17:27:28 +00:00
2008-05-13 09:11:18 +00:00
#server options
set ( SERVER_UID "" CACHE STRING "User id of the user who runs wesnothd" )
set ( SERVER_GID "" CACHE STRING "Group id of the user who runs wesnothd" )
set ( FIFO_DIR "/var/run/wesnothd" CACHE STRING "Directory for the wesnothd fifo socket file" )
#build options
2008-05-05 21:06:14 +00:00
option ( ENABLE_GAME "Enable compilation of the game" ON )
option ( ENABLE_CAMPAIGN_SERVER "Enable compilation of campaign server" )
option ( ENABLE_SERVER "Enable compilation of server" ON )
2008-10-04 18:33:01 +00:00
option ( ENABLE_EDITOR "Enable compilation of the new map editor into the game executable" ON )
2008-05-05 21:06:14 +00:00
option ( ENABLE_TOOLS "Enable building and installation of tools for artists and WML maintainers" )
option ( ENABLE_TESTS "Build unit tests" )
2009-07-07 08:42:42 +00:00
option ( ENABLE_NLS "Enable building of translations" ON )
2008-12-30 21:03:11 +00:00
option ( ENABLE_POOL_ALLOC "Enable custom pool malloc" OFF )
2009-02-22 12:59:07 +00:00
option ( ENABLE_LOW_MEM "Reduce memory usage by removing extra functionality" OFF )
2009-04-07 11:58:48 +00:00
if ( UNIX AND NOT APPLE AND NOT CYGWIN )
2009-04-07 10:24:37 +00:00
option ( ENABLE_DESKTOP_ENTRY "enable installation of desktop entry files" ON )
set ( ICONDIR "${DATAROOTDIR}/pixmaps" CACHE STRING "Sets the icon directory for desktop entry to a non-default location." )
set ( DESKTOPDIR "${DATAROOTDIR}/applications/" CACHE STRING "Sets the desktop file directory for desktop entry to a non-default location." )
2009-04-07 11:58:48 +00:00
endif ( UNIX AND NOT APPLE AND NOT CYGWIN )
2009-05-19 18:17:12 +00:00
option ( ENABLE_STRICT_COMPILATION "Sets the strict compilation mode" ON )
2009-05-27 19:08:57 +00:00
option ( ENABLE_DEBUG_WINDOW_LAYOUT "Add the debug option to allow the generation of debug layout files in dot format" OFF )
2009-02-22 12:59:07 +00:00
2009-03-21 07:47:46 +00:00
#misc options
if ( NOT MSVC )
# Pot updates don't work at Windows so no reason to even try
option ( ENABLE_POT_UPDATE_TARGET "Enables the tools to update the pot files and manuals. This target has extra dependencies." OFF )
endif ( NOT MSVC )
2008-05-15 14:56:38 +00:00
2009-08-10 17:50:37 +00:00
if ( UNIX AND NOT APPLE AND NOT CYGWIN )
2010-03-03 10:21:55 +00:00
option ( ENABLE_NOTIFICATIONS "Enable Window manager notification messages" ON )
2009-08-10 17:50:37 +00:00
endif ( UNIX AND NOT APPLE AND NOT CYGWIN )
2008-05-15 14:56:38 +00:00
set ( BINARY_SUFFIX "" CACHE STRING "Suffix behind all binaries" )
set ( BINARY_PREFIX "" CACHE STRING "Prefix in front of all binaries" )
2008-05-05 21:06:14 +00:00
2008-05-13 09:11:18 +00:00
#
# Handle options (set paths/definitions/etc...)
#
2008-05-05 21:06:14 +00:00
2010-04-10 17:30:45 +00:00
2009-04-12 15:45:12 +00:00
if ( CMAKE_COMPILER_IS_GNUCXX )
2009-05-19 18:17:12 +00:00
# Set our own default flags at first run.
2009-04-12 15:45:12 +00:00
if ( NOT CONFIGURED )
2009-05-19 18:17:12 +00:00
if ( ENABLE_STRICT_COMPILATION )
2010-04-25 09:43:12 +00:00
# The current networking code breaks strict aliasing in g++ 4.5.
# Once the code is converted to boost::asio it might be reenabled.
2010-05-26 20:19:07 +00:00
set ( STRICT_FLAGS "-Werror -Wno-strict-aliasing" )
2009-05-19 18:17:12 +00:00
else ( ENABLE_STRICT_COMPILATION )
set ( STRICT_FLAGS "" )
endif ( ENABLE_STRICT_COMPILATION )
# Strict compilation for C files is disabled until somebody wants to clean them.
2009-05-20 17:13:49 +00:00
set ( CMAKE_C_FLAGS "-O2 -W -Wall -ansi $ENV{CFLAGS}"
2009-05-19 18:17:12 +00:00
C A C H E S T R I N G " F l a g s u s e d b y t h e C c o m p i l e r d u r i n g n o r m a l b u i l d s . " F O R C E )
2009-05-20 17:13:49 +00:00
set ( CMAKE_C_FLAGS_DEBUG "-O0 -DDEBUG -ggdb3 -W -Wall -ansi $ENV{CFLAGS}"
2009-05-19 18:17:12 +00:00
C A C H E S T R I N G " F l a g s u s e d b y t h e C c o m p i l e r d u r i n g d e b u g b u i l d s . " F O R C E )
2009-05-20 17:13:49 +00:00
set ( CMAKE_CXX_FLAGS "-O2 -W -Wall -ansi ${STRICT_FLAGS} $ENV{CXXFLAGS}"
2009-05-19 18:17:12 +00:00
C A C H E S T R I N G " F l a g s u s e d b y t h e C X X c o m p i l e r d u r i n g n o r m a l b u i l d s . " F O R C E )
2009-05-20 17:13:49 +00:00
set ( CMAKE_CXX_FLAGS_DEBUG "-O0 -DDEBUG -ggdb3 -W -Wall -ansi ${STRICT_FLAGS} $ENV{CXXFLAGS}"
2009-05-19 18:17:12 +00:00
C A C H E S T R I N G " F l a g s u s e d b y t h e C X X c o m p i l e r d u r i n g d e b u g b u i l d s . " F O R C E )
2009-04-12 15:45:12 +00:00
endif ( NOT CONFIGURED )
endif ( CMAKE_COMPILER_IS_GNUCXX )
2008-05-15 13:02:11 +00:00
2008-05-08 19:19:15 +00:00
# compose datadir path of datarootdir and datadirname
set ( DATADIR ${ DATAROOTDIR } / ${ DATADIRNAME } )
2008-05-08 19:35:40 +00:00
2008-05-04 17:27:28 +00:00
if ( NOT WIN32 )
2009-04-13 14:41:42 +00:00
add_definitions ( -DWESNOTH_PATH=\\\ "${DATADIR}\\\" )
2008-05-04 17:27:28 +00:00
endif ( NOT WIN32 )
2008-12-26 09:01:31 +00:00
if ( NOT ENABLE_POOL_ALLOC OR WIN32 )
add_definitions ( -DDISABLE_POOL_ALLOC )
endif ( NOT ENABLE_POOL_ALLOC OR WIN32 )
2008-10-04 18:33:01 +00:00
if ( NOT ENABLE_EDITOR )
2009-08-08 11:14:58 +00:00
add_definitions ( -DDISABLE_EDITOR )
2008-10-04 18:33:01 +00:00
endif ( NOT ENABLE_EDITOR )
2008-06-18 19:20:18 +00:00
2008-06-18 20:02:26 +00:00
if ( X11_FOUND )
2008-06-18 20:11:34 +00:00
add_definitions ( -D_X11 )
2008-06-18 20:02:26 +00:00
endif ( X11_FOUND )
2009-06-05 17:44:34 +00:00
add_definitions ( -DHAS_RELATIVE_LOCALEDIR=1 )
2009-04-13 14:41:42 +00:00
add_definitions ( -DLOCALEDIR=\\\ "${LOCALEDIR}\\\" )
2008-05-08 20:32:54 +00:00
set ( LOCALE_INSTALL ${ DATADIR } / ${ LOCALEDIR } )
2008-05-04 17:27:28 +00:00
2009-04-13 14:41:42 +00:00
add_definitions ( -DFIFODIR=\\\ "${FIFO_DIR}\\\" )
2008-05-13 09:11:18 +00:00
2008-05-04 17:27:28 +00:00
if ( PREFERENCES_DIR )
2009-04-13 14:41:42 +00:00
add_definitions ( -DPREFERENCES_DIR=\\\ "${PREFERENCES_DIR}\\\" )
2008-05-04 17:27:28 +00:00
endif ( PREFERENCES_DIR )
if ( GUI STREQUAL "tiny" )
add_definitions ( -DUSE_TINY_GUI )
endif ( GUI STREQUAL "tiny" )
2009-02-22 12:59:07 +00:00
if ( ENABLE_LOW_MEM )
add_definitions ( -DLOW_MEM )
endif ( ENABLE_LOW_MEM )
2009-05-27 19:08:57 +00:00
if ( ENABLE_DEBUG_WINDOW_LAYOUT )
add_definitions ( -DDEBUG_WINDOW_LAYOUT_GRAPHS )
endif ( ENABLE_DEBUG_WINDOW_LAYOUT )
2008-05-15 13:02:11 +00:00
#
# Libraries that are only required by some targets
#
2008-10-04 11:24:35 +00:00
if ( ENABLE_TOOLS OR ENABLE_GAME OR ENABLE_TESTS )
2008-05-15 14:56:38 +00:00
find_package ( SDL_image 1.2 REQUIRED )
2009-03-19 23:18:29 +00:00
endif ( ENABLE_TOOLS OR ENABLE_GAME OR ENABLE_TESTS )
2008-10-04 11:24:35 +00:00
if ( ENABLE_GAME OR ENABLE_TESTS )
2008-05-15 14:56:38 +00:00
find_package ( SDL_mixer 1.2 REQUIRED )
find_package ( SDL_ttf 2.0.8 REQUIRED )
2009-03-19 23:18:29 +00:00
endif ( ENABLE_GAME OR ENABLE_TESTS )
2008-05-15 13:02:11 +00:00
if ( ENABLE_GAME OR ENABLE_SERVER OR ENABLE_CAMPAIGN_SERVER OR ENABLE_TESTS )
2008-05-15 14:56:38 +00:00
find_package ( SDL_net REQUIRED )
2009-03-19 23:18:29 +00:00
endif ( ENABLE_GAME OR ENABLE_SERVER OR ENABLE_CAMPAIGN_SERVER OR ENABLE_TESTS )
2008-05-15 13:02:11 +00:00
if ( ENABLE_TOOLS )
2008-05-15 14:56:38 +00:00
find_package ( ZLIB REQUIRED )
find_package ( PNG REQUIRED )
2009-03-19 23:18:29 +00:00
endif ( ENABLE_TOOLS )
2008-09-12 12:32:47 +00:00
if ( ENABLE_TESTS )
2009-08-01 14:37:08 +00:00
find_package ( Boost 1.35 REQUIRED COMPONENTS unit_test_framework )
2009-03-19 23:18:29 +00:00
endif ( ENABLE_TESTS )
if ( ENABLE_GAME )
2009-03-28 07:36:29 +00:00
find_package ( Lua51 REQUIRED )
2009-08-01 18:28:18 +00:00
2009-04-10 19:19:53 +00:00
if ( NOT MSVC )
2010-03-30 21:24:20 +00:00
find_package ( PkgConfig REQUIRED )
pkg_check_modules ( PANGOCAIRO REQUIRED pangocairo>=1.14.8 )
2009-04-10 19:19:53 +00:00
pkg_check_modules ( FONTCONFIG REQUIRED fontconfig>=2.4.1 )
endif ( NOT MSVC )
2009-08-01 18:28:18 +00:00
find_package ( FriBiDi )
if ( ENABLE_FRIBIDI AND FRIBIDI_LIBRARIES )
add_definitions ( -DHAVE_FRIBIDI )
elseif ( ENABLE_FRIBIDI AND NOT FRIBIDI_LIBRARIES )
message ( "Could not find FriBiDi. Disabling FriBiDi support." )
endif ( )
2009-08-10 17:50:37 +00:00
if ( ENABLE_NOTIFICATIONS )
2010-03-03 23:08:31 +00:00
pkg_check_modules ( LIBDBUS dbus-1 )
if ( LIBDBUS_FOUND )
add_definitions ( -DHAVE_LIBDBUS )
else ( LIBDBUS_FOUND )
message ( "Could not find dbus-1, Disabling notification support." )
endif ( LIBDBUS_FOUND )
2009-08-10 17:50:37 +00:00
endif ( ENABLE_NOTIFICATIONS )
2009-03-19 23:18:29 +00:00
endif ( ENABLE_GAME )
2008-05-15 13:02:11 +00:00
2008-05-15 14:56:38 +00:00
# get languages
file ( READ po/LINGUAS LINGUAS )
string ( REPLACE "\n" "" LINGUAS ${ LINGUAS } )
separate_arguments ( LINGUAS )
#
# Include subdirectories
#
add_subdirectory ( doc )
2009-01-23 12:37:29 +00:00
2008-05-15 14:56:38 +00:00
if ( GETTEXT_FOUND AND ENABLE_NLS )
add_subdirectory ( po )
endif ( GETTEXT_FOUND AND ENABLE_NLS )
add_subdirectory ( src )
2008-05-15 13:02:11 +00:00
2008-05-14 13:00:50 +00:00
#
# shrink images for tinygui
#
2008-05-09 01:49:21 +00:00
if ( GUI STREQUAL "tiny" )
FIND_PACKAGE ( ImageMagick REQUIRED )
2008-05-05 21:06:14 +00:00
2008-05-09 01:49:21 +00:00
if ( ${ CMAKE_SOURCE_DIR } STREQUAL ${ CMAKE_BINARY_DIR } )
set ( IMAGE_BUILD_DIR ${ CMAKE_SOURCE_DIR } /tiny_images )
2008-05-12 23:00:16 +00:00
else ( )
2008-05-09 01:49:21 +00:00
set ( IMAGE_BUILD_DIR ${ CMAKE_BINARY_DIR } )
2008-05-15 14:56:38 +00:00
endif ( )
2008-05-09 01:49:21 +00:00
set ( IMAGE_FILES data/*.jpg data/*.png images/*.jpg images/*.png )
add_custom_target ( shrink-images ALL
C O M M A N D $ { C M A K E _ C O M M A N D }
2008-07-14 17:46:42 +00:00
A R G S - D I M A G E _ F I L E S = " $ { I M A G E _ F I L E S } " - D I M A G E _ B U I L D _ D I R = " $ { I M A G E _ B U I L D _ D I R } " - D I M A G E M A G I C K _ I D E N T I F Y _ E X E C U T A B L E = " $ { I M A G E M A G I C K _ I D E N T I F Y _ E X E C U T A B L E } " - D I M A G E M A G I C K _ C O N V E R T _ E X E C U T A B L E = " $ { I M A G E M A G I C K _ C O N V E R T _ E X E C U T A B L E } " - P " $ { C M A K E _ M O D U L E _ P A T H } / S h r i n k I m a g e s . c m a k e "
2008-05-09 11:00:19 +00:00
W O R K I N G _ D I R E C T O R Y $ { C M A K E _ S O U R C E _ D I R }
C O M M E N T " C r e a t i n g r e s i z e d i m a g e s f o r t i n y g u i . " )
2008-05-09 01:49:21 +00:00
2008-05-15 14:56:38 +00:00
#
# Install files (exclude images from data-dir, we install them from our build dir)
#
2008-05-05 22:22:28 +00:00
2008-05-12 23:00:16 +00:00
# this is a workaround for a bug in 2.4-7
file ( MAKE_DIRECTORY ${ IMAGE_BUILD_DIR } /data ${ IMAGE_BUILD_DIR } /images )
2009-02-27 16:20:37 +00:00
install ( DIRECTORY ${ IMAGE_BUILD_DIR } /data ${ IMAGE_BUILD_DIR } /images DESTINATION ${ DATADIR } USE_SOURCE_PERMISSIONS )
install ( DIRECTORY data fonts sounds DESTINATION ${ DATADIR } USE_SOURCE_PERMISSIONS
2008-05-09 01:49:21 +00:00
P A T T E R N " * . p n g " E X C L U D E
P A T T E R N " * . j p g " E X C L U D E
P A T T E R N " . s v n " E X C L U D E )
2008-05-09 10:53:45 +00:00
else ( )
2008-05-05 22:22:28 +00:00
2008-05-15 14:56:38 +00:00
#
# Install files
#
2009-02-27 16:20:37 +00:00
install ( DIRECTORY data fonts images sounds DESTINATION ${ DATADIR } USE_SOURCE_PERMISSIONS PATTERN ".svn" EXCLUDE )
2008-05-01 20:12:38 +00:00
2008-05-15 14:56:38 +00:00
endif ( )
2009-04-07 10:24:37 +00:00
#
2009-04-07 11:58:48 +00:00
# Install desktop file so wesnoth appears in the application start menu with an icon
2009-04-14 09:14:17 +00:00
# TODO: string replacement to have the real binary name in does not work atm, because in the Categories= block semicolons are lost...
2009-04-07 10:24:37 +00:00
#
2009-04-07 11:58:48 +00:00
if ( ENABLE_DESKTOP_ENTRY AND ENABLE_GAME )
# do some crude string replacing to have the real binary name in the .desktop file (read in original .desktop file, replace the Exec= line with the correct value and output the generated file)
2009-04-14 09:14:17 +00:00
# file(READ icons/wesnoth.desktop wesnoth-desktop-orig)
2009-04-07 15:10:45 +00:00
#string(REGEX REPLACE "(\nName.*=.*)\n" "\\1 (${BINARY_SUFFIX})\n" wesnoth-desktop-modified ${wesnoth-desktop-orig} )
2009-04-14 09:14:17 +00:00
# string(REPLACE "Exec=wesnoth" "Exec=${BINARY_PREFIX}wesnoth${BINARY_SUFFIX}" wesnoth-desktop-modified ${wesnoth-desktop-orig} )
# file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_PREFIX}wesnoth${BINARY_SUFFIX}.desktop ${wesnoth-desktop-modified} )
2009-04-07 15:10:45 +00:00
#execute_process(COMMAND sed "-i" "'s/^\(Name.*=.*\)$/\1TEST/g'" ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_PREFIX}wesnoth${BINARY_SUFFIX}.desktop )
#exec_program(sed ARGS "-i" "'s/^\(Name.*=.*\)$/\1TEST/g'" ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_PREFIX}wesnoth${BINARY_SUFFIX}.desktop )
2009-04-07 11:58:48 +00:00
# install the generated .desktop file
2009-04-14 09:14:17 +00:00
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_PREFIX}wesnoth${BINARY_SUFFIX}.desktop DESTINATION ${DESKTOPDIR} )
install ( FILES icons/wesnoth.desktop DESTINATION ${ DESKTOPDIR } )
2009-04-07 10:24:37 +00:00
install ( FILES icons/wesnoth-icon.png DESTINATION ${ ICONDIR } )
2009-04-07 11:58:48 +00:00
2009-04-07 10:24:37 +00:00
if ( ENABLE_EDITOR )
2009-04-07 11:58:48 +00:00
# do some crude string replacing to have the real binary name in the .desktop file (read in original .desktop file, replace the Exec= line with the correct value and output the generated file)
2009-04-14 09:14:17 +00:00
# file(READ icons/wesnoth_editor.desktop wesnoth-editor-desktop-orig)
# string(REPLACE "Exec=wesnoth -e" "Exec=${BINARY_PREFIX}wesnoth${BINARY_SUFFIX} -e" wesnoth-editor-desktop-modified ${wesnoth-editor-desktop-orig} )
# file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_PREFIX}wesnoth_editor${BINARY_SUFFIX}.desktop ${wesnoth-editor-desktop-modified} )
2009-04-07 11:58:48 +00:00
# install the generated .desktop file
2009-04-14 09:14:17 +00:00
# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${BINARY_PREFIX}wesnoth_editor${BINARY_SUFFIX}.desktop DESTINATION ${DESKTOPDIR} )
install ( FILES icons/wesnoth_editor.desktop DESTINATION ${ DESKTOPDIR } )
2009-04-07 10:24:37 +00:00
install ( FILES icons/wesnoth_editor-icon.png DESTINATION ${ ICONDIR } )
endif ( ENABLE_EDITOR )
2009-04-07 11:58:48 +00:00
endif ( ENABLE_DESKTOP_ENTRY AND ENABLE_GAME )
2009-04-07 10:24:37 +00:00
2008-05-09 01:49:21 +00:00
2008-05-13 09:11:18 +00:00
if ( ENABLE_SERVER AND FIFO_DIR )
2008-05-13 18:28:39 +00:00
install ( CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E make_directory \$ENV{DESTDIR}/${FIFO_DIR})" )
2008-05-13 09:11:18 +00:00
if ( SERVER_UID AND SERVER_GID )
2008-05-13 18:28:39 +00:00
install ( CODE "execute_process(COMMAND chown ${SERVER_UID}:${SERVER_GID} \$ENV{DESTDIR}/${FIFO_DIR})" )
2008-05-15 14:56:38 +00:00
endif ( )
endif ( )
2008-05-14 13:00:50 +00:00
2009-10-03 16:18:21 +00:00
# Index for checking states of localized images at runtime.
install ( FILES l10n-track DESTINATION ${ DATADIR } )
2008-05-09 01:49:21 +00:00
#
2008-05-14 13:00:50 +00:00
# uninstall
2008-05-09 01:49:21 +00:00
#
2008-05-01 20:12:38 +00:00
2008-05-14 13:00:50 +00:00
configure_file (
2008-07-14 17:46:42 +00:00
" $ { C M A K E _ M O D U L E _ P A T H } / u n i n s t a l l . c m a k e . i n "
2008-05-14 13:00:50 +00:00
" $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / u n i n s t a l l . c m a k e "
I M M E D I A T E @ O N L Y )
add_custom_target ( uninstall
" $ { C M A K E _ C O M M A N D } " - P " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / u n i n s t a l l . c m a k e " )
#
# Packaging stuff
#
2008-05-09 01:49:21 +00:00
2008-05-15 14:56:38 +00:00
include ( CPack )
set ( CPACK_GENERATOR "TGZ" )
set ( CPACK_SOURCE_GENERATOR "TGZ" )
2008-05-09 22:07:30 +00:00
set ( CONFIGURED ON CACHE INTERNAL "" )