2019-11-02 04:54:48 +08:00
# This portfile is based (shamelessly copied and adapted a bit) on 'ogre' portfile.
2020-05-16 07:39:54 +08:00
if ( EXISTS "${CURRENT_INSTALLED_DIR}/Media/HLMS/Blendfunctions_piece_fs.glslt" )
message ( FATAL_ERROR "FATAL ERROR: ogre-next and ogre are incompatible." )
endif ( )
2019-11-02 04:54:48 +08:00
if ( NOT VCPKG_TARGET_IS_WINDOWS )
message ( "${PORT} currently requires the following library from the system package manager:\n Xaw\n\nIt can be installed on Ubuntu systems via apt-get install libxaw7-dev" )
endif ( )
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 G R E C a v e / o g r e - n e x t
R E F 8 0 8 3 0 6 7 c 1 8 3 5 1 4 7 d e 5 d 8 2 0 1 5 3 4 7 d 9 5 c 7 1 0 e 3 6 b c 0
S H A 5 1 2 2 6 6 0 f 7 3 9 d e f 7 0 7 6 b 4 2 0 0 9 b a 9 3 2 a 2 7 5 3 2 f 2 a 2 0 e 7 b e 8 e c 2 6 7 4 a f f 2 9 1 1 6 c 7 d c d 7 f 2 d 7 5 5 6 4 d 8 c e 0 7 b e f 3 d b a 1 3 e c e 5 2 9 3 d 6 0 4 5 7 3 a d 4 f 8 7 3 4 f 6 0 8 6 c 1 7 5 0 1 2 7 f 5 2 8 3 4 c d
H E A D _ R E F m a s t e r
P A T C H E S
t o o l c h a i n _ f i x e s . p a t c h
r e n a m e _ c o n f i g _ c m a k e . p a t c h
f i x _ f i n d _ p a c k a g e _ s d l 2 . p a t c h
)
file ( REMOVE "${SOURCE_PATH}/CMake/Packages/FindOpenEXR.cmake" )
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
set ( OGRE_STATIC ON )
else ( )
set ( OGRE_STATIC OFF )
endif ( )
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
d 3 d 9 O G R E _ B U I L D _ R E N D E R S Y S T E M _ D 3 D 9
j a v a O G R E _ B U I L D _ C O M P O N E N T _ J A V A
p y t h o n O G R E _ B U I L D _ C O M P O N E N T _ P Y T H O N
c s h a r p O G R E _ B U I L D _ C O M P O N E N T _ C S H A R P
)
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 O G R E _ B U I L D _ D E P E N D E N C I E S = O F F
- D O G R E _ B U I L D _ S A M P L E S = O F F
- D O G R E _ B U I L D _ T E S T S = O F F
- D O G R E _ B U I L D _ T O O L S = O F F
- D O G R E _ B U I L D _ M S V C _ M P = O N
- D O G R E _ B U I L D _ M S V C _ Z M = O N
- D O G R E _ I N S T A L L _ D E P E N D E N C I E S = O F F
- D O G R E _ I N S T A L L _ D O C S = O F F
- D O G R E _ I N S T A L L _ P D B = O F F
- D O G R E _ I N S T A L L _ S A M P L E S = O F F
- D O G R E _ I N S T A L L _ T O O L S = O F F
- D O G R E _ I N S T A L L _ C M A K E = O N
- D O G R E _ I N S T A L L _ V S P R O P S = O F F
- D O G R E _ S T A T I C = $ { O G R E _ S T A T I C }
- D O G R E _ C O N F I G _ T H R E A D _ P R O V I D E R = s t d
- D O G R E _ B U I L D _ R E N D E R S Y S T E M _ D 3 D 1 1 = O N
- D O G R E _ B U I L D _ R E N D E R S Y S T E M _ G L = O N
- D O G R E _ B U I L D _ R E N D E R S Y S T E M _ G L 3 P L U S = O N
- D O G R E _ B U I L D _ R E N D E R S Y S T E M _ G L E S = O F F
- D O G R E _ B U I L D _ R E N D E R S Y S T E M _ G L E S 2 = O F F
# Optional stuff
$ { F E A T U R E _ O P T I O N S }
# vcpkg specific stuff
- D O G R E _ C M A K E _ D I R = s h a r e / o g r e - n e x t
)
vcpkg_install_cmake ( )
vcpkg_fixup_cmake_targets ( )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/share )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /debug/include )
file ( GLOB REL_CFGS ${ CURRENT_PACKAGES_DIR } /bin/*.cfg )
if ( REL_CFGS )
file ( COPY ${ REL_CFGS } DESTINATION ${ CURRENT_PACKAGES_DIR } /lib )
file ( REMOVE ${ REL_CFGS } )
endif ( )
file ( GLOB DBG_CFGS ${ CURRENT_PACKAGES_DIR } /debug/bin/*.cfg )
if ( DBG_CFGS )
file ( COPY ${ DBG_CFGS } DESTINATION ${ CURRENT_PACKAGES_DIR } /debug/lib )
file ( REMOVE ${ DBG_CFGS } )
endif ( )
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
file ( REMOVE_RECURSE ${ CURRENT_PACKAGES_DIR } /bin ${ CURRENT_PACKAGES_DIR } /debug/bin )
endif ( )
#Remove OgreMain*.lib from lib/ folder, because autolink would complain, since it defines a main symbol
#manual-link subfolder is here to the rescue!
2020-05-16 07:39:54 +08:00
if ( VCPKG_TARGET_IS_WINDOWS )
2019-11-02 04:54:48 +08:00
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Release" )
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /lib/manual-link )
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /lib/OgreMain.lib ${ CURRENT_PACKAGES_DIR } /lib/manual-link/OgreMain.lib )
else ( )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /lib/OgreMainStatic.lib ${ CURRENT_PACKAGES_DIR } /lib/manual-link/OgreMainStatic.lib )
endif ( )
endif ( )
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Debug" )
file ( MAKE_DIRECTORY ${ CURRENT_PACKAGES_DIR } /debug/lib/manual-link )
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /debug/lib/OgreMain_d.lib ${ CURRENT_PACKAGES_DIR } /debug/lib/manual-link/OgreMain_d.lib )
else ( )
file ( RENAME ${ CURRENT_PACKAGES_DIR } /debug/lib/OgreMainStatic_d.lib ${ CURRENT_PACKAGES_DIR } /debug/lib/manual-link/OgreMainStatic_d.lib )
endif ( )
endif ( )
file ( GLOB SHARE_FILES ${ CURRENT_PACKAGES_DIR } /share/ogre-next/*.cmake )
foreach ( SHARE_FILE ${ SHARE_FILES } )
file ( READ "${SHARE_FILE}" _contents )
string ( REPLACE "lib/OgreMain" "lib/manual-link/OgreMain" _contents "${_contents}" )
file ( WRITE "${SHARE_FILE}" "${_contents}" )
endforeach ( )
endif ( )
# Handle copyright
2020-05-16 07:39:54 +08:00
file ( INSTALL ${ SOURCE_PATH } /LICENSE DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } RENAME copyright )
2019-11-02 04:54:48 +08:00
vcpkg_copy_pdbs ( )