2024-09-17 19:00:25 +00:00
|
|
|
# Deskflow -- mouse and keyboard sharing utility
|
2024-07-02 10:23:56 +00:00
|
|
|
# Copyright (C) 2012-2024 Symless Ltd.
|
|
|
|
|
# Copyright (C) 2009-2012 Nick Bolton
|
|
|
|
|
#
|
2012-06-10 16:50:54 +00:00
|
|
|
# This package is free software; you can redistribute it and/or
|
|
|
|
|
# modify it under the terms of the GNU General Public License
|
2015-05-03 02:33:52 +00:00
|
|
|
# found in the file LICENSE that should have accompanied this file.
|
2024-07-02 10:23:56 +00:00
|
|
|
#
|
2012-06-10 16:50:54 +00:00
|
|
|
# This package 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 General Public License for more details.
|
|
|
|
|
#
|
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
2024-10-21 20:39:15 +00:00
|
|
|
if(UNIX AND NOT APPLE)
|
|
|
|
|
pkg_check_modules(LIBEI REQUIRED QUIET "libei-1.0 >= 1.3")
|
|
|
|
|
message(STATUS "libei version: ${LIBEI_VERSION}")
|
|
|
|
|
|
|
|
|
|
pkg_check_modules(LIBPORTAL REQUIRED QUIET "libportal >= 0.8")
|
|
|
|
|
message(STATUS "libportal version: ${LIBPORTAL_VERSION}")
|
|
|
|
|
endif()
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-02 10:23:56 +00:00
|
|
|
if(WIN32)
|
|
|
|
|
file(GLOB headers "MSWindows*.h")
|
|
|
|
|
file(GLOB sources "MSWindows*.cpp")
|
|
|
|
|
elseif(APPLE)
|
|
|
|
|
file(GLOB headers "OSX*.h" "IOSX*.h")
|
2024-07-16 08:30:35 +00:00
|
|
|
file(
|
|
|
|
|
GLOB
|
|
|
|
|
sources
|
|
|
|
|
"OSX*.cpp"
|
|
|
|
|
"IOSX*.cpp"
|
|
|
|
|
"OSX*.m"
|
|
|
|
|
"OSX*.mm")
|
2024-07-02 10:23:56 +00:00
|
|
|
elseif(UNIX)
|
2024-08-30 14:53:25 +00:00
|
|
|
file(GLOB x_headers "XWindows*.h")
|
|
|
|
|
file(GLOB x_sources "XWindows*.cpp")
|
|
|
|
|
|
|
|
|
|
if(LIBEI_FOUND)
|
|
|
|
|
file(GLOB ei_headers "Ei*.h")
|
|
|
|
|
file(GLOB ei_sources "Ei*.cpp")
|
|
|
|
|
|
|
|
|
|
# The Portal sources also require EI.
|
|
|
|
|
if(LIBPORTAL_FOUND)
|
|
|
|
|
file(GLOB portal_headers "Portal*.h")
|
|
|
|
|
file(GLOB portal_sources "Portal*.cpp")
|
|
|
|
|
endif()
|
|
|
|
|
endif()
|
|
|
|
|
|
|
|
|
|
list(
|
|
|
|
|
APPEND
|
|
|
|
|
headers
|
|
|
|
|
${x_headers}
|
|
|
|
|
${ei_headers}
|
|
|
|
|
${portal_headers})
|
|
|
|
|
list(
|
|
|
|
|
APPEND
|
|
|
|
|
sources
|
|
|
|
|
${x_sources}
|
|
|
|
|
${ei_sources}
|
|
|
|
|
${portal_sources})
|
2014-02-26 17:46:02 +00:00
|
|
|
endif()
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-07-18 07:04:39 +00:00
|
|
|
if(ADD_HEADERS_TO_SOURCES)
|
2024-07-02 10:23:56 +00:00
|
|
|
list(APPEND sources ${headers})
|
2012-06-10 16:50:54 +00:00
|
|
|
endif()
|
|
|
|
|
|
2024-07-02 10:23:56 +00:00
|
|
|
if(APPLE)
|
|
|
|
|
list(APPEND inc /System/Library/Frameworks)
|
2013-08-30 14:38:43 +00:00
|
|
|
endif()
|
|
|
|
|
|
2012-06-10 16:50:54 +00:00
|
|
|
include_directories(${inc})
|
2014-02-26 17:46:02 +00:00
|
|
|
add_library(platform STATIC ${sources})
|
2013-09-24 16:29:51 +00:00
|
|
|
target_link_libraries(platform client ${libs})
|
2012-06-10 16:50:54 +00:00
|
|
|
|
2024-08-30 14:53:25 +00:00
|
|
|
macro(link_wayland_libs)
|
2024-10-21 20:39:15 +00:00
|
|
|
target_compile_definitions(platform PUBLIC WINAPI_LIBEI WINAPI_LIBPORTAL HAVE_LIBPORTAL_INPUTCAPTURE)
|
|
|
|
|
|
2024-08-30 14:53:25 +00:00
|
|
|
target_link_libraries(platform ${LIBXKBCOMMON_LINK_LIBRARIES}
|
2024-10-21 20:39:15 +00:00
|
|
|
${GLIB2_LINK_LIBRARIES} ${LIBM_LIBRARIES}
|
|
|
|
|
${LIBEI_LINK_LIBRARIES} ${LIBPORTAL_LINK_LIBRARIES}
|
|
|
|
|
)
|
2024-08-30 14:53:25 +00:00
|
|
|
|
2024-10-21 20:39:15 +00:00
|
|
|
target_include_directories(platform PUBLIC ${LIBEI_INCLUDE_DIRS} ${LIBPORTAL_INCLUDE_DIRS})
|
2024-08-30 14:53:25 +00:00
|
|
|
|
|
|
|
|
endmacro()
|
|
|
|
|
|
2024-07-02 10:23:56 +00:00
|
|
|
if(UNIX)
|
|
|
|
|
target_link_libraries(
|
|
|
|
|
platform
|
|
|
|
|
io
|
|
|
|
|
net
|
|
|
|
|
ipc
|
2024-09-17 19:00:25 +00:00
|
|
|
app
|
2024-07-02 10:23:56 +00:00
|
|
|
client
|
|
|
|
|
${libs})
|
2021-10-21 07:25:57 +00:00
|
|
|
|
2024-07-02 10:23:56 +00:00
|
|
|
if(NOT APPLE)
|
2024-07-08 14:37:51 +00:00
|
|
|
find_package(Qt6 COMPONENTS DBus)
|
|
|
|
|
target_link_libraries(platform Qt6::DBus)
|
2024-08-30 14:53:25 +00:00
|
|
|
|
|
|
|
|
link_wayland_libs()
|
2024-07-02 10:23:56 +00:00
|
|
|
endif()
|
2012-06-10 16:50:54 +00:00
|
|
|
endif()
|
2013-08-30 14:38:43 +00:00
|
|
|
|
2024-07-02 10:23:56 +00:00
|
|
|
if(APPLE)
|
|
|
|
|
find_library(COCOA_LIBRARY Cocoa)
|
|
|
|
|
target_link_libraries(platform ${COCOA_LIBRARY})
|
2013-08-30 14:38:43 +00:00
|
|
|
endif()
|