Commit ba232ae0 authored by Patrik Huber's avatar Patrik Huber

Simplify generator expression to one line, add to more targets

parent ff315fba
......@@ -29,28 +29,16 @@ else(Boost_FOUND)
message(FATAL_ERROR "Boost not found")
endif()
# set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthreads") # IF GCC OR CLANG!
# Eigen::LevenbergMarquardt probably needs -pthreads. => So eos needs pthreads! How to add in modern CMake?
# Cleaner way would be to add it to fit-model's target_link_libraries, but that requires a CMake >2.8.10.
# clang and gcc.
# Or if we include Eigen in a modern way, it may include it as a transitive dependency and the problem may go away.
# Simple model fitting (orthographic camera & shape to landmarks) example:
add_executable(fit-model-simple fit-model-simple.cpp)
target_link_libraries(fit-model-simple eos ${OpenCV_LIBS} ${Boost_LIBRARIES})
target_compile_options(fit-model-simple PUBLIC "$<$<CXX_COMPILER_ID:GNU>:-pthread>")
target_compile_options(fit-model-simple PUBLIC "$<$<CXX_COMPILER_ID:Clang>:-pthreads>")
target_link_libraries(fit-model-simple "$<$<CXX_COMPILER_ID:GNU>:-pthread> $<$<CXX_COMPILER_ID:Clang>:-pthreads>")
# Model fitting example that fits orthographic camera, shape, blendshapes, and contours:
add_executable(fit-model fit-model.cpp)
target_link_libraries(fit-model eos ${OpenCV_LIBS} ${Boost_LIBRARIES})
target_link_libraries(fit-model "$<$<CXX_COMPILER_ID:GNU>:-pthread> $<$<CXX_COMPILER_ID:Clang>:-pthreads>")
#target_compile_options(fit-model PUBLIC "$<$<CXX_COMPILER_ID:GNU>:-pthread>")
#target_compile_options(fit-model PUBLIC "$<$<CXX_COMPILER_ID:Clang>:-pthreads>") # => clang says this is unused during compilation!
target_link_libraries(fit-model "$<$<CXX_COMPILER_ID:GNU>:-pthread>")
target_link_libraries(fit-model "$<$<CXX_COMPILER_ID:Clang>:-pthreads>")
if(EOS_BUILD_CERES_EXAMPLE)
# Find Ceres, for the fit-model-ceres app:
......
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