Skip to content

Commit 6eba239

Browse files
jibseneustas
authored andcommitted
Fix auto detect of bundled mode (#704)
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.
1 parent 2216a0d commit 6eba239

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ project(brotli C)
1111
# we'll use the BROTLI_BUNDLED_MODE variable to let them do that; just
1212
# set it to OFF in your project before you add_subdirectory(brotli).
1313
get_directory_property(BROTLI_PARENT_DIRECTORY PARENT_DIRECTORY)
14-
if(BROTLI_BUNDLED_MODE STREQUAL "")
14+
if(NOT DEFINED BROTLI_BUNDLED_MODE)
1515
# Bundled mode hasn't been set one way or the other, set the default
1616
# depending on whether or not we are the top-level project.
1717
if(BROTLI_PARENT_DIRECTORY)
18-
set(BROTLI_BUNDLED_MODE OFF)
19-
else()
2018
set(BROTLI_BUNDLED_MODE ON)
19+
else()
20+
set(BROTLI_BUNDLED_MODE OFF)
2121
endif()
2222
endif()
2323
mark_as_advanced(BROTLI_BUNDLED_MODE)

0 commit comments

Comments
 (0)