2
0
mirror of https://github.com/boostorg/yap.git synced 2026-01-22 18:02:12 +00:00
Files
yap/example/CMakeLists.txt
greole bf9e8a121d Dependent compilation of tests, examples ... etc (#100)
* add a project name

* opt out of test, example, perf and doc build

* compiler definitions for clang

* fix build order by setting target depencies

* fix streampos namespace

* bump benchmark version

* remove file since it is part of google benchmark

* deactivate tests for google benchmark

* add missing ;

* add constexpr and variadic templates to compile features

* FIX set compile on interface since yap is an interface lib

* set cxx 14 as compile feature to compile boost

* add missing $

* replace cxx_std_14 by concrete features

* add all features to interface_compile_properties

* fix interface_compile_properties
2020-04-08 18:30:26 -05:00

45 lines
1.1 KiB
CMake

include_directories(${CMAKE_HOME_DIRECTORY})
include(CTest)
enable_testing()
add_custom_target(run_examples COMMAND ${CMAKE_CTEST_COMMAND} -VV -C ${CMAKE_CFG_INTDIR})
macro(add_sample name)
add_executable(${name} ${name}.cpp)
target_link_libraries(${name} yap)
add_test(${name} ${CMAKE_CURRENT_BINARY_DIR}/${name})
if (clang_on_linux)
target_link_libraries(${name} c++)
endif ()
endmacro()
add_sample(minimal)
add_sample(hello_world)
add_sample(hello_world_redux)
add_sample(calc1)
add_sample(calc2a)
add_sample(calc2b)
add_sample(calc3)
add_sample(lazy_vector)
add_sample(tarray)
add_sample(vec3)
add_sample(vector)
add_sample(mixed)
add_sample(map_assign)
add_sample(future_group)
add_sample(transform_terminals)
add_sample(pipable_algorithms)
if (constexpr_if_define STREQUAL "-DBOOST_NO_CONSTEXPR_IF=0")
add_sample(let)
add_sample(self_evaluation)
endif ()
add_executable(autodiff autodiff_example.cpp)
add_dependencies(autodiff autodiff_library)
target_link_libraries(autodiff yap boost autodiff_library)
if (clang_on_linux)
target_link_libraries(autodiff c++)
endif ()