CMakeLists.txt 729 Bytes
Newer Older
Kirill Terekhov's avatar
Kirill Terekhov committed
1
2
3
4
5
6
project(DrawGrid)
set(SOURCE main.cpp
           rotate.cpp
           rotate.h
           my_glut.h)
find_package(OpenGL)
Kirill Terekhov's avatar
Kirill Terekhov committed
7
find_package(GLUT)
Kirill Terekhov's avatar
Kirill Terekhov committed
8
9
10

if(OPENGL_FOUND)
	if(GLUT_FOUND)
Kirill Terekhov's avatar
Kirill Terekhov committed
11
12
		include_directories(${OPENGL_INCLUDE_DIR})
		include_directories(${GLUT_INCLUDE_DIR})
Kirill Terekhov's avatar
Kirill Terekhov committed
13
		add_executable(DrawGrid ${SOURCE})
Kirill Terekhov's avatar
Kirill Terekhov committed
14
		target_link_libraries(DrawGrid inmost ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
Kirill Terekhov's avatar
Kirill Terekhov committed
15
16
17
18
19
20
21
22
23
24
25
26
27
		if(USE_MPI)
		  target_link_libraries(DrawGrid ${MPI_LIBRARIES}) 
		  if(MPI_LINK_FLAGS)
            set_target_properties(DrawGrid PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
            endif() 
		endif(USE_MPI)
	else(GLUT_FOUND)
		message("GLUT not found")
	endif(GLUT_FOUND)
else(OPENGL_FOUND)
	message("OpenGL not found")
endif(OPENGL_FOUND)