Changeset View
Changeset View
Standalone View
Standalone View
src/solid/devices/CMakeLists.txt
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | |||||
88 | flex_target(SolidLexer | 88 | flex_target(SolidLexer | ||
89 | devices/predicate_lexer.l | 89 | devices/predicate_lexer.l | ||
90 | ${CMAKE_CURRENT_BINARY_DIR}/predicate_lexer.c | 90 | ${CMAKE_CURRENT_BINARY_DIR}/predicate_lexer.c | ||
91 | COMPILE_FLAGS "-P Solid" | 91 | COMPILE_FLAGS "-P Solid" | ||
92 | ) | 92 | ) | ||
93 | add_flex_bison_dependency(SolidLexer SolidParser) | 93 | add_flex_bison_dependency(SolidLexer SolidParser) | ||
94 | list(APPEND solid_LIB_SRCS ${BISON_SolidParser_OUTPUTS} ${FLEX_SolidLexer_OUTPUTS}) | 94 | list(APPEND solid_LIB_SRCS ${BISON_SolidParser_OUTPUTS} ${FLEX_SolidLexer_OUTPUTS}) | ||
95 | 95 | | |||
96 | include(devices/backends/fakehw/CMakeLists.txt) | | |||
97 | | ||||
98 | if(NOT WIN32 AND NOT APPLE AND NOT ANDROID) | | |||
99 | if (CMAKE_SYSTEM_NAME MATCHES FreeBSD) | | |||
100 | option(EXPERIMENTAL_BSDISKS "Use UDisks2/bsdisks backend instead of HAL to manage disk devices" OFF) | | |||
101 | else () | | |||
102 | set(EXPERIMENTAL_BSDISKS FALSE) | | |||
103 | endif() | | |||
104 | | ||||
105 | if ( UDEV_FOUND ) | | |||
106 | message(STATUS "Building Solid UDev backend." ) | | |||
107 | include(devices/backends/udev/CMakeLists.txt) | | |||
108 | endif() | | |||
109 | | ||||
110 | message(STATUS "Building Solid UPower backend." ) | | |||
111 | include(devices/backends/upower/CMakeLists.txt) | | |||
112 | | ||||
113 | # FIXME: this should work on more Unix systems | | |||
114 | if ((CMAKE_SYSTEM_NAME MATCHES Linux AND UDEV_FOUND) OR EXPERIMENTAL_BSDISKS) | | |||
115 | message(STATUS "Building Solid UDisks2 backend." ) | | |||
116 | include(devices/backends/udisks2/CMakeLists.txt) | | |||
117 | endif () | | |||
118 | | ||||
119 | message(STATUS "Building Solid fstab backend." ) | | |||
120 | include(devices/backends/fstab/CMakeLists.txt) | | |||
121 | | ||||
122 | if (NOT CMAKE_SYSTEM_NAME MATCHES Linux) | | |||
123 | message(STATUS "Building Solid HAL backend." ) | | |||
124 | include(devices/backends/hal/CMakeLists.txt) | | |||
125 | endif() | | |||
126 | endif() | | |||
127 | | ||||
128 | include(CheckIncludeFiles) | 96 | include(CheckIncludeFiles) | ||
129 | include(CheckFunctionExists) | 97 | include(CheckFunctionExists) | ||
130 | include(CheckCXXSourceCompiles) | 98 | include(CheckCXXSourceCompiles) | ||
131 | 99 | | |||
132 | #Needed for the fstab backend | 100 | #Needed for the fstab backend | ||
133 | check_include_files(mntent.h HAVE_MNTENT_H) | 101 | check_include_files(mntent.h HAVE_MNTENT_H) | ||
134 | check_include_files(sys/types.h HAVE_SYS_TYPES_H) | 102 | check_include_files(sys/types.h HAVE_SYS_TYPES_H) | ||
135 | check_include_files(sys/param.h HAVE_SYS_PARAM_H) | 103 | check_include_files(sys/param.h HAVE_SYS_PARAM_H) | ||
Show All 11 Lines | 114 | int main(){ | |||
147 | struct statvfs *mntbufp; | 115 | struct statvfs *mntbufp; | ||
148 | int flags; | 116 | int flags; | ||
149 | return getmntinfo(&mntbufp, flags); | 117 | return getmntinfo(&mntbufp, flags); | ||
150 | } | 118 | } | ||
151 | " GETMNTINFO_USES_STATVFS ) | 119 | " GETMNTINFO_USES_STATVFS ) | ||
152 | 120 | | |||
153 | configure_file(devices/config-solid.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-solid.h ) | 121 | configure_file(devices/config-solid.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-solid.h ) | ||
154 | 122 | | |||
155 | if(APPLE) | | |||
156 | find_package(IOKit REQUIRED) | | |||
157 | | ||||
158 | message(STATUS "-- Building Solid IOKit backend." ) | | |||
159 | include(devices/backends/iokit/CMakeLists.txt) | | |||
160 | endif() | | |||
161 | | ||||
162 | if(WIN32) | | |||
163 | message(STATUS "-- Building Solid Windows backend." ) | | |||
164 | include(devices/backends/win/CMakeLists.txt) | | |||
165 | endif() | | |||
166 | | ||||
167 | set(solid_OPTIONAL_LIBS) | 123 | set(solid_OPTIONAL_LIBS) | ||
168 | 124 | | |||
169 | if(WIN32) | 125 | add_device_backends_build("${CMAKE_CURRENT_SOURCE_DIR}/devices/backends" solid_LIB_SRCS solid_OPTIONAL_LIBS) | ||
170 | set(solid_OPTIONAL_LIBS ${solid_OPTIONAL_LIBS} Qt5::Network setupapi) | | |||
171 | set(solid_OPTIONAL_LIBS ${solid_OPTIONAL_LIBS} setupapi) | | |||
172 | endif() | | |||
173 | | ||||
174 | if(APPLE) | | |||
175 | set(solid_OPTIONAL_LIBS ${IOKIT_LIBRARY} "-framework DiskArbitration") | | |||
176 | endif() | | |||
177 | | ||||
178 | if ( UDEV_FOUND ) | | |||
179 | set(solid_OPTIONAL_LIBS ${solid_OPTIONAL_LIBS} ${UDEV_LIBS}) | | |||
180 | endif () | |