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