Commit 66a712dd authored by Patrik Huber's avatar Patrik Huber

Added CMake option BUILD_CERES_EXAMPLE

parent 6931b61d
...@@ -54,6 +54,8 @@ endif() ...@@ -54,6 +54,8 @@ endif()
message(STATUS "Options:") message(STATUS "Options:")
option(BUILD_EXAMPLES "Build the example applications." ON) option(BUILD_EXAMPLES "Build the example applications." ON)
message(STATUS "BUILD_EXAMPLES: ${BUILD_EXAMPLES}") message(STATUS "BUILD_EXAMPLES: ${BUILD_EXAMPLES}")
option(BUILD_CERES_EXAMPLE "Build the fit-model-ceres example (requires Ceres)." OFF)
message(STATUS "BUILD_CERES_EXAMPLE: ${BUILD_CERES_EXAMPLE}")
option(BUILD_UTILS "Build utility applications." OFF) option(BUILD_UTILS "Build utility applications." OFF)
message(STATUS "BUILD_UTILS: ${BUILD_UTILS}") message(STATUS "BUILD_UTILS: ${BUILD_UTILS}")
option(BUILD_DOCUMENTATION "Build the library documentation." OFF) option(BUILD_DOCUMENTATION "Build the library documentation." OFF)
......
...@@ -33,18 +33,21 @@ if(MSVC) ...@@ -33,18 +33,21 @@ if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
endif() endif()
# Find Ceres, for the fit-model-ceres app:
find_package(Ceres REQUIRED)
message(STATUS "Ceres locations: Headers: ${CERES_INCLUDE_DIRS} Library: ${CERES_LIBRARIES}")
include_directories(${CERES_INCLUDE_DIRS})
# Model fitting (affine cam & shape to landmarks) example: # Model fitting (affine cam & shape to landmarks) example:
add_executable(fit-model fit-model.cpp) add_executable(fit-model fit-model.cpp)
target_link_libraries(fit-model ${OpenCV_LIBS} ${Boost_LIBRARIES}) target_link_libraries(fit-model ${OpenCV_LIBS} ${Boost_LIBRARIES})
# Single and multi-image non-linear model fitting with Ceres example: if(BUILD_CERES_EXAMPLE)
add_executable(fit-model-ceres fit-model-ceres.cpp) # Find Ceres, for the fit-model-ceres app:
target_link_libraries(fit-model-ceres ${CERES_LIBRARIES} ${OpenCV_LIBS} ${Boost_LIBRARIES}) find_package(Ceres REQUIRED)
message(STATUS "Ceres locations: Headers: ${CERES_INCLUDE_DIRS} Library: ${CERES_LIBRARIES}")
include_directories(${CERES_INCLUDE_DIRS})
# Single and multi-image non-linear model fitting with Ceres example:
add_executable(fit-model-ceres fit-model-ceres.cpp)
target_link_libraries(fit-model-ceres ${CERES_LIBRARIES} ${OpenCV_LIBS} ${Boost_LIBRARIES})
install(TARGETS fit-model-ceres DESTINATION bin)
endif()
# Generate random samples from the model: # Generate random samples from the model:
add_executable(generate-obj generate-obj.cpp) add_executable(generate-obj generate-obj.cpp)
......
...@@ -23,5 +23,6 @@ ...@@ -23,5 +23,6 @@
# Configuration options # Configuration options
# ============================== # ==============================
set(BUILD_EXAMPLES ON CACHE BOOL "Build the example applications." FORCE) set(BUILD_EXAMPLES ON CACHE BOOL "Build the example applications." FORCE)
set(BUILD_CERES_EXAMPLE OFF CACHE BOOL "Build the fit-model-ceres example (requires Ceres)." FORCE)
set(BUILD_UTILS OFF CACHE BOOL "Build utility applications." FORCE) set(BUILD_UTILS OFF CACHE BOOL "Build utility applications." FORCE)
set(BUILD_DOCUMENTATION OFF CACHE BOOL "Build the library documentation." FORCE) set(BUILD_DOCUMENTATION OFF CACHE BOOL "Build the library documentation." FORCE)
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