[flatbuffers] fix executable remaining in bin folder (#4294)

* [flatbuffers] fix executable remaining in bin folder

* [flatbuffers] clean portfile for flatc executable
This commit is contained in:
Erwan BERNARD 2018-10-16 11:27:22 +02:00 committed by Robert Schumacher
parent de7bc03245
commit d798fd3040

View File

@ -30,22 +30,22 @@ vcpkg_configure_cmake(
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/flatbuffers")
if(EXISTS ${CURRENT_PACKAGES_DIR}/debug/bin AND NOT EXISTS ${CURRENT_PACKAGES_DIR}/debug/bin/flatc)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
if(EXISTS ${CURRENT_PACKAGES_DIR}/bin/flatc.exe)
file(GLOB flatc_path ${CURRENT_PACKAGES_DIR}/bin/flatc*)
if(flatc_path)
make_directory(${CURRENT_PACKAGES_DIR}/tools/flatbuffers)
get_filename_component(flatc_executable ${flatc_path} NAME)
file(
RENAME
${CURRENT_PACKAGES_DIR}/bin/flatc.exe
${CURRENT_PACKAGES_DIR}/tools/flatbuffers/flatc.exe
${flatc_path}
${CURRENT_PACKAGES_DIR}/tools/flatbuffers/${flatc_executable}
)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin)
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/flatbuffers)
endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
# Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/flatbuffers)
file(RENAME ${CURRENT_PACKAGES_DIR}/share/flatbuffers/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/flatbuffers/copyright)