[CMake] Fwd: Linking external code that uses different library version

Charles Prado chrspx at gmail.com
Tue Jan 5 06:55:03 EST 2016


Hello everyone.

I'm trying to build my project, which have this code as dependency:
https://github.com/kylemcdonald/FaceTracker .

The project Is using the library OpenCV (version 3.1.0), but I need to
compile FaceTracker code using OpenCV version 2.4.0. CMake provides any
option that can help me with this?

Here is my CMakeLists.txt file:

cmake_minimum_required(VERSION 2.8)
project( Neuromarketing-RF )
find_package( Boost 1.58.0 REQUIRED COMPONENTS filesystem system )
include_directories( ${Boost_INCLUDE_DIRS} include src/external )
find_package( OpenCV REQUIRED )
file(GLOB FACETRACKER_HEADERS
"external/FaceTracker/include/FaceTracker/*.h")
file(GLOB FACETRACKER_SRC "external/FaceTracker/src/*/*.cc")
file(GLOB SOURCES "src/*cpp")
add_executable( Neuromarketing-RF ${SOURCES} ${FACETRACKER_SRC} )
target_link_libraries( Neuromarketing-RF ${OpenCV_LIBS} ${Boost_LIBRARIES} )
target_compile_features( Neuromarketing-RF PRIVATE cxx_range_for )
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake/attachments/20160105/da6ea142/attachment.html>


More information about the CMake mailing list