[c5f859]: CMakeLists.txt Maximize Restore History

Download this file

CMakeLists.txt    107 lines (88 with data), 3.8 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
103
104
105
# 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(switchview)
set (PACKAGE switchview)
set (VERSION 0.2.0)
set(RC_VERSION ${VERSION})
STRING(REGEX REPLACE "[.]" "," RC_VERSION ${RC_VERSION})
set(RC_VERSION "${RC_VERSION},0")
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 )
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(INSTALL_PIXMAPS share/pixmaps)
set(INSTALL_APPLICATIONS share/applications)
set(INSTALL_MANPAGES share/man)
set(TRANSLATIONS share/switchview/translations)
set(SYSCONFDIR "/etc" CACHE PATH "config directory")
endif()
set(DEFAULT_TRANSLATIONS ${CMAKE_INSTALL_PREFIX}/${TRANSLATIONS})
MESSAGE( STATUS "Configuring ${PACKAGE} ${VERSION}...")
if (USES_COASTAL_INCLUDE_DIRS)
message(STATUS " Using local coastal dependency")
else()
pkg_check_modules(USES_COASTAL REQUIRED libcoastal>=0.4.1)
endif()
if (USES_SIPWITCH_INCLUDE_DIRS)
message(STATUS " Using local sipwitch dependency")
else()
pkg_check_modules(USES_SIPWITCH REQUIRED libsipwitch>=1.5.0)
endif()
include_directories(${USES_COASTAL_INCLUDE_DIRS} ${USES_SIPWITCH_INCLUDE_DIRS})
find_package(Qt4 4.8.0 REQUIRED)
if(QT4_FOUND)
include(${QT_USE_FILE})
ADD_DEFINITIONS(-DQT_GUI_LIBS -DQT_CORE_LIB ${USES_SIPWITCH_CFLAGS})
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()
configure_file(${PACKAGE}-config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}-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(src)
add_subdirectory(system)
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}[-_]*.deb"
COMMAND rm -f "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}-*.zip"
COMMAND rm -f "${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE}*.changes"
)
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()