Skip to content

Commit

Permalink
Fix auto detect of bundled mode (#704)
Browse files Browse the repository at this point in the history
Set bundled mode to ON when parent directory is not empty. Due to the
peculiarities of CMake if, comparing an undefined variable to the empty
string is false, so this likely never triggered.
  • Loading branch information
jibsen authored and eustas committed Sep 13, 2018
1 parent 2216a0d commit 6eba239
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Expand Up @@ -11,13 +11,13 @@ project(brotli C)
# we'll use the BROTLI_BUNDLED_MODE variable to let them do that; just
# set it to OFF in your project before you add_subdirectory(brotli).
get_directory_property(BROTLI_PARENT_DIRECTORY PARENT_DIRECTORY)
if(BROTLI_BUNDLED_MODE STREQUAL "")
if(NOT DEFINED BROTLI_BUNDLED_MODE)
# Bundled mode hasn't been set one way or the other, set the default
# depending on whether or not we are the top-level project.
if(BROTLI_PARENT_DIRECTORY)
set(BROTLI_BUNDLED_MODE OFF)
else()
set(BROTLI_BUNDLED_MODE ON)
else()
set(BROTLI_BUNDLED_MODE OFF)
endif()
endif()
mark_as_advanced(BROTLI_BUNDLED_MODE)
Expand Down

0 comments on commit 6eba239

Please sign in to comment.