Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15-SP3:Update
python-pivy
0001-Allow-using-SoQt-snapshots-with-stable-Coi...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0001-Allow-using-SoQt-snapshots-with-stable-Coin-version.patch of Package python-pivy
From 57acc4ac6b621fb4985e22bb505f0069858352f1 Mon Sep 17 00:00:00 2001 From: Christophe Giboudeaux <christophe@krop.fr> Date: Mon, 13 May 2019 12:13:06 +0200 Subject: [PATCH] Allow using SoQt snapshots with stable Coin version. The current SoQt snapshots use CMake config files while the Coin version currently available doesn't. In order to use CMake to find path, we'll use a FindCoin.cmake module. --- CMakeLists.txt | 15 +++++---- FindCoin.cmake | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 6 deletions(-) create mode 100644 FindCoin.cmake Index: b/CMakeLists.txt =================================================================== --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,17 +1,19 @@ project(pivy_cmake_setup NONE) +# libraries cannot be found if the project is 'NONE') +project(pivy_cmake_setup) cmake_minimum_required(VERSION 3.5) +set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}) +find_package(Coin MODULE REQUIRED) -find_package(Coin CONFIG REQUIRED) - -if (Coin_INCLUDE_DIR) +if (Coin_INCLUDE_DIRS) MESSAGE(STATUS "COIN_FOUND: true") else() MESSAGE(STATUS "COIN_FOUND: false") endif() -MESSAGE(STATUS "COIN_INCLUDE_DIR: ${Coin_INCLUDE_DIR}") -MESSAGE(STATUS "COIN_LIB_DIR: ${Coin_LIB_DIR}") +MESSAGE(STATUS "COIN_INCLUDE_DIR: ${Coin_INCLUDE_DIRS}") +MESSAGE(STATUS "COIN_LIB_DIR: ${PC_Coin_LIBDIR}") MESSAGE(STATUS "COIN_VERSION: ${Coin_VERSION}") @@ -23,6 +25,8 @@ if (SoQt_INCLUDE_DIRS) else() MESSAGE(STATUS "SOQT_FOUND: false") endif() +# python is confused if the include directories contain more than one path +list(REMOVE_DUPLICATES SoQt_INCLUDE_DIRS) MESSAGE(STATUS "SOQT_INCLUDE_DIR: ${SoQt_INCLUDE_DIRS}") MESSAGE(STATUS "SOQT_LIB_DIR: ${SoQt_LIBRARY_DIRS}") Index: b/FindCoin.cmake =================================================================== --- /dev/null +++ b/FindCoin.cmake @@ -0,0 +1,88 @@ +#.rst: +# FindCoin +# --------- +# +# Try to find the Coin library. +# This module is temporary and only meant to find older Coin versions when using +# GIT snapshots for SoQt. +# +# This will define the following variables: +# +# ``Coin_FOUND`` +# Coin was found. +# +# ``Coin_VERSION`` +# The version of Coin. +# +# ``Coin_INCLUDE_DIRS`` +# This should be passed to target_include_directories() if +# the target is not used for linking. +# +# ``Coin_LIBRARIES`` +# The Coin library. +# This can be passed to target_link_libraries() instead of +# the ``Coin::Coin`` target +# +# If ``Coin_FOUND`` is TRUE, the following imported target +# will be available: +# +# ``Coin::Coin`` +# The Coin library +# +#============================================================================= +# Copyright 2019 Christophe Giboudeaux <christophe@krop.fr> +# +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# +# 1. Redistributions of source code must retain the copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. The name of the author may not be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +#============================================================================= +find_package(PkgConfig QUIET) +pkg_check_modules(PC_Coin Coin) + +find_path(Coin_INCLUDE_DIRS + NAMES Inventor/So.h + HINTS ${PC_Coin_INCLUDEDIR} +) + +find_library(Coin_LIBRARIES + NAMES Coin + HINTS ${PC_Coin_LIBDIR} +) + +set(Coin_VERSION "${PC_Coin_VERSION}") + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args(Coin + FOUND_VAR Coin_FOUND + REQUIRED_VARS Coin_LIBRARIES Coin_INCLUDE_DIRS + VERSION_VAR Coin_VERSION +) +if(Coin_FOUND AND NOT TARGET Coin::Coin) + add_library(Coin::Coin UNKNOWN IMPORTED) + set_target_properties(Coin::Coin PROPERTIES + IMPORTED_LOCATION "${Coin_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${Coin_INCLUDE_DIRS}") +endif() + +mark_as_advanced(Coin_LIBRARIES Coin_INCLUDE_DIRS Coin_VERSION)
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor