CMake AUTOMOC: CMake 3.9 starts to complain about strongly connected components in auto-generated autogen targets
CMake 3.9 starts to fail with projects using static libraries depending on each other.
cmake-3.9-strongly-connected-targets.tar.gz
With CMake < 3.9:
% cmake --version
cmake version 3.7.2
CMake suite maintained and supported by Kitware (kitware.com/cmake).
% cmake ..
-- The C compiler identification is Clang 5.0.1
-- The CXX compiler identification is Clang 5.0.1
-- Check for working C compiler: /usr/lib/ccache/cc
-- Check for working C compiler: /usr/lib/ccache/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/lib/ccache/c++
-- Check for working CXX compiler: /usr/lib/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: /home/kfunk/tmp/cmake-3.9-strongly-connected-targets/build
With CMake 3.9.0 (or 3.9.4, or current master branch):
% ~/opt/cmake-master/bin/cmake --version
cmake version 3.10.20171024-g48c713
CMake suite maintained and supported by Kitware (kitware.com/cmake).
% ~/opt/cmake-master/bin/cmake ..
-- The C compiler identification is Clang 5.0.1
-- The CXX compiler identification is Clang 5.0.1
-- Check for working C compiler: /usr/lib/ccache/cc
-- Check for working C compiler: /usr/lib/ccache/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/lib/ccache/c++
-- Check for working CXX compiler: /usr/lib/ccache/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
"b" of type STATIC_LIBRARY
depends on "a" (weak)
depends on "b_autogen" (strong)
"a" of type STATIC_LIBRARY
depends on "b" (weak)
depends on "a_autogen" (strong)
"b_autogen" of type UTILITY
depends on "a" (strong)
"a_autogen" of type UTILITY
depends on "b" (strong)
At least one of these targets is not a STATIC_LIBRARY. Cyclic dependencies are allowed only among static libraries.
-- Build files have been written to: /home/kfunk/tmp/cmake-3.9-strongly-connected-targets/build
Edited by Kevin Funk