Commit 0d437a08 authored by Laurent Belcour's avatar Laurent Belcour

[CMake] Working compilation suite for a minimal set of plugins

parent 3bff1244
......@@ -7,9 +7,32 @@ find_package(EIGEN3)
add_definitions(-DALTA_PLUGIN_DIRECTORY="/usr/lib/alta_plugins")
# Add core and library include files
include_directories ("external/build" "sources" ${EIGEN3_INCLUDE_DIR})
include_directories("external/build" "sources" ${EIGEN3_INCLUDE_DIR})
include_directories("external")
#############################
# Helper functions #
#############################
function(alta_add_plugin name sources)
add_library(${name} SHARED sources/plugins/${sources})
target_link_libraries(${name} core)
target_compile_features(${name} PRIVATE cxx_range_for)
endfunction(alta_add_plugin)
function(alta_add_soft name sources)
add_executable(${name} sources/softs/${sources})
target_link_libraries(${name} core)
target_compile_features(${name} PRIVATE cxx_range_for)
endfunction(alta_add_soft)
#############################
# ALTA core #
#############################
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
# Add ALTA core library
add_library(core STATIC sources/core/common.cpp
sources/core/metrics.cpp
sources/core/params.cpp
......@@ -21,7 +44,44 @@ add_library(core STATIC sources/core/common.cpp
sources/core/rational_function.cpp)
target_compile_features(core PRIVATE cxx_range_for)
# Add main test suite
#############################
# Plugins #
#############################
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/plugins)
set(CMAKE_SHARED_MODULE_PREFIX "")
# Data
alta_add_plugin(data_merl data_io/merl.cpp)
alta_add_plugin(data_utia data_io/utia.cpp)
# Functions
alta_add_plugin(nonlinear_function_diffuse nonlinear_function_diffuse/function.cpp)
# Fitters
alta_add_plugin(nonlinear_fitter_eigen nonlinear_fitter_eigen/fitter.cpp)
#############################
# Softs #
#############################
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/softs)
add_executable(brdf2data sources/softs/brdf2data/main.cpp)
target_link_libraries(brdf2data core)
target_compile_features(brdf2data PRIVATE cxx_range_for)
alta_add_soft(data2data data2data/main.cpp)
alta_add_soft(data2brdf data2brdf/main.cpp)
#############################
# Tests #
#############################
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/tests)
include_directories("sources/tests")
add_executable(test_data_io sources/tests/core/data-io.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