【发布时间】:2016-10-13 15:50:33
【问题描述】:
我正在尝试使用带有 cmake 和 gcc 5.4 的 activemq-cpp 编译代码
find_path(ACTIVEMQCPP_DIR NAMES cms/Config.h HINTS $ENV{ACTIVEMQDIR})
这里ACTIVEMQDIR是一个环境变量设置为
/usr/local/include/activemq-cpp-3.10.0
message(STATUS ACTIVEMQCPP_DIR=${ACTIVEMQCPP_DIR})
include_directories(${ACTIVEMQCPP_DIR})
//include_directories(/usr/local/include/activemq-cpp-3.10.0) 如果我明确地硬编码路径,那么没关系...
cmake 的输出:
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/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/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- 1=/usr/local/include/activemq-cpp-3.10.0
-- 2=/usr/local/lib
-- 3=/usr/local/include/activemq-cpp-3.10.0
-- 4=/usr/local/lib/libactivemq-cpp.so
-- Configuring done
-- Generating done
-- Build files have been written to
-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/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/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
ACTIVEMQCPP_DIR=/usr/local/include/activemq-cpp-3.10.0
-- Configuring done
-- Generating done
-- Build files have been written to: /home/oem/ClionProjects/untitled/b2
问题是include_directories(${ACTIVEMQCPP_DIR}) 不起作用。变量ACTIVEMQCPP_DIR 未设置
【问题讨论】:
-
注释
ACTIVEMQCPP_DIR=行是什么,用LARGE粗体字体显示? CMake输出的第二部分(缩进)是什么意思?它与第一部分非常相似(未缩进)。请修复问题帖子的内容和格式。目前很难理解。