0

I'm trying to compile my flandmark but it is very complicated. C:\flandmark\libflandmark\CMakeLists.txt I put in first line:

set(OpenCV "C:/opencv248/sources/cmake") 

It is correct ?

Follow my full file 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)

Look the Result when I executed by 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.

Please, Could you tell me in details what I have to do ? I don't know why they don't available the .dll already compiled for us! :(

Thanks

  • actually, if you already got opencv running, you could just shortcut it by adding the files from libflandmark to your project (thus skipping the whole dll/cmake issues – berak Sep 03 '14 at 19:53
  • Thks to replied, but My problem is : My application is JAVA and I used java wrapper ( javacv ) + opencv (works fine), But I need to generate the .dll to integrate JAVA + dll. – Molina Henrique Sep 04 '14 at 01:28

2 Answers2

1

You should just set the OpenCV_DIR variable in cmake-gui to the build directory of OpenCV. Then it should work without problems.

uricamic
  • 31
  • 4
  • Thks uricamic !! But could you specify what the file I put this OPENCV_DIR ? will be : set(OpenCV_DIR "C:\opencv248\build\x86\vc10\lib") into libflandmark\CMakeLists.txt ? – Molina Henrique Sep 04 '14 at 12:11
  • And what the path specific I need to Put ? Did you mean specifically this path ? OPENCV_DIR: C:/opencv248/build/x86/vc12/staticlib – Molina Henrique Sep 04 '14 at 12:26
0

Hi Guys Thanks for Help me in this step. I have solved the problem I followed the orientation from Uricamic, Let me follow details about the solution:

In cmake-gui set the variable OPENCV_DIR = C:/opencv/build/x86/vc12/staticlib I choose where to build the binaries : c:/flandmark-bin Afterwards the generate by Cmake-gui, The results of generated:

C:\flandmark-bin
  - CMakeCache.txt
  - CMakeFiles
  - examples
  - libflandmark
  - matlab_toolbox
C:\flandmark-bin\CMakeFiles
   - cmake.check_cache
   - CMakeGNUtoMS_lib.bat
   - CMakeOutput.log
   - CMakeTmp
C:\flandmark-bin\CMakeFiles\3.0.1
   - CMakeCCompiler.cmake
   - CMakeCXXCompiler.cmake
   - CMakeDetermineCompilerABI_C.bin
   - CMakeDetermineCompilerABI_CXX.bin
   - CMakeRCCompiler.cmake
   - CMakeSystem.cmake
   - CompilerIdC
   - CompilerIdCXX
 C:\flandmark-bin\CMakeFiles\3.0.1\CompilerIdC
   - a.exe
   - CMakeCCompilerId.c
C:\flandmark-bin\CMakeFiles\3.0.1\CompilerIdCXX
   - a.exe
   - CMakeCXXCompilerId.cpp
C:\flandmark-bin\CMakeFiles\CMakeTmp
C:\flandmark-bin\examples
   - CMakeFiles
   - face.jpg
   - flandmark_model.dat
   - groupphoto.jpg
   - haarcascade_frontalface_alt.xml
   - seq_bruges04_300frames.avi
C:\flandmark-bin\examples\CMakeFiles
C:\flandmark-bin\libflandmark
  - CMakeFiles
  - flandmarkConfig.cmake
C:\flandmark-bin\libflandmark\CMakeFiles
C:\flandmark-bin\matlab_toolbox
   - mex
   C:\flandmark-bin\matlab_toolbox\mex
     - CMakeFiles

This Doubt is resolved !

My Another doubt is How I could generate .dll files starting the C:/flandmark-bin generated (above) ?