Skip to content
Permalink
Browse files

Merge pull request #2145 from rcurtin/stb-cmake-fix

Safer adding of stb/ suffix to include directory.
  • Loading branch information
rcurtin committed Jan 14, 2020
2 parents 7f520f0 + e33468b commit 9d8a4a71194f214804877a1028e4f1693d506c16
Showing with 12 additions and 1 deletion.
  1. +10 −1 CMake/FindStbImage.cmake
  2. +2 −0 HISTORY.md
@@ -14,7 +14,6 @@ find_path(STB_IMAGE_INCLUDE_DIR

if(STB_IMAGE_INCLUDE_DIR)
set(STB_IMAGE_FOUND YES)
set(STB_IMAGE_INCLUDE_DIR "${STB_IMAGE_INCLUDE_DIR}/stb/")
else ()
find_path(STB_IMAGE_INCLUDE_DIR
NAMES stb_image.h stb_image_write.h
@@ -25,6 +24,16 @@ else ()
endif ()
endif ()

# Make sure that stb/ is the last part of the include directory, if it was
# found.
if (STB_IMAGE_INCLUDE_DIR)
string(REGEX MATCH ".*stb[/]?" STB_INCLUDE_HAS_TRAILING_STB
"${STB_IMAGE_INCLUDE_DIR}")
if (NOT STB_INCLUDE_HAS_TRAILING_STB)
set(STB_IMAGE_INCLUDE_DIR "${STB_IMAGE_INCLUDE_DIR}/stb/")
endif ()
endif ()

# Checks 'REQUIRED'.
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(STB_IMAGE
@@ -21,6 +21,8 @@
`BUILD_JULIA_BINDINGS=(ON/OFF)` and `JULIA_EXECUTABLE=/path/to/julia` CMake
parameters.

* CMake fix for finding STB include directory (#2145).

### mlpack 3.2.2
###### 2019-11-26
* Add `valid` and `same` padding option in `Convolution` and `Atrous

0 comments on commit 9d8a4a7

Please sign in to comment.
You can’t perform that action at this time.