CMakeLists.txt 1.42 KB
Newer Older
1
2
3
4
5
6
7
8
project(Octree)
set(SOURCE main.cpp
           rotate.cpp
           rotate.h
	   octgrid.cpp
	   octgrid.h
           my_glut.h)

9
10
11
12
set(SOURCE_LIGHT main_light.cpp
	   octgrid.cpp
	   octgrid.h)

13
add_executable(Octree ${SOURCE})
14
15
add_executable(Octree_light ${SOURCE_LIGHT})
set(TARGETS Octree Octree_light)
16

17
18
19
foreach(vtarget ${TARGETS})
target_link_libraries(${vtarget} inmost)
#target_link_libraries(${vtarget} lapack blas) 
20
21
22


if(USE_MPI)
23
24
  message("linking ${vtarget} with mpi")
  target_link_libraries(${vtarget} ${MPI_LIBRARIES}) 
25
  if(MPI_LINK_FLAGS)
26
27
    message("adding link flags to ${vtarget}")
    set_target_properties(${vtarget} PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
28
29
30
31
32
33
34
35
36
37
  endif() 
endif(USE_MPI)

find_package(OpenGL)
find_package(GLUT)

if(OPENGL_FOUND)
	if(GLUT_FOUND)
		include_directories(${OPENGL_INCLUDE_DIR})
		include_directories(${GLUT_INCLUDE_DIR})
Kirill Terekhov's avatar
Kirill Terekhov committed
38
		add_definitions(-D__GRAPHICS__)
39
		target_link_libraries(${vtarget} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
40
	else(GLUT_FOUND)
41
		message("GLUT not found for ${vtarget}")
42
43
	endif(GLUT_FOUND)
else(OPENGL_FOUND)
44
	message("OpenGL not found for ${vtarget}")
45
46
47
endif(OPENGL_FOUND)

if(USE_PARTITIONER_ZOLTAN)
48
49
  message("linking ${vtarget} with Zoltan")
  target_link_libraries(${vtarget} ${ZOLTAN_LIBRARIES})
50
51
endif()
if(USE_PARTITIONER_PARMETIS)
52
53
  message("linking ${vtarget} with ParMETIS")
  target_link_libraries(${vtarget} ${PARMETIS_LIBRARIES})
54
55
endif()

56
57
58
endforeach(vtarget ${TARGETS})