-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
51 lines (40 loc) · 2.01 KB
/
CMakeLists.txt
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
cmake_minimum_required (VERSION 2.6)
project (graphbox)
add_definitions (-Wall)
set (PROJECT_VERSION_MAJOR beta)
set (PROJECT_VERSION_MINOR 0)
set (PROJECT_VERSION_PATCH 0)
set (PROJECT_VERSION ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH})
set (PROJECT_SOURCE_DIR ${CMAKE_HOME_DIRECTORY}/src)
set (PROJECT_CONTENT_DIR ${CMAKE_HOME_DIRECTORY}/usr)
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_CONTENT_DIR}/lib)
file (GLOB SOURCES ${PROJECT_SOURCE_DIR}/*.cpp)
find_package (PkgConfig REQUIRED)
pkg_check_modules (GTKMM REQUIRED gtkmm-2.4)
include_directories (${GTKMM_INCLUDE_DIRS} ${PROJECT_CONTENT_DIR}/include)
add_library (${PROJECT_NAME} SHARED ${SOURCES})
if (UNIX)
set (CMAKE_INSTALL_PREFIX /)
install (DIRECTORY ${PROJECT_CONTENT_DIR} DESTINATION .)
set (CPACK_BINARY_DEB ON)
set (CPACK_BINARY_STGZ OFF)
set (CPACK_BINARY_TGZ OFF)
set (CPACK_BINARY_TZ OFF)
set (CPACK_BINARY_TBZ2 OFF)
set (CPACK_PACKAGE_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set (CPACK_PACKAGE_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set (CPACK_PACKAGE_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "graphbox - Gtkmm Widget to draw graphs")
set (CPACK_DEBIAN_PACKAGE_MAINTAINER "Андрей Корнилов")
set (CPACK_DEBIAN_PACKAGE_DEPENDS libgtkmm-2.4-dev)
set (CPACK_DEBIAN_PACKAGE_ARCHITECTURE i386)
set (CPACK_SYSTEM_NAME ${CPACK_DEBIAN_PACKAGE_ARCHITECTURE})
set (CPACK_DEBIAN_FILE_NAME ${PROJECT_NAME}-${PROJECT_VERSION}-${CPACK_SYSTEM_NAME}.deb)
include (CPack)
set (TEMP_DEBIAN_DIRECTORY "_CPack_Packages/${CPACK_SYSTEM_NAME}/DEB/${CPACK_DEBIAN_FILE_NAME}_temp")
add_custom_target (package_deb make package
COMMAND dpkg-deb -x ${CPACK_DEBIAN_FILE_NAME} ${TEMP_DEBIAN_DIRECTORY}
COMMAND dpkg-deb -e ${CPACK_DEBIAN_FILE_NAME} ${TEMP_DEBIAN_DIRECTORY}/DEBIAN
COMMAND dpkg-deb -b ${TEMP_DEBIAN_DIRECTORY} ${CPACK_DEBIAN_FILE_NAME}
COMMAND rm -rf ${TEMP_DEBIAN_DIRECTORY})
endif (UNIX)