2019-03-23 01:35:55 +08:00
include ( vcpkg_common_functions )
2019-08-09 07:43:39 +08:00
if ( NOT CMAKE_HOST_WIN32 )
2019-03-26 20:20:11 +08:00
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 )
vcpkg_add_to_path ( "${PYTHON3_DIR}" )
2019-07-03 04:47:50 +08:00
2019-08-09 07:43:39 +08:00
if ( CMAKE_HOST_WIN32 )
# Must not modify system copy of python3 -- on CMAKE_HOST_WIN32, we have our own private copy
2019-09-24 04:47:07 +08:00
if ( NOT EXISTS ${ PYTHON3_DIR } /easy_install ${ EXECUTABLE_SUFFIX } )
if ( NOT EXISTS ${ PYTHON3_DIR } /Scripts/pip ${ EXECUTABLE_SUFFIX } )
2019-08-09 07:43:39 +08:00
get_filename_component ( PYTHON3_DIR_NAME "${PYTHON3_DIR}" NAME )
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 / 3 . 3 / g e t - p i p . p y "
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 "
S H A 5 1 2 9 2 e 6 8 5 2 5 8 3 0 b b 2 3 9 5 5 a 3 1 c b 1 9 e b c 3 0 2 1 e f 1 6 b 6 3 3 7 e a b 8 3 d 5 d b 2 9 6 1 b 7 9 1 2 8 3 d 2 8 6 7 2 0 7 5 4 5 f a f 8 3 6 3 5 f 6 0 2 7 f 2 f 7 b 7 f 8 f e e 2 c 8 5 f 2 c f d 8 e 8 2 6 7 d f 2 5 4 0 6 4 7 4 5 7 1 c 7 4 1
)
2019-09-24 04:47:07 +08:00
execute_process ( COMMAND ${ PYTHON3_DIR } /python ${ EXECUTABLE_SUFFIX } ${ GET_PIP } )
2019-08-09 07:43:39 +08:00
endif ( )
2019-09-24 04:47:07 +08:00
execute_process ( COMMAND ${ PYTHON3_DIR } /Scripts/pip ${ EXECUTABLE_SUFFIX } install six )
2019-08-09 07:43:39 +08:00
else ( )
2019-09-24 04:47:07 +08:00
execute_process ( COMMAND ${ PYTHON3_DIR } /easy_install ${ EXECUTABLE_SUFFIX } six )
2019-03-23 01:35:55 +08:00
endif ( )
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
2019-09-24 04:47:07 +08:00
O P T I O N S
- D B I N _ I N S T A L L _ D I R : S T R I N G = b i n
2019-03-23 01:35:55 +08:00
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 )
2019-09-24 04:47:07 +08:00
vcpkg_copy_pdbs ( )
file ( INSTALL ${ SOURCE_PATH } /LICENSE DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } RENAME copyright )