Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

[51289f]: CMakeLists.txt Maximize Restore History

Download this file

CMakeLists.txt    104 lines (86 with data), 3.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
# Copyright (C) 2011 David Sugar, Tycho Softworks
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
cmake_minimum_required(VERSION 2.6)
PROJECT(coastal-qt)
set (PACKAGE coastal-qt)
set (VERSION 0.3.1)
set (SOVERSION 0)
set (COASTAL_VERSION ${VERSION})
INCLUDE(FindPkgConfig)
INCLUDE(CheckIncludeFiles)
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
endif ()
if( APPLE OR WIN32)
option(BUILD_DBUS "Set to ON to use DBUS" OFF)
else()
option(BUILD_DBUS "Set to OFF to disable DBUS" ON)
endif()
if( APPLE )
SET( MACOSX_BUNDLE_SHORT_VERSION_STRING ${VERSION} )
SET( MACOSX_BUNDLE_VERSION ${VERSION} )
SET( MACOSX_BUNDLE_LONG_VERSION_STRING Version ${VERSION} )
if(NOT CMAKE_OSX_ARCHITECTURES)
SET( CMAKE_OSX_ARCHITECTURES ppc;i386 )
endif()
endif()
set(INSTALL_BINDIR bin)
if(WIN32 AND NOT MSYS AND NOT CYGWIN AND NOT MINGW)
set(TRANSLATIONS translations)
else()
set(TRANSLATIONS share/coastal-qt/translations)
endif()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/common")
set(DEFAULT_TRANSLATIONS ${CMAKE_INSTALL_PREFIX}/${TRANSLATIONS})
# make sure qt dbus set if used
if(BUILD_DBUS)
set(QT_USE_QTDBUS 1)
add_definitions(-DQT_DBUS_LIB)
include_directories(${QT_QTDBUS_INCLUDE_DIR})
endif()
find_package(Qt4 4.6.0 REQUIRED)
if(QT4_FOUND)
include(${QT_USE_FILE})
ADD_DEFINITIONS(-DQT_GUI_LIBS -DQT_CORE_LIB)
include_directories(${QT_QTCORE_INCLUDE_DIR} ${QT_QTGUI_INCLUDE_DIR})
if(QT_IS_STATIC)
file(GLOB QT_PLUGINS ${QT_PLUGINS_DIR}/codecs/*${CMAKE_STATIC_LIBRARY_SUFFIX})
endif()
else()
message(ERROR "Building without QT")
endif()
check_include_files(windows.h HAVE_WINDOWS_H)
configure_file(coastal-qt-config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/coastal-qt-config.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/${PACKAGE}.spec.cmake ${CMAKE_CURRENT_SOURCE_DIR}/${PACKAGE}.spec @ONLY)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
add_subdirectory(common)
add_subdirectory(manpager)
add_subdirectory(search)
add_subdirectory(notify)
add_subdirectory(system)
add_subdirectory(translations)
if(CMAKE_GENERATOR MATCHES "Unix Makefiles")
add_custom_target(cleandist
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
COMMAND rm -f "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}[-_]*.gz"
COMMAND rm -f "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}_*.dsc"
COMMAND rm -f "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}-*.rpm"
COMMAND rm -f "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}[-_]*.deb"
COMMAND rm -f "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}-*.zip"
)
add_custom_target(dist
DEPENDS cleandist
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
COMMAND git archive --format tar --output="${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}-${VERSION}.tar" --prefix="${PACKAGE}-${VERSION}/" HEAD
COMMAND gzip "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}-${VERSION}.tar"
)
endif()