diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-04-19 11:19:22 -0400 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2010-04-19 11:19:22 -0400 |
commit | 84d1b2ae3a7187f418b1cbbec03eabda372ea699 (patch) | |
tree | 2a62b619ec3e5299edfcf3b7e4a184670ff3e29a /doc/examples/CMakeLists.txt | |
parent | 40b2aaa8b149403a8f345f1f7721ddd6088db669 (diff) |
add platform check for how to link to the standard math library.
This allows to support QNX.
Diffstat (limited to 'doc/examples/CMakeLists.txt')
-rw-r--r-- | doc/examples/CMakeLists.txt | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/doc/examples/CMakeLists.txt b/doc/examples/CMakeLists.txt index 29cf078c1..13ec0c123 100644 --- a/doc/examples/CMakeLists.txt +++ b/doc/examples/CMakeLists.txt @@ -1,17 +1,20 @@ -FILE(GLOB examples_SRCS "*.cpp") +file(GLOB examples_SRCS "*.cpp") -ADD_CUSTOM_TARGET(all_examples) +add_custom_target(all_examples) -FOREACH(example_src ${examples_SRCS}) -GET_FILENAME_COMPONENT(example ${example_src} NAME_WE) -ADD_EXECUTABLE(${example} ${example_src}) -GET_TARGET_PROPERTY(example_executable - ${example} LOCATION) -ADD_CUSTOM_COMMAND( - TARGET ${example} - POST_BUILD - COMMAND ${example_executable} - ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out -) -ADD_DEPENDENCIES(all_examples ${example}) -ENDFOREACH(example_src) +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() + get_target_property(example_executable + ${example} LOCATION) + add_custom_command( + TARGET ${example} + POST_BUILD + COMMAND ${example_executable} + ARGS >${CMAKE_CURRENT_BINARY_DIR}/${example}.out + ) + add_dependencies(all_examples ${example}) +endforeach(example_src) |