Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[stb] update and add cmake module #8527

Merged
merged 2 commits into from
Oct 9, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ports/darknet/CONTROL
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Source: darknet
Version: 0.2.5.1
Version: 0.2.5.1-1
Description: Darknet is an open source neural network framework written in C and CUDA. You only look once (YOLO) is a state-of-the-art, real-time object detection system, best example of darknet functionalities.
Build-Depends: pthreads (windows), stb

Expand All @@ -8,7 +8,7 @@ Build-Depends: cuda
Description: Build darknet with support for CUDA

Feature: cudnn
Build-Depends: darknet[cuda]
Build-Depends: darknet[cuda], cudnn
Description: Build darknet with support for CUDNN

Feature: opencv-base
Expand Down
1 change: 1 addition & 0 deletions ports/darknet/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ endif()
file(REMOVE_RECURSE ${SOURCE_PATH}/3rdparty)
file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindPThreads_windows.cmake)
file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindCUDNN.cmake)
file(REMOVE ${SOURCE_PATH}/cmake/Modules/FindStb.cmake)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
Expand Down
4 changes: 2 additions & 2 deletions ports/stb/CONTROL
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Source: stb
Version: 2019-07-11
Version: 2019-08-17
Homepage: https://github.com/nothings/stb
Description: stb single-file public domain libraries for C/C++
Description: public domain header-only libraries
29 changes: 29 additions & 0 deletions ports/stb/FindStb.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Distributed under the OSI-approved BSD 3-Clause License.

#.rst:
# FindStb
# ------------
#
# Find the Stb include headers.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module defines the following variables:
#
# ``Stb_FOUND``
# True if Stb library found
#
# ``Stb_INCLUDE_DIR``
# Location of Stb headers
#

include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
include(${CMAKE_ROOT}/Modules/SelectLibraryConfigurations.cmake)

if(NOT Stb_INCLUDE_DIR)
find_path(Stb_INCLUDE_DIR NAMES stb_image.h PATHS ${Stb_DIR} PATH_SUFFIXES include)
endif()

find_package_handle_standard_args(Stb DEFAULT_MSG Stb_INCLUDE_DIR)
mark_as_advanced(Stb_INCLUDE_DIR)
15 changes: 6 additions & 9 deletions ports/stb/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
#header-only library
include(vcpkg_common_functions)
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO nothings/stb
REF c72a95d766b8cbf5514e68d3ddbf6437ac9425b1
SHA512 2be9b2d7848fca133d5733ebb0fdd1f357195f38a2f2b471af3657468f00a75cc94f029ace6127e748da80e0f86933c16a554593a21d8a9057b7691d39facf4b
REF 052dce117ed989848a950308bd99eef55525dfb1
SHA512 490be1e727ff77385ce6050c03774ee6819fb194ac38076be98635091ce5271851a9e5ac9763bea961758837735ed6fc680f4fee645acf419457460c403c9f20
HEAD_REF master
)

# Put the licence file where vcpkg expects it
file(COPY ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/stb/README.md)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/stb/README.md ${CURRENT_PACKAGES_DIR}/share/stb/copyright)

# Copy the stb header files
file(GLOB HEADER_FILES ${SOURCE_PATH}/*.h)
file(COPY ${HEADER_FILES} DESTINATION ${CURRENT_PACKAGES_DIR}/include)

file(INSTALL ${SOURCE_PATH}/README.md DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/FindStb.cmake" DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT})
8 changes: 8 additions & 0 deletions ports/stb/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
set(STB_PREV_MODULE_PATH ${CMAKE_MODULE_PATH})
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})

if(NOT Stb_INCLUDE_DIR)
_find_package(${ARGS})
endif()

set(CMAKE_MODULE_PATH ${STB_PREV_MODULE_PATH})