X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=CMakeLists.txt;h=02957135c74acf9768d98bb2fa126f5af4e838ea;hp=3e4ee9c273aa82d1ad5ff578fc540c6f14d8b19e;hb=a2121709c6e39fe3640163e5a4b6b96b8b0f1ab8;hpb=f64d4eec4bba63ececdece95f5c73b0ac550acd4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 3e4ee9c2..02957135 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,22 +25,22 @@ # NOTE: You should remove CMakeCache.txt if you plan to change any of these values! +cmake_minimum_required(VERSION 2.8.9) project(QuasselIRC) +# Versions +set(QUASSEL_MAJOR 0) +set(QUASSEL_MINOR 11) +set(QUASSEL_PATCH 0) +set(QUASSEL_VERSION_STRING "0.11-pre") + +# Tell CMake about or own stuff +set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) + include(CheckFunctionExists) include(CheckIncludeFile) include(CheckCXXCompilerFlag) -# For building against Qt5, we check for an even newer cmake version below! -cmake_minimum_required(VERSION 2.8.1 FATAL_ERROR) - -if(COMMAND cmake_policy) - cmake_policy(SET CMP0003 NEW) -endif(COMMAND cmake_policy) - -# Use our own (well, and KDE's) version of some modules -# In particular cmake's own FindQt4 and FindOpenSSL are quite buggy -set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules) include(QuasselMacros) # Various options and variables that can be set on the command line @@ -397,6 +397,13 @@ if(BUILD_GUI) else(WITH_PHONON) message(STATUS "Not enabling Phonon support") endif(WITH_PHONON) + + find_package(Libsnore) + if(LIBSNORE_FOUND) + add_definitions(-DHAVE_LIBSNORE) + set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} ${LIBSNORE_LIBRARIES}) + set(HAVE_SNORENOTIFY true) + endif(LIBSNORE_FOUND) endif(NOT HAVE_KDE) # Setup libindicate-qt support @@ -425,13 +432,6 @@ if(BUILD_GUI) /System/Library/Frameworks/Foundation.framework ) endif() - -find_package(Libsnore) -if(LIBSNORE_FOUND) - add_definitions(-DHAVE_LIBSNORE -DLIBSNORE_PLUGIN_PATH="${LIBSNORE_PLUGIN_PATH}") - set(CLIENT_LIBRARIES ${CLIENT_LIBRARIES} ${LIBSNORE_LIBRARIES}) - set(HAVE_SNORENOTIFY true) -endif(LIBSNORE_FOUND) endif(BUILD_GUI) # Core-only deps @@ -543,20 +543,18 @@ if(NOT WIN32) endif(HAVE_UMASK) endif(NOT WIN32) -# We need to create a version.gen -# For this, we create our genversion binary and make sure it is run every time. +# Generate version information from Git +include(GetGitRevisionDescription) +get_git_head_revision(GIT_REFSPEC GIT_HEAD) +git_describe(GIT_DESCRIBE --long) -setup_qt_variables() -include_directories(${QUASSEL_QT_INCLUDES}) - -add_executable(genversion ${CMAKE_SOURCE_DIR}/src/common/genversion.cpp) -target_link_libraries(genversion ${QUASSEL_QT_LIBRARIES}) -set_target_properties(genversion PROPERTIES COMPILE_FLAGS "${QUASSEL_QT_COMPILEFLAGS}") +# Sanitize things if we're not in a Git repo +if(NOT GIT_HEAD OR NOT GIT_DESCRIBE) + set(GIT_HEAD "") + set(GIT_DESCRIBE "") +endif() -get_target_property(GENVERSION_EXECUTABLE genversion LOCATION) -add_custom_target(genversion_run ALL ${GENVERSION_EXECUTABLE} - ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/src/version.gen) -add_dependencies(genversion_run genversion) +configure_file(version.h.in ${CMAKE_BINARY_DIR}/version.h @ONLY) # These variables will be added to the main targets (CORE, QTCLIENT, MONO) set(COMMON_DEPS ${RC_WIN32})