X-Git-Url: https://git.quassel-irc.org/?a=blobdiff_plain;f=CMakeLists.txt;h=8a9303d05ae209d6c33a57d94af11509a004fe6c;hb=9fb825b46a6ab188d32ed91f1aca34726aa69781;hp=a220522805838739749a7f45ddd58c19ac683525;hpb=933f2d9f203bc5fabf3040d9361ba4e0cb637b9b;p=quassel.git diff --git a/CMakeLists.txt b/CMakeLists.txt index a2205228..8a9303d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,12 @@ 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") + include(CheckFunctionExists) include(CheckIncludeFile) include(CheckCXXCompilerFlag) @@ -537,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. - -setup_qt_variables() -include_directories(${QUASSEL_QT_INCLUDES}) +# Generate version information from Git +include(GetGitRevisionDescription) +get_git_head_revision(GIT_REFSPEC GIT_HEAD) +git_describe(GIT_DESCRIBE --long) -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})