Skip to content

Commit

Permalink
allow to force-disable webp from the command line
Browse files Browse the repository at this point in the history
inspired by PR 377 by LebdevRI
  • Loading branch information
boucman committed Feb 19, 2014
1 parent 2f05100 commit 265f55b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
6 changes: 6 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ OPT_EXPERIMENTAL_IOP=-1
OPT_GEO=-1
OPT_LUA=-1
OPT_OPENEXR=-1
OPT_WEBP=-1

# ---------------------------------------------------------------------------
# Parse options
Expand Down Expand Up @@ -71,6 +72,9 @@ parse_feature()
openexr)
OPT_OPENEXR=$value
;;
webp)
OPT_WEBP=$value
;;
*)
echo "warning: unknown feature '$feature'"
;;
Expand Down Expand Up @@ -145,6 +149,7 @@ so that the cmake script autodetects features.
--enable-geo
--enable-lua
--enable-openexr
--enable-webp
Extra:
-h --help Print help message
Expand Down Expand Up @@ -218,6 +223,7 @@ cmake_boolean_option INSTALL_IOP_EXPERIMENTAL $OPT_EXPERIMENTAL_IOP
cmake_boolean_option USE_GEO $OPT_GEO
cmake_boolean_option USE_LUA $OPT_LUA
cmake_boolean_option USE_OPENEXR $OPT_OPENEXR
cmake_boolean_option USE_WEBP $OPT_WEBP

# Some people might need this, but ignore if unset in environment
CMAKE_PREFIX_PATH=${CMAKE_PREFIX_PATH:-}
Expand Down
15 changes: 9 additions & 6 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,15 @@ if(USE_OPENEXR)
endif(OPENEXR_FOUND)
endif(USE_OPENEXR)

find_package(WebP 0.3.0)
if(WEBP_FOUND)
include_directories(${WebP_INCLUDE_DIRS})
list(APPEND LIBS ${WebP_LIBRARIES})
add_definitions(${WebP_DEFINITIONS})
endif(WEBP_FOUND)
if(USE_WEBP)
find_package(WebP 0.3.0)
if(WEBP_FOUND)
include_directories(${WebP_INCLUDE_DIRS})
list(APPEND LIBS ${WebP_LIBRARIES})
add_definitions(${WebP_DEFINITIONS})
endif(WEBP_FOUND)
else(USE_WEBP)
endif(USE_WEBP)

# Find all the libs that don't require extra parameters
foreach(lib ${OUR_LIBS} LensFun GIO GThread GModule Cairo PangoCairo PThread Rsvg2 GDK-PixBuf LibXml2 Sqlite3 Exiv2 CURL PNG JPEG TIFF LCMS2)
Expand Down

0 comments on commit 265f55b

Please sign in to comment.