Commit 575bbcdc authored by Emmanuelle Sarrazin's avatar Emmanuelle Sarrazin

ENH: Add openthreads recipe

parent a14a4135
#
# Copyright (C) 2005-2017 Centre National d'Etudes Spatiales (CNES)
#
# This file is part of Orfeo Toolbox
#
# https://www.orfeo-toolbox.org/
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
if(WIN32)
cmake_minimum_required(VERSION 2.4.6 FATAL_ERROR)
else()
if(APPLE)
cmake_minimum_required(VERSION 2.4.6 FATAL_ERROR)
else()
cmake_minimum_required(VERSION 2.4.0 FATAL_ERROR)
endif()
endif()
project(OpenThreads)
# We have some custom .cmake scripts not in the official distribution.
# Maybe this can be used override existing behavior if needed?
set(CMAKE_MODULE_PATH "${OpenThreads_SOURCE_DIR}/CMakeModules;${CMAKE_MODULE_PATH}")
################################################################################
# Installation stuff
# We want to build SONAMES shared librariess
set(OPENTHREADS_SONAMES TRUE)
#set(CMAKE_DEBUG_POSTFIX "d")
#set(INSTALL_BINDIR OpenThreads/bin)
#set(INSTALL_INCDIR OpenThreads/include)
#set(INSTALL_LIBDIR OpenThreads/lib)
#set(INSTALL_DOCDIR OpenThreads/docs)
#set(CMAKE_DEBUG_POSTFIX "d")
set(LIB_POSTFIX "")
#if(UNIX AND NOT WIN32 AND NOT APPLE)
# if(CMAKE_SIZEOF_VOID_P MATCHES "8")
# set(LIB_POSTFIX "64")
# endif()
#endif()
################################################################################
# Add a source group for the include headers so they are seen in IDEs.
# Hmmm, this isn't working for me in Xcode.
# source_group(
# "Header Files"
# FILES ${OpenThreads_PUBLIC_HEADERS}
# )
# Make the headers visible to everything
include_directories(
${OpenThreads_SOURCE_DIR}/include
)
subdirs(src/OpenThreads)
# FIXME: Make optional install test programs
# FIXME: /bin directory not correct for Windows
# install_targets(/bin OpenThreads)
#set(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin/${CMAKE_SYSTEM_NAME})
# OTB modifications
# Alls bin or lib in OTB bin directory
#set(OUTPUT_BINDIR ${PROJECT_BINARY_DIR}/bin)
set(OUTPUT_BINDIR ${CMAKE_BINARY_DIR}/bin)
make_directory(${OUTPUT_BINDIR})
set(EXECUTABLE_OUTPUT_PATH ${OUTPUT_BINDIR})
#set(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib/${CMAKE_SYSTEM_NAME})
#set(OUTPUT_LIBDIR ${PROJECT_BINARY_DIR}/lib)
set(OUTPUT_LIBDIR ${CMAKE_BINARY_DIR}/lib)
make_directory(${OUTPUT_LIBDIR})
set(LIBRARY_OUTPUT_PATH ${OUTPUT_LIBDIR})
################################################################################
# Create bin and lib directories if required
if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bin ${CMAKE_BINARY_DIR}/lib)
endif()
# This needs to be run very last so other parts of the scripts can take
# advantage of this.
if(NOT OPENTHREADS_CONFIG_HAS_BEEN_RUN_BEFORE)
set(OPENTHREADS_CONFIG_HAS_BEEN_RUN_BEFORE 1 CACHE INTERNAL "Flag to track whether this is the first time running CMake or if CMake has been configured before")
endif()
#!/usr/bin/env bash
set +x
set -e # Abort on error
[[ -d build ]] || mkdir build
cd build
#export CMAKE_LIBRARY_PATH=${BUILD_PREFIX}/lib:${CMAKE_LIBRARY_PATH}
#export CMAKE_LIBRARY_PATH=${BUILD_PREFIX}/${HOST}/sysroot/usr/lib:${CMAKE_LIBRARY_PATH}
#export CMAKE_INCLUDE_PATH=${BUILD_PREFIX}/${HOST}/sysroot/usr/include:${CMAKE_INCLUDE_PATH}
#export CMAKE_INCLUDE_PATH=${BUILD_PREFIX}/${HOST}/include:${CMAKE_INCLUDE_PATH}
#export CMAKE_INCLUDE_PATH=${BUILD_PREFIX}/include:${CMAKE_INCLUDE_PATH}
#export CXXFLAGS="-I${BUILD_PREFIX}/include -I${BUILD_PREFIX}/${HOST}/include/ -I${BUILD_PREFIX}/${HOST}/sysroot/usr/include"
if [[ $target_platform =~ linux.* ]]; then
export LDFLAGS="$LDFLAGS -Wl,-rpath-link,${PREFIX}/lib"
fi
CC=${BUILD_PREFIX}/bin/${HOST}-gcc CXX=$BUILD_PREFIX/bin/${HOST}-g++ \
cmake -G "Ninja" \
-DCMAKE_INSTALL_PREFIX=$PREFIX \
-DBUILD_SHARED_LIBS:BOOL=ON ..
ninja install
{% set version = "3.6.3" %}
package:
name: openscenegraph
version: {{ version }}
source:
- url: https://github.com/openscenegraph/OpenSceneGraph/archive/OpenSceneGraph-{{ version }}.zip
sha256: d8f237e76393e4c749b25321d3735d2c4e5b8c7076f9826213eb0cf8eeca0031
- path: CMakeLists.txt
build:
number: 1000
requirements:
build:
- cmake
- ninja
- {{ compiler('c') }}
- {{ compiler('cxx') }}
#- {{ cdt('mesa-libgl-devel') }} # [linux]
#- {{ cdt('mesa-dri-drivers') }} # [linux]
#- {{ cdt('libx11-devel') }} # [linux]
test:
commands:
- test -f ${PREFIX}/include/OpenThreads/Thread # [unix]
- if not exist %PREFIX%\\Library\\include\\Thread exit 1 # [win]
- conda inspect linkages -p ${PREFIX} OpenThreads # [not win]
- conda inspect objects -p ${PREFIX} OpenThreads # [osx]
about:
home: http://www.openscenegraph.org
license: OpenSceneGraph Public License
license_file: LICENSE.txt
summary: A C++ open-source 3D graphics application programming interface
extra:
recipe-maintainers:
- CNES
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment