2019-03-23 01:35:55 +08:00
include ( vcpkg_common_functions )
2019-03-26 20:20:11 +08:00
if ( VCPKG_CMAKE_SYSTEM_NAME STREQUAL "Linux" )
message ( "${PORT} currently requires the following tools from the system package manager:\n python-six\n\nThis can be installed on Ubuntu systems via apt-get install python-six python3-six (depending on your current python default interpreter)" )
endif ( )
if ( VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" )
message ( FATAL_ERROR "${PORT} does not currently support UWP" )
endif ( )
2019-03-23 01:35:55 +08:00
vcpkg_from_github (
O U T _ S O U R C E _ P A T H S O U R C E _ P A T H
R E P O o p e n 6 2 5 4 1 / o p e n 6 2 5 4 1
R E F v 0 . 3 . 0
S H A 5 1 2 6 7 7 6 6 d 2 2 6 e 1 b 9 0 0 c 0 c 3 7 3 0 9 0 9 9 e c d b e 9 8 7 d 1 0 8 8 8 e b f 4 3 f 9 0 6 6 b 2 1 c f 7 9 f 6 4 d 3 4 e 6 a c 3 0 c 2 6 7 1 a 4 9 0 1 8 9 2 f 0 4 4 8 5 9 d a 4 e 8 d b a a 9 f e d 5 a 4 9 c 6 3 3 f 7 3 f e f 3 b e c 7 5 7 7 4 0 5 0
H E A D _ R E F m a s t e r
)
file ( READ ${ SOURCE_PATH } /CMakeLists.txt OPEN62541_CMAKELISTS )
string ( REPLACE
" R U N T I M E D E S T I N A T I O N \ $ { C M A K E _ I N S T A L L _ P R E F I X } "
" R U N T I M E D E S T I N A T I O N \ $ { B I N _ I N S T A L L _ D I R } "
O P E N 6 2 5 4 1 _ C M A K E L I S T S " $ { O P E N 6 2 5 4 1 _ C M A K E L I S T S } " )
file ( WRITE ${ SOURCE_PATH } /CMakeLists.txt "${OPEN62541_CMAKELISTS}" )
if ( CMAKE_HOST_WIN32 )
set ( EXECUTABLE_SUFFIX ".exe" )
else ( )
set ( EXECUTABLE_SUFFIX "" )
endif ( )
vcpkg_find_acquire_program ( PYTHON3 )
get_filename_component ( PYTHON3_DIR "${PYTHON3}" DIRECTORY )
2019-07-03 04:47:50 +08:00
get_filename_component ( PYTHON3_DIR_NAME "${PYTHON3_DIR}" NAME )
2019-03-23 01:35:55 +08:00
vcpkg_add_to_path ( "${PYTHON3_DIR}" )
2019-07-03 04:47:50 +08:00
2019-03-23 01:35:55 +08:00
if ( NOT EXISTS ${ PYTHON3_DIR } /easy_install ${ EXECUTABLE_SUFFIX } )
if ( NOT EXISTS ${ PYTHON3_DIR } /Scripts/pip ${ EXECUTABLE_SUFFIX } )
vcpkg_download_distfile ( GET_PIP
U R L S " h t t p s : / / b o o t s t r a p . p y p a . i o / g e t - p i p . p y "
2019-07-03 04:47:50 +08:00
F I L E N A M E " t o o l s / p y t h o n / $ { P Y T H O N 3 _ D I R _ N A M E } / g e t - p i p . p y "
2019-05-07 01:03:39 +08:00
S H A 5 1 2 9 9 5 2 0 d 2 2 3 8 1 9 7 0 8 b 8 f 6 e 4 b 8 3 9 d 1 f a 2 1 5 e 4 e 8 a d c 7 f c d 0 d b 6 c 2 5 a 0 3 9 9 c f 2 f a 1 0 0 3 4 b 3 5 6 7 3 c f 4 5 0 6 0 9 3 0 3 6 4 6 d 1 2 4 9 7 f 3 0 1 e f 5 3 b 7 e 7 c c 6 5 c 7 8 e 7 b c e 4 a f 0 c 6 7 3 5 5 5 a d
2019-03-23 01:35:55 +08:00
)
execute_process ( COMMAND ${ PYTHON3_DIR } /python ${ EXECUTABLE_SUFFIX } ${ PYTHON3_DIR } /get-pip.py )
endif ( )
execute_process ( COMMAND ${ PYTHON3_DIR } /Scripts/pip ${ EXECUTABLE_SUFFIX } install six )
else ( )
execute_process ( COMMAND ${ PYTHON3_DIR } /easy_install ${ EXECUTABLE_SUFFIX } six )
endif ( )
vcpkg_configure_cmake (
S O U R C E _ P A T H $ { S O U R C E _ P A T H }
P R E F E R _ N I N J A
O P T I O N S _ D E B U G
- D C M A K E _ D E B U G _ P O S T F I X = d
)
vcpkg_install_cmake ( )
if ( EXISTS ${ CURRENT_PACKAGES_DIR } /lib/cmake/ ${ PORT } )
vcpkg_fixup_cmake_targets ( CONFIG_PATH lib/cmake/ ${ PORT } )
else ( )
vcpkg_fixup_cmake_targets ( CONFIG_PATH lib/cmake )
endif ( )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/include )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/share )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /share/open62541/tools )
file ( COPY ${ SOURCE_PATH } /LICENSE DESTINATION ${ CURRENT_PACKAGES_DIR } /share/open62541 )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /share/open62541/LICENSE ${ CURRENT_PACKAGES_DIR } /share/open62541/copyright )