added and to predefined alias variables. (needs core restart)
[quassel.git] / CMakeLists.txt
index 16dac30..29fd963 100644 (file)
@@ -14,9 +14,9 @@ project(QuasselIRC)
 # Target scopes don't work in older versions
 cmake_minimum_required(VERSION 2.4.7 FATAL_ERROR)
 
-# This would suppress annoying warnings on cmake-2.6, but we can't use it 
-# with 2.4, so... DUH!
-# cmake_policy(SET CMP0003 OLD)  # suppress linker warnings
+if(COMMAND cmake_policy)
+   cmake_policy(SET CMP0003 OLD)  # suppress linker warnings
+endif(COMMAND cmake_policy)
 
 # Use our own (well, KDE's) version of some modules
 # In particular cmake's FindQt4 and FindOpenSSL are quite buggy
@@ -32,7 +32,8 @@ option(DEPLOY        "Mac OS X only! Adds required libs to bundle resources and
 option(SPUTDEV       "Do not use!" OFF)
 
 set(QT "" CACHE STRING "Path to a Qt installation to use instead of the system Qt")
-
+set(LINGUAS "" CACHE STRING "Space-separated List of locales specifying languages that should be compiled")
 if(STATIC)
   set(CMAKE_BUILD_TYPE Release)
 endif(STATIC)
@@ -69,6 +70,9 @@ endif(SPUTDEV)
 
 # Set up OpenSSL
 find_package(OpenSSL)
+if(NOT OPENSSL_FOUND)
+  add_definitions(-DQT_NO_OPENSSL)
+endif(NOT OPENSSL_FOUND)
 
 # Select a Qt installation here, if you don't want to use system Qt
 if(QT)
@@ -111,8 +115,11 @@ endif(WANT_QTCLIENT OR WANT_MONO)
 # Make sure version.gen exists before building mod_common
 add_dependencies(mod_common genversion_run)
 
+# Generate binary translation files
+include(QuasselGenerateTranslations)
+quassel_generate_i18n_resource(RC_I18N ${LINGUAS})
+
 # Add resources
-qt4_add_resources(RC_I18N i18n/i18n.qrc)
 qt4_add_resources(RC_ICONS src/icons/icons.qrc)
 qt4_add_resources(RC_QUASSEL_ICONS src/icons/quassel-icons.qrc)
 qt4_add_resources(RC_SQL src/core/sql.qrc)