From f8ae60976d28aea7f8aac6ef5d39669b36b41ae1 Mon Sep 17 00:00:00 2001 From: Arkady Shapkin Date: Sat, 1 Jul 2017 00:38:26 +0300 Subject: [PATCH] [freeglut] Remove debug suffix --- ports/freeglut/CONTROL | 2 +- ports/freeglut/portfile.cmake | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ports/freeglut/CONTROL b/ports/freeglut/CONTROL index 00680a7731..775f989385 100644 --- a/ports/freeglut/CONTROL +++ b/ports/freeglut/CONTROL @@ -1,3 +1,3 @@ Source: freeglut -Version: 3.0.0 +Version: 3.0.0-1 Description: Open source implementation of GLUT with source and binary backwards compatibility. \ No newline at end of file diff --git a/ports/freeglut/portfile.cmake b/ports/freeglut/portfile.cmake index 929d8b9e49..c2d1f28162 100644 --- a/ports/freeglut/portfile.cmake +++ b/ports/freeglut/portfile.cmake @@ -7,6 +7,12 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +# disable debug suffix, because FindGLUT.cmake from CMake 3.8 doesn't support it +file(READ ${SOURCE_PATH}/CMakeLists.txt FREEGLUT_CMAKELISTS) +string(REPLACE "SET( CMAKE_DEBUG_POSTFIX \"d\" )" + "\#SET( CMAKE_DEBUG_POSTFIX \"d\" )" FREEGLUT_CMAKELISTS "${FREEGLUT_CMAKELISTS}") +file(WRITE ${SOURCE_PATH}/CMakeLists.txt "${FREEGLUT_CMAKELISTS}") + if (VCPKG_LIBRARY_LINKAGE STREQUAL dynamic) set(FREEGLUT_STATIC OFF) set(FREEGLUT_DYNAMIC ON) @@ -26,6 +32,15 @@ vcpkg_configure_cmake( vcpkg_install_cmake() +# Patch header +file(READ ${CURRENT_PACKAGES_DIR}/include/GL/freeglut_std.h FREEGLUT_STDH) +string(REPLACE "pragma comment (lib, \"freeglut_staticd.lib\")" + "pragma comment (lib, \"freeglut_static.lib\")" FREEGLUT_STDH "${FREEGLUT_STDH}") +string(REPLACE "pragma comment (lib, \"freeglutd.lib\")" + "pragma comment (lib, \"freeglut.lib\")" FREEGLUT_STDH "${FREEGLUT_STDH}") +file(WRITE ${CURRENT_PACKAGES_DIR}/include/GL/freeglut_std.h "${FREEGLUT_STDH}") + +# Clean file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) # Handle copyright