From bcf3fe1b4600eb9926d8d17a5a6cca363f0d3ee4 Mon Sep 17 00:00:00 2001 From: Johannes Zarl Date: Sat, 11 Jul 2015 21:27:03 +0000 Subject: [PATCH] Set public definitions in cmake package. As with pkg-config, the cmake package now sets "-DFREEGLUT_GLES" when appropriate. (cherry picked from commit 792d805542a9a96053e1fb3e49f9518ee462d9b0) (cherry picked from commit 792d805542a9a96053e1fb3e49f9518ee462d9b0) git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@1771 7f0cb862-5218-0410-a997-914c9d46530a --- CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4be7c73..be50f98 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -245,8 +245,8 @@ ENDIF() # but do use GLES constants directly for all other needs # GLES1 and GLES2 libraries are compatible and can be co-linked. IF(FREEGLUT_GLES) - ADD_DEFINITIONS(-DFREEGLUT_GLES) - LIST(APPEND LIBS GLESv2 GLESv1_CM EGL) + LIST(APPEND PUBLIC_DEFINITIONS -DFREEGLUT_GLES) + LIST(APPEND LIBS GLESv2 GLESv1_CM EGL) ELSE() FIND_PACKAGE(OpenGL REQUIRED) LIST(APPEND LIBS ${OPENGL_gl_LIBRARY}) @@ -449,9 +449,11 @@ ELSE() ENDIF() IF(FREEGLUT_BUILD_SHARED_LIBS) TARGET_LINK_LIBRARIES(freeglut ${LIBS}) + TARGET_COMPILE_DEFINITIONS(freeglut PUBLIC ${PUBLIC_DEFINITIONS}) ENDIF() IF(FREEGLUT_BUILD_STATIC_LIBS) TARGET_LINK_LIBRARIES(freeglut_static ${LIBS}) + TARGET_COMPILE_DEFINITIONS(freeglut_static PUBLIC ${PUBLIC_DEFINITIONS}) ENDIF() IF(FREEGLUT_BUILD_SHARED_LIBS) -- 1.7.10.4