From 8af4581139e968c70b05b746e1c4164b5689857d Mon Sep 17 00:00:00 2001 From: Alex Cunningham Date: Sun, 20 May 2012 17:38:46 +0000 Subject: [PATCH] Making GTSAM_BUILD_EXAMPLES flag affect unstable examples --- gtsam_unstable/discrete/CMakeLists.txt | 31 +++++++++++++------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/gtsam_unstable/discrete/CMakeLists.txt b/gtsam_unstable/discrete/CMakeLists.txt index f3c481ad4..8c94b0e46 100644 --- a/gtsam_unstable/discrete/CMakeLists.txt +++ b/gtsam_unstable/discrete/CMakeLists.txt @@ -23,18 +23,19 @@ set (discrete_excluded_tests "") gtsam_add_subdir_tests(discrete_unstable "${discrete_local_libs}" "${discrete_full_libs}" "${discrete_excluded_tests}") # add examples -foreach(example schedulingExample schedulingQuals12) - add_executable(${example} "examples/${example}.cpp") - - # Disable building during make all/install - if (GTSAM_ENABLE_INSTALL_EXAMPLE_FIX) - set_target_properties(${example} PROPERTIES EXCLUDE_FROM_ALL ON) - endif() - - add_dependencies(examples ${example}) - - add_dependencies(${example} gtsam-static gtsam_unstable-static) - target_link_libraries(${example} gtsam-static gtsam_unstable-static) - add_custom_target(${example}.run ${EXECUTABLE_OUTPUT_PATH}${example} ${ARGN}) -endforeach(example) - +if (GTSAM_BUILD_EXAMPLES) + foreach(example schedulingExample schedulingQuals12) + add_executable(${example} "examples/${example}.cpp") + + # Disable building during make all/install + if (GTSAM_ENABLE_INSTALL_EXAMPLE_FIX) + set_target_properties(${example} PROPERTIES EXCLUDE_FROM_ALL ON) + endif() + + add_dependencies(examples ${example}) + + add_dependencies(${example} gtsam-static gtsam_unstable-static) + target_link_libraries(${example} gtsam-static gtsam_unstable-static) + add_custom_target(${example}.run ${EXECUTABLE_OUTPUT_PATH}${example} ${ARGN}) + endforeach(example) +endif (GTSAM_BUILD_EXAMPLES)