summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt121
1 files changed, 75 insertions, 46 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5c5fde22..b73f9797 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,24 +1,28 @@
-#################################################
-#
-# (C) 2016 Alexander Golubev
-# fatzer2 (AT) gmail.com
-#
-# Improvements and feedback are welcome
-#
-# This file is released under GPL >= 2
-#
-#################################################
+###########################################
+# #
+# (C) 2016 Alexander Golubev #
+# fatzer2 (AT) gmail.com #
+# #
+# Improvements and feedback are welcome #
+# #
+# This file is released under GPL >= 2 #
+# #
+###########################################
-cmake_minimum_required( VERSION 2.8 )
+##### set project version ########################
-##### general package setup #####################
+include( TDEVersion )
+cmake_minimum_required( VERSION ${TDE_CMAKE_MINIMUM_VERSION} )
+tde_set_project_version( )
+
+
+##### general package setup
project( tdegames )
-set( VERSION R14.1.0 )
-##### include essential cmake modules ###########
+##### include essential cmake modules
include( FindPkgConfig )
include( CheckIncludeFile )
@@ -27,34 +31,36 @@ include( CheckSymbolExists )
include( CheckCXXSourceCompiles )
-##### include our cmake modules #################
+##### include our cmake modules
-set( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" )
include( TDEMacros )
-##### setup install paths #######################
+##### setup install paths
include( TDESetupPaths )
tde_setup_paths( )
-##### optional stuff ############################
-
-option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
-option( WITH_ARTS "Enable aRts support" ${WITH_ALL_OPTIONS} )
-
+##### optional stuff
-##### options comments ##########################
+option( WITH_ALL_OPTIONS "Enable all optional support" OFF )
+option( WITH_GCC_VISIBILITY "Enable fvisibility and fvisibility-inlines-hidden" ${WITH_ALL_OPTIONS} )
+option( WITH_ARTS "Enable aRts support" ${WITH_ALL_OPTIONS} )
-# WITH_ARTS affects kbounce
-# if disabled the game will have no sound
-# NOTE: ARTS is unconditionally required to build kolf and kasteroids
+######################## options comments #############################
+# #
+# WITH_ARTS affects kbounce if disabled the game will have no sound #
+# #
+# ARTS is required to build kolf and kasteroids #
+# #
+#######################################################################
-##### user requested modules ####################
-option( BUILD_ALL "Build all" OFF )
+##### user requested modules
+option( BUILD_ALL "Build all" OFF )
+option( BUILD_LIBTDEGAMES "Build libtdegames" ${BUILD_ALL} )
option( BUILD_ATLANTIK "Build atlantik" ${BUILD_ALL} )
option( BUILD_DOC "Build documentation" ${BUILD_ALL} )
option( BUILD_KASTEROIDS "Build kasteroids" ${BUILD_ALL} )
@@ -86,21 +92,19 @@ option( BUILD_KSOKOBAN "Build ksokoban" ${BUILD_ALL} )
option( BUILD_KSPACEDUEL "Build kspaceduel" ${BUILD_ALL} )
option( BUILD_KTRON "Build ktron" ${BUILD_ALL} )
option( BUILD_KTUBERLING "Build ktuberling" ${BUILD_ALL} )
-option( BUILD_LIBTDEGAMES "Build libtdegames" ${BUILD_ALL} )
option( BUILD_LSKAT "Build lskat" ${BUILD_ALL} )
option( BUILD_TWIN4 "Build twin4" ${BUILD_ALL} )
+option( BUILD_TDEFIFTEEN "Build tdefifteen" ${BUILD_ALL} )
-##### configure checks ##########################
+##### configure checks
include( ConfigureChecks.cmake )
-###### global compiler settings #################
+###### global compiler settings
-add_definitions(
- -DHAVE_CONFIG_H
-)
+add_definitions( -DHAVE_CONFIG_H )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TQT_CXX_FLAGS}" )
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined" )
@@ -110,19 +114,44 @@ if( WITH_TEST )
enable_testing()
endif( WITH_TEST )
-##### add apidox targets ############
-add_custom_target(apidox
- COMMAND "./generate_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "/usr/share/tqt3/doc/html"
- WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/")
+##### add apidox targets
+
+add_custom_target( apidox
+ COMMAND ${CMAKE_COMMAND} -E env
+ "TQTDOCDIR=/usr/share/tqt3/doc/html"
+ "DOXDATA=${HTML_INSTALL_DIR}/en/common"
+ ${CMAKE_SOURCE_DIR}/admin/doxygen.sh
+ --no-modulename
+ ${CMAKE_SOURCE_DIR}
+ COMMAND
+ find ${CMAKE_BINARY_DIR}/apidocs -name '*.html' |
+ xargs -r sed -i 's|${CMAKE_BINARY_DIR}/apidocs|${HTML_INSTALL_DIR}/en/${PROJECT_NAME}-apidocs|g'
+ COMMAND
+ find ${CMAKE_BINARY_DIR}/apidocs -name '*.tag' |
+ xargs -r sed -i 's|${CMAKE_SOURCE_DIR}/|${PROJECT_NAME}/|g'
+ WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
+)
+
+add_custom_target( install-apidox
+ COMMAND ${CMAKE_COMMAND} -E echo Apidox installed in ${HTML_INSTALL_DIR}/en/${PROJECT_NAME}-apidocs
+)
-add_custom_target(install-apidox
- COMMAND "./install_apidox" "${CMAKE_SOURCE_DIR}" "${CMAKE_BINARY_DIR}" "${HTML_INSTALL_DIR}" "${CMAKE_INSTALL_PREFIX}"
- WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}/cmake/")
+install( CODE "
+ if( EXISTS ${CMAKE_BINARY_DIR}/apidocs )
+ file(
+ INSTALL ${CMAKE_BINARY_DIR}/apidocs/
+ DESTINATION ${HTML_INSTALL_DIR}/en/${PROJECT_NAME}-apidocs
+ PATTERN doxygen_sqlite3.db EXCLUDE
+ PATTERN installdox-slow EXCLUDE
+ )
+ endif()"
+)
-##### tdegames directories #####################
+##### tdegames directories
+tde_conditional_add_subdirectory( BUILD_LIBTDEGAMES libtdegames )
tde_conditional_add_subdirectory( BUILD_ATLANTIK atlantik )
tde_conditional_add_subdirectory( BUILD_DOC doc )
tde_conditional_add_subdirectory( BUILD_KASTEROIDS kasteroids )
@@ -154,15 +183,15 @@ tde_conditional_add_subdirectory( BUILD_KSOKOBAN ksokoban )
tde_conditional_add_subdirectory( BUILD_KSPACEDUEL kspaceduel )
tde_conditional_add_subdirectory( BUILD_KTRON ktron )
tde_conditional_add_subdirectory( BUILD_KTUBERLING ktuberling )
-tde_conditional_add_subdirectory( BUILD_LIBTDEGAMES libtdegames )
tde_conditional_add_subdirectory( BUILD_LSKAT lskat )
tde_conditional_add_subdirectory( BUILD_TWIN4 twin4 )
+tde_conditional_add_subdirectory( BUILD_TDEFIFTEEN tdefifteen )
if( BUILD_KSIRTET OR BUILD_KFOULEGGS OR BUILD_KLICKETY )
- add_subdirectory( libksirtet )
-endif( )
+ add_subdirectory( libksirtet )
+endif()
-##### write configure files #####################
+##### write configure files
configure_file( config.h.cmake config.h @ONLY )