-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request qgis#59800 from m-kuhn/external_o2
Use o2 library from https://github.com/qgis/o2/
- Loading branch information
Showing
8 changed files
with
156 additions
and
129 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,30 @@ | ||
# Find O2 | ||
# ~~~~~~~~~ | ||
# Copyright (c) 2016, Monsanto Company, USA | ||
# Author: Larry Shaffer, <lshaffer (at) boundlessgeo (dot) com> | ||
# FindO2.cmake - Find the O2 library using pkg-config | ||
# | ||
# Redistribution and use is allowed according to the terms of the BSD license. | ||
# For details see the accompanying COPYING-CMAKE-SCRIPTS file. | ||
# | ||
# CMake module to search for O2 OAuth 1/2 library from: | ||
# https://github.com/pipacs/o2 | ||
# | ||
# If it's found it sets O2_FOUND to TRUE | ||
# and following variables are set: | ||
# O2_INCLUDE_DIR | ||
# O2_LIBRARY | ||
# O2_LIBRARY_STATIC | ||
|
||
IF (O2_INCLUDE_DIR AND (O2_LIBRARY OR O2_LIBRARY_STATIC)) | ||
SET(O2_FOUND TRUE) | ||
# This module defines: | ||
# - `O2_FOUND` - Set to TRUE if the library is found. | ||
# - `O2_INCLUDE_DIRS` - Include directories for the library. | ||
# - `O2_LIBRARIES` - Libraries to link against. | ||
# - The alias target `o2::o2` if the library is found. | ||
|
||
ELSE (O2_INCLUDE_DIR AND (O2_LIBRARY OR O2_LIBRARY_STATIC)) | ||
find_package(PkgConfig REQUIRED) | ||
|
||
FIND_PATH(O2_INCLUDE_DIR o2.h | ||
PATHS | ||
/usr/include | ||
/usr/local/include | ||
"$ENV{LIB_DIR}/include" | ||
$ENV{INCLUDE} | ||
PATH_SUFFIXES o2 | ||
) | ||
FIND_LIBRARY(O2_LIBRARY NAMES o2 | ||
PATHS | ||
/usr/local/lib | ||
/usr/lib | ||
"$ENV{LIB_DIR}/lib" | ||
"$ENV{LIB}" | ||
) | ||
FIND_LIBRARY(O2_LIBRARY_STATIC NAMES libo2.a libo2_static.a o2_static | ||
PATHS | ||
/usr/local/lib | ||
/usr/lib | ||
"$ENV{LIB_DIR}/lib" | ||
"$ENV{LIB}" | ||
) | ||
pkg_search_module(PC_O2 IMPORTED_TARGET o2) | ||
|
||
include(FindPackageHandleStandardArgs) | ||
find_package_handle_standard_args(O2 DEFAULT_MSG O2_LIBRARY O2_INCLUDE_DIR) | ||
if (PC_O2_FOUND) | ||
set(O2_FOUND TRUE) | ||
set(O2_INCLUDE_DIRS ${PC_O2_INCLUDE_DIRS}) | ||
set(O2_LIBRARIES ${PC_O2_LIBRARIES}) | ||
|
||
ENDIF (O2_INCLUDE_DIR AND (O2_LIBRARY OR O2_LIBRARY_STATIC)) | ||
add_library(o2::o2 ALIAS PkgConfig::PC_O2) | ||
else() | ||
set(O2_FOUND FALSE) | ||
if (NOT O2_FIND_QUIETLY) | ||
message(WARNING "O2 library not found via pkg-config.") | ||
endif() | ||
if (O2_FIND_REQUIRED) | ||
message(FATAL_ERROR "O2 library is required but was not found.") | ||
endif() | ||
endif() | ||
|
||
IF (O2_FOUND) | ||
IF (NOT O2_FIND_QUIETLY) | ||
MESSAGE(STATUS "Found O2: ${O2_LIBRARY} ${O2_LIBRARY_STATIC}") | ||
ENDIF (NOT O2_FIND_QUIETLY) | ||
ELSE (O2_FOUND) | ||
IF (O2_FIND_REQUIRED) | ||
MESSAGE(FATAL_ERROR "Could not find O2") | ||
ENDIF (O2_FIND_REQUIRED) | ||
ENDIF (O2_FOUND) | ||
# Mark results for cache | ||
mark_as_advanced(O2_INCLUDE_DIRS O2_LIBRARIES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO qgis/o2 | ||
REF "v${VERSION}" | ||
SHA512 e0116a8f72e8c98ef4237e36598a8f246319a30bb5bfab629e3220e7b819b1e9028c2e6caa4c92f17c4b0548c94c242120c5b4750abce2441a2db5d88b2e22f5 | ||
HEAD_REF master | ||
) | ||
|
||
vcpkg_cmake_configure( | ||
DISABLE_PARALLEL_CONFIGURE | ||
SOURCE_PATH ${SOURCE_PATH} | ||
OPTIONS | ||
-Do2_WITH_QT6=ON | ||
-Do2_WITH_KEYCHAIN=ON | ||
) | ||
vcpkg_cmake_install() | ||
vcpkg_fixup_pkgconfig() | ||
|
||
vcpkg_copy_pdbs() | ||
|
||
# Handle copyright | ||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "o2", | ||
"version": "1", | ||
"description": "OAuth 2.0 for Qt", | ||
"homepage": "https://github.com/qgis/o2", | ||
"license": "BSD-2-Clause", | ||
"dependencies": [ | ||
"qtkeychain-qt6", | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
] | ||
} |
Oops, something went wrong.