0
我在/ usr/lib文件夾中有一個libmosquittopp.so。 mosquittopp.h位於/ usr/include文件夾內。鏈接到cmake中的.so庫
我喜歡鏈接到我的項目到那個庫。
所以我的CMakeLists.txt文件
cmake_minimum_required(VERSION 2.6)
PROJECT(MosquittoTest)
# The version number.
set (VERSION_MAJOR 1)
set (VERSION_MINOR 0)
include_directories("${PROJECT_BINARY_DIR}")
# Linked libariries
#For MQTT
#location of raspicam's cmake file is /usr/src/raspicam-0.1.3/build
link_directories(/usr/lib)
target_link_libraries (MosquittoTest mosquittopp)
ADD_EXECUTABLE(MosquittoTest MosquittoTest.cpp)
# add the install targets
install (TARGETS MosquittoTest DESTINATION bin)
install (FILES MosquittoInterface.h DESTINATION include)
但是,當我在ccmake GUI配置,我有錯誤的
Cannot specify link ibraries for target MosquittoTest which is not built by this project.
什麼是錯我的cmake?