2018-02-05 20:15:49 +08:00
include ( vcpkg_common_functions )
vcpkg_download_distfile ( ARCHIVE
U R L S " h t t p s : / / d o w n l o a d s . s o u r c e f o r g e . n e t / p r o j e c t / e p s i l o n - p r o j e c t / e p s i l o n / 0 . 9 . 2 / e p s i l o n - 0 . 9 . 2 . t a r . g z ? r = h t t p s % 3 A % 2 F % 2 F s o u r c e f o r g e . n e t % 2 F p r o j e c t s % 2 F e p s i l o n - p r o j e c t % 2 F f i l e s % 2 F e p s i l o n % 2 F 0 . 9 . 2 % 2 F e p s i l o n - 0 . 9 . 2 . t a r . g z % 2 F d o w n l o a d % 3 F u s e _ m i r r o r % 3 D a y e r a "
F I L E N A M E " e p s i l o n - 0 . 9 . 2 . t a r . g z "
S H A 5 1 2 9 5 f 4 2 7 c 6 8 a 4 a 4 e b 7 8 4 f 7 d 4 8 4 d 8 7 f c 5 7 3 1 3 3 9 8 3 5 1 0 f 6 b 0 3 0 6 6 3 f 8 8 9 5 5 e 2 4 4 6 4 9 0 a 0 7 b 1 3 4 3 a e 4 6 6 8 2 5 1 b 4 6 6 f 6 7 c f 9 a 7 9 b d 8 3 4 b 9 3 3 c 5 7 c 5 e d 1 2 3 2 7 f 3 2 1 7 4 f 2 0 a c 0 f )
# Extract source into archictecture specific directory, because GDALs' nmake based build currently does not
# support out of source builds.
set ( SOURCE_PATH_DEBUG ${ CURRENT_BUILDTREES_DIR } /src- ${ TARGET_TRIPLET } -debug/epsilon-0.9.2 )
set ( SOURCE_PATH_RELEASE ${ CURRENT_BUILDTREES_DIR } /src- ${ TARGET_TRIPLET } -release/epsilon-0.9.2 )
2019-10-08 01:35:13 +08:00
file ( REMOVE_RECURSE ${ SOURCE_PATH_DEBUG } ${ SOURCE_PATH_RELEASE } ) # to be sure that the patches can be properly applied, we always clean the buildtrees folder
2018-02-05 20:15:49 +08:00
foreach ( BUILD_TYPE debug release )
vcpkg_extract_source_archive ( ${ ARCHIVE } ${ CURRENT_BUILDTREES_DIR } /src- ${ TARGET_TRIPLET } - ${ BUILD_TYPE } )
vcpkg_apply_patches (
S O U R C E _ P A T H $ { C U R R E N T _ B U I L D T R E E S _ D I R } / s r c - $ { T A R G E T _ T R I P L E T } - $ { B U I L D _ T Y P E } / e p s i l o n - 0 . 9 . 2
P A T C H E S
$ { C M A K E _ C U R R E N T _ L I S T _ D I R } / 0 0 0 1 - V S 2 0 1 5 - p r o v i d e s - s n p r i n t f . p a t c h
$ { C M A K E _ C U R R E N T _ L I S T _ D I R } / 0 0 0 2 - A d d - C F L A G S - f o r - C R T - s e l e c t i o n - a n d - w a r n i n g - s u p r e s s i o n . p a t c h
)
endforeach ( )
find_program ( NMAKE nmake REQUIRED )
if ( VCPKG_CRT_LINKAGE STREQUAL static )
set ( CL_FLAGS_REL "/MT /Ox /fp:precise" )
set ( CL_FLAGS_DBG "/MTd /Zi" )
set ( TARGET_LIB epsilon.lib )
else ( )
set ( CL_FLAGS_REL "/MD /Ox /fp:precise" )
set ( CL_FLAGS_DBG "/MDd /Zi" )
set ( TARGET_LIB epsilon_i.lib )
endif ( )
################
# Release build
################
message ( STATUS "Building ${TARGET_TRIPLET}-rel" )
file ( TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" INST_DIR_REL )
vcpkg_execute_required_process (
C O M M A N D $ { N M A K E } - f m a k e f i l e . v c
" I N S T D I R = \ " $ { I N S T _ D I R _ R E L } \ " "
M S V C _ V E R = 1 9 0 0
C R T _ F L A G S = $ { C L _ F L A G S _ R E L }
I N S T A L L E D _ R O O T = $ { C U R R E N T _ I N S T A L L E D _ D I R }
$ { T A R G E T _ L I B }
W O R K I N G _ D I R E C T O R Y $ { S O U R C E _ P A T H _ R E L E A S E }
L O G N A M E n m a k e - b u i l d - $ { T A R G E T _ T R I P L E T } - r e l e a s e
)
message ( STATUS "Building ${TARGET_TRIPLET}-rel done" )
################
# Debug build
################
message ( STATUS "Building ${TARGET_TRIPLET}-dbg" )
file ( TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/debug" INST_DIR_DBG )
vcpkg_execute_required_process (
C O M M A N D $ { N M A K E } / G - f m a k e f i l e . v c
" I N S T D I R = \ " $ { I N S T _ D I R _ D B G } \ " "
M S V C _ V E R = 1 9 0 0
C R T _ F L A G S = $ { C L _ F L A G S _ D B G }
D E B U G = 1
I N S T A L L E D _ R O O T = $ { C U R R E N T _ I N S T A L L E D _ D I R }
$ { T A R G E T _ L I B }
W O R K I N G _ D I R E C T O R Y $ { S O U R C E _ P A T H _ D E B U G }
L O G N A M E n m a k e - b u i l d - $ { T A R G E T _ T R I P L E T } - d e b u g
)
message ( STATUS "Building ${TARGET_TRIPLET}-dbg done" )
message ( STATUS "Packaging ${TARGET_TRIPLET}" )
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /lib )
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /debug/lib )
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /include )
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /share/epsilon/filters )
if ( VCPKG_CRT_LINKAGE STREQUAL dynamic )
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /bin )
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /debug/bin )
file ( INSTALL ${ SOURCE_PATH_RELEASE } /epsilon.dll
D E S T I N A T I O N $ { C U R R E N T _ P A C K A G E S _ D I R } / b i n / )
file ( INSTALL ${ SOURCE_PATH_DEBUG } /epsilon.dll
D E S T I N A T I O N $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / b i n / )
file ( INSTALL ${ SOURCE_PATH_RELEASE } /epsilon_i.lib
D E S T I N A T I O N $ { C U R R E N T _ P A C K A G E S _ D I R } / l i b / )
file ( INSTALL ${ SOURCE_PATH_DEBUG } /epsilon_i.lib
D E S T I N A T I O N $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / l i b / )
else ( )
file ( INSTALL ${ SOURCE_PATH_RELEASE } /epsilon.lib
D E S T I N A T I O N $ { C U R R E N T _ P A C K A G E S _ D I R } / l i b / )
file ( INSTALL ${ SOURCE_PATH_DEBUG } /epsilon.lib
D E S T I N A T I O N $ { C U R R E N T _ P A C K A G E S _ D I R } / d e b u g / l i b / )
endif ( )
file ( COPY ${ SOURCE_PATH_RELEASE } /lib/epsilon.h
D E S T I N A T I O N $ { C U R R E N T _ P A C K A G E S _ D I R } / i n c l u d e / )
file ( GLOB FILTERS ${ SOURCE_PATH_RELEASE } /filters/*.filter )
file ( INSTALL ${ FILTERS }
D E S T I N A T I O N $ { C U R R E N T _ P A C K A G E S _ D I R } / s h a r e / e p s i l o n / f i l t e r s / )
vcpkg_copy_pdbs ( )
file ( INSTALL ${ SOURCE_PATH_RELEASE } /COPYING DESTINATION ${ CURRENT_PACKAGES_DIR } /share/epsilon/ RENAME copyright )
message ( STATUS "Packaging ${TARGET_TRIPLET} done" )