CMakeLists.txt 851 Bytes
Newer Older
Kirill Terekhov's avatar
Kirill Terekhov committed
1
2
project(DrawGrid)
set(SOURCE main.cpp
Dmitry Bagaev's avatar
Dmitry Bagaev committed
3
4
5
		rotate.cpp
		rotate.h
		my_glut.h)
Kirill Terekhov's avatar
Kirill Terekhov committed
6
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)
Dmitry Bagaev's avatar
Dmitry Bagaev committed
11
		message("linking DrawGrid with GLUT and OpenGL")
Kirill Terekhov's avatar
Kirill Terekhov committed
12
13
		include_directories(${OPENGL_INCLUDE_DIR})
		include_directories(${GLUT_INCLUDE_DIR})
Kirill Terekhov's avatar
Kirill Terekhov committed
14
		add_executable(DrawGrid ${SOURCE})
Kirill Terekhov's avatar
Kirill Terekhov committed
15
		target_link_libraries(DrawGrid inmost ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES})
Kirill Terekhov's avatar
Kirill Terekhov committed
16
		if(USE_MPI)
Dmitry Bagaev's avatar
Dmitry Bagaev committed
17
			target_link_libraries(DrawGrid ${MPI_LIBRARIES})
Kirill Terekhov's avatar
Fixes    
Kirill Terekhov committed
18
19
			if(MPI_LINK_FLAGS)
				set_target_properties(DrawGrid PROPERTIES LINK_FLAGS "${MPI_LINK_FLAGS}")
Dmitry Bagaev's avatar
Dmitry Bagaev committed
20
			endif()
Kirill Terekhov's avatar
Kirill Terekhov committed
21
		endif(USE_MPI)
Kirill Terekhov's avatar
Fixes    
Kirill Terekhov committed
22
		install(TARGETS DrawGrid EXPORT inmost-targets RUNTIME DESTINATION bin)
Kirill Terekhov's avatar
Kirill Terekhov committed
23
	else(GLUT_FOUND)
Dmitry Bagaev's avatar
Dmitry Bagaev committed
24
		message("GLUT not found, not building DrawGrid")
Kirill Terekhov's avatar
Kirill Terekhov committed
25
26
	endif(GLUT_FOUND)
else(OPENGL_FOUND)
Dmitry Bagaev's avatar
Dmitry Bagaev committed
27
	message("OpenGL not found, not building DrawGrid")
Kirill Terekhov's avatar
Kirill Terekhov committed
28
endif(OPENGL_FOUND)