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
|
# vim:expandtab:shiftwidth=2:tabstop=2:
# Copyright (C) 2014 Canonical Ltd.
# 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
if(CMAKE_CROSSCOMPILING)
# QT_MOC_EXECUTABLE is set by Qt5CoreConfigExtras, but it sets it to
# the target executable rather than the host executable, which is no
# use for cross-compiling. For cross-compiling, we have a guess and
# override it ourselves
if(NOT TARGET Qt5::moc)
find_program(
QT_MOC_EXECUTABLE moc
PATHS /usr/lib/qt5/bin /usr/lib/${OXIDE_LIBRARY_HOST_ARCHITECTURE}/qt5/bin
NO_DEFAULT_PATH)
if(QT_MOC_EXECUTABLE STREQUAL "QT_MOC_EXECUTABLE-NOTFOUND")
message(FATAL_ERROR "Can't find a moc executable for the host arch")
endif()
add_executable(Qt5::moc IMPORTED)
set_target_properties(Qt5::moc PROPERTIES
IMPORTED_LOCATION "${QT_MOC_EXECUTABLE}")
endif()
else()
# This should be enough to initialize QT_MOC_EXECUTABLE
find_package(Qt5Core)
endif()
set(OXIDE_CORELIB_NAME OxideQtCore)
set(OXIDE_CORELIB_SO_VERSION 0)
set(OXIDE_SUBPROCESS_DIR oxide-qt)
set(OXIDE_RENDERER_NAME oxide-renderer)
list(APPEND OXIDE_GYP_EXTRA_ARGS -Doxide_core_name=${OXIDE_CORELIB_NAME})
list(APPEND OXIDE_GYP_EXTRA_ARGS -Doxide_core_so_version=${OXIDE_CORELIB_SO_VERSION})
list(APPEND OXIDE_GYP_EXTRA_ARGS -Doxide_subprocess_dir=${OXIDE_SUBPROCESS_DIR})
list(APPEND OXIDE_GYP_EXTRA_ARGS -Doxide_renderer_name=${OXIDE_RENDERER_NAME})
list(APPEND OXIDE_GYP_EXTRA_ARGS -Dqt_moc_executable=${QT_MOC_EXECUTABLE})
|