我正在编写一个CMakeLists.txt文件来构建我的C++项目,该项目由
functions.
的各种共享库
问题是,libhybris.so依赖于libpcre (正则表达式功能),所以我有以下语句:
# libhybris.so generation
add_library( libhybris
SHARED
${LIB_SOURCES} )
...
# Needed libraries
target_link_libraries( libhybris
dl
pcre
pthread
readline )
第3点中的一个共享库名为pcre.so,因此我还有以下内容:
add_library( pcre SHARED ${PCRE_SOURCES} )
...
target_link_libraries( pcre
dl
pcre
curl
pthread
readline
ffi
libhybris )
因此,当我运行一个"cmake .“时,我有以下错误:
-- 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依赖项(系统libpcre.so)与我的pcre.so是相同的,而它显然不是。
如何在不更改名称的情况下解决问题?
发布于 2010-06-04 22:27:37
这取决于您的开发环境。您可以设置一个构建路径来克服这些困难。
https://stackoverflow.com/questions/2977989
复制相似问题