Cmake 在非根服务器上构建spectrum2

Cmake 在非根服务器上构建spectrum2,cmake,makefile,xmpp,log4cxx,Cmake,Makefile,Xmpp,Log4cxx,正如主题所说,我在非根服务器上安装spectrum2时遇到问题。主要的问题是,我必须从源代码构建很多依赖项,并将它们正确链接。我已经在/home/$USER/log4cxx_build/apache-log4cxx-0.10.0中安装了log4cxx及其依赖项。尝试cd-libtransport和make时,我得到以下结果: $USER@puppis libtransport]$ make [ 1%] Built target pb [ 1%] Building CXX object plu

正如主题所说,我在非根服务器上安装spectrum2时遇到问题。主要的问题是,我必须从源代码构建很多依赖项,并将它们正确链接。我已经在
/home/$USER/log4cxx_build/apache-log4cxx-0.10.0
中安装了log4cxx及其依赖项。尝试
cd-libtransport
make
时,我得到以下结果:

$USER@puppis libtransport]$ make
[  1%] Built target pb
[  1%] Building CXX object plugin/cpp/CMakeFiles/transport-plugin.dir/networkplugin.cpp.o
In Datei, eingefügt von /home/$USER/libtransport/plugin/cpp/networkplugin.cpp:23:
/home/$USER/libtransport/include/transport/Logging.h:30:28: Fehler: log4cxx/logger.h: Datei oder Verzeichnis nicht gefunden
/home/$USER/libtransport/include/transport/Logging.h:31:37: Fehler: log4cxx/consoleappender.h: Datei oder Verzeichnis nicht gefunden
/home/$USER/libtransport/include/transport/Logging.h:32:35: Fehler: log4cxx/patternlayout.h: Datei oder Verzeichnis nicht gefunden
/home/$USER/libtransport/include/transport/Logging.h:33:42: Fehler: log4cxx/propertyconfigurator.h: Datei oder Verzeichnis nicht gefunden
/home/$USER/libtransport/include/transport/Logging.h:34:40: Fehler: log4cxx/helpers/properties.h: Datei oder Verzeichnis nicht gefunden
/home/$USER/libtransport/include/transport/Logging.h:35:45: Fehler: log4cxx/helpers/fileinputstream.h: Datei oder Verzeichnis nicht gefunden
/home/$USER/libtransport/include/transport/Logging.h:36:40: Fehler: log4cxx/helpers/transcoder.h: Datei oder Verzeichnis nicht gefunden
/home/$USER/libtransport/include/transport/Logging.h:38:32: Fehler: log4cxx/logmanager.h: Datei oder Verzeichnis nicht gefunden
In file included from /home/$USER/libtransport/plugin/cpp/networkplugin.cpp:23:
/home/$USER/libtransport/include/transport/Logging.h:42: Fehler: »log4cxx« is not a namespace-name
/home/$USER/libtransport/include/transport/Logging.h:42: Fehler: expected namespace-name before »;« token
/home/$USER/libtransport/plugin/cpp/networkplugin.cpp:38: Fehler: »log4cxx« has not been declared
/home/$USER/libtransport/plugin/cpp/networkplugin.cpp:38: Fehler: expected initializer before »logger«
/home/$USER/libtransport/plugin/cpp/networkplugin.cpp: In member function »void Transport::NetworkPlugin::checkPing()«:
/home/$USER/libtransport/plugin/cpp/networkplugin.cpp:679: Fehler: »logger« wurde in diesem Gültigkeitsbereich nicht definiert
/home/$USER/libtransport/plugin/cpp/networkplugin.cpp:679: Fehler: »LOG4CXX_ERROR« wurde in diesem Gültigkeitsbereich nicht definiert
make[2]: *** [plugin/cpp/CMakeFiles/transport-plugin.dir/networkplugin.cpp.o] Fehler 1
make[1]: *** [plugin/cpp/CMakeFiles/transport-plugin.dir/all] Fehler 2
make: *** [all] Fehler 2
在安装过程中似乎找不到log4cxx


感谢您的帮助。提前感谢!:-)

在用户目录中安装log4cxx后,需要重新运行
cmake
并添加搜索标题和库的提示,例如:

cmake-DCMAKE_INCLUDE_PATH=/home/$USER/log4cxx_build/apache-log4cxx-0.10.0/INCLUDE-DCMAKE_LIBRARY_PATH=/home/$USER/log4cxx_build/apache-log4cxx-0.10.0/lib


另外,最好将所有依赖项安装到单个目录中

,谢谢您的回答。如果我这样做的话,我会遇到很多错误,比如
警告:目标“传输”请求链接到目录“/home/$USER/log4cxx_build/apache-log4cxx-0.10.0/”。目标只能链接到库。CMake正在丢弃该物品。
你知道是什么原因吗?我注意到我没有
/home/$USER/log4cxx_build/apache-log4cxx-0.10.0/lib
文件夹。我能找到的唯一库是
/home/$USER/log4cxx_build/apache-log4cxx-0.10.0/src/main/cpp/.libs