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
2022-04-01 01:58:32 +08:00
R E F 1 0 b 5 6 6 9 4 f 3 3 f d 6 e a d 1 c 5 0 1 e b 9 0 3 7 9 b c a c 6 7 1 d 8 4 1 #v2.3.0
S H A 5 1 2 b 2 f 1 c 5 5 6 5 5 5 8 2 b 2 8 4 4 b 7 c 1 0 c c e 9 6 5 c c 5 2 6 8 8 2 9 a 0 7 0 2 b 0 9 a b c f e 0 4 f b a 8 d b 0 0 a d 0 3 2 f 6 0 5 d 6 8 3 c 8 8 8 1 1 f 7 7 f 9 b 7 b 4 f b 8 a 1 0 9 5 0 7 9 f 1 a 1 c 9 6 b b e 9 f d 0 2 2 6 2 1 f 4 f f 4 c f 8 1
2019-11-02 04:54:48 +08:00
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
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 ( )
2022-04-01 01:58:32 +08:00
2019-11-02 04:54:48 +08:00
vcpkg_check_features ( OUT_FEATURE_OPTIONS FEATURE_OPTIONS
2022-04-01 01:58:32 +08:00
F E A T U R E S
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
2019-11-02 04:54:48 +08:00
)
2022-04-01 01:58:32 +08:00
vcpkg_cmake_configure (
S O U R C E _ P A T H " $ { S O U R C E _ P A T H } "
2019-11-02 04:54:48 +08:00
O P T I O N S
2022-04-01 01:58:32 +08:00
$ { F E A T U R E _ O P T I O N S }
2019-11-02 04:54:48 +08:00
- 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
2022-04-01 01:58:32 +08:00
- D O G R E _ C O P Y _ D E P E N D E N C I E S = O F F
2019-11-02 04:54:48 +08:00
- 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 _ 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
- 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
)
2022-04-01 01:58:32 +08:00
vcpkg_cmake_install ( )
vcpkg_copy_pdbs ( )
vcpkg_cmake_config_fixup ( )
2019-11-02 04:54:48 +08:00
2022-04-01 01:58:32 +08:00
file ( GLOB REL_CFGS "${CURRENT_PACKAGES_DIR}/bin/*.cfg" )
2019-11-02 04:54:48 +08:00
if ( REL_CFGS )
2022-04-01 01:58:32 +08:00
file ( COPY ${ REL_CFGS } DESTINATION "${CURRENT_PACKAGES_DIR}/lib" )
2019-11-02 04:54:48 +08:00
file ( REMOVE ${ REL_CFGS } )
endif ( )
2022-04-01 01:58:32 +08:00
file ( GLOB DBG_CFGS "${CURRENT_PACKAGES_DIR}/debug/bin/*.cfg" )
2019-11-02 04:54:48 +08:00
if ( DBG_CFGS )
2022-04-01 01:58:32 +08:00
file ( COPY ${ DBG_CFGS } DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" )
2019-11-02 04:54:48 +08:00
file ( REMOVE ${ DBG_CFGS } )
endif ( )
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "static" )
2022-04-01 01:58:32 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin" )
2019-11-02 04:54:48 +08:00
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" )
2022-04-01 01:58:32 +08:00
file ( MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/lib/manual-link" )
2019-11-02 04:54:48 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
2022-04-01 01:58:32 +08:00
file ( RENAME "${CURRENT_PACKAGES_DIR}/lib/release/OgreMain.lib" "${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMain.lib" )
2019-11-02 04:54:48 +08:00
else ( )
2022-04-01 01:58:32 +08:00
file ( RENAME "${CURRENT_PACKAGES_DIR}/lib/release/OgreMainStatic.lib" "${CURRENT_PACKAGES_DIR}/lib/manual-link/OgreMainStatic.lib" )
2019-11-02 04:54:48 +08:00
endif ( )
endif ( )
if ( NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "Debug" )
2022-04-01 01:58:32 +08:00
file ( MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link" )
2019-11-02 04:54:48 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic" )
2022-04-01 01:58:32 +08:00
file ( RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/debug/OgreMain_d.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/OgreMain_d.lib" )
2019-11-02 04:54:48 +08:00
else ( )
2022-04-01 01:58:32 +08:00
file ( RENAME "${CURRENT_PACKAGES_DIR}/debug/lib/debug/OgreMainStatic_d.lib" "${CURRENT_PACKAGES_DIR}/debug/lib/manual-link/OgreMainStatic_d.lib" )
2019-11-02 04:54:48 +08:00
endif ( )
endif ( )
2022-04-01 01:58:32 +08:00
file ( GLOB SHARE_FILES "${CURRENT_PACKAGES_DIR}/share/ogre-next/*.cmake" )
2019-11-02 04:54:48 +08:00
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
2022-04-01 01:58:32 +08:00
file ( INSTALL ${ SOURCE_PATH } /COPYING DESTINATION ${ CURRENT_PACKAGES_DIR } /share/ ${ PORT } RENAME copyright )
2019-11-02 04:54:48 +08:00
2022-04-01 01:58:32 +08:00
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share" )