Commit cf73dc0c authored by Patrik Huber's avatar Patrik Huber

Added EOS_ to the global CMake option variables

parent b2589316
......@@ -19,7 +19,7 @@ before_install:
before_script:
- mkdir build
- cd build
- cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${CXX_COMPILER} -DBUILD_EXAMPLES=on -DBUILD_UTILS=on -DGENERATE_PYTHON_BINDINGS=on -DPYTHON_EXECUTABLE=`which python3.5` ..
- cmake -DCMAKE_C_COMPILER=${C_COMPILER} -DCMAKE_CXX_COMPILER=${CXX_COMPILER} -DEOS_BUILD_EXAMPLES=on -DEOS_BUILD_UTILS=on -DEOS_GENERATE_PYTHON_BINDINGS=on -DPYTHON_EXECUTABLE=`which python3.5` ..
script:
- make VERBOSE=1
......@@ -45,18 +45,18 @@ endif()
# All the options for building the library. Can be changed on the command-line or in initial_cache.cmake.
message(STATUS "Options:")
option(BUILD_EXAMPLES "Build the example applications." ON)
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)
message(STATUS "BUILD_UTILS: ${BUILD_UTILS}")
option(BUILD_DOCUMENTATION "Build the library documentation." OFF)
message(STATUS "BUILD_DOCUMENTATION: ${BUILD_DOCUMENTATION}")
option(GENERATE_PYTHON_BINDINGS "Build python bindings. Requires python to be installed." OFF)
message(STATUS "GENERATE_PYTHON_BINDINGS: ${GENERATE_PYTHON_BINDINGS}")
option(GENERATE_MATLAB_BINDINGS "Build Matlab bindings. Requires Matlab with the compiler installed or the Matlab Compiler Runtime." OFF)
message(STATUS "GENERATE_MATLAB_BINDINGS: ${GENERATE_MATLAB_BINDINGS}")
option(EOS_BUILD_EXAMPLES "Build the example applications." ON)
message(STATUS "EOS_BUILD_EXAMPLES: ${EOS_BUILD_EXAMPLES}")
option(EOS_BUILD_CERES_EXAMPLE "Build the fit-model-ceres example (requires Ceres)." OFF)
message(STATUS "EOS_BUILD_CERES_EXAMPLE: ${EOS_BUILD_CERES_EXAMPLE}")
option(EOS_BUILD_UTILS "Build utility applications." OFF)
message(STATUS "EOS_BUILD_UTILS: ${EOS_BUILD_UTILS}")
option(EOS_BUILD_DOCUMENTATION "Build the library documentation." OFF)
message(STATUS "EOS_BUILD_DOCUMENTATION: ${EOS_BUILD_DOCUMENTATION}")
option(EOS_GENERATE_PYTHON_BINDINGS "Build python bindings. Requires python to be installed." OFF)
message(STATUS "EOS_GENERATE_PYTHON_BINDINGS: ${EOS_GENERATE_PYTHON_BINDINGS}")
option(EOS_GENERATE_MATLAB_BINDINGS "Build Matlab bindings. Requires Matlab with the compiler installed or the Matlab Compiler Runtime." OFF)
message(STATUS "EOS_GENERATE_MATLAB_BINDINGS: ${EOS_GENERATE_MATLAB_BINDINGS}")
# Build a CPack driven installer package:
......@@ -162,19 +162,19 @@ install(FILES ${CMAKE_SOURCE_DIR}/3rdparty/nanoflann/COPYING DESTINATION 3rdpart
install(DIRECTORY ${CMAKE_SOURCE_DIR}/3rdparty/eigen3-nnls/src/ DESTINATION 3rdparty/eigen3-nnls/src) # eigen3-nnls header
install(FILES ${CMAKE_SOURCE_DIR}/3rdparty/eigen3-nnls/README.md DESTINATION 3rdparty/eigen3-nnls/) # eigen3-nnls attribution
if(BUILD_EXAMPLES)
if(EOS_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
if(BUILD_UTILS)
if(EOS_BUILD_UTILS)
add_subdirectory(utils)
endif()
if(BUILD_DOCUMENTATION)
if(EOS_BUILD_DOCUMENTATION)
add_subdirectory(doc)
endif()
if(GENERATE_PYTHON_BINDINGS)
if(EOS_GENERATE_PYTHON_BINDINGS)
set(PYBIND11_PATH "${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/pybind11")
# If this fails, the repo has probably not been cloned with submodules. Run: git submodule update --init
add_subdirectory(${PYBIND11_PATH}) # add and initialise pybind11
......@@ -183,7 +183,7 @@ if(GENERATE_PYTHON_BINDINGS)
install(FILES ${CMAKE_SOURCE_DIR}/3rdparty/pybind11/LICENSE DESTINATION 3rdparty/pybind11/) # pybind11 licence
endif()
if(GENERATE_MATLAB_BINDINGS)
if(EOS_GENERATE_MATLAB_BINDINGS)
add_subdirectory(matlab)
install(DIRECTORY ${CMAKE_SOURCE_DIR}/3rdparty/mexplus/include/ DESTINATION 3rdparty/mexplus/include) # mexplus headers
install(FILES ${CMAKE_SOURCE_DIR}/3rdparty/mexplus/LICENSE DESTINATION 3rdparty/mexplus/) # mexplus licence
......
......@@ -84,7 +84,7 @@ The full model is available at [http://www.cvssp.org/facemodel](http://www.cvssp
## Python bindings
_Experimental_: eos includes python bindings for some of its functionality (and more can be added!). Set `-DGENERATE_PYTHON_BINDINGS=on` when running `cmake` to build them (and optionally set `PYTHON_EXECUTABLE` to point to your python interpreter if it's not found automatically).
_Experimental_: eos includes python bindings for some of its functionality (and more can be added!). Set `-DEOS_GENERATE_PYTHON_BINDINGS=on` when running `cmake` to build them (and optionally set `PYTHON_EXECUTABLE` to point to your python interpreter if it's not found automatically).
After building the bindings, they can be used like any python module:
......@@ -101,7 +101,7 @@ help(eos) # check the documentation
## Matlab bindings
_Experimental_: eos includes Matlab bindings for the `fit_shape_and_pose(...)` function, which means the fitting can be run from Matlab. Set `-DGENERATE_MATLAB_BINDINGS=on` when running `cmake` to build the required mex-file and run the `INSTALL` target to install everything. (Set `Matlab_ROOT_DIR` to point to your Matlab directory if it's not found automatically). More bindings (e.g. the MorphableModel itself) might be added in the future.
_Experimental_: eos includes Matlab bindings for the `fit_shape_and_pose(...)` function, which means the fitting can be run from Matlab. Set `-DEOS_GENERATE_MATLAB_BINDINGS=on` when running `cmake` to build the required mex-file and run the `INSTALL` target to install everything. (Set `Matlab_ROOT_DIR` to point to your Matlab directory if it's not found automatically). More bindings (e.g. the MorphableModel itself) might be added in the future.
Go to the `install/eos/matlab` directory and run [`demo.m`](https://github.com/patrikhuber/eos/blob/master/matlab/demo.m) to see how to run the fitting. The result is a mesh and rendering parameters (pose).
......
......@@ -25,7 +25,7 @@ install:
before_build: # We're still in %home%
- cmd: mkdir build
- cmd: cd build
- cmd: '%cmake% -G "Visual Studio 14 Win64" -DOpenCV_DIR=C:\projects\opencv -DBOOST_ROOT=C:\Libraries\boost_1_59_0 -DBOOST_LIBRARYDIR=C:\Libraries\boost_1_59_0\lib64-msvc-14.0 -DEIGEN3_INCLUDE_DIR=C:\projects\eigen-eigen-ce5a455b34c0 -DCMAKE_INSTALL_PREFIX=..\install -DBUILD_EXAMPLES=on -DBUILD_UTILS=on -DGENERATE_PYTHON_BINDINGS=on -DPYTHON_EXECUTABLE:path=C:\Python35-x64\python.exe ..\eos'
- cmd: '%cmake% -G "Visual Studio 14 Win64" -DOpenCV_DIR=C:\projects\opencv -DBOOST_ROOT=C:\Libraries\boost_1_59_0 -DBOOST_LIBRARYDIR=C:\Libraries\boost_1_59_0\lib64-msvc-14.0 -DEIGEN3_INCLUDE_DIR=C:\projects\eigen-eigen-ce5a455b34c0 -DCMAKE_INSTALL_PREFIX=..\install -DEOS_BUILD_EXAMPLES=on -DEOS_BUILD_UTILS=on -DEOS_GENERATE_PYTHON_BINDINGS=on -DPYTHON_EXECUTABLE:path=C:\Python35-x64\python.exe ..\eos'
build:
project: C:\projects\build\eos.sln
......
......@@ -41,7 +41,7 @@ target_link_libraries(fit-model-simple ${OpenCV_LIBS} ${Boost_LIBRARIES})
add_executable(fit-model fit-model.cpp)
target_link_libraries(fit-model ${OpenCV_LIBS} ${Boost_LIBRARIES})
if(BUILD_CERES_EXAMPLE)
if(EOS_BUILD_CERES_EXAMPLE)
# Find Ceres, for the fit-model-ceres app:
find_package(Ceres REQUIRED)
message(STATUS "Ceres locations: Headers: ${CERES_INCLUDE_DIRS} Library: ${CERES_LIBRARIES}")
......
......@@ -30,9 +30,9 @@
# Configuration options
# ==============================
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_DOCUMENTATION OFF CACHE BOOL "Build the library documentation." FORCE)
set(GENERATE_PYTHON_BINDINGS OFF CACHE BOOL "Build python bindings. Requires python to be installed." FORCE)
set(GENERATE_MATLAB_BINDINGS OFF CACHE BOOL "Build Matlab bindings. Requires Matlab with the compiler installed or the Matlab Compiler Runtime." FORCE)
set(EOS_BUILD_EXAMPLES ON CACHE BOOL "Build the example applications." FORCE)
set(EOS_BUILD_CERES_EXAMPLE OFF CACHE BOOL "Build the fit-model-ceres example (requires Ceres)." FORCE)
set(EOS_BUILD_UTILS OFF CACHE BOOL "Build utility applications." FORCE)
set(EOS_BUILD_DOCUMENTATION OFF CACHE BOOL "Build the library documentation." FORCE)
set(EOS_GENERATE_PYTHON_BINDINGS OFF CACHE BOOL "Build python bindings. Requires python to be installed." FORCE)
set(EOS_GENERATE_MATLAB_BINDINGS OFF CACHE BOOL "Build Matlab bindings. Requires Matlab with the compiler installed or the Matlab Compiler Runtime." 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