Vertex shader now handles dance note positioning instead of glTranslatef.
[performous.git] / CMakeLists.txt
blobd7bb77cec86be9132206e37dc7c632cd82b14119
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)
21 if(WIN32)
22         set(SHARE_INSTALL "." CACHE STRING "Data file install path. Must be a relative path (from CMAKE_INSTALL_PREFIX), with no trailing slash.")
23 else(WIN32)
24         if(NOT SHARE_INSTALL)
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)
27 endif(WIN32)
29 mark_as_advanced(SHARE_INSTALL)
31 #need to put here do setting LOCALE_DIR variable
32 find_package(Gettext)
33 if(Gettext_FOUND)
34         if(NOT LOCALE_DIR)
35                 if(WIN32)
36                         SET(LOCALE_DIR "bin/locale")
37                 elseif(APPLE)
38                         SET(LOCALE_DIR "share/locale")
39                 else()#other os
40                         SET(LOCALE_DIR "share/locale")
41                 endif(WIN32)
42         endif(NOT LOCALE_DIR)
43         
44         if(NOT LOCALE_DIR)
45                 message(QUIET "Set LOCALE_DIR to path to get Gettext working")
46         else()
47                 find_package(Msgfmt)
48                 if(Msgfmt_FOUND)
49                         message(STATUS "Found msgfmt to convert language file. Translation enabled")
50                         add_subdirectory(lang)
51                 else()
52                         message(STATUS "Cannot find msgfmt to convert language file. Translation won't be enabled")
53                 endif()
54         endif(NOT LOCALE_DIR)
55 endif(Gettext_FOUND)
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)
63 if (ENABLE_TOOLS)
64   add_subdirectory(tools)
65 endif (ENABLE_TOOLS)
67 if(WIN32)
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)
70 endif(WIN32)