Commit ae216114 authored by Ruslan Baratov's avatar Ruslan Baratov

Consistent 'REQUIRED' usage

If 'REQUIRED' used inside 'find_package' there is no need to check '*_FOUND'
variable. And vice versa - if package is not optional then 'REQUIRED' can be
used instead of 'if(NOT *_FOUND) message(FATAL_ERROR)' block.
parent b5411a5a
...@@ -48,11 +48,7 @@ if(MSVC) ...@@ -48,11 +48,7 @@ if(MSVC)
add_definitions(-DBOOST_ALL_DYN_LINK) # Link against the dynamic boost lib - needs to match with the version that find_package finds. add_definitions(-DBOOST_ALL_DYN_LINK) # Link against the dynamic boost lib - needs to match with the version that find_package finds.
endif() endif()
find_package(Boost 1.50.0 COMPONENTS system REQUIRED) find_package(Boost 1.50.0 COMPONENTS system REQUIRED)
if(Boost_FOUND) message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}")
message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}")
else(Boost_FOUND)
message(FATAL_ERROR "Boost not found")
endif()
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
find_package(Eigen3 REQUIRED) find_package(Eigen3 REQUIRED)
......
find_package(Doxygen) find_package(Doxygen REQUIRED)
if(NOT DOXYGEN_FOUND)
message(FATAL_ERROR "Doxygen is needed to build the documentation.")
endif()
set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in) set(doxyfile_in ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) set(doxyfile ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
......
...@@ -21,11 +21,7 @@ if(MSVC) ...@@ -21,11 +21,7 @@ if(MSVC)
add_definitions(-DBOOST_ALL_DYN_LINK) # Link against the dynamic boost lib - needs to match with the version that find_package finds. add_definitions(-DBOOST_ALL_DYN_LINK) # Link against the dynamic boost lib - needs to match with the version that find_package finds.
endif() endif()
find_package(Boost 1.50.0 COMPONENTS system filesystem program_options REQUIRED) find_package(Boost 1.50.0 COMPONENTS system filesystem program_options REQUIRED)
if(Boost_FOUND) message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}")
message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}")
else(Boost_FOUND)
message(FATAL_ERROR "Boost not found")
endif()
# Simple model fitting (orthographic camera & shape to landmarks) example: # Simple model fitting (orthographic camera & shape to landmarks) example:
add_executable(fit-model-simple fit-model-simple.cpp) add_executable(fit-model-simple fit-model-simple.cpp)
......
...@@ -22,11 +22,7 @@ if(MSVC) ...@@ -22,11 +22,7 @@ if(MSVC)
add_definitions(-DBOOST_ALL_DYN_LINK) # Link against the dynamic boost lib - needs to match with the version that find_package finds. add_definitions(-DBOOST_ALL_DYN_LINK) # Link against the dynamic boost lib - needs to match with the version that find_package finds.
endif() endif()
find_package(Boost 1.50.0 COMPONENTS system filesystem program_options REQUIRED) find_package(Boost 1.50.0 COMPONENTS system filesystem program_options REQUIRED)
if(Boost_FOUND) message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}")
message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}")
else(Boost_FOUND)
message(FATAL_ERROR "Boost not found")
endif()
pybind11_add_module(python-bindings generate-python-bindings.cpp pybind11_glm.hpp pybind11_opencv.hpp) pybind11_add_module(python-bindings generate-python-bindings.cpp pybind11_glm.hpp pybind11_opencv.hpp)
target_link_libraries(python-bindings PRIVATE eos ${OpenCV_LIBS} ${Boost_LIBRARIES}) target_link_libraries(python-bindings PRIVATE eos ${OpenCV_LIBS} ${Boost_LIBRARIES})
......
...@@ -21,11 +21,7 @@ if(MSVC) ...@@ -21,11 +21,7 @@ if(MSVC)
add_definitions(-DBOOST_ALL_DYN_LINK) # Link against the dynamic boost lib - needs to match with the version that find_package finds. add_definitions(-DBOOST_ALL_DYN_LINK) # Link against the dynamic boost lib - needs to match with the version that find_package finds.
endif() endif()
find_package(Boost 1.50.0 COMPONENTS system filesystem program_options REQUIRED) find_package(Boost 1.50.0 COMPONENTS system filesystem program_options REQUIRED)
if(Boost_FOUND) message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}")
message(STATUS "Boost found at ${Boost_INCLUDE_DIRS}")
else(Boost_FOUND)
message(FATAL_ERROR "Boost not found")
endif()
# Converts a CVSSP .scm Morphable Model to a cereal binary file: # Converts a CVSSP .scm Morphable Model to a cereal binary file:
add_executable(scm-to-cereal scm-to-cereal.cpp) add_executable(scm-to-cereal scm-to-cereal.cpp)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment