CLion无法识别OpenCV库(没有IntelliSense)

时间:2017-03-20 21:19:54

标签: c++ linux opencv cmake clion

我试图在很长一段时间内解决这个问题。几个小时后,我决定发一个问题,因为我没有想法。我已将一个项目导入到CLion中,CMakeLists.txt已经在里面。我正在研究ubuntu并拥有最新的cmake版本(3.5.something,OpenCV是2.4.x)。我只使用clion作为IntelliSense,我不会用它来进行编译(我使用终端)。

通过打开项目,我得到以下警告消息(我以某种方式成功地减少了警告)。对于OpenCVModules.cmake中的每个add_library行都会发生这种情况(我只发布其中一个):

CMake Warning (dev) at /usr/local/share/OpenCV/OpenCVModules.cmake:53 (add_library):
  ADD_LIBRARY called with SHARED option but the target platform does not
  support dynamic linking.  Building a STATIC library instead.  This may lead
  to problems.

有没有人有想法?

@的CMakeLists.txt

# OpenCV:
find_package(OpenCV REQUIRED)
include_directories(${OPENCV_INCLUDE_DIR})
IF(OpenCV_FOUND)
  MESSAGE(STATUS "OpenCV_LIBS = ${OpenCV_LIBS}")
ELSE(OpenCV_FOUND)
  MESSAGE(STATUS "OpenCV_LIBS not found!")
ENDIF(OpenCV_FOUND)

project(cvtask1a)
file(GLOB SOURCES ${SOURCE_WILDCARDS})
include_directories(${CMAKE_SOURCE_DIR}/cgcvcommon)
add_executable(cvtask1a ${SOURCES})
target_link_libraries(cvtask1a ${OpenCV_LIBS})

0 个答案:

没有答案