I have the following problem.
I am writing a CMakeLists.txt file to create my C ++ project, which consists of
- libhybris.so: a shared library with some exported functions.
- hybris: executable file that references libhybris.so
- A collection of different shared libraries that link to libhybris.so
The problem is that libhybris.so is dependent on libpcre (for regex features), so I have the following statements:
add_library( libhybris
SHARED
${LIB_SOURCES} )
...
target_link_libraries( libhybris
dl
pcre
pthread
readline )
And one of the common libraries from point 3 is called pcre.so, so I also have the following:
add_library( pcre SHARED ${PCRE_SOURCES} )
...
target_link_libraries( pcre
dl
pcre
curl
pthread
readline
ffi
libhybris )
So, when I run "cmake.", I get the following error:
-- Configuring done
CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
"libhybris" of type SHARED_LIBRARY
depends on "pcre"
"pcre" of type SHARED_LIBRARY
depends on "libhybris"
At least one of these targets is not a STATIC_LIBRARY. Cyclic dependencies are allowed only among static libraries.
CMake , libhybris.so pcre (system libpcre.so) - , pcre.so, .
, pcre.so?