aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alex@karatarakis.com>2018-03-20 01:29:25 -0700
committerGitHub <noreply@github.com>2018-03-20 01:29:25 -0700
commit9415cc099196bc70dcde575e31835e9874f9d146 (patch)
tree8bf53daaf1118db082ce7f2238d699631377eee7
parent41d5f84e2858460d2506e64367c72dd64ed10ab6 (diff)
parent241e3ddd25b55af4d70195a88fc463aa593366b8 (diff)
downloadvcpkg-9415cc099196bc70dcde575e31835e9874f9d146.tar.gz
vcpkg-9415cc099196bc70dcde575e31835e9874f9d146.zip
Merge pull request #3082 from past-due/proj4_fix_vcpkg_build_type
[proj4] Fix build failure when VCPKG_BUILD_TYPE is set
-rw-r--r--ports/proj4/portfile.cmake24
1 files changed, 16 insertions, 8 deletions
diff --git a/ports/proj4/portfile.cmake b/ports/proj4/portfile.cmake
index 626d6b2e4..bc4e66fcd 100644
--- a/ports/proj4/portfile.cmake
+++ b/ports/proj4/portfile.cmake
@@ -40,13 +40,17 @@ vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH share/proj4)
# Rename library and adapt cmake configuration
-file(READ ${CURRENT_PACKAGES_DIR}/share/proj4/proj4-targets-release.cmake _contents)
-string(REPLACE "proj_4_9.lib" "proj.lib" _contents "${_contents}")
-file(WRITE ${CURRENT_PACKAGES_DIR}/share/proj4/proj4-targets-release.cmake "${_contents}")
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ file(READ ${CURRENT_PACKAGES_DIR}/share/proj4/proj4-targets-release.cmake _contents)
+ string(REPLACE "proj_4_9.lib" "proj.lib" _contents "${_contents}")
+ file(WRITE ${CURRENT_PACKAGES_DIR}/share/proj4/proj4-targets-release.cmake "${_contents}")
+endif()
-file(READ ${CURRENT_PACKAGES_DIR}/share/proj4/proj4-targets-debug.cmake _contents)
-string(REPLACE "proj_4_9_d.lib" "projd.lib" _contents "${_contents}")
-file(WRITE ${CURRENT_PACKAGES_DIR}/share/proj4/proj4-targets-debug.cmake "${_contents}")
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ file(READ ${CURRENT_PACKAGES_DIR}/share/proj4/proj4-targets-debug.cmake _contents)
+ string(REPLACE "proj_4_9_d.lib" "projd.lib" _contents "${_contents}")
+ file(WRITE ${CURRENT_PACKAGES_DIR}/share/proj4/proj4-targets-debug.cmake "${_contents}")
+endif()
file(READ ${CURRENT_PACKAGES_DIR}/share/proj4/proj4-targets.cmake _contents)
string(REPLACE "set(_IMPORT_PREFIX \"${CURRENT_PACKAGES_DIR}\")"
@@ -55,8 +59,12 @@ string(REPLACE "set(_IMPORT_PREFIX \"${CURRENT_PACKAGES_DIR}\")"
)
file(WRITE ${CURRENT_PACKAGES_DIR}/share/proj4/proj4-targets.cmake "${_contents}")
-file(RENAME ${CURRENT_PACKAGES_DIR}/lib/proj_4_9.lib ${CURRENT_PACKAGES_DIR}/lib/proj.lib)
-file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/proj_4_9_d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/projd.lib)
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ file(RENAME ${CURRENT_PACKAGES_DIR}/lib/proj_4_9.lib ${CURRENT_PACKAGES_DIR}/lib/proj.lib)
+endif()
+if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/proj_4_9_d.lib ${CURRENT_PACKAGES_DIR}/debug/lib/projd.lib)
+endif()
# Remove duplicate headers installed from debug build
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)