我正在尝试编译我的flandmark,但是它非常复杂。
C:\ flandmark \ libflandmark \ CMakeLists.txt我放在第一行:
set(OpenCV "C:/opencv248/sources/cmake")
它是正确的 ?
跟随我的完整文件CMakeList.txt:
set(OpenCV "C:/opencv248/sources/cmake")
find_package( OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
add_library(flandmark_static STATIC flandmark_detector.cpp flandmark_detector.h liblbp.cpp liblbp.h)
target_link_libraries(flandmark_static ${OpenCV_LIBS})
if(CMAKE_COMPILER_IS_GNUCC)
set_target_properties(flandmark_static PROPERTIES COMPILE_FLAGS -fPIC)
endif(CMAKE_COMPILER_IS_GNUCC)
set_property(TARGET flandmark_static PROPERTY COMPILE_DEFINITIONS FLANDMARK_STATIC)
add_library(flandmark_shared SHARED flandmark_detector.cpp flandmark_detector.h liblbp.cpp liblbp.h)
target_link_libraries(flandmark_shared ${OpenCV_LIBS})
#setup Config.cmake
SET(FLANDMARK_BASE_DIR "${PROJECT_SOURCE_DIR}/libflandmark")
set(FLANDMARK_BINARY_DIR "${PROJECT_BINARY_DIR}/libflandmark")
configure_file(flandmarkConfig.cmake.in
"${PROJECT_BINARY_DIR}/libflandmark/flandmarkConfig.cmake" @ONLY)
export(PACKAGE flandmark)
在我由CMake-gui执行时查看结果:
OpenCV ARCH: x86
OpenCV RUNTIME: mingw
OpenCV STATIC: OFF
CMake Warning at C:/opencv248/build/OpenCVConfig.cmake:161 (message):
Found OpenCV Windows Pack but it has not binaries compatible with your
configuration.
You should manually point CMake variable OpenCV_DIR to your build of OpenCV
library.
Call Stack (most recent call first):
libflandmark/CMakeLists.txt:2 (find_package)
CMake Error at libflandmark/CMakeLists.txt:2 (find_package):
Found package configuration file:
C:/opencv248/build/OpenCVConfig.cmake
but it set OpenCV_FOUND to FALSE so package "OpenCV" is considered to be
NOT FOUND.
拜托,您能详细告诉我我该怎么做吗?
我不知道为什么他们不可用已经为我们编译的.dll! :(
谢谢
最佳答案
您只需将cmake-gui中的OpenCV_DIR变量设置为OpenCV的build目录。然后它应该可以正常工作。
关于c++ - 我无法从flandmark v0.7 Plataform x86 Win 7生成dll,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/25652538/