Debian Codegraph @

CMakeLists.txt

raw ◀ ▶
1 Debian patch touch this file
1 #
2 # %injeqt copyright begin%
3 # Copyright 2014 Rafał Malinowski ([email protected])
4 # %injeqt copyright end%
5 #
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
10 #
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
15 #
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 #
20
21 project (injeqt)
•22 cmake_minimum_required (VERSION 3.5)
23
24 set (INJEQT_SOVERSION "1")
25 set (INJEQT_VERSION "1.2")
26
27 option (DISABLE_TESTS "Do not build tests" OFF)
28 option (DISABLE_EXAMPLES "Do not build examples" OFF)
29
30 find_package (Qt5Core 5.2 REQUIRED)
31
32 # do not link with qtmain on windows
33 if (POLICY CMP0043)
34 cmake_policy (SET CMP0043 NEW)
35 endif ()
36
37 set (WARNINGS "-Werror -W -Wall -Wextra -Wundef -Wunused -Wuninitialized -Wcast-align -Wpointer-arith -Woverloaded-virtual -Wnon-virtual-dtor -fno-common")
38 set (VISIBILITY "-fvisibility=hidden -fvisibility-inlines-hidden")
39 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${WARNINGS} ${VISIBILITY}")
40
41 set (CMAKE_AUTOMOC TRUE)
42 set (CMAKE_INCLUDE_CURRENT_DIR ON)
43
44 include_directories (
45 ${CMAKE_CURRENT_SOURCE_DIR}/include
46 ${CMAKE_CURRENT_SOURCE_DIR}/src/internal
47 )
48
49 add_subdirectory (src)
50
51 if (NOT DISABLE_EXAMPLES)
52 add_subdirectory (examples)
53 endif (NOT DISABLE_EXAMPLES)
54
55 if (NOT CMAKE_BUILD_TYPE MATCHES RELEASE AND NOT DISABLE_TESTS)
56 enable_testing ()
57 add_subdirectory (test)
58 endif (NOT CMAKE_BUILD_TYPE MATCHES RELEASE AND NOT DISABLE_TESTS)
59
60 if (NOT DEFINED CMAKE_INSTALL_LIBDIR)
61 set (CMAKE_INSTALL_LIBDIR lib)
62 endif (NOT DEFINED CMAKE_INSTALL_LIBDIR)
63
64 set (prefix ${CMAKE_INSTALL_PREFIX})
65 set (exec_prefix ${CMAKE_INSTALL_PREFIX})
66 set (libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
67 set (includedir ${CMAKE_INSTALL_PREFIX}/include)
68 set (LIBS "-lQt5Core")
69
70 configure_file (
71 ${CMAKE_CURRENT_SOURCE_DIR}/injeqt.pc.in
72 ${CMAKE_CURRENT_BINARY_DIR}/injeqt.pc
73 @ONLY
74 )
75
76 install (DIRECTORY
77 include/injeqt DESTINATION include
78 )
79
80 install (FILES
81 ${CMAKE_CURRENT_BINARY_DIR}/injeqt.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
82 )