From 8e7228718fc0059f1c34efe051a47deec2f3a115 Mon Sep 17 00:00:00 2001 From: Max Risuhin Date: Mon, 25 Jun 2018 00:59:21 -0700 Subject: [PATCH] Support linux compilation --- desktop/CMakeLists.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/desktop/CMakeLists.txt b/desktop/CMakeLists.txt index 994e67b..5c586f3 100644 --- a/desktop/CMakeLists.txt +++ b/desktop/CMakeLists.txt @@ -8,10 +8,13 @@ set(REACT_NATIVE_DESKTOP_EXTERNAL_MODULES_SRC ${REACT_NATIVE_DESKTOP_EXTERNAL_MO include(${CMAKE_ROOT}/Modules/ExternalProject.cmake) +if (UNIX AND NOT APPLE) + set(qtkeychain_LIBPATHSUFFIX /x86_64-linux-gnu) +endif() set(qtkeychain_ROOT ${CMAKE_CURRENT_BINARY_DIR}/qtkeychain) set(qtkeychain_BUILDDIR ${qtkeychain_ROOT}/build) -set(qtkeychain_STATIC_LIB ${qtkeychain_BUILDDIR}/lib/${CMAKE_STATIC_LIBRARY_PREFIX}qt5keychain${CMAKE_STATIC_LIBRARY_SUFFIX}) +set(qtkeychain_STATIC_LIB ${qtkeychain_BUILDDIR}/lib${qtkeychain_LIBPATHSUFFIX}/${CMAKE_STATIC_LIBRARY_PREFIX}qt5keychain${CMAKE_STATIC_LIBRARY_SUFFIX}) set(qtkeychain_INCLUDE_DIR ${qtkeychain_BUILDDIR}/include/qt5keychain) @@ -23,10 +26,16 @@ ExternalProject_Add(qtkeychain LOG_DOWNLOAD 1 ) +if (UNIX AND NOT APPLE) + find_package(Qt5 COMPONENTS DBus REQUIRED) + set(qtkeychain_DEPS Qt5::DBus) + set(REACT_NATIVE_DESKTOP_EXTERNAL_QT_COMPONENTS ${REACT_NATIVE_DESKTOP_EXTERNAL_PROJECT_DEPS} DBus PARENT_SCOPE) +endif() + set(REACT_NATIVE_DESKTOP_EXTERNAL_PROJECT_DEPS ${REACT_NATIVE_DESKTOP_EXTERNAL_PROJECT_DEPS} qtkeychain PARENT_SCOPE) set(REACT_NATIVE_DESKTOP_EXTERNAL_MODULES_LIBS ${REACT_NATIVE_DESKTOP_EXTERNAL_MODULES_LIBS} - ${qtkeychain_STATIC_LIB} PARENT_SCOPE) + ${qtkeychain_STATIC_LIB} ${qtkeychain_DEPS} PARENT_SCOPE) set(REACT_NATIVE_DESKTOP_EXTERNAL_MODULES_INCLUDE_DIRS ${REACT_NATIVE_DESKTOP_EXTERNAL_MODULES_INCLUDE_DIRS} ${qtkeychain_INCLUDE_DIR} PARENT_SCOPE)