[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_install_cmake()
vcpkg_fixup_cmake_targets(CONFIG_PATH "lib/cmake/flatbuffers") 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(GLOB flatc_path ${CURRENT_PACKAGES_DIR}/bin/flatc*)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/bin) if(flatc_path)
endif()
if(EXISTS ${CURRENT_PACKAGES_DIR}/bin/flatc.exe)
make_directory(${CURRENT_PACKAGES_DIR}/tools/flatbuffers) make_directory(${CURRENT_PACKAGES_DIR}/tools/flatbuffers)
get_filename_component(flatc_executable ${flatc_path} NAME)
file( file(
RENAME RENAME
${CURRENT_PACKAGES_DIR}/bin/flatc.exe ${flatc_path}
${CURRENT_PACKAGES_DIR}/tools/flatbuffers/flatc.exe ${CURRENT_PACKAGES_DIR}/tools/flatbuffers/${flatc_executable}
) )
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin) vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/flatbuffers)
vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/flatbuffers)
endif() endif()
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
# Handle copyright # Handle copyright
file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/flatbuffers) 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) file(RENAME ${CURRENT_PACKAGES_DIR}/share/flatbuffers/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/flatbuffers/copyright)