1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
5 MESSAGE(STATUS "adding freeglut from : ${OSGFreeGlutSrcDir}")
9 SET(${PROJECT_NAME}SharedTarget osgglut)
11 SET(OSG_FREEGLUT_SRCS ${OSGFreeGlutSrcDir}/src/freeglut_callbacks.c
12 ${OSGFreeGlutSrcDir}/src/freeglut_cursor.c
13 ${OSGFreeGlutSrcDir}/src/freeglut_display.c
14 ${OSGFreeGlutSrcDir}/src/freeglut_ext.c
15 ${OSGFreeGlutSrcDir}/src/freeglut_font.c
16 ${OSGFreeGlutSrcDir}/src/freeglut_font_data.c
17 ${OSGFreeGlutSrcDir}/src/freeglut_gamemode.c
18 ${OSGFreeGlutSrcDir}/src/freeglut_geometry.c
19 ${OSGFreeGlutSrcDir}/src/freeglut_glutfont_definitions.c
20 ${OSGFreeGlutSrcDir}/src/freeglut_init.c
21 ${OSGFreeGlutSrcDir}/src/freeglut_input_devices.c
22 ${OSGFreeGlutSrcDir}/src/freeglut_joystick.c
23 ${OSGFreeGlutSrcDir}/src/freeglut_main.c
24 ${OSGFreeGlutSrcDir}/src/freeglut_menu.c
25 ${OSGFreeGlutSrcDir}/src/freeglut_misc.c
26 ${OSGFreeGlutSrcDir}/src/freeglut_overlay.c
27 ${OSGFreeGlutSrcDir}/src/freeglut_spaceball.c
28 ${OSGFreeGlutSrcDir}/src/freeglut_state.c
29 ${OSGFreeGlutSrcDir}/src/freeglut_stroke_mono_roman.c
30 ${OSGFreeGlutSrcDir}/src/freeglut_stroke_roman.c
31 ${OSGFreeGlutSrcDir}/src/freeglut_structure.c
32 ${OSGFreeGlutSrcDir}/src/freeglut_teapot.c
33 ${OSGFreeGlutSrcDir}/src/freeglut_videoresize.c
34 ${OSGFreeGlutSrcDir}/src/freeglut_window.c
35 ${OSGFreeGlutSrcDir}/src/freeglut_xinput.c)
37 SET(OSG_FREEGLUT_HDR ${OSGFreeGlutSrcDir}/include/GL/glut.h
38 ${OSGFreeGlutSrcDir}/include/GL/freeglut.h
39 ${OSGFreeGlutSrcDir}/include/GL/freeglut_std.h
40 ${OSGFreeGlutSrcDir}/include/GL/freeglut_ext.h)
42 INCLUDE_DIRECTORIES(${OSGFreeGlutSrcDir}/include)
45 ADD_LIBRARY(${${PROJECT_NAME}SharedTarget} SHARED ${OSG_FREEGLUT_SRCS})
47 ADD_DEPENDENCIES(ALL_STANDARD_BUILD ${${PROJECT_NAME}SharedTarget})
49 SET_TARGET_PROPERTIES(${${PROJECT_NAME}SharedTarget} PROPERTIES
50 DEFINE_SYMBOL FREEGLUT_EXPORTS
53 TARGET_LINK_LIBRARIES(${${PROJECT_NAME}SharedTarget} ${OPENGL_gl_LIBRARY})
55 INSTALL(TARGETS ${${PROJECT_NAME}SharedTarget}
56 CONFIGURATIONS Release
57 RUNTIME DESTINATION bin COMPONENT release_runtimes
58 LIBRARY DESTINATION lib COMPONENT release_libraries
59 ARCHIVE DESTINATION lib COMPONENT release_libraries)
61 INSTALL(TARGETS ${${PROJECT_NAME}SharedTarget}
63 RUNTIME DESTINATION bin COMPONENT debug_runtimes
64 LIBRARY DESTINATION lib COMPONENT debug_libraries
65 ARCHIVE DESTINATION lib COMPONENT debug_libraries)
66 ENDIF(BUILD_SHARED_LIBS)
68 INSTALL(FILES ${OSG_FREEGLUT_HDR}
69 DESTINATION include${OSG_SUPPORT_INC_SUBDIR}/GL
70 COMPONENT code_headers
71 PERMISSIONS OWNER_WRITE OWNER_READ
75 SET(OSG_GLUT_INCLUDE_DIR ${OSGFreeGlutSrcDir}/include CACHE PATH "" FORCE)
76 SET(OSG_GLUT_SHARED_LIBRARY ${${PROJECT_NAME}SharedTarget} CACHE STRING "" FORCE)
78 ELSE(OSGFreeGlutSrcDir)
79 MESSAGE(STATUS "ignoring freeglut")
81 SET(OSGFreeGlutSrcDir "" CACHE PATH "")
82 ENDIF(OSGFreeGlutSrcDir)