2016-09-19 11:50:08 +08:00
|
|
|
include(vcpkg_execute_required_process)
|
|
|
|
|
|
|
|
function(vcpkg_extract_source_archive ARCHIVE)
|
2016-09-29 23:27:12 +08:00
|
|
|
if(NOT ARGC EQUAL 2)
|
|
|
|
set(WORKING_DIRECTORY ${CURRENT_BUILDTREES_DIR}/src)
|
|
|
|
else()
|
|
|
|
set(WORKING_DIRECTORY ${ARGV1})
|
|
|
|
endif()
|
|
|
|
|
2016-09-21 12:09:00 +08:00
|
|
|
get_filename_component(ARCHIVE_FILENAME ${ARCHIVE} NAME)
|
2016-09-29 23:27:12 +08:00
|
|
|
if(NOT EXISTS ${WORKING_DIRECTORY}/${ARCHIVE_FILENAME}.extracted)
|
2016-09-19 11:50:08 +08:00
|
|
|
message(STATUS "Extracting source ${ARCHIVE}")
|
2016-09-29 23:27:12 +08:00
|
|
|
file(MAKE_DIRECTORY ${WORKING_DIRECTORY})
|
2016-09-19 11:50:08 +08:00
|
|
|
vcpkg_execute_required_process(
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E tar xjf ${ARCHIVE}
|
2016-09-29 23:27:12 +08:00
|
|
|
WORKING_DIRECTORY ${WORKING_DIRECTORY}
|
2016-09-19 11:50:08 +08:00
|
|
|
LOGNAME extract
|
|
|
|
)
|
2016-09-29 23:27:12 +08:00
|
|
|
file(WRITE ${WORKING_DIRECTORY}/${ARCHIVE_FILENAME}.extracted)
|
2016-09-19 11:50:08 +08:00
|
|
|
endif()
|
|
|
|
message(STATUS "Extracting done")
|
|
|
|
endfunction()
|