This repository has been archived by the owner on Feb 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathCMakeLists.txt
159 lines (129 loc) · 6.23 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
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
151
152
153
154
155
156
157
158
cmake_minimum_required(VERSION 3.8)
project(adriconf)
set(CMAKE_CXX_STANDARD 14)
option(ENABLE_UNIT_TESTS "Enables building Unit tests" ON)
set(TOP_CMAKE_WAS_CALLED TRUE)
set(SYSCONFDIR "/etc" CACHE PATH "The path to read system-wide configuration. Equivalent to mesa SYSCONFDIR option")
add_definitions(-DSYSCONFDIR="${SYSCONFDIR}")
set(DATADIR "/usr/share/drirc.d" CACHE PATH "The path to read system-wide configurations. Equivalent to mesa DATADIR option")
add_definitions(-DDATADIR="${DATADIR}")
# Setup version string
if(EXISTS "${CMAKE_SOURCE_DIR}/.git")
execute_process(
COMMAND git log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
else()
set(GIT_COMMIT_HASH "UNKNOWN")
endif()
file (STRINGS "VERSION" BUILD_VERSION_NUMBER)
configure_file(
${CMAKE_SOURCE_DIR}/adriconf/version.h.in
${CMAKE_BINARY_DIR}/generated/version.h
)
include_directories(${CMAKE_BINARY_DIR}/generated)
find_package(PkgConfig REQUIRED)
set(OpenGL_GL_PREFERENCE "GLVND")
find_package(OpenGL REQUIRED)
# GTKMM
pkg_check_modules(GTKMM REQUIRED gtkmm-3.0)
# BOOST
find_package(Boost 1.60 REQUIRED COMPONENTS locale filesystem system)
# LIBXML
pkg_check_modules(LibXML++ libxml++-3.0)
if (NOT LibXML++_FOUND)
pkg_check_modules(LibXML++2 REQUIRED libxml++-2.6)
set(LibXML++_INCLUDE_DIRS ${LibXML++2_INCLUDE_DIRS})
set(LibXML++_LIBRARIES ${LibXML++2_LIBRARIES})
endif ()
# X11
pkg_check_modules(X11 REQUIRED x11)
# LIBDRM
pkg_check_modules(DRM REQUIRED libdrm)
# GBM
pkg_check_modules(GBM REQUIRED gbm)
# LIBPCI
pkg_check_modules(PCILIB REQUIRED libpci)
# INTL
find_package(Intl REQUIRED)
find_package(Gettext REQUIRED)
include_directories(${INTL_INCLUDE_DIRS})
link_directories(${INTL_LIBRARY_DIRS})
#EGL
pkg_check_modules(EGL REQUIRED egl)
#INTL INSTALL TRANSLATIONS
GETTEXT_CREATE_TRANSLATIONS(po/adriconf.pot ALL po/en.po po/hr.po po/lv.po po/pt_BR.po po/zh_CN.po)
set(SHARED_SOURCE_FILES
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/Device.cpp
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/Device.h
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DriverOption.cpp
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DriverOption.h
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/Section.cpp
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/Section.h
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DriverConfiguration.cpp
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DriverConfiguration.h
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/GPUInfo.cpp
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/GPUInfo.h
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/Application.cpp
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/Application.h
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/ApplicationOption.cpp
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/ApplicationOption.h
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/ComboBoxColumn.h
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DriverOptionType.h
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/GBMDevice.cpp
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/GBMDevice.h
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/EGLDisplayWrapper.cpp
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/EGLDisplayWrapper.h
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DRMDeviceInterface.h
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DRMDevice.h
${CMAKE_SOURCE_DIR}/adriconf/ValueObject/DRMDevice.cpp
${CMAKE_SOURCE_DIR}/adriconf/Logging/LoggerInterface.h
${CMAKE_SOURCE_DIR}/adriconf/Logging/LoggerLevel.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/ParserInterface.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/ConfigurationResolverInterface.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/DRIQuery.cpp
${CMAKE_SOURCE_DIR}/adriconf/Utils/DRIQuery.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/WriterInterface.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/ConfigurationLoaderInterface.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/PCIDatabaseQuery.cpp
${CMAKE_SOURCE_DIR}/adriconf/Utils/PCIDatabaseQuery.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/PCIDatabaseQueryInterface.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/Parser.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/Parser.cpp
${CMAKE_SOURCE_DIR}/adriconf/Utils/ConfigurationResolver.cpp
${CMAKE_SOURCE_DIR}/adriconf/Utils/ConfigurationResolver.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/Writer.cpp
${CMAKE_SOURCE_DIR}/adriconf/Utils/Writer.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/ConfigurationLoader.cpp
${CMAKE_SOURCE_DIR}/adriconf/Utils/ConfigurationLoader.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/GBMDeviceFactoryInterface.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/GBMDeviceFactory.cpp
${CMAKE_SOURCE_DIR}/adriconf/Utils/GBMDeviceFactory.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/EGLDisplayFactoryInterface.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/EGLDisplayFactory.cpp
${CMAKE_SOURCE_DIR}/adriconf/Utils/EGLDisplayFactory.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/DRMDeviceFactoryInterface.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/DRMDeviceFactory.cpp
${CMAKE_SOURCE_DIR}/adriconf/Utils/DRMDeviceFactory.h
${CMAKE_SOURCE_DIR}/adriconf/Translation/TranslatorInterface.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/DisplayServerQueryInterface.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/WaylandQuery.cpp
${CMAKE_SOURCE_DIR}/adriconf/Utils/WaylandQuery.h
${CMAKE_SOURCE_DIR}/adriconf/Utils/XorgQuery.cpp
${CMAKE_SOURCE_DIR}/adriconf/Utils/XorgQuery.h
${CMAKE_SOURCE_DIR}/adriconf/GUI.cpp
${CMAKE_SOURCE_DIR}/adriconf/GUI.h
)
# GTest and GMock setup
if (ENABLE_UNIT_TESTS)
configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt)
execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/googletest-download" )
execute_process(COMMAND "${CMAKE_COMMAND}" --build . WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/googletest-download" )
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
add_subdirectory("${CMAKE_BINARY_DIR}/googletest-src" "${CMAKE_BINARY_DIR}/googletest-build")
add_subdirectory(tests)
endif()
add_subdirectory(adriconf)