fixed install target:
[freeglut] / CMakeLists.txt
1 CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
2 PROJECT(freeglut)
3
4 # NOTE: On Windows and Cygwin, the dll's are placed in the
5 # CMAKE_RUNTIME_OUTPUT_DIRECTORY, while their corresponding import
6 # libraries end up in CMAKE_ARCHIVE_OUTPUT_DIRECTORY. On other
7 # platforms, such as Linux, the shared libraries are put in
8 # CMAKE_ARCHIVE_OUTPUT_DIRECTORY instead.
9 # Static libraries end up in CMAKE_ARCHIVE_OUTPUT_DIRECTORY on all
10 # platforms.
11 SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
12 SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
13 SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)
14
15 # setup version numbers
16 # TODO: Update these for each release!
17 set(VERSION_MAJOR 3)
18 set(VERSION_MINOR 0)
19 set(VERSION_PATCH 0)
20
21
22 # BUILD_SHARED_LIBS is already a standard CMake variable, but we need to
23 # re-declare it here so it will show up in the GUI.
24 # by default, we want to build both
25 OPTION(BUILD_SHARED_LIBS "Build FreeGLUT shared library." ON)
26 OPTION(BUILD_STATIC_LIBS "Build FreeGLUT static library." ON)
27
28 # option to also copy .pdb files to install directory when executing
29 # INSTALL target
30 IF(MSVC)
31     OPTION(INSTALL_PDB "Also install .pdb files" ON)
32 ELSE()
33     SET(INSTALL_PDB OFF)
34 ENDIF()
35
36 # OpenGL ES support
37 OPTION(FREEGLUT_GLES1 "Use OpenGL ES 1.x (requires EGL)" OFF)
38 OPTION(FREEGLUT_GLES2 "Use OpenGL ES 2.x (requires EGL) (overrides BUILD_GLES1)" OFF)
39
40
41
42 SET(FREEGLUT_HEADERS
43     include/GL/freeglut.h
44     include/GL/freeglut_ext.h
45     include/GL/freeglut_std.h
46     include/GL/glut.h
47 )
48 SET(FREEGLUT_SRCS
49     ${FREEGLUT_HEADERS}
50     src/fg_callbacks.c
51     src/fg_cursor.c
52     src/fg_display.c
53     src/fg_ext.c
54     src/fg_font_data.c
55     src/fg_gamemode.c
56     src/fg_gl2.c
57     src/fg_gl2.h
58     src/fg_init.c
59     src/fg_init.h
60     src/fg_internal.h
61     src/fg_input_devices.c
62     src/fg_joystick.c
63     src/fg_main.c
64     src/fg_main.h
65     src/fg_misc.c
66     src/fg_overlay.c
67     src/fg_spaceball.c
68     src/fg_state.c
69     src/fg_stroke_mono_roman.c
70     src/fg_stroke_roman.c
71     src/fg_structure.c
72     src/fg_videoresize.c
73     src/fg_window.c
74 )
75 # TODO: OpenGL ES requires a compatible version of these files:
76 IF(NOT FREEGLUT_GLES2 AND NOT FREEGLUT_GLES1)
77     LIST(APPEND FREEGLUT_SRCS
78         src/fg_font.c
79         src/fg_menu.c
80         src/fg_teapot.c
81         src/fg_teapot_data.h
82         src/fg_geometry.c
83     )
84 ELSE()
85     LIST(APPEND FREEGLUT_SRCS
86         src/fg_geometry.c
87         src/gles_stubs.c
88     )
89 ENDIF()
90
91 IF(WIN32)
92     LIST(APPEND FREEGLUT_SRCS
93         src/mswin/fg_cursor_mswin.c
94         src/mswin/fg_display_mswin.c
95         src/mswin/fg_ext_mswin.c
96         src/mswin/fg_gamemode_mswin.c
97         src/mswin/fg_init_mswin.c
98         src/mswin/fg_internal_mswin.h
99         src/mswin/fg_input_devices_mswin.c
100         src/mswin/fg_joystick_mswin.c
101         src/mswin/fg_main_mswin.c
102         src/mswin/fg_menu_mswin.c
103         src/mswin/fg_spaceball_mswin.c
104         src/mswin/fg_state_mswin.c
105         src/mswin/fg_structure_mswin.c
106         src/mswin/fg_window_mswin.c
107         ${CMAKE_BINARY_DIR}/freeglut.rc # generated below from freeglut.rc.in
108     )
109     IF (MSVC AND NOT CMAKE_CL_64)
110         # .def file only for 32bit Windows builds (TODO: MSVC only right
111         # now, needed for any other Windows platform?)
112         LIST(APPEND FREEGLUT_SRCS
113             ${CMAKE_BINARY_DIR}/freeglutdll.def # generated below from src/freeglutdll.def.in
114         )
115     ENDIF()
116
117 ELSEIF(ANDROID)
118     LIST(APPEND FREEGLUT_SRCS
119         src/android/native_app_glue/android_native_app_glue.c
120         src/android/native_app_glue/android_native_app_glue.h
121         src/android/fg_internal_android.h
122         src/android/fg_cursor_android.c
123         src/android/fg_ext_android.c
124         src/android/fg_gamemode_android.c
125         src/android/fg_init_android.c
126         src/android/fg_input_devices_android.c
127         src/android/fg_joystick_android.c
128         src/android/fg_main_android.c
129         src/android/fg_main_android.h
130         src/android/fg_runtime_android.c
131         src/android/fg_spaceball_android.c
132         src/android/fg_state_android.c
133         src/android/fg_structure_android.c
134         src/android/fg_window_android.c
135     )
136 ELSE()
137     LIST(APPEND FREEGLUT_SRCS
138         src/x11/fg_cursor_x11.c
139         src/x11/fg_ext_x11.c
140         src/x11/fg_gamemode_x11.c
141         src/x11/fg_glutfont_definitions_x11.c
142         src/x11/fg_init_x11.c
143         src/x11/fg_internal_x11.h
144         src/x11/fg_input_devices_x11.c
145         src/x11/fg_joystick_x11.c
146         src/x11/fg_main_x11.c
147         src/x11/fg_menu_x11.c
148         src/x11/fg_spaceball_x11.c
149         src/x11/fg_state_x11.c
150         src/x11/fg_structure_x11.c
151         src/x11/fg_window_x11.c
152         src/x11/fg_xinput_x11.c
153     )
154     IF(NOT(FREEGLUT_GLES2 OR FREEGLUT_GLES1))
155         LIST(APPEND FREEGLUT_SRCS
156             src/x11/fg_internal_x11_glx.h
157             src/x11/fg_display_x11_glx.c
158             src/x11/fg_state_x11_glx.c
159             src/x11/fg_state_x11_glx.h
160             src/x11/fg_window_x11_glx.c
161             src/x11/fg_window_x11_glx.h
162         )
163     ENDIF()
164 ENDIF()
165 IF(FREEGLUT_GLES2 OR FREEGLUT_GLES1)
166     LIST(APPEND FREEGLUT_SRCS
167         src/egl/fg_internal_egl.h
168         src/egl/fg_display_egl.c
169         src/egl/fg_ext_egl.c
170         src/egl/fg_init_egl.c
171         src/egl/fg_init_egl.h
172         src/egl/fg_state_egl.c
173         src/egl/fg_state_egl.h
174         src/egl/fg_structure_egl.c
175         src/egl/fg_structure_egl.h
176         src/egl/fg_window_egl.c
177         src/egl/fg_window_egl.h
178     )
179 ENDIF()
180
181 # For OpenGL ES (GLES):
182 # - compile with -DFREEGLUT_GLES1 and -DFREEGLUT_GLES2 to cleanly
183 #   bootstrap headers inclusion in freeglut_std.h; these constants
184 #   also need to be defined in client applications (e.g. through
185 #   pkg-config), but use GLES constants directly for all other needs
186 # - define GLES version-specific library
187 IF(FREEGLUT_GLES2)
188   ADD_DEFINITIONS(-DFREEGLUT_GLES2)
189   LIST(APPEND LIBS GLESv2 EGL)
190 ELSEIF(FREEGLUT_GLES1)
191   ADD_DEFINITIONS(-DFREEGLUT_GLES1)
192   LIST(APPEND LIBS GLESv1_CM EGL)
193 ELSE()
194   FIND_PACKAGE(OpenGL REQUIRED)
195   LIST(APPEND LIBS ${OPENGL_gl_LIBRARY})
196   INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
197 ENDIF()
198
199 # lib m for math, not needed on windows
200 IF (NOT WIN32)
201     # For compilation:
202     LIST(APPEND LIBS m)
203     # For CHECK_FUNCTION_EXISTS:
204     LIST(APPEND CMAKE_REQUIRED_LIBRARIES m)
205 ENDIF()
206
207 IF(WIN32)
208     # hide insecure CRT warnings, common practice
209     ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
210     IF(MSVC)
211         SET( CMAKE_DEBUG_POSTFIX "d" )
212     ENDIF(MSVC)
213     
214 ENDIF()
215
216 IF(CMAKE_COMPILER_IS_GNUCC)
217   SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
218   IF(!ANDROID)
219     # not setting -ansi as EGL/KHR headers doesn't support it
220     SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi")
221   ENDIF()
222 ENDIF(CMAKE_COMPILER_IS_GNUCC)
223
224 INCLUDE(CheckIncludeFiles)
225 IF(UNIX AND NOT ANDROID)
226     FIND_PACKAGE(X11 REQUIRED)
227     LIST(APPEND LIBS ${X11_LIBRARIES})
228     IF(X11_Xrandr_FOUND)
229         SET(HAVE_X11_EXTENSIONS_XRANDR_H TRUE)
230         LIST(APPEND LIBS ${X11_Xrandr_LIB})
231     ENDIF()
232     IF(X11_xf86vmode_FOUND)
233         SET(HAVE_X11_EXTENSIONS_XF86VMODE_H TRUE)
234         # Work-around http://www.cmake.org/Bug/bug_view_page.php?bug_id=6976
235         IF(NOT "${X11_Xxf86vm_LIB}")
236             SET(X11_Xxf86vm_LIB "Xxf86vm")
237         ENDIF()
238         LIST(APPEND LIBS ${X11_Xxf86vm_LIB})
239     ENDIF()
240     IF(X11_Xinput_FOUND)
241         # Needed for multi-touch:
242         CHECK_INCLUDE_FILES("${X11_Xinput_INCLUDE_PATH}/X11/extensions/XInput2.h" HAVE_X11_EXTENSIONS_XINPUT2_H)
243         LIST(APPEND LIBS ${X11_Xinput_LIB})
244     ENDIF()
245 ENDIF()
246 IF(ANDROID)
247     # -landroid for ANativeWindow
248     # -llog for native Android logging
249     LIST(APPEND LIBS android log)
250 ENDIF()
251
252 INCLUDE(CheckFunctionExists)
253 INCLUDE(CheckTypeSize)
254 CHECK_INCLUDE_FILES(sys/types.h HAVE_SYS_TYPES_H)
255 CHECK_INCLUDE_FILES(unistd.h    HAVE_UNISTD_H)
256 CHECK_INCLUDE_FILES(sys/time.h  HAVE_SYS_TIME_H)
257 CHECK_INCLUDE_FILES(stdbool.h   HAVE_STDBOOL_H)
258 CHECK_INCLUDE_FILES(sys/param.h HAVE_SYS_PARAM_H)
259 CHECK_INCLUDE_FILES(sys/ioctl.h HAVE_SYS_IOCTL_H)
260 CHECK_INCLUDE_FILES(fcntl.h     HAVE_FCNTL_H)
261 CHECK_INCLUDE_FILES(errno.h     HAVE_ERRNO_H)
262 CHECK_INCLUDE_FILES(usbhid.h    HAVE_USBHID_H)
263 CHECK_FUNCTION_EXISTS(gettimeofday HAVE_GETTIMEOFDAY)
264 CHECK_FUNCTION_EXISTS(vfprintf  HAVE_VFPRINTF)
265 CHECK_FUNCTION_EXISTS(_doprnt   HAVE_DOPRNT)
266 CHECK_FUNCTION_EXISTS(XParseGeometry   HAVE_XPARSEGEOMETRY)
267 IF (NOT HAVE_XPARSEGEOMETRY)
268    LIST(APPEND FREEGLUT_SRCS
269         src/util/xparsegeometry_repl.c
270         src/util/xparsegeometry_repl.h)
271    SET(NEED_XPARSEGEOMETRY_IMPL TRUE)
272 ENDIF()
273 # decide on suitable type for internal time keeping, 64-bit if possible
274 CHECK_INCLUDE_FILES(stdint.h    HAVE_STDINT_H)
275 CHECK_INCLUDE_FILES(inttypes.h  HAVE_INTTYPES_H)
276 IF (NOT (HAVE_STDINT_H OR HAVE_INTTYPES_H))
277     IF (MSVC)
278         # Some old Microsoft VC releases don't support unsigned long
279         # long, but all we care about is support for unsigned __int64 on
280         # MSVC, so test for presence of that type
281         CHECK_TYPE_SIZE("unsigned __int64" U__INT64 BUILTIN_TYPES_ONLY)
282     ELSEIF()
283         CHECK_TYPE_SIZE("unsigned long long" ULONG_LONG BUILTIN_TYPES_ONLY)
284     ENDIF()
285 ENDIF()
286
287 # The generated config.h is placed in the project's build directory, just to
288 # ensure that all CMake-generated files are kept away from the main source tree.
289 # As a result, the build directory must to be added to the include path list.
290 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/config.h.in ${CMAKE_BINARY_DIR}/config.h)
291 INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/include ${CMAKE_SOURCE_DIR}/src)
292 ADD_DEFINITIONS(-DHAVE_CONFIG_H)
293 IF(WIN32)
294     # we also have to generate freeglut.rc, which contains the version
295     # number
296     CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/freeglut.rc.in ${CMAKE_BINARY_DIR}/freeglut.rc)
297     IF (MSVC AND NOT CMAKE_CL_64)
298         # .def file only for 32bit Windows builds with Visual Studio
299         CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/src/freeglutdll.def.in ${CMAKE_BINARY_DIR}/freeglutdll.def)
300     ENDIF()
301 ENDIF()
302
303 IF(BUILD_SHARED_LIBS)
304     ADD_LIBRARY(freeglut SHARED ${FREEGLUT_SRCS})
305 ENDIF()
306 IF(BUILD_STATIC_LIBS)
307     ADD_LIBRARY(freeglut_static STATIC ${FREEGLUT_SRCS})
308 ENDIF()
309
310
311 IF(WIN32)
312     LIST(APPEND LIBS winmm)
313     IF(BUILD_SHARED_LIBS)
314         SET_TARGET_PROPERTIES(freeglut PROPERTIES COMPILE_FLAGS -DFREEGLUT_EXPORTS)
315     ENDIF()
316     IF(BUILD_STATIC_LIBS)
317         SET_TARGET_PROPERTIES(freeglut_static PROPERTIES COMPILE_FLAGS -DFREEGLUT_STATIC)
318         # need to set machine:x64 for linker, at least for VC10, and
319         # doesn't hurt for older compilers:
320         # http://public.kitware.com/Bug/view.php?id=11240#c22768
321         IF (CMAKE_CL_64)
322             SET_TARGET_PROPERTIES(freeglut_static PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
323         ENDIF()
324     ENDIF()
325 ELSE()
326     # on UNIX we need to make sure:
327     # - all shared libraries must have a soname/version, see :
328     #   http://sourceware.org/autobook/autobook/autobook_91.html#SEC91
329     #   http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
330     #   Current: -version-info 12:0:9 -> 3.9.0
331     #   Note: most platforms now prefer the latter major.minor.revision form
332     #   (e.g. FreeBSD, cf. http://debbugs.gnu.org/cgi/bugreport.cgi?bug=8765),
333     #   or special-cased FreeGLUT long ago (e.g. .so.4 on OpenBSD), so
334     #   the lack of support for current:revision:age in CMake should
335     #   not be a problem.
336     # - the output library should be named glut so it'll be linkable with -lglut
337     # - the shared library should link to the dependency libraries so that the user
338     #   won't have to link them explicitly (they shouldn't have to know that we depend
339     #   on Xrandr or Xxf86vm)
340     IF(FREEGLUT_GLES2)
341       SET(LIBNAME freeglut-gles2)
342     ELSEIF(FREEGLUT_GLES1)
343       SET(LIBNAME freeglut-gles1)
344     ELSE()
345       SET(LIBNAME glut)
346     ENDIF()
347
348     SET_TARGET_PROPERTIES(freeglut PROPERTIES VERSION 3.9.0 SOVERSION 3 OUTPUT_NAME ${LIBNAME})
349     SET_TARGET_PROPERTIES(freeglut_static PROPERTIES OUTPUT_NAME ${LIBNAME})
350     IF(ANDROID)
351         # Not in CMake toolchain file, because the toolchain
352         # file is called several times and generally doesn't
353         # seem to be meant for modifying CFLAGS:
354         # '-mandroid' is not mandatory but doesn't hurt
355         # '-O0 -gstabs+' helps the currently buggy GDB port
356         # Too late to manipulate ENV: SET(ENV{CFLAGS} "$ENV{CFLAGS} -mandroid")
357         # Not using _INIT variables, they seem to be used internally only
358         SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mandroid")
359         SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -gstabs+")
360     ENDIF()
361 ENDIF()
362 IF(BUILD_SHARED_LIBS)
363     TARGET_LINK_LIBRARIES(freeglut ${LIBS})
364 ENDIF()
365 IF(BUILD_STATIC_LIBS)
366     TARGET_LINK_LIBRARIES(freeglut_static ${LIBS})
367 ENDIF()
368
369 IF(BUILD_SHARED_LIBS)
370     INSTALL(TARGETS freeglut
371             RUNTIME DESTINATION bin
372             LIBRARY DESTINATION lib
373             ARCHIVE DESTINATION lib
374     )
375     IF(INSTALL_PDB)
376         INSTALL(FILES ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Debug/freeglut${CMAKE_DEBUG_POSTFIX}.pdb
377             DESTINATION bin
378                         CONFIGURATIONS Debug)
379     ENDIF()
380 ENDIF()
381 IF(BUILD_STATIC_LIBS)
382     INSTALL(TARGETS freeglut_static
383             RUNTIME DESTINATION bin
384             LIBRARY DESTINATION lib
385             ARCHIVE DESTINATION lib
386     )
387     IF(INSTALL_PDB)
388         INSTALL(FILES ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/Debug/freeglut_static${CMAKE_DEBUG_POSTFIX}.pdb
389             DESTINATION lib
390                         CONFIGURATIONS Debug)
391     ENDIF()
392 ENDIF()
393 INSTALL(FILES ${FREEGLUT_HEADERS} DESTINATION include/GL)
394
395
396
397 # Optionally build demos, on by default.
398 option( FREEGLUT_BUILD_DEMOS "Build FreeGLUT demos." ON )
399
400 SET(DEMO_LIBS ${OPENGL_glu_LIBRARY} ${LIBS})
401 # lib m for math, not needed on windows
402 IF (NOT WIN32)
403     LIST(APPEND DEMO_LIBS m)
404 ENDIF()
405
406 MACRO(ADD_DEMO name)
407     IF( FREEGLUT_BUILD_DEMOS )
408         IF(BUILD_SHARED_LIBS)
409             ADD_EXECUTABLE(${name} ${ARGN})
410             TARGET_LINK_LIBRARIES(${name} ${DEMO_LIBS} freeglut)
411             IF(WIN32 AND MSVC)
412                 SET_TARGET_PROPERTIES(${name} PROPERTIES DEBUG_POSTFIX d)
413             ENDIF()
414         ENDIF()
415         IF(BUILD_STATIC_LIBS)
416             ADD_EXECUTABLE(${name}_static ${ARGN})
417             TARGET_LINK_LIBRARIES(${name}_static ${DEMO_LIBS} freeglut_static)
418             SET_TARGET_PROPERTIES(${name}_static PROPERTIES COMPILE_FLAGS -DFREEGLUT_STATIC)
419             IF(WIN32 AND MSVC)
420                 SET_TARGET_PROPERTIES(${name}_static PROPERTIES DEBUG_POSTFIX d)
421             ENDIF()
422         ENDIF()
423     ENDIF()
424 ENDMACRO()
425
426 ADD_DEMO(CallbackMaker   progs/demos/CallbackMaker/CallbackMaker.c)
427 ADD_DEMO(Fractals        progs/demos/Fractals/fractals.c)
428 ADD_DEMO(Fractals_random progs/demos/Fractals_random/fractals_random.c)
429 ADD_DEMO(Lorenz          progs/demos/Lorenz/lorenz.c)
430 ADD_DEMO(One             progs/demos/One/one.c)
431 ADD_DEMO(Resizer         progs/demos/Resizer/Resizer.cpp)
432 ADD_DEMO(multi-touch     progs/demos/multi-touch/multi-touch.c)
433 ADD_DEMO(shapes          progs/demos/shapes/shapes.c
434                          progs/demos/shapes/glmatrix.h
435                          progs/demos/shapes/glmatrix.c)
436 ADD_DEMO(smooth_opengl3  progs/demos/smooth_opengl3/smooth_opengl3.c)
437 IF(UNIX)
438     ADD_DEMO(spaceball       progs/demos/spaceball/spaceball.c
439                              progs/demos/spaceball/vmath.c
440                              progs/demos/spaceball/vmath.h)
441 ENDIF()
442 ADD_DEMO(subwin          progs/demos/subwin/subwin.c)
443 ADD_DEMO(timer           progs/demos/timer/timer.c)
444
445
446
447 # pkg-config support, to install at $(libdir)/pkgconfig
448 # Define static build dependencies
449 IF(WIN32)
450   SET(PC_LIBS_PRIVATE "-lopengl32 -lwinmm -lgdi32 -lm")
451 ELSEIF(FREEGLUT_GLES2)
452   IF(ANDROID)
453     SET(PC_LIBS_PRIVATE "-llog -landroid -lGLESv2 -lEGL -lm")
454   ELSE()
455     SET(PC_LIBS_PRIVATE "-lX11 -lXxf86vm -lXrandr -lGLESv2 -lEGL -lm")
456   ENDIF()
457 ELSEIF(FREEGLUT_GLES1)
458   IF(ANDROID)
459     SET(PC_LIBS_PRIVATE "-llog -landroid -lGLESv1_CM -lEGL -lm")
460   ELSE()
461     SET(PC_LIBS_PRIVATE "-lX11 -lXxf86vm -lXrandr -lGLESv1_CM -lEGL -lm")
462   ENDIF()
463 ELSE()
464   SET(PC_LIBS_PRIVATE "-lX11 -lXxf86vm -lXrandr -lGL -lm")
465 ENDIF()
466 # Client applications need to define FreeGLUT GLES version to
467 # bootstrap headers inclusion in freeglut_std.h:
468 SET(PC_LIBNAME "glut")
469 SET(PC_FILENAME "freeglut.pc")
470 IF(FREEGLUT_GLES2)
471   SET(PC_CFLAGS "-DFREEGLUT_GLES2")
472   SET(PC_LIBNAME "freeglut-gles2")
473   SET(PC_FILENAME "freeglut-gles2.pc")
474 ELSEIF(FREEGLUT_GLES1)
475   SET(PC_CFLAGS "-DFREEGLUT_GLES1")
476   SET(PC_LIBNAME "freeglut-gles1")
477   SET(PC_FILENAME "freeglut-gles1.pc")
478 ENDIF()
479 CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/freeglut.pc.in ${CMAKE_BINARY_DIR}/freeglut.pc @ONLY)
480 INSTALL(FILES ${CMAKE_BINARY_DIR}/freeglut.pc DESTINATION share/pkgconfig/ RENAME ${PC_FILENAME})
481 # TODO: change the library and .pc name when building for GLES,
482 # e.g. -lglut-GLES2