I am trying to solve this thing for quite some time. After a few hours I just decided to post a question because I am out of ideas. I imported a project into CLion with the CMakeLists.txt already inside. I am working on ubuntu and have the newest cmake version (3.5.something, OpenCV is 2.4.x). I use clion just for the IntelliSense, I wont be using it for the compilation anyway (I use terminal for that).
By opening the project I get following warning messages (which I somehow succeeded to reduce to warnings). This happens for every add_library line in OpenCVModules.cmake (I post just one of them):
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.
Has anyone got ideas?
@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})