summaryrefslogtreecommitdiff
path: root/examples/src/models/ising/CMakeLists.txt
diff options
context:
space:
mode:
authorJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-10 21:45:32 -0400
committerJaron Kent-Dobias <jaron@kent-dobias.com>2018-10-10 21:45:32 -0400
commita43ff1f98e9b9814f858bccb11c174b418458491 (patch)
treeae7e094d914eddb8a1ae9548420ba8c2f329ffae /examples/src/models/ising/CMakeLists.txt
parent6e264d243f0b29d90e90b605b6cdeab8227129c9 (diff)
downloadc++-a43ff1f98e9b9814f858bccb11c174b418458491.tar.gz
c++-a43ff1f98e9b9814f858bccb11c174b418458491.tar.bz2
c++-a43ff1f98e9b9814f858bccb11c174b418458491.zip
big rearrangement of files to make libraries and example (research) files clearer, and changed to c++ std lib random numbers
Diffstat (limited to 'examples/src/models/ising/CMakeLists.txt')
-rw-r--r--examples/src/models/ising/CMakeLists.txt28
1 files changed, 28 insertions, 0 deletions
diff --git a/examples/src/models/ising/CMakeLists.txt b/examples/src/models/ising/CMakeLists.txt
new file mode 100644
index 0000000..e8fbc9a
--- /dev/null
+++ b/examples/src/models/ising/CMakeLists.txt
@@ -0,0 +1,28 @@
+
+add_executable(wolff_ising wolff_ising.cpp)
+add_executable(wolff_ising_2d wolff_ising.cpp)
+add_executable(wolff_ising_2d_no-field wolff_ising.cpp)
+
+set_target_properties(wolff_ising_2d PROPERTIES COMPILE_FLAGS "-DDIMENSION=2")
+set_target_properties(wolff_ising_2d_no-field PROPERTIES COMPILE_FLAGS "-DDIMENSION=2 -DNOFIELD")
+
+find_library(GL NAMES GL)
+find_library(GLU NAMES GLU)
+find_library(GLUT NAMES glut)
+
+if (${GLUT} MATCHES "GLUT-NOTFOUND")
+ target_link_libraries(wolff_ising wolff wolff_examples)
+ target_link_libraries(wolff_ising_2d wolff wolff_examples)
+ target_link_libraries(wolff_ising_2d_no-field wolff wolff_examples)
+else()
+ target_compile_definitions(wolff_ising PUBLIC HAVE_GLUT)
+ target_compile_definitions(wolff_ising_2d PUBLIC HAVE_GLUT)
+ target_compile_definitions(wolff_ising_2d_no-field PUBLIC HAVE_GLUT)
+
+ target_link_libraries(wolff_ising wolff wolff_examples glut GL GLU)
+ target_link_libraries(wolff_ising_2d wolff wolff_examples glut GL GLU)
+ target_link_libraries(wolff_ising_2d_no-field wolff wolff_examples glut GL GLU)
+endif()
+
+install(TARGETS wolff_ising wolff_ising_2d wolff_ising_2d_no-field DESTINATION ${CMAKE_INSTALL_BINDIR})
+