Merge pull request #3582 from vtavernier/port/soil

[soil] Added port for SOIL
This commit is contained in:
Alexander Karatarakis 2018-05-25 17:18:57 -07:00 committed by GitHub
commit c7903141b3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 112 additions and 0 deletions

50
ports/soil/CMakeLists.txt Normal file
View File

@ -0,0 +1,50 @@
cmake_minimum_required(VERSION 3.8)
project(SOIL C)
option(INSTALL_HEADERS "Install header files" ON)
set(INSTALL_CMAKE_DIR share/soil)
add_library(SOIL STATIC
src/image_helper.c
src/stb_image_aug.c
src/image_DXT.c
src/SOIL.c)
target_include_directories(SOIL INTERFACE $<INSTALL_INTERFACE:include>)
if(INSTALL_HEADERS)
install(TARGETS SOIL
EXPORT SOILTargets
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
install(FILES src/SOIL.h
DESTINATION include/SOIL/)
# Prepare and install package files
set(SOIL_VERSION "2018.7.7")
export(TARGETS SOIL FILE "${PROJECT_BINARY_DIR}/SOILTargets.cmake")
export(PACKAGE SOIL)
# Create the SOILConfig.cmake and SOILConfigVersion files
configure_file(SOILConfig.cmake.in "${PROJECT_BINARY_DIR}/SOILConfig.cmake" @ONLY)
configure_file(SOILConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/SOILConfigVersion.cmake" @ONLY)
# Install the SOILConfig.cmake and SOILConfigVersion.cmake
install(FILES
"${PROJECT_BINARY_DIR}/SOILConfig.cmake"
"${PROJECT_BINARY_DIR}/SOILConfigVersion.cmake"
DESTINATION "${INSTALL_CMAKE_DIR}")
# Install the export set for use with the install-tree
install(EXPORT SOILTargets DESTINATION
"${INSTALL_CMAKE_DIR}")
else()
install(TARGETS SOIL
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)
endif()

3
ports/soil/CONTROL Normal file
View File

@ -0,0 +1,3 @@
Source: soil
Version: 2008.07.07-1
Description: Simple OpenGL Image Library

6
ports/soil/LICENSE Normal file
View File

@ -0,0 +1,6 @@
https://www.lonesock.net/soil.html
Simple OpenGL Image Library
License:
Public Domain

View File

@ -0,0 +1,13 @@
# - Config file for the SOIL package
# It defines the following variables
# SOIL_INCLUDE_DIRS - include directories for SOIL
# SOIL_LIBRARIES - libraries to link against
# Load targets
get_filename_component(SOIL_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
include("${SOIL_CMAKE_DIR}/SOILTargets.cmake")
# Set properties
get_target_property(SOIL_INCLUDE_DIRS SOIL INTERFACE_INCLUDE_DIRECTORIES)
set(SOIL_LIBRARIES SOIL)
mark_as_advanced(SOIL_INCLUDE_DIRS SOIL_LIBRARIES)

View File

@ -0,0 +1,11 @@
set(PACKAGE_VERSION "@SOIL_VERSION@")
# Check whether the requested PACKAGE_FIND_VERSION is compatible
if("${PACKAGE_VERSION}" VERSION_LESS "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_COMPATIBLE FALSE)
else()
set(PACKAGE_VERSION_COMPATIBLE TRUE)
if ("${PACKAGE_VERSION}" VERSION_EQUAL "${PACKAGE_FIND_VERSION}")
set(PACKAGE_VERSION_EXACT TRUE)
endif()
endif()

29
ports/soil/portfile.cmake Normal file
View File

@ -0,0 +1,29 @@
include(vcpkg_common_functions)
set(SOURCE_PATH "${CURRENT_BUILDTREES_DIR}/src/Simple OpenGL Image Library")
vcpkg_download_distfile(ARCHIVE
URLS "http://www.lonesock.net/files/soil.zip"
FILENAME "soil-2008.07.07.zip"
SHA512 a575a84aa65b7556320779d635561341f5cf156418d0462473e5d1eb082829be3bcb30600b4887af75aeddd3715de16bdb3ca1668ebaa93eea62bacf22b79548
)
vcpkg_extract_source_archive(${ARCHIVE})
file(COPY
${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt
${CMAKE_CURRENT_LIST_DIR}/SOILConfig.cmake.in
${CMAKE_CURRENT_LIST_DIR}/SOILConfigVersion.cmake.in
${CMAKE_CURRENT_LIST_DIR}/LICENSE
DESTINATION ${SOURCE_PATH}
)
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS_DEBUG -DINSTALL_HEADERS=OFF
)
vcpkg_install_cmake()
# Handle copyright
file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/soil RENAME copyright)