CMakeLists.txt 1.53 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)

SilverLife's avatar
SilverLife committed
13
14
15
16
17
set(SOURCE_TEST main_test.cpp
	   octgrid.cpp
	   octgrid.h)


18
add_executable(Octree ${SOURCE})
19
add_executable(Octree_light ${SOURCE_LIGHT})
SilverLife's avatar
SilverLife committed
20
21
add_executable(Octree_test ${SOURCE_TEST})
set(TARGETS Octree Octree_light Octree_test)
22

23
24
25
foreach(vtarget ${TARGETS})
target_link_libraries(${vtarget} inmost)
#target_link_libraries(${vtarget} lapack blas) 
26
27
28


if(USE_MPI)
29
30
  message("linking ${vtarget} with mpi")
  target_link_libraries(${vtarget} ${MPI_LIBRARIES}) 
31
  if(MPI_LINK_FLAGS)
32
33
    message("adding link flags to ${vtarget}")
    set_target_properties(${vtarget} PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
34
35
36
37
38
39
40
41
42
43
  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
44
		add_definitions(-D__GRAPHICS__)
45
		target_link_libraries(${vtarget} ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
46
	else(GLUT_FOUND)
47
		message("GLUT not found for ${vtarget}")
48
49
	endif(GLUT_FOUND)
else(OPENGL_FOUND)
50
	message("OpenGL not found for ${vtarget}")
51
52
53
endif(OPENGL_FOUND)

if(USE_PARTITIONER_ZOLTAN)
54
55
  message("linking ${vtarget} with Zoltan")
  target_link_libraries(${vtarget} ${ZOLTAN_LIBRARIES})
56
57
endif()
if(USE_PARTITIONER_PARMETIS)
58
59
  message("linking ${vtarget} with ParMETIS")
  target_link_libraries(${vtarget} ${PARMETIS_LIBRARIES})
60
61
endif()

62
63
64
endforeach(vtarget ${TARGETS})