summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt29
1 files changed, 15 insertions, 14 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1bec5c6..eedccaa 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -23,26 +23,27 @@ add_executable(analyze_correlations src/analyze_correlations.cpp ${CPPSOURCES} $
SET_TARGET_PROPERTIES(wolff_planar PROPERTIES COMPILE_FLAGS "-DN_COMP=2")
SET_TARGET_PROPERTIES(wolff_heisenberg PROPERTIES COMPILE_FLAGS "-DN_COMP=3")
-find_library(GSL gsl)
-find_library(FFTW fftw3)
-find_library(M m)
-FIND_LIBRARY(GL GL)
-FIND_LIBRARY(GLU GLU)
-FIND_LIBRARY(GLUT glut)
+find_library(GSL NAMES gsl)
+find_library(FFTW NAMES fftw3)
+find_library(M NAMES m)
+FIND_LIBRARY(GL NAMES GL)
+FIND_LIBRARY(GLU NAMES GLU)
+FIND_LIBRARY(GLUT NAMES glut)
+FIND_LIBRARY(TESTING NAMES Idontexist)
target_link_libraries(wolff_finite cblas gsl m)
target_link_libraries(analyze_correlations cblas gsl fftw3 m)
-if (GL_FOUND AND GLU_FOUND AND GLUT_FOUND)
- target_link_libraries(wolff_ising cblas gsl m glut GL GLU)
- target_link_libraries(wolff_heisenberg cblas gsl m glut GL GLU)
- target_link_libraries(wolff_planar cblas gsl m glut GL GLU)
- target_compile_definitions(wolff_ising HAVE_GLUT)
- target_compile_definitions(wolff_planar HAVE_GLUT)
- target_compile_definitions(wolff_heisenberg HAVE_GLUT)
-else ()
+if (${GLUT} MATCHES "GLUT-NOTFOUND")
target_link_libraries(wolff_ising cblas gsl m)
target_link_libraries(wolff_heisenberg cblas gsl m)
target_link_libraries(wolff_planar cblas gsl m)
+else()
+ target_link_libraries(wolff_ising cblas gsl m glut GL GLU)
+ target_link_libraries(wolff_heisenberg cblas gsl m glut GL GLU)
+ target_link_libraries(wolff_planar cblas gsl m glut GL GLU)
+ target_compile_definitions(wolff_ising PUBLIC HAVE_GLUT)
+ target_compile_definitions(wolff_planar PUBLIC HAVE_GLUT)
+ target_compile_definitions(wolff_heisenberg PUBLIC HAVE_GLUT)
endif()
install(TARGETS wolff_finite wolff_ising wolff_heisenberg wolff_planar analyze_correlations DESTINATION bin)