mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-06 14:34:28 +02:00
Checkpoint - turning quazip into external
This commit is contained in:
parent
f981fb9f46
commit
c56a3b6d22
7 changed files with 75 additions and 65 deletions
|
@ -202,6 +202,8 @@ if (NOT ANDROID)
|
|||
set_target_properties(ice-server PROPERTIES FOLDER "Apps")
|
||||
add_subdirectory(interface)
|
||||
set_target_properties(interface PROPERTIES FOLDER "Apps")
|
||||
add_subdirectory(stack-manager)
|
||||
set_target_properties(stack-manager PROPERTIES FOLER "Apps")
|
||||
add_subdirectory(tests)
|
||||
add_subdirectory(plugins)
|
||||
add_subdirectory(tools)
|
||||
|
|
25
cmake/externals/quazip/CMakeLists.txt
vendored
Normal file
25
cmake/externals/quazip/CMakeLists.txt
vendored
Normal file
|
@ -0,0 +1,25 @@
|
|||
set(EXTERNAL_NAME quazip)
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(
|
||||
${EXTERNAL_NAME}
|
||||
URL https://s3-us-west-1.amazonaws.com/hifi-production/dependencies/quazip-0.6.2.zip
|
||||
URL_MD5 514851970f1a14d815bdc3ad6267af4d
|
||||
BINARY_DIR ${EXTERNAL_PROJECT_PREFIX}/build
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=<INSTALL_DIR> -DCMAKE_PREFIX_PATH=$ENV{QT_CMAKE_PREFIX_PATH}
|
||||
LOG_DOWNLOAD 1
|
||||
LOG_CONFIGURE 1
|
||||
LOG_BUILD 1
|
||||
)
|
||||
|
||||
# Hide this external target (for ide users)
|
||||
set_target_properties(${EXTERNAL_NAME} PROPERTIES FOLDER "hidden/externals")
|
||||
|
||||
ExternalProject_Get_Property(${EXTERNAL_NAME} INSTALL_DIR)
|
||||
|
||||
string(TOUPPER ${EXTERNAL_NAME} EXTERNAL_NAME_UPPER)
|
||||
set(${EXTERNAL_NAME_UPPER}_INCLUDE_DIRS ${INSTALL_DIR}/include CACHE PATH "List of QuaZip include directories")
|
||||
|
||||
if (APPLE)
|
||||
set(${EXTERNAL_NAME_UPPER}_LIBRARIES ${INSTALL_DIR}/lib/libquazip.1.0.0.dylib CACHE FILEPATH "List of QuaZip libraries")
|
||||
endif ()
|
13
cmake/macros/TargetQuazip.cmake
Normal file
13
cmake/macros/TargetQuazip.cmake
Normal file
|
@ -0,0 +1,13 @@
|
|||
#
|
||||
# Copyright 2015 High Fidelity, Inc.
|
||||
# Created by Leonardo Murillo on 2015/11/20
|
||||
#
|
||||
# Distributed under the Apache License, Version 2.0.
|
||||
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
#
|
||||
macro(TARGET_QUAZIP)
|
||||
add_dependency_external_projects(quazip)
|
||||
find_package(QUAZIP REQUIRED)
|
||||
target_include_directories(${TARGET_NAME} PUBLIC ${QUAZIP_INCLUDE_DIRS})
|
||||
target_link_libraries(${TARGET_NAME} ${QUAZIP_LIBRARIES})
|
||||
endmacro()
|
|
@ -12,21 +12,21 @@
|
|||
# QUAZIP_LIBRARIES - List of QuaZip libraries
|
||||
# QUAZIP_ZLIB_INCLUDE_DIR - The include dir of zlib headers
|
||||
|
||||
include("${MACRO_DIR}/HifiLibrarySearchHints.cmake")
|
||||
hifi_library_search_hints("quazip")
|
||||
|
||||
IF (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
|
||||
SET(QUAZIP_FOUND TRUE)
|
||||
ELSE (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
|
||||
SET(QUAZIP_SEARCH_DIRS "$ENV{HIFI_LIB_DIR}/QuaZip")
|
||||
IF (WIN32)
|
||||
FIND_PATH(QUAZIP_INCLUDE_DIRS quazip.h PATH_SUFFIXES include/quazip HINTS ${QUAZIP_SEARCH_DIRS})
|
||||
FIND_LIBRARY(QUAZIP_LIBRARIES NAMES quazip PATH_SUFFIXES lib HINTS ${QUAZIP_SEARCH_DIRS})
|
||||
ELSEIF(APPLE)
|
||||
FIND_PATH(QUAZIP_INCLUDE_DIRS quazip.h PATH_SUFFIXES include/quazip HINTS ${QUAZIP_SEARCH_DIRS})
|
||||
FIND_LIBRARY(QUAZIP_LIBRARIES NAMES quazip PATH_SUFFIXES lib HINTS ${QUAZIP_SEARCH_DIRS})
|
||||
ELSE ()
|
||||
FIND_PATH(QUAZIP_INCLUDE_DIRS quazip.h PATH_SUFFIXES quazip HINTS ${QUAZIP_SEARCH_DIRS})
|
||||
FIND_LIBRARY(QUAZIP_LIBRARIES NAMES quazip-qt5 PATH_SUFFIXES lib HINTS ${QUAZIP_SEARCH_DIRS})
|
||||
ENDIF ()
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(QUAZIP DEFAULT_MSG QUAZIP_INCLUDE_DIRS QUAZIP_LIBRARIES)
|
||||
ENDIF (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES)
|
||||
if (WIN32)
|
||||
find_path(QUAZIP_INCLUDE_DIRS quazip.h PATH_SUFFIXES include/quazip HINTS ${QUAZIP_SEARCH_DIRS})
|
||||
# find_library(QUAZIP_LIBRARIES NAMES quazip PATH_SUFFIXES lib HINTS ${QUAZIP_SEARCH_DIRS})
|
||||
elseif (APPLE)
|
||||
find_path(QUAZIP_INCLUDE_DIRS quazip.h PATH_SUFFIXES include/quazip HINTS ${QUAZIP_SEARCH_DIRS})
|
||||
# find_library(QUAZIP_LIBRARIES NAMES quazip PATH_SUFFIXES lib HINTS ${QUAZIP_SEARCH_DIRS})
|
||||
else ()
|
||||
find_path(QUAZIP_INCLUDE_DIRS quazip.h PATH_SUFFIXES quazip HINTS ${QUAZIP_SEARCH_DIRS})
|
||||
# find_library(QUAZIP_LIBRARIES NAMES quazip-qt5 PATH_SUFFIXES lib HINTS ${QUAZIP_SEARCH_DIRS})
|
||||
endif ()
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(QUAZIP DEFAULT_MSG QUAZIP_INCLUDE_DIRS)
|
||||
|
||||
mark_as_advanced(QUAZIP_INCLUDE_DIRS QUAZIP_SEARCH_DIRS)
|
||||
|
|
|
@ -1,43 +1,10 @@
|
|||
cmake_minimum_required(VERSION 2.8.11)
|
||||
|
||||
if (POLICY CMP0028)
|
||||
cmake_policy(SET CMP0028 OLD)
|
||||
endif ()
|
||||
|
||||
set(TARGET_NAME "StackManager")
|
||||
|
||||
project(${TARGET_NAME})
|
||||
|
||||
set(CMAKE_AUTOMOC ON)
|
||||
|
||||
if (NOT QT_CMAKE_PREFIX_PATH)
|
||||
set(QT_CMAKE_PREFIX_PATH $ENV{QT_CMAKE_PREFIX_PATH})
|
||||
endif ()
|
||||
|
||||
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${QT_CMAKE_PREFIX_PATH})
|
||||
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules/")
|
||||
|
||||
find_package(Qt5Widgets REQUIRED)
|
||||
find_package(Qt5Gui REQUIRED)
|
||||
find_package(Qt5Svg REQUIRED)
|
||||
find_package(Qt5Core REQUIRED)
|
||||
find_package(Qt5Network REQUIRED)
|
||||
find_package(Qt5WebKitWidgets REQUIRED)
|
||||
find_package(QuaZip REQUIRED)
|
||||
set(TARGET_NAME "stack-manager")
|
||||
setup_hifi_project(Widgets Gui Svg Core Network WebKitWidgets)
|
||||
|
||||
if (WIN32)
|
||||
find_package(ZLIB REQUIRED)
|
||||
endif ()
|
||||
|
||||
include_directories(
|
||||
${QUAZIP_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
src
|
||||
src/ui
|
||||
${PROJECT_BINARY_DIR}/includes
|
||||
)
|
||||
|
||||
if (DEFINED ENV{JOB_ID})
|
||||
set(PR_BUILD "false")
|
||||
set(BUILD_SEQ $ENV{JOB_ID})
|
||||
|
@ -54,12 +21,17 @@ else ()
|
|||
endif ()
|
||||
|
||||
configure_file(src/StackManagerVersion.h.in "${PROJECT_BINARY_DIR}/includes/StackManagerVersion.h")
|
||||
include_directories(
|
||||
${PROJECT_BINARY_DIR}/includes
|
||||
${PROJECT_SOURCE_DIR}/src
|
||||
${PROJECT_SOURCE_DIR}/src/ui
|
||||
${QUAZIP_INCLUDE_DIRS}
|
||||
${ZLIB_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
file(GLOB SRCS "src/*.cpp" "src/ui/*.cpp")
|
||||
file(GLOB HEADERS "src/*.h" "src/ui/*.h" "${PROJECT_BINARY_DIR}/includes/*.h")
|
||||
file(GLOB QT_RES_FILES "src/*.qrc")
|
||||
qt5_add_resources(QT_RES "${QT_RES_FILES}")
|
||||
set(SM_SRCS ${QT_RES} ${SRCS} ${HEADERS})
|
||||
target_quazip()
|
||||
|
||||
target_link_libraries(${TARGET_NAME} ${QUAZIP_LIBRARIES})
|
||||
|
||||
if (APPLE)
|
||||
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.8)
|
||||
|
@ -68,13 +40,11 @@ if (APPLE)
|
|||
set(MACOSX_BUNDLE_ICON_FILE icon.icns)
|
||||
set_source_files_properties(${CMAKE_CURRENT_SOURCE_DIR}/assets/icon.icns PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
|
||||
set(SM_SRCS ${SM_SRCS} "${CMAKE_CURRENT_SOURCE_DIR}/assets/icon.icns")
|
||||
add_executable(${TARGET_NAME} MACOSX_BUNDLE ${SM_SRCS})
|
||||
# add_executable(${TARGET_NAME} MACOSX_BUNDLE ${SM_SRCS})
|
||||
else ()
|
||||
if (WIN32)
|
||||
add_executable(${TARGET_NAME} WIN32 ${SM_SRCS} windows_icon.rc)
|
||||
# add_executable(${TARGET_NAME} WIN32 ${SM_SRCS} windows_icon.rc)
|
||||
else ()
|
||||
add_executable(${TARGET_NAME} ${SM_SRCS})
|
||||
# add_executable(${TARGET_NAME} ${SM_SRCS})
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
target_link_libraries(${TARGET_NAME} Qt5::Core Qt5::Gui Qt5::Svg Qt5::Network Qt5::Widgets Qt5::WebKitWidgets ${QUAZIP_LIBRARIES} ${ZLIB_LIBRARIES})
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#ifndef hifi_BackgroundProcess_h
|
||||
#define hifi_BackgroundProcess_h
|
||||
|
||||
#include "LogViewer.h"
|
||||
#include <LogViewer.h>
|
||||
|
||||
#include <QProcess>
|
||||
#include <QString>
|
||||
|
|
|
@ -9,8 +9,8 @@
|
|||
#include "Downloader.h"
|
||||
#include "GlobalData.h"
|
||||
|
||||
#include <quazip.h>
|
||||
#include <quazipfile.h>
|
||||
#include <quazip/quazip.h>
|
||||
#include <quazip/quazipfile.h>
|
||||
|
||||
#include <QNetworkRequest>
|
||||
#include <QFile>
|
||||
|
|
Loading…
Reference in a new issue