summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-19 14:20:11 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-19 14:20:11 -0400
commita9536365e6e0a571147253d2c2308716a767fbbb (patch)
treec5b0739f43e89933601c3cc0d030bd568850b1ca /examples
parent6fde4f4bf3899c3958d8f3618fbbe817cfb40db2 (diff)
downloadc++-a9536365e6e0a571147253d2c2308716a767fbbb.tar.gz
c++-a9536365e6e0a571147253d2c2308716a767fbbb.tar.bz2
c++-a9536365e6e0a571147253d2c2308716a767fbbb.zip
only compile ising_animation if GLUT is present
Diffstat (limited to 'examples')
-rw-r--r--examples/CMakeLists.txt12
1 files 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()
+