-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathCMakeLists.txt
85 lines (69 loc) · 2.56 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
79
80
81
82
83
84
85
#
# %injeqt copyright begin%
# Copyright 2014 Rafał Malinowski ([email protected])
# %injeqt copyright end%
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#
project (injeqt)
cmake_minimum_required (VERSION 2.8)
set (INJEQT_SOVERSION "1")
set (INJEQT_VERSION "1.2")
option (DISABLE_TESTS "Do not build tests" OFF)
option (DISABLE_EXAMPLES "Do not build examples" OFF)
find_package (Qt5Core 5.2 REQUIRED)
# do not link with qtmain on windows
if (POLICY CMP0020)
cmake_policy (SET CMP0020 OLD)
endif ()
if (POLICY CMP0043)
cmake_policy (SET CMP0043 NEW)
endif ()
set (WARNINGS "-Werror -W -Wall -Wextra -Wundef -Wunused -Wuninitialized -Wcast-align -Wpointer-arith -Woverloaded-virtual -Wnon-virtual-dtor -fno-common")
set (VISIBILITY "-fvisibility=hidden -fvisibility-inlines-hidden")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${WARNINGS} ${VISIBILITY}")
set (CMAKE_AUTOMOC TRUE)
set (CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories (
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/src/internal
)
add_subdirectory (src)
if (NOT DISABLE_EXAMPLES)
add_subdirectory (examples)
endif (NOT DISABLE_EXAMPLES)
if (NOT CMAKE_BUILD_TYPE MATCHES RELEASE AND NOT DISABLE_TESTS)
enable_testing ()
add_subdirectory (test)
endif (NOT CMAKE_BUILD_TYPE MATCHES RELEASE AND NOT DISABLE_TESTS)
if (NOT DEFINED CMAKE_INSTALL_LIBDIR)
set (CMAKE_INSTALL_LIBDIR lib)
endif (NOT DEFINED CMAKE_INSTALL_LIBDIR)
set (prefix ${CMAKE_INSTALL_PREFIX})
set (exec_prefix ${CMAKE_INSTALL_PREFIX})
set (libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
set (includedir ${CMAKE_INSTALL_PREFIX}/include)
set (LIBS "-lQt5Core")
configure_file (
${CMAKE_CURRENT_SOURCE_DIR}/injeqt.pc.in
${CMAKE_CURRENT_BINARY_DIR}/injeqt.pc
@ONLY
)
install (DIRECTORY
include/injeqt DESTINATION include
)
install (FILES
${CMAKE_CURRENT_BINARY_DIR}/injeqt.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
)