Commit c3587e5c87585f6a7abf403d7fda8523d1310d40

Authored by Austin Blanton
1 parent cee70e6a

Use our fork of cvmatio for a better install and move non-find logic to top CMakeLists

CMakeLists.txt
@@ -96,6 +96,11 @@ set(BR_WITH_CVMATIO OFF CACHE BOOL "Build with cvmatio library to read Matlab da @@ -96,6 +96,11 @@ set(BR_WITH_CVMATIO OFF CACHE BOOL "Build with cvmatio library to read Matlab da
96 if(${BR_WITH_CVMATIO}) 96 if(${BR_WITH_CVMATIO})
97 find_package(cvmatio REQUIRED) 97 find_package(cvmatio REQUIRED)
98 add_definitions(-DCVMATIO) 98 add_definitions(-DCVMATIO)
  99 + add_subdirectory(${CVMATIO_DIR})
  100 + include_directories(${CVMATIO_DIR}/include)
  101 + set(BR_THIRDPARTY_SRC ${BR_THIRDPARTY_SRC} ${CVMATIO_DIR}/src/MatlabIO.cpp)
  102 + link_directories(${CVMATIO_LIB_DIR})
  103 + set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} cvmatio)
99 endif() 104 endif()
100 105
101 # Compiler flags 106 # Compiler flags
share/openbr/cmake/Findcvmatio.cmake
1 set(CVMATIO_DIR "${BR_THIRDPARTY_DIR}/cvmatio") 1 set(CVMATIO_DIR "${BR_THIRDPARTY_DIR}/cvmatio")
2 if(NOT EXISTS ${CVMATIO_DIR}) 2 if(NOT EXISTS ${CVMATIO_DIR})
3 # download source from github 3 # download source from github
4 - execute_process(COMMAND "git" "clone" "https://github.com/hbristow/cvmatio.git" WORKING_DIRECTORY ${BR_THIRDPARTY_DIR}) 4 + execute_process(COMMAND "git" "clone" "https://github.com/biometrics/cvmatio.git" WORKING_DIRECTORY ${BR_THIRDPARTY_DIR})
5 else() 5 else()
6 # update the source 6 # update the source
7 execute_process(COMMAND "git" "pull" WORKING_DIRECTORY ${CVMATIO_DIR}) 7 execute_process(COMMAND "git" "pull" WORKING_DIRECTORY ${CVMATIO_DIR})
8 endif() 8 endif()
9 -add_subdirectory(${CVMATIO_DIR})  
10 -include_directories(${CVMATIO_DIR}/include)  
11 -set(BR_THIRDPARTY_SRC ${BR_THIRDPARTY_SRC} ${CVMATIO_DIR}/src/MatlabIO.cpp)  
12 set(CVMATIO_LIB_DIR ${CMAKE_BINARY_DIR}/3rdparty/cvmatio/src) 9 set(CVMATIO_LIB_DIR ${CMAKE_BINARY_DIR}/3rdparty/cvmatio/src)
13 -link_directories(${CVMATIO_LIB_DIR})  
14 -set(BR_THIRDPARTY_LIBS ${BR_THIRDPARTY_LIBS} cvmatio)  
15 -# because the project's cmake installs to the project folder,  
16 -# install(TARGETS cvmatio DESTINATION lib) doesn't work  
17 -# (i get error "target doesn't exist in this directory")  
18 -# so yeah, this won't work in windows  
19 -install(FILES ${CVMATIO_LIB_DIR}/libcvmatio.dylib DESTINATION lib)