From 2e87390656dbc66309501dbaf6fcd7521234ef37 Mon Sep 17 00:00:00 2001 From: serg06 Date: Sun, 24 May 2020 18:08:57 -0400 Subject: [PATCH] Initialize some CMake variables as empty before build This prevents a bug that occurs when a parent has a `sources` variable when doing `add_subdirectory("libzmq")`. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0fee2532..56059582 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,6 +31,12 @@ include(ZMQSupportMacros) find_package(PkgConfig) +# Set lists to empty beforehand as to not accidentally take values from parent +set(sources) +set(cxx-sources) +set(html-docs) +set(target_outputs) + option(ENABLE_ASAN "Build with address sanitizer" OFF) if(ENABLE_ASAN) message(STATUS "Instrumenting with Address Sanitizer")