[readosm] Fix build failure when VCPKG_BUILD_TYPE is set

This commit is contained in:
past-due 2018-03-19 18:13:36 -04:00
parent 5968ebf9f4
commit 72564e610e

View File

@ -30,6 +30,7 @@ endif()
################ ################
# Debug build # Debug build
################ ################
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
message(STATUS "Building ${TARGET_TRIPLET}-dbg") message(STATUS "Building ${TARGET_TRIPLET}-dbg")
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/debug" INST_DIR_DBG) file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/debug" INST_DIR_DBG)
@ -43,10 +44,12 @@ vcpkg_execute_required_process(
) )
vcpkg_copy_pdbs() vcpkg_copy_pdbs()
message(STATUS "Building ${TARGET_TRIPLET}-dbg done") message(STATUS "Building ${TARGET_TRIPLET}-dbg done")
endif()
################ ################
# Release build # Release build
################ ################
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
message(STATUS "Building ${TARGET_TRIPLET}-rel") message(STATUS "Building ${TARGET_TRIPLET}-rel")
file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" INST_DIR_REL) file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" INST_DIR_REL)
@ -58,6 +61,7 @@ vcpkg_execute_required_process(
LOGNAME nmake-build-${TARGET_TRIPLET}-release LOGNAME nmake-build-${TARGET_TRIPLET}-release
) )
message(STATUS "Building ${TARGET_TRIPLET}-rel done") message(STATUS "Building ${TARGET_TRIPLET}-rel done")
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/readosm RENAME copyright) file(INSTALL ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/readosm RENAME copyright)
@ -70,9 +74,13 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static)
else() else()
file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/readosm.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/lib/readosm.lib)
file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/readosm.lib) file(REMOVE ${CURRENT_PACKAGES_DIR}/debug/lib/readosm.lib)
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
file(RENAME ${CURRENT_PACKAGES_DIR}/lib/readosm_i.lib ${CURRENT_PACKAGES_DIR}/lib/readosm.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/lib/readosm_i.lib ${CURRENT_PACKAGES_DIR}/lib/readosm.lib)
endif()
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/readosm_i.lib ${CURRENT_PACKAGES_DIR}/debug/lib/readosm.lib) file(RENAME ${CURRENT_PACKAGES_DIR}/debug/lib/readosm_i.lib ${CURRENT_PACKAGES_DIR}/debug/lib/readosm.lib)
endif() endif()
endif()
message(STATUS "Packaging ${TARGET_TRIPLET} done") message(STATUS "Packaging ${TARGET_TRIPLET} done")