mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-15 07:10:37 +08:00
6fb3e5f176
Ancient versions of CMake required else(), endif(), and similar block termination commands to have arguments matching the command starting the block. This is no longer the preferred style.
20 lines
607 B
CMake
20 lines
607 B
CMake
file(GLOB examples_SRCS "*.cpp")
|
|
|
|
foreach(example_src ${examples_SRCS})
|
|
get_filename_component(example ${example_src} NAME_WE)
|
|
add_executable(${example} ${example_src})
|
|
if(EIGEN_STANDARD_LIBRARIES_TO_LINK_TO)
|
|
target_link_libraries(${example} ${EIGEN_STANDARD_LIBRARIES_TO_LINK_TO})
|
|
endif()
|
|
add_custom_command(
|
|
TARGET ${example}
|
|
POST_BUILD
|
|
COMMAND ${example}
|
|
ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out
|
|
)
|
|
add_dependencies(all_examples ${example})
|
|
endforeach()
|
|
|
|
if(EIGEN_COMPILER_SUPPORT_CPP11)
|
|
ei_add_target_property(nullary_indexing COMPILE_FLAGS "-std=c++11")
|
|
endif() |