]> git.treefish.org Git - phys/latlib.git/blob - CMakeLists.txt
Added startconfig option.
[phys/latlib.git] / CMakeLists.txt
1 project(latlib)
2
3 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
4
5 #PROFILING
6 #set(CMAKE_CXX_FLAGS -pg)
7 #set(CMAKE_EXE_LINKER_FLAGS -pg)
8 #set(CMAKE_SHARED_LINKER_FLAGS -pg)
9
10 cmake_minimum_required(VERSION 2.8)
11
12 find_package(Boost 1.49 COMPONENTS iostreams REQUIRED)
13 include_directories(${Boost_INCLUDE_DIRS}) 
14
15 if(NOT DEFINED ENV{MPI_DISABLED})
16   find_package(MPI REQUIRED)
17   set(CMAKE_CXX_COMPILE_FLAGS ${CMAKE_CXX_COMPILE_FLAGS} ${MPI_COMPILE_FLAGS})
18   set(CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS} ${MPI_LINK_FLAGS})
19   include_directories(${MPI_INCLUDE_PATH})
20 else()
21   message("LATLIB: MPI support is disabled!")
22 endif()
23
24 add_library(lat_datread datread.cpp)
25 target_link_libraries(lat_datread ${Boost_LIBRARIES})
26
27 add_library(lat_configcache configcache.cpp)
28 target_link_libraries(lat_configcache ${Boost_LIBRARIES} lat_writeout lat_datread)
29
30 add_library(lat_hypercache hypercache.cpp)
31 target_link_libraries(lat_hypercache lat_configcache lat_writeout)
32
33 add_library(lat_neigh neigh.cpp)
34
35 add_library(lat_writeout writeout.cpp)
36 if(DEFINED ENV{MPI_DISABLED})
37   set_target_properties(lat_writeout PROPERTIES COMPILE_DEFINITIONS "MPI_DISABLED")
38 endif()
39
40 add_library(lat_paraq paraq.cpp)
41
42 add_library(lat_progress progress.cpp)
43
44 find_package(OpenGL)
45 find_package(GLUT)
46 if (OPENGL_FOUND AND GLUT_FOUND)
47     include_directories( ${OPENGL_INCLUDE_DIRS}  ${GLUT_INCLUDE_DIRS} ../ )
48     add_library(lat_culooks culooks.cpp culooks_cube.cpp culooks_drawing.cpp)
49     target_link_libraries(lat_culooks ${OPENGL_LIBRARIES} ${GLUT_LIBRARY} pthread)
50     add_executable(culooks_test culooks_test.cpp)
51     target_link_libraries(culooks_test lat_culooks)
52 endif ()
53
54 add_executable(neigh_test neigh_test.cpp)
55 target_link_libraries(neigh_test lat_neigh)
56
57 add_subdirectory(o815)