This file is part of MXE. See index.html for further information. Contains ad hoc patches for cross building. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Boris Pek Date: Sat, 18 Jun 2016 16:24:52 +0300 Subject: [PATCH] Back compatibility with older freeglut packages in MXE diff --git a/CMakeLists.txt b/CMakeLists.txt index 1111111..2222222 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,7 +11,7 @@ INCLUDE(GNUInstallDirs) # CMAKE_ARCHIVE_OUTPUT_DIRECTORY instead. # Static libraries end up in CMAKE_ARCHIVE_OUTPUT_DIRECTORY on all # platforms. -SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin) +SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib) @@ -53,9 +53,9 @@ ENDIF() OPTION(FREEGLUT_GLES "Use OpenGL ES (requires EGL)" OFF) # option to build either as "glut" (ON) or "freeglut" (OFF) -IF(NOT WIN32) +#IF(NOT WIN32) OPTION(FREEGLUT_REPLACE_GLUT "Be a replacement for GLUT" ON) -ENDIF() +#ENDIF() SET(FREEGLUT_HEADERS @@ -346,12 +346,18 @@ ENDIF() IF(WIN32) + IF(FREEGLUT_REPLACE_GLUT) + SET(LIBNAME glut) + ELSE() + SET(LIBNAME freeglut) + ENDIF() + LIST(APPEND LIBS winmm) IF(FREEGLUT_BUILD_SHARED_LIBS) - SET_TARGET_PROPERTIES(freeglut PROPERTIES COMPILE_FLAGS -DFREEGLUT_EXPORTS) + SET_TARGET_PROPERTIES(freeglut PROPERTIES COMPILE_FLAGS -DFREEGLUT_EXPORTS OUTPUT_NAME ${LIBNAME}) ENDIF() IF(FREEGLUT_BUILD_STATIC_LIBS) - SET_TARGET_PROPERTIES(freeglut_static PROPERTIES COMPILE_FLAGS -DFREEGLUT_STATIC) + SET_TARGET_PROPERTIES(freeglut_static PROPERTIES COMPILE_FLAGS -DFREEGLUT_STATIC OUTPUT_NAME ${LIBNAME}) # need to set machine:x64 for linker, at least for VC10, and # doesn't hurt for older compilers: # http://public.kitware.com/Bug/view.php?id=11240#c22768