CMakeLists.txt 1.71 KB
Newer Older
Kirill Terekhov's avatar
Kirill Terekhov committed
1
2
3
project(DrawMatrix)
set(SOURCE main.cpp my_glut.h)
find_package(OpenGL)
Kirill Terekhov's avatar
Kirill Terekhov committed
4
find_package(GLUT)
Kirill Terekhov's avatar
Kirill Terekhov committed
5
6

if(OPENGL_FOUND)
Kirill Terekhov's avatar
Kirill Terekhov committed
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  if(GLUT_FOUND)
    message("linking DrawMatrix with GLUT and OpenGL")
    include_directories(${OPENGL_INCLUDE_DIR})
    include_directories(${GLUT_INCLUDE_DIR})
    add_executable(DrawMatrix ${SOURCE})
    target_link_libraries(DrawMatrix inmost ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
    if(USE_MPI)
      target_link_libraries(DrawMatrix ${MPI_LIBRARIES}) 
      if(MPI_LINK_FLAGS)
        set_target_properties(DrawMatrix PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
      endif() 
    endif(USE_MPI)
    if(USE_SOLVER)
      if(USE_SOLVER_ANI3D)
        message("linking DrawMatrix with ANI3d")
        target_link_libraries(DrawMatrix ani3d)
      endif()
      if(USE_SOLVER_PETSC)
        message("linking DrawMatrix with PETSc")
        add_definitions(${PETSC_DEFINITIONS})
        target_link_libraries(DrawMatrix ${PETSC_LIBRARIES})
      endif()
      if(USE_SOLVER_TRILINOS)
        message("linking DrawMatrix with Trilinos")
        target_link_libraries(DrawMatrix ${Trilinos_LIBRARIES} ${Trilinos_TPL_LIBRARIES})
      endif()
Kirill Terekhov's avatar
Kirill Terekhov committed
33
34
35
36
      if(USE_SOLVER_METIS)
        message("linking DrawMatrix with Metis")
        target_link_libraries(DrawMatrix ${METIS_LIBRARIES})
      endif()
Kirill Terekhov's avatar
Kirill Terekhov committed
37
38
39
40
      if(USE_SOLVER_MONDRIAAN)
        message("linking DrawMatrix with Mondriaan")
        target_link_libraries(DrawMatrix ${MONDRIAAN_LIBRARIES})
      endif()
Kirill Terekhov's avatar
Kirill Terekhov committed
41
    endif()
Kirill Terekhov's avatar
Kirill Terekhov committed
42
43


Kirill Terekhov's avatar
Fixes    
Kirill Terekhov committed
44
    install(TARGETS DrawMatrix EXPORT inmost-targets RUNTIME DESTINATION bin)
Kirill Terekhov's avatar
Kirill Terekhov committed
45
46
47
  else(GLUT_FOUND)
    message("GLUT not found, not building DrawMatrix")
  endif(GLUT_FOUND)
Kirill Terekhov's avatar
Kirill Terekhov committed
48
else(OPENGL_FOUND)
Kirill Terekhov's avatar
Kirill Terekhov committed
49
  message("OpenGL not found, not building DrawMatrix")
Kirill Terekhov's avatar
Kirill Terekhov committed
50
endif(OPENGL_FOUND)