forked from lxqt/qterminal
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
79 lines (62 loc) · 2.66 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
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
cmake_minimum_required( VERSION 2.6 )
project( qterminal )
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules )
IF (NOT LIB_SUFFIX)
MESSAGE(STATUS "")
MESSAGE(STATUS "LIB_SUFFIX variable is not defined. It will be autodetected now.")
MESSAGE(STATUS "You can set it manually with -DLIB_SUFFIX=<value> (64 for example)")
IF (NOT APPLE)
# check 64 bit
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
SET (LIB_SUFFIX "")
else (CMAKE_SIZEOF_VOID_P EQUAL 4)
set (LIB_SUFFIX "64")
MESSAGE(STATUS " LIB_SUFFIX is set to '${LIB_SUFFIX}'")
endif (CMAKE_SIZEOF_VOID_P EQUAL 4)
ELSE (NOT APPLE)
message(STATUS "LIB_SUFFIX is disabled for APPLE: ${CMAKE_SYSTEM_NAME}")
SET (LIB_SUFFIX "")
ENDIF (NOT APPLE)
# BSD does not use lib64 for 64bit libs
IF (${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR ${CMAKE_SYSTEM_NAME} MATCHES "OpenBSD")
message(STATUS "LIB_SUFFIX is disabled for *BSD: ${CMAKE_SYSTEM_NAME}")
SET (LIB_SUFFIX "")
ENDIF()
#
MESSAGE(STATUS "")
ENDIF (NOT LIB_SUFFIX)
find_package( Qt4 COMPONENTS QtCore QtGui REQUIRED)
INCLUDE( ${QT_USE_FILE} )
MESSAGE(STATUS "Qt4 version: ${QT_VERSION_MAJOR}.${QT_VERSION_MINOR}.${QT_VERSION_PATCH}")
add_definitions ( ${QT_DEFINITIONS} )
include_directories( ${QT_INCLUDES} )
MESSAGE(STATUS "Qt4 libs: ${QT_LIBRARIES}")
find_package ( QTermWidget REQUIRED )
if (APPLE)
FIND_LIBRARY(CARBON_LIBRARY Carbon REQUIRED)
MESSAGE(STATUS "CARBON_LIBRARY: ${CARBON_LIBRARY}")
elseif (UNIX)
FIND_PACKAGE(X11 REQUIRED)
MESSAGE(STATUS "X11_X11_LIB: ${X11_X11_LIB}")
endif ()
set(STR_VERSION "0.4.0")
add_definitions(-DSTR_VERSION=\"${STR_VERSION}\")
# a helper for macosx to build 32/64 bit universals
IF (WANT_UNIVERSAL)
SET (CMAKE_OSX_ARCHITECTURES "i386;x86_64;")
MESSAGE(STATUS "Archs builds: ${CMAKE_OSX_ARCHITECTURES}")
ENDIF (WANT_UNIVERSAL)
subdirs( src )
install(FILES qterminal.desktop DESTINATION share/applications)
install(FILES qterminal_drop.desktop DESTINATION share/applications)
# make dist custom target
SET(CPACK_PACKAGE_NAME "qterminal")
SET(CPACK_PACKAGE_VERSION ${STR_VERSION})
SET(CPACK_SOURCE_GENERATOR "TGZ;TBZ2")
SET(CPACK_SOURCE_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${CPACK_PACKAGE_VERSION}")
SET(CPACK_IGNORE_FILES "/CVS/;/\\\\.svn/;/\\\\.git/;\\\\.swp$;\\\\.#;/#;\\\\.tar.gz$;/CMakeFiles/;CMakeCache.txt;\\\\.qm$;/build/;\\\\.diff$;.DS_Store'")
SET(CPACK_SOURCE_IGNORE_FILES ${CPACK_IGNORE_FILES})
INCLUDE(CPack)
# simulate autotools' "make dist"
add_custom_target(dist COMMAND ${CMAKE_MAKE_PROGRAM} package_source)