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
2023-09-29 14:13:40 +08:00
R E F v $ { V E R S I O N }
S H A 5 1 2 6 2 c 7 2 1 6 8 0 e d 7 7 e 7 4 b 6 e 1 6 4 9 a b 7 3 2 4 b d 4 9 f c 3 c 7 c 2 e 6 0 a d 7 6 a 6 2 e c 5 f 8 9 9 f 3 2 7 d 6 5 a 1 4 0 4 6 2 d 7 5 3 0 0 e a c 4 f 4 1 5 6 7 a 8 9 0 3 a 7 4 8 d 0 7 a 7 6 0 d c 3 7 6 e d d c a d f 0 a e e a 5 a 3 c a 5 a 7
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 ( )
2023-09-29 14:13:40 +08:00
vcpkg_check_features (
O U T _ F E A T U R E _ O P T I O N S F E A T U R E _ O P T I O N S
F E A T U R E S
p l a n a r - r e f l e c t i o n s O G R E _ B U I L D _ C O M P O N E N T _ P L A N A R _ R E F L E C T I O N S
)
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 ( )
2023-09-29 14:13:40 +08:00
file ( GLOB LIBS "${CURRENT_PACKAGES_DIR}/lib/release/*" )
file ( GLOB DLLS "${CURRENT_PACKAGES_DIR}/bin/release/*" )
file ( COPY ${ LIBS } DESTINATION "${CURRENT_PACKAGES_DIR}/lib" )
file ( COPY ${ DLLS } DESTINATION "${CURRENT_PACKAGES_DIR}/bin" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib/release/" "${CURRENT_PACKAGES_DIR}/bin/release/" )
2019-11-02 04:54:48 +08:00
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 ( )
2023-09-29 14:13:40 +08:00
file ( GLOB LIBS "${CURRENT_PACKAGES_DIR}/debug/lib/debug/*" )
file ( GLOB DLLS "${CURRENT_PACKAGES_DIR}/debug/bin/debug/*" )
file ( COPY ${ LIBS } DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib" )
file ( COPY ${ DLLS } DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin" )
file ( REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/lib/debug/" "${CURRENT_PACKAGES_DIR}/debug/bin/debug/" )
2019-11-02 04:54:48 +08:00
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" )
2023-09-29 14:13:40 +08:00
vcpkg_fixup_pkgconfig ( )