summaryrefslogtreecommitdiff
path: root/examples/CMakeLists.txt
blob: 5cdf3a0adc24f546ddd87323e875e3977c10d9d9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

add_executable(ising ising.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)
add_executable(xy On.cpp)
add_executable(potts_3 potts.cpp)
add_executable(clock_5 clock.cpp)
add_executable(discrete_gaussian discrete_gaussian.cpp)
add_executable(continuous_gaussian continuous_gaussian.cpp)

target_compile_definitions(xy PUBLIC WOLFF_N=2)
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_standalone wolff)
target_link_libraries(ising_random_field wolff)
target_link_libraries(ising_no_field wolff)
target_link_libraries(xy wolff)
target_link_libraries(potts_3 wolff)
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")
  message(WARNING "Executable examples/ising_animation is not being built because the glut library can't be found.")
else()
  add_executable(ising_animation ising_animation.cpp)
  target_link_libraries(ising_animation wolff GL GLU glut)
endif()