Continuation of this question, where there's already some advice on how to solve the issue, but still I cannot manage.
My current CMakeLists.txt
is the following:
cmake_minimum_required(VERSION 3.12)
project( project_360_visual )
find_package(OpenCV REQUIRED)
set(SOURCE_FILES
${CMAKE_SOURCE_DIR}/src/project_360_visual.cpp
${CMAKE_SOURCE_DIR}/src/projection.cpp)
set(INCLUDE_FILES
${CMAKE_SOURCE_DIR}/include/project_360_visual.h
${CMAKE_SOURCE_DIR}/include/projection.h)
#Creating executable targets
add_executable(project_360_visual ${SOURCE_FILES} ${INCLUDE_FILES})
set_target_properties(project_360_visual PROPERTIES RUNTIME_OUTPUT_DIRECTORY
${CMAKE_SOURCE_DIR}/bin )
#Creating library targets
add_library(opencv_tracking430 SHARED IMPORTED GLOBAL)
set_target_properties(opencv_tracking430 PROPERTIES
IMPORTED_LOCATION "c:/opencv/build/bin/Release/opencv_tracking430.dll"
IMPORTED_IMPLIB "c:/opencv/build/lib/Release/opencv_tracking430.lib"
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin
)
target_include_directories(project_360_visual PUBLIC ${CMAKE_SOURCE_DIR}/include)
target_link_libraries(project_360_visual PUBLIC ${OpenCV_LIBS} opencv_tracking430)
Again, building is fine, but when I run the executable the .dll
is not seen.
I'm not sure I've used correctly the LIBRARY_OUTPUT_DIRECTORY
property.
I think the idea of target opencv_tracking430
is to import the library and then move it in LIBRARY_OUTPUT_FOLDER
, the same needs to be done for the executable.
The executable is correctly moved, but not the .dll
.
Any suggestions?