1 project(Performous CXX C)
2 cmake_minimum_required(VERSION 2.6)
3 cmake_policy(VERSION 2.6)
4 set(PROJECT_VERSION "0.6.1+")
6 # Avoid source tree pollution
7 if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
8 message(FATAL_ERROR "In-source builds are not permitted. Make a separate folder for building:\nmkdir build; cd build; cmake ..\nBefore that, remove the files already created:\nrm -rf CMakeCache.txt CMakeFiles")
9 endif(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
11 include(cmake/performous-packaging.cmake)
13 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
15 # Add a sensible build type default and warning because empty means no optimization and no debug info.
16 if(NOT CMAKE_BUILD_TYPE)
17 message("WARNING: CMAKE_BUILD_TYPE is not defined!\n Defaulting to CMAKE_BUILD_TYPE=RelWithDebInfo. Use ccmake to set a proper value.")
18 SET(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
19 endif(NOT CMAKE_BUILD_TYPE)
22 set(SHARE_INSTALL "." CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.")
25 set(SHARE_INSTALL "share/games/performous" CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.")
26 endif(NOT SHARE_INSTALL)
29 mark_as_advanced(SHARE_INSTALL)
31 #need to put here do setting LOCALE_DIR variable
36 SET(LOCALE_DIR "bin/locale")
38 SET(LOCALE_DIR "share/locale")
40 SET(LOCALE_DIR "share/locale")
45 message(QUIET "Set LOCALE_DIR to path to get Gettext working")
49 message(STATUS "Found msgfmt to convert language file. Translation enabled")
50 add_subdirectory(lang)
52 message(STATUS "Cannot find msgfmt to convert language file. Translation won't be enabled")
56 add_subdirectory(themes)
57 add_subdirectory(data)
58 add_subdirectory(game)
59 add_subdirectory(docs)
61 option(ENABLE_TOOLS "Enable extra tools (e.g. Singstar ripper)" ON)
64 add_subdirectory(tools)
68 option(ENABLE_VERSIONING "Add number version information. This allows to add version information to exe. Be carefull, in beta (and a lot useless)" OFF)
69 install(FILES win32/ConfigureSongDirectory.bat DESTINATION bin)