-
-
Notifications
You must be signed in to change notification settings - Fork 598
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removed OpenCV and boost::filesystem dependency from utils
scm-to-cereal is the only util and it now only requires boost::program_options.
- Loading branch information
1 parent
dd4cd62
commit d465a04
Showing
1 changed file
with
4 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,17 @@ | ||
# The utils need a few additional dependencies (e.g. boost::split, boost filesystem, program_options, and OpenCV highgui): | ||
|
||
# Check installed version in order to include the correct OpenCV libraries: | ||
# First call find_package without a version to find any OpenCV. OpenCV_VERSION_MAJOR is then defined. | ||
find_package(OpenCV REQUIRED core) | ||
if("${OpenCV_VERSION_MAJOR}$" EQUAL 2) | ||
message(STATUS "OpenCV 2.x detected") | ||
find_package(OpenCV 2.4.3 REQUIRED core imgproc highgui) | ||
elseif("${OpenCV_VERSION_MAJOR}$" EQUAL 3) | ||
message(STATUS "OpenCV 3.x detected - including imgcodecs for compatibility") | ||
find_package(OpenCV 3 REQUIRED core imgproc imgcodecs) | ||
endif() | ||
# This allows us to compile in RelWithDebInfo. It'll use the Release-version of OpenCV: | ||
set_target_properties(${OpenCV_LIBS} PROPERTIES MAP_IMPORTED_CONFIG_RELWITHDEBINFO RELEASE) | ||
|
||
# scm-to-cereal needs boost::program_options: | ||
if(MSVC) | ||
# The standard find_package for boost on Win finds the dynamic libs, so for dynamic linking to boost we need to #define: | ||
add_definitions(-DBOOST_ALL_NO_LIB) # Don't use the automatic library linking by boost with VS (#pragma ...). Instead, we specify everything here in cmake. | ||
add_definitions(-DBOOST_ALL_DYN_LINK) # Link against the dynamic boost lib - needs to match with the version that find_package finds. | ||
add_definitions(-D_HAS_AUTO_PTR_ETC) # Boost 1.65.1 still does not work with VS C++17 mode, this is the workaround | ||
endif() | ||
find_package(Boost 1.50.0 COMPONENTS system filesystem program_options REQUIRED) | ||
find_package(Boost 1.50.0 COMPONENTS system program_options REQUIRED) | ||
message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}") | ||
|
||
# Converts a CVSSP .scm Morphable Model to a cereal binary file: | ||
add_executable(scm-to-cereal scm-to-cereal.cpp) | ||
target_link_libraries(scm-to-cereal eos ${OpenCV_LIBS} ${Boost_LIBRARIES}) | ||
target_include_directories(scm-to-cereal PUBLIC ${OpenCV_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) | ||
target_link_libraries(scm-to-cereal eos ${Boost_LIBRARIES}) | ||
target_include_directories(scm-to-cereal PUBLIC ${Boost_INCLUDE_DIRS}) | ||
|
||
# Install targets: | ||
install(TARGETS scm-to-cereal DESTINATION bin) |