From f6327b82948cd259559aadf6ffcc2c9187fae152 Mon Sep 17 00:00:00 2001 From: Alexey Sokolov Date: Sat, 23 Nov 2019 10:12:06 +0000 Subject: [PATCH] Fix in-source cmake build. When doing sequence "cmake .; make; cmake ." the second cmake failed because targets translation_foo and po_foo were defined twice (where foo is some module). One of those targets came from foo.cpp, but another one from foo.so, because we use GLOB to gather list of modules. --- modules/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 34ed05d7..8f0c12dd 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -90,8 +90,6 @@ foreach(modpath ${all_modules}) continue() endif() - list(APPEND actual_modules "${modpath}") - set(modenabled true) if(moddisable_${mod}) @@ -109,14 +107,16 @@ foreach(modpath ${all_modules}) if(modenabled) if(modtype STREQUAL "cpp") add_cxx_module("${mod}" "${modpath}") - endif() - if(modtype STREQUAL "pm") + elseif(modtype STREQUAL "pm") add_perl_module("${mod}" "${modpath}") - endif() - if(modtype STREQUAL "py") + elseif(modtype STREQUAL "py") add_python_module("${mod}" "${modpath}") + else() + continue() endif() endif() + + list(APPEND actual_modules "${modpath}") endforeach() if(HAVE_I18N)