CMakeLists.txt 5.76 KB
Newer Older
Ludovic Fauvet's avatar
Ludovic Fauvet committed
1
2
3
4
5
6
#Forking CMakeQt by Rohit Yadav<rohityadav89@gmail.com>
#CMake Build System for Qt Project: VLMC
#Edit as per needs...

#Project Info
SET(CPACK_PACKAGE_VERSION_MAJOR "0")
7
8
SET(CPACK_PACKAGE_VERSION_MINOR "1")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
Ludovic Fauvet's avatar
Ludovic Fauvet committed
9
SET(COMPLETE_VERSION ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH})
10
11
12

# Codename of the Project :-)
SET(RELEASE_NAME "alpha")
Ludovic Fauvet's avatar
Ludovic Fauvet committed
13
14
15
# version: 0.0.1
SET(PROJECT_VERSION ${COMPLETE_VERSION})
#Name of the project
16
PROJECT(vlmc-${PROJECT_VERSION})
Ludovic Fauvet's avatar
Ludovic Fauvet committed
17

Ludovic Fauvet's avatar
Ludovic Fauvet committed
18
19
SITE_NAME(HOSTNAME)

Ludovic Fauvet's avatar
Ludovic Fauvet committed
20
21
22
23
24
25
26
#CMake Settings
CMAKE_MINIMUM_REQUIRED(VERSION 2.6.0)
SET(CMAKE_COLOR_MAKEFILE ON)
SET(CMAKE_VERBOSE_MAKEFILE OFF)
# set path to additional CMake modules
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})

27
28
29
30
31
32
33
34
35
36
# Configuring build type
IF(NOT CMAKE_BUILD_TYPE)
    SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING
        "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
        FORCE)
    MESSAGE("Setting build type to '${CMAKE_BUILD_TYPE}'")
ELSE(NOT CMAKE_BUILD_TYPE)
    MESSAGE("Build type set to '${CMAKE_BUILD_TYPE}'")
ENDIF(NOT CMAKE_BUILD_TYPE)

37
38
39
40
41
42
IF(WIN32)
    # Building in release for WIN32
    set(CMAKE_BUILD_TYPE "Release")
    SET_PROPERTY(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_RELEASE QT_NO_DEBUG)
ENDIF(WIN32)

43
# Optionally allow embedding libvlc into the binary as
Ludovic Fauvet's avatar
Ludovic Fauvet committed
44
# VLMC requires libVLC
Ludovic Fauvet's avatar
Ludovic Fauvet committed
45
#SET (WITH_LIBVLC FALSE CACHE BOOL "Compile LibVLC in VLMC")
Ludovic Fauvet's avatar
Ludovic Fauvet committed
46

Ludovic Fauvet's avatar
Ludovic Fauvet committed
47
SET(WITH_CRASHBUTTON FALSE CACHE BOOL "Enable the crash button")
48
49
SET(WITH_CRASHHANDLER_GUI TRUE CACHE BOOL "Enable the crash handler GUI (with backtrace and restart capabilities)")
SET(WITH_CRASHHANDLER TRUE CACHE BOOL "Enable the crash handler")
50

Ludovic Fauvet's avatar
Ludovic Fauvet committed
51
52
53
54
55
56
57
58
FIND_PACKAGE(LIBVLC)
  IF (NOT LIBVLC_FOUND)
    MESSAGE (SEND_ERROR "LibVLC dependency was not found (please get libvlc)!")
  ENDIF (NOT LIBVLC_FOUND)

INCLUDE_DIRECTORIES(${LIBVLC_INCLUDE_DIR})

# search for Qt4
59
FIND_PACKAGE(Qt4 4.5.1 COMPONENTS QtCore QtGui QtSvg QtXml REQUIRED )
Ludovic Fauvet's avatar
Ludovic Fauvet committed
60

61
INCLUDE(${QT_USE_FILE})
Ludovic Fauvet's avatar
Ludovic Fauvet committed
62
63
64
65
ADD_DEFINITIONS(${QT_DEFINITIONS})

# layout of VLMC installation
# (default values are platform-specific)
66
67
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/effects)
Ludovic Fauvet's avatar
Ludovic Fauvet committed
68

69
70
# Copy the sh launcher
IF (NOT WIN32)
71
    CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/cmake/vlmc.sh" "${CMAKE_CURRENT_BINARY_DIR}/vlmc" COPYONLY)
72
73
ENDIF(NOT WIN32)

Ludovic Fauvet's avatar
Ludovic Fauvet committed
74
75
76
77
78
79
80
# common for MAC and UNIX
SET (DEFAULT_BIN_SUBDIR     bin)
SET (DEFAULT_LIB_SUBDIR     lib)
SET (DEFAULT_DATA_SUBDIR    share)
SET (DEFAULT_SRC_SUBDIR     src)
SET (DEFAULT_INCLUDE_SUBDIR include)

81
82
83
84
85
86
87
88
89
SET (LIB_SUFFIX          ""                             CACHE STRING "Define lib directory suffix (32/64)")
SET (VLMC_BIN_SUBDIR     "${DEFAULT_BIN_SUBDIR}"        CACHE STRING "Subdirectory where executables will be installed")
SET (VLMC_LIB_SUBDIR     "${DEFAULT_LIB_SUBDIR}"        CACHE STRING "Subdirectory where libraries will be installed")
SET (VLMC_DATA_SUBDIR    "${DEFAULT_DATA_SUBDIR}"       CACHE STRING "Subdirectory where VLMC data will be installed")
SET (VLMC_SRC_SUBDIR     "${DEFAULT_SRC_SUBDIR}"        CACHE STRING "Subdirectory where VLMC source is")
SET (VLMC_INCLUDE_SUBDIR "${DEFAULT_INCLUDE_SUBDIR}"    CACHE STRING "Subdirectory where header files will be installed")

# append the suffix (if any) to the lib directory
SET (VLMC_LIB_SUBDIR "${VLMC_LIB_SUBDIR}${LIB_SUFFIX}")
Ludovic Fauvet's avatar
Ludovic Fauvet committed
90
91

# full paths for the installation
92
93
94
95
96
97
98
SET (VLMC_BIN_DIR     ${CMAKE_INSTALL_PREFIX}/${VLMC_BIN_SUBDIR})
SET (VLMC_LIB_DIR     ${CMAKE_INSTALL_PREFIX}/${VLMC_LIB_SUBDIR})
SET (VLMC_INCLUDE_DIR ${CMAKE_INSTALL_PREFIX}/${VLMC_INCLUDE_SUBDIR})
SET (VLMC_DATA_DIR    ${CMAKE_INSTALL_PREFIX}/${VLMC_DATA_SUBDIR}/vlmc/)
SET (VLMC_DOC_DIR     ${CMAKE_INSTALL_PREFIX}/${VLMC_DATA_SUBDIR}/doc/vlmc/)
SET (VLMC_EFFECTS_DIR ${CMAKE_INSTALL_PREFIX}/${VLMC_LIB_SUBDIR}/vlmc/effects/)
SET (VLMC_DESKTOP_DIR ${CMAKE_INSTALL_PREFIX}/${VLMC_DATA_SUBDIR}/applications/)
Ludovic Fauvet's avatar
Ludovic Fauvet committed
99
100
101
102
103
104
105
106
107

# manual page - makes sense only on unix systems
IF (UNIX)
  SET (DEFAULT_MANUAL_SUBDIR  man)
  SET (VLMC_MANUAL_SUBDIR  ${DEFAULT_MANUAL_SUBDIR}  CACHE STRING "Subdirectory where manual files will be installed")
  MARK_AS_ADVANCED (VLMC_MANUAL_SUBDIR)
  SET (VLMC_MANUAL_DIR  ${CMAKE_INSTALL_PREFIX}/${VLMC_MANUAL_SUBDIR})
ENDIF (UNIX)

108
SUBDIRS(ts)
Ludovic Fauvet's avatar
Ludovic Fauvet committed
109
110
SUBDIRS(src)

111
# Copy stuff to doc subdirectory
Ludovic Fauvet's avatar
Ludovic Fauvet committed
112
INSTALL (FILES AUTHORS COPYING INSTALL NEWS README TRANSLATORS
113
         DESTINATION ${VLMC_DOC_DIR})
Ludovic Fauvet's avatar
Ludovic Fauvet committed
114

115
116
117
# Copy .desktop file
INSTALL (FILES share/vlmc.desktop DESTINATION ${VLMC_DESKTOP_DIR})

118
119
120
# Copy the share directory
INSTALL (DIRECTORY share/ DESTINATION ${VLMC_DATA_DIR})

Ludovic Fauvet's avatar
Ludovic Fauvet committed
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
#############################################################
# Enable packaging

INCLUDE(InstallRequiredSystemLibraries)

SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "VLMC")
SET(CPACK_PACKAGE_VENDOR "VLMC Team")
SET(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
SET(CPACK_PACKAGE_INSTALL_DIRECTORY "VLMC ${COMPLETE_VERSION}")
IF(WIN32 AND NOT UNIX)
  # There is a bug in NSI that does not handle full unix paths properly. Make
  # sure there is at least one set of four (4) backslashes.
  SET(CPACK_PACKAGE_ICON "${CMAKE_SOURCE_DIR}/share\\\\vlmc.png")
  SET(CPACK_NSIS_INSTALLED_ICON_NAME "\\\\vlmc.exe")
  SET(CPACK_NSIS_DISPLAY_NAME "${CPACK_PACKAGE_INSTALL_DIRECTORY} VLMC")
  SET(CPACK_NSIS_HELP_LINK "http:\\\\\\\\vlmc.org")
  SET(CPACK_NSIS_URL_INFO_ABOUT "http:\\\\\\\\vlmc.org")
  SET(CPACK_NSIS_CONTACT "vlmc-devel@vlmc.org")
  SET(CPACK_NSIS_MODIFY_PATH ON)

#  SET(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "  !include \\\"${CMAKE_SOURCE_DIR}\\\\win_build\\\\extra.nsh\\\"")
ELSE(WIN32 AND NOT UNIX)
  #SET(CPACK_STRIP_FILES "VLMC")
  #SET(CPACK_SOURCE_STRIP_FILES "")
ENDIF(WIN32 AND NOT UNIX)
SET(CPACK_PACKAGE_EXECUTABLES "vlmc" "VLMC")
INCLUDE(CPack)