From a9536365e6e0a571147253d2c2308716a767fbbb Mon Sep 17 00:00:00 2001 From: Jaron Kent-Dobias Date: Fri, 19 Oct 2018 14:20:11 -0400 Subject: only compile ising_animation if GLUT is present --- examples/CMakeLists.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index fcb6c0f..33b76ae 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -1,6 +1,5 @@ add_executable(ising ising.cpp) -add_executable(ising_animation ising_animation.cpp) add_executable(ising_standalone ising_standalone.cpp) add_executable(ising_random_field ising_random_field.cpp) add_executable(ising_no_field ising_no_field.cpp) @@ -15,7 +14,6 @@ target_compile_definitions(potts_3 PUBLIC WOLFF_POTTSQ=3) target_compile_definitions(clock_5 PUBLIC WOLFF_POTTSQ=5) target_link_libraries(ising wolff) -target_link_libraries(ising_animation wolff GL GLU glut) target_link_libraries(ising_standalone wolff) target_link_libraries(ising_random_field wolff) target_link_libraries(ising_no_field wolff) @@ -25,3 +23,13 @@ target_link_libraries(clock_5 wolff) target_link_libraries(discrete_gaussian wolff) target_link_libraries(continuous_gaussian wolff) +FIND_LIBRARY(GL NAMES GL) +FIND_LIBRARY(GLU NAMES GLU) +FIND_LIBRARY(GLUT NAMES glut) + +if (${GLUT} MATCHES "GLUT-NOTFOUND") +else() + add_executable(ising_animation ising_animation.cpp) + target_link_libraries(ising_animation wolff GL GLU glut) +endif() + -- cgit v1.2.3-70-g09d2