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-07-21 06:44:03 +08:00
R E F e 4 c 5 f 0 f 6 d 3 6 c 0 7 a f 5 9 4 e 3 e f 1 4 3 d 0 1 7 b d a 1 5 8 1 4 4 2 #v2.3.1
S H A 5 1 2 2 6 3 a 5 0 b 6 4 d e f a 7 3 4 5 a 1 0 9 a 0 6 8 c c 1 7 c 3 4 7 a 6 9 6 f 8 3 f 6 4 a b c 0 7 1 2 5 6 b b 4 6 5 7 1 e d 6 b 2 e f 9 4 e e 3 4 8 0 d 9 0 9 3 8 c d b 7 f 7 4 5 d 3 6 a 4 c 4 8 9 0 d 8 2 6 7 7 d 3 5 7 c 6 2 c 9 a 2 9 5 6 e a e 8 d 4 a c 1 5
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
2023-08-31 04:44:54 +08:00
a v o i d - n a m e - c l a s h e s . p a t c h
f i x - e r r o r - c 2 0 3 9 . p a t c h
2019-11-02 04:54:48 +08:00
)
file ( REMOVE "${SOURCE_PATH}/CMake/Packages/FindOpenEXR.cmake" )
2023-08-31 04:44:54 +08:00
if ( EXISTS "${SOURCE_PATH}/CMake/FeatureSummary.cmake" )
file ( RENAME "${SOURCE_PATH}/CMake/FeatureSummary.cmake" "${SOURCE_PATH}/CMake/OgreFeatureSummary.cmake" )
endif ( )
2019-11-02 04:54:48 +08:00
if ( VCPKG_LIBRARY_LINKAGE STREQUAL static )
set ( OGRE_STATIC ON )
else ( )
set ( OGRE_STATIC OFF )
endif ( )
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 }
- D O G R E _ C O P Y _ D E P E N D E N C I E S = O F F
2023-08-31 04:44:54 +08:00
- D O G R E _ B U I L D _ S A M P L E S 2 = O F F
2019-11-02 04:54:48 +08:00
- 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
2023-08-31 04:44:54 +08:00
vcpkg_install_copyright ( FILE_LIST "${SOURCE_PATH}/COPYING" )
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" )