我是CMake的新手。我想用OpenCV lib编译我的代码的共享库。这是我的CMakeLists文件
cmake_minimum_required(VERSION 3.7)
project(FM)
set(CMAKE_CXX_STANDARD 14)
find_package(OpenCV REQUIRED)
set(HEADER_FILES
FeatureExtract2.h
FeatureCompare2.h
Matching.h
Helper.h
)
set(SOURCE_FILES
FeatureExtract2.cpp
FeatureCompare2.cpp
Matching.cpp
)
add_library(FM SHARED ${HEADER_FILES} ${SOURCE_FILES})
target_link_libraries(FM OpenCV_LIBS})
这是CMake错误:
(target_link_libraries):
Cannot specify link libraries for target "FM" which is not built by this project.
我在这做错了什么?非常感谢!