summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt31
1 files changed, 21 insertions, 10 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b225d39..1bec5c6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.0)
project(wolff)
+
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")
@@ -22,17 +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_package(OpenMP)
-if (OPENMP_FOUND)
- set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
- set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
+find_library(GSL gsl)
+find_library(FFTW fftw3)
+find_library(M m)
+FIND_LIBRARY(GL GL)
+FIND_LIBRARY(GLU GLU)
+FIND_LIBRARY(GLUT glut)
+
+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 ()
+ target_link_libraries(wolff_ising cblas gsl m)
+ target_link_libraries(wolff_heisenberg cblas gsl m)
+ target_link_libraries(wolff_planar cblas gsl m)
endif()
-target_link_libraries(wolff_finite gsl cblas fftw3 m)
-target_link_libraries(wolff_ising gsl cblas fftw3 m glut GL GLU)
-target_link_libraries(wolff_heisenberg gsl cblas fftw3 m)
-target_link_libraries(wolff_planar gsl cblas fftw3 m)
-target_link_libraries(analyze_correlations gsl cblas fftw3 m)
-
install(TARGETS wolff_finite wolff_ising wolff_heisenberg wolff_planar analyze_correlations DESTINATION bin)