aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob <jacob11163@gmail.com>2019-03-06 11:32:25 -0800
committerVictor Romero <romerosanchezv@gmail.com>2019-03-06 11:32:25 -0800
commitf6f2def009f6a77874164b519d53aa944069f280 (patch)
treefd43f875bc3308084dcc3a1e85dc77bf7e356e67
parent8e65c100584d08c1d1416099045545b9f8a86a87 (diff)
downloadvcpkg-f6f2def009f6a77874164b519d53aa944069f280.tar.gz
vcpkg-f6f2def009f6a77874164b519d53aa944069f280.zip
[soil2] Add new package soil2 (#5554)
-rw-r--r--ports/soil2/CMakeLists.txt90
-rw-r--r--ports/soil2/CONTROL3
-rw-r--r--ports/soil2/LICENSE7
-rw-r--r--ports/soil2/portfile.cmake33
-rw-r--r--ports/soil2/soil2Config.cmake.in13
-rw-r--r--ports/soil2/soil2ConfigVersion.cmake.in11
6 files changed, 157 insertions, 0 deletions
diff --git a/ports/soil2/CMakeLists.txt b/ports/soil2/CMakeLists.txt
new file mode 100644
index 000000000..6b5368e47
--- /dev/null
+++ b/ports/soil2/CMakeLists.txt
@@ -0,0 +1,90 @@
+cmake_minimum_required(VERSION 3.9)
+
+# Create the soil2 project
+project("soil2" LANGUAGES C)
+
+find_package(OpenGL)
+
+# Do we want to install the headers?
+option(INSTALL_HEADERS "Install header files" ON)
+
+# Set the install dir
+set(INSTALL_CMAKE_DIR share/soil2)
+
+# Set the source files to compile
+set(SOIL2_SRC
+ src/SOIL2/etc1_utils.c
+ src/SOIL2/image_DXT.c
+ src/SOIL2/image_helper.c
+ src/SOIL2/SOIL2.c
+)
+
+# Set the soil2 headers
+set(SOIL2_HEADERS
+ src/SOIL2/SOIL2.h
+ src/SOIL2/etc1_utils.h
+ src/SOIL2/image_DXT.h
+ src/SOIL2/image_helper.h
+ src/SOIL2/jo_jpeg.h
+ src/SOIL2/pkm_helper.h
+ src/SOIL2/pvr_helper.h
+ src/SOIL2/stb_image.h
+ src/SOIL2/stb_image_write.h
+ src/SOIL2/stbi_DDS.h
+ src/SOIL2/stbi_ext.h
+ src/SOIL2/stbi_pkm.h
+ src/SOIL2/stbi_pvr.h
+)
+
+# Add the library as a static linkage
+add_library(soil2 STATIC ${SOIL2_SRC})
+
+# The include dir
+target_include_directories(soil2 INTERFACE $<INSTALL_INTERFACE:include>)
+
+# link opengl32
+target_link_libraries(soil2 PRIVATE ${OPENGL_gl_LIBRARY})
+
+# If its msvc mute the secure warnings
+if(MSVC)
+ target_compile_definitions(soil2 PRIVATE _CRT_SECURE_NO_WARNINGS)
+endif(MSVC)
+
+if(INSTALL_HEADERS)
+ # Install the library object
+ install(TARGETS soil2 EXPORT soil2Targets
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ )
+
+ # Install the headers
+ install(FILES ${SOIL2_HEADERS}
+ DESTINATION include/SOIL2/)
+
+ # Prepare for install package files
+ set(SOIL2_VERSION "release-1.11")
+
+ # Export the stuff
+ export(TARGETS soil2 FILE "${PROJECT_BINARY_DIR}/soil2Targets.cmake")
+ export(PACKAGE soil2)
+
+ # Create the soil2Config.cmake and soil2ConfigVersion.cmake
+ configure_file(soil2Config.cmake.in "${PROJECT_BINARY_DIR}/soil2Config.cmake" @ONLY)
+ configure_file(soil2ConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/soil2ConfigVersion.cmake" @ONLY)
+
+ # Install the soil2Config.cmake and soil2ConfigVersion.cmake
+ install(FILES
+ "${PROJECT_BINARY_DIR}/soil2Config.cmake"
+ "${PROJECT_BINARY_DIR}/soil2ConfigVersion.cmake"
+ DESTINATION "${INSTALL_CMAKE_DIR}"
+ )
+
+ # Install the export set for use with the install-tree
+ install(EXPORT soil2Targets DESTINATION "${INSTALL_CMAKE_DIR}")
+else(INSTALL_HEADERS)
+ # Install the library object
+ install(TARGETS soil2 EXPORT soil2
+ ARCHIVE DESTINATION lib
+ LIBRARY DESTINATION lib
+ )
+endif(INSTALL_HEADERS)
diff --git a/ports/soil2/CONTROL b/ports/soil2/CONTROL
new file mode 100644
index 000000000..c53cb77a5
--- /dev/null
+++ b/ports/soil2/CONTROL
@@ -0,0 +1,3 @@
+Source: soil2
+Version: release-1.11
+Description: Simple OpenGL Image Library 2 \ No newline at end of file
diff --git a/ports/soil2/LICENSE b/ports/soil2/LICENSE
new file mode 100644
index 000000000..02c410675
--- /dev/null
+++ b/ports/soil2/LICENSE
@@ -0,0 +1,7 @@
+Copyright 2018 Matrin Lucas Golini
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file
diff --git a/ports/soil2/portfile.cmake b/ports/soil2/portfile.cmake
new file mode 100644
index 000000000..d54dcd7fc
--- /dev/null
+++ b/ports/soil2/portfile.cmake
@@ -0,0 +1,33 @@
+include(vcpkg_common_functions)
+
+# Download the release-1.11 from bitbucket
+vcpkg_from_bitbucket(
+ OUT_SOURCE_PATH SOURCE_PATH
+ REPO SpartanJ/soil2
+ REF release-1.11
+ SHA512 203c2306fd72e24b9e990cb054f3b1b0391eaf26ed645842fb381971673dab8ea20c2739c8dff1fc11c83d6f66add0ad77ae79d8ff68930e3e1cb003e34f2414
+ HEAD_REF master
+)
+
+# Copy the CMakeLists and LICENSE
+file(
+ COPY
+ ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt
+ ${CMAKE_CURRENT_LIST_DIR}/LICENSE
+ ${CMAKE_CURRENT_LIST_DIR}/soil2Config.cmake.in
+ ${CMAKE_CURRENT_LIST_DIR}/soil2ConfigVersion.cmake.in
+ DESTINATION ${SOURCE_PATH}
+)
+
+# Configure the cmake file (we imported)
+vcpkg_configure_cmake(
+ SOURCE_PATH ${SOURCE_PATH}
+ PREFER_NINJA
+ OPTIONS_DEBUG -DINSTALL_HEADERS=OFF
+)
+
+# Run the install
+vcpkg_install_cmake()
+
+# Handle copyright
+file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION ${CURRENT_PACKAGES_DIR}/share/soil2 RENAME copyright)
diff --git a/ports/soil2/soil2Config.cmake.in b/ports/soil2/soil2Config.cmake.in
new file mode 100644
index 000000000..4d9d8b4ca
--- /dev/null
+++ b/ports/soil2/soil2Config.cmake.in
@@ -0,0 +1,13 @@
+# - Config file for the soil2 package
+# It defines the following variables
+# SOIL2_INCLUDE_DIRS - include directories for SOIL2
+# SOIL2_LIBRARIES - libraries to link against
+
+# Load targets
+get_filename_component(SOIL2_CMAKE_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
+include("${SOIL2_CMAKE_DIR}/soil2Targets.cmake")
+
+# Set properties
+get_target_property(SOIL2_INCLUDE_DIRS soil2 INTERFACE_INCLUDE_DIRECTORIES)
+set(SOIL2_LIBRARIES soil2)
+mark_as_advanced(SOIL2_INCLUDE_DIRS SOIL2_LIBRARIES)
diff --git a/ports/soil2/soil2ConfigVersion.cmake.in b/ports/soil2/soil2ConfigVersion.cmake.in
new file mode 100644
index 000000000..a6ae96f32
--- /dev/null
+++ b/ports/soil2/soil2ConfigVersion.cmake.in
@@ -0,0 +1,11 @@
+set(PACKAGE_VERSION "@SOIL2_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()