paroj wrote: ↑Thu Mar 11, 2021 7:25 pm
when CMake is run, it will output a summary like
Code: Select all
Building core features:
+ Mesh Lod
+ DDS image codec (.dds)
+ ETC image codec (.pkm, .ktx)
+ ASTC image codec (.astc)
+ ZIP archives
+ Multi-threaded WorkQueue
which tells you whether Ogre could find everything it needs to build ZIP support. If it does not you should check the CMake log for anything suspicious.
I will leave the steps to do this with vcpkg as an exercise for the reader.
Here's my working process
1. remove the cache of vcpkg and compile ogre again and install again
Code: Select all
$ uname -r
5.11.2-1-MANJARO
$ vcpkg version
Vcpkg package management program version 2021-01-13-unknownhash
$ cmake --version
cmake version 3.19.6
Code: Select all
$ sudo rm -rf /root/.cache/vcpkg/
$ sudo rm -rf /usr/share/vcpkg/buildtrees/
$ sudo rm -rf /var/cache/vcpkg/
$ sudo vcpkg remove ogre[zziplib]:x64-linux
$ sudo vcpkg install ogre[zziplib]:x64-linux --recurse
here it is the log of compile and install
Code: Select all
Computing installation plan...
The following packages will be built and installed:
ogre[assimp,core,freeimage,overlay,zziplib]:x64-linux -> 1.12.9#5
Detecting compiler hash for triplet x64-linux...
Could not locate cached archive: /root/.cache/vcpkg/archives/72/72717fa40a1605d664a4d00976ebea6044f41a1d.zip
Starting package 1/1: ogre:x64-linux
Building package ogre[assimp,core,freeimage,overlay,zziplib]:x64-linux...
ogre currently requires the following library from the system package manager:
Xaw
It can be installed on Ubuntu systems via apt-get install libxaw7-dev
-- Downloading https://github.com/OGRECave/ogre/archive/7d0c8181ac43ad20bdba326abbd3deeddf310f0b.tar.gz -> OGRECave-ogre-7d0c8181ac43ad20bdba326abbd3deeddf310f0b.tar.gz...
-- Extracting source /var/cache/vcpkg/OGRECave-ogre-7d0c8181ac43ad20bdba326abbd3deeddf310f0b.tar.gz
-- Applying patch toolchain_fixes.patch
-- Applying patch fix-dependency.patch
-- Applying patch fix-findimgui.patch
-- Applying patch disable-dependency-qt.patch
-- Using source at /usr/share/vcpkg/buildtrees/ogre/src/eddf310f0b-6ab1152694.clean
CMake Deprecation Warning at scripts/cmake/vcpkg_check_features.cmake:182 (message):
calling `vcpkg_check_features` without the `FEATURES` keyword has been
deprecated.
Please add the `FEATURES` keyword to the call.
Call Stack (most recent call first):
ports/ogre/portfile.cmake:32 (vcpkg_check_features)
scripts/ports.cmake:139 (include)
-- Found external ninja('1.10.2').
-- Configuring x64-linux-dbg
-- Configuring x64-linux-rel
-- Building x64-linux-dbg
-- Building x64-linux-rel
-- Installing: /usr/share/vcpkg/packages/ogre_x64-linux/share/ogre/copyright
-- Performing post-build validation
-- Performing post-build validation done
Stored binary cache: /root/.cache/vcpkg/archives/72/72717fa40a1605d664a4d00976ebea6044f41a1d.zip
Building package ogre[assimp,core,freeimage,overlay,zziplib]:x64-linux... done
Installing package ogre[assimp,core,freeimage,overlay,zziplib]:x64-linux...
Installing package ogre[assimp,core,freeimage,overlay,zziplib]:x64-linux... done
Elapsed time for package ogre:x64-linux: 11 min
Total elapsed time: 11 min
The package ogre:x64-linux provides CMake targets:
find_package(OGRE CONFIG REQUIRED)
# Note: 18 target(s) were omitted.
target_link_libraries(main PRIVATE OgreMain Codec_EXR OgreBites Codec_STBI)
2. dump the log of CMake when it compiles the official
Tutorials (Bootstrap.cpp) example
My CMakeLists.txt
Code: Select all
cmake_minimum_required (VERSION 3.10)
set(DIR_VCPKG "/usr/share/vcpkg/scripts/buildsystems/vcpkg.cmake")
message("[log] the directory of vcpkg is ${DIR_VCPKG}")
set(CMAKE_TOOLCHAIN_FILE ${DIR_VCPKG})
set(DIR_ORGE "/usr/share/vcpkg/packages/ogre_x64-linux")
set(OGRE_CONFIG_DIR "${DIR_ORGE}/share/OGRE/")
set(OGRE_INCLUDE_DIRS "${DIR_ORGE}/include/OGRE/")
set(OGRE_LIBRARY_DIRS "${DIR_ORGE}/lib/OGRE/")
set(app "Ogre3D.out")
include_directories(${OGRE_INCLUDE_DIRS})
link_directories(${OGRE_LIBRARY_DIRS})
project(01-Bootstrap)
set(CMAKE_CXX_STANDARD 11)
find_package(imgui)
find_package(OpenEXR)
# find_package(OGRE CONFIG REQUIRED)
# find_package(OGRE 1.11 REQUIRED COMPONENTS Bites RTShaderSystem)
# find_package(OGRE 1.11 CONFIG REQUIRED COMPONENTS Bites RTShaderSystem)
find_package(OGRE CONFIG REQUIRED COMPONENTS Bites RTShaderSystem)
file(COPY ${OGRE_CONFIG_DIR}/plugins.cfg ${OGRE_CONFIG_DIR}/resources.cfg
DESTINATION ${CMAKE_BINARY_DIR})
add_executable(${app} Bootstrap.cpp)
# target_link_libraries(${app} PRIVATE OgreMain Codec_EXR OgreBites Codec_STBI)
# target_link_libraries(${app} OgreBites OgreRTShaderSystem)
target_link_libraries(${app} PUBLIC OgreMain Codec_EXR OgreBites Codec_STBI OgreRTShaderSystem)
The compile log
Code: Select all
[log] the directory of vcpkg is /usr/share/vcpkg/scripts/buildsystems/vcpkg.cmake
-- The C compiler identification is GNU 10.2.0
-- The CXX compiler identification is GNU 10.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found ZLIB: /usr/share/vcpkg/installed/x64-linux/debug/lib/libz.a (found version "1.2.11")
-- Found BZip2: /usr/share/vcpkg/installed/x64-linux/lib/libbz2.a (found version "1.0.8")
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
-- Found PNG: /usr/share/vcpkg/installed/x64-linux/debug/lib/libpng.a (found version "1.6.37")
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found OGRE
-- static : ON
-- components : Bites;MeshLodGenerator;Overlay;Paging;Property;RTShaderSystem;Terrain;Volume
-- plugins : Plugin_BSPSceneManager;Plugin_CgProgramManager;Plugin_OctreeSceneManager;Plugin_PCZSceneManager;Plugin_ParticleFX;RenderSystem_GL;RenderSystem_GL3Plus;Codec_STBI;Codec_FreeImage;Codec_EXR
-- media : /usr/share/vcpkg/installed/x64-linux/share/OGRE/Media
-- Configuring done
-- Generating done
-- Build files have been written to: /home/gapry/Workspaces/ogre/01-Bootstrap/build
make: Entering directory '/home/gapry/Workspaces/ogre/01-Bootstrap/build'
make[1]: Entering directory '/home/gapry/Workspaces/ogre/01-Bootstrap/build'
make[2]: Entering directory '/home/gapry/Workspaces/ogre/01-Bootstrap/build'
Scanning dependencies of target Ogre3D.out
make[2]: Leaving directory '/home/gapry/Workspaces/ogre/01-Bootstrap/build'
make[2]: Entering directory '/home/gapry/Workspaces/ogre/01-Bootstrap/build'
[ 50%] Building CXX object CMakeFiles/Ogre3D.out.dir/Bootstrap.cpp.o
[100%] Linking CXX executable Ogre3D.out
make[2]: Leaving directory '/home/gapry/Workspaces/ogre/01-Bootstrap/build'
[100%] Built target Ogre3D.out
make[1]: Leaving directory '/home/gapry/Workspaces/ogre/01-Bootstrap/build'
make: Leaving directory '/home/gapry/Workspaces/ogre/01-Bootstrap/build'
Since the log show the following message so I think the ogre is compiled with ZIP support
Code: Select all
-- Found BZip2: /usr/share/vcpkg/installed/x64-linux/lib/libbz2.a (found version "1.0.8")
-- Looking for BZ2_bzCompressInit
-- Looking for BZ2_bzCompressInit - found
But, it still can't be execute, the error message as following
Code: Select all
$ DefaultWorkQueue('Root') initialising on thread 140289387673792.
DefaultWorkQueue('Root')::WorkerFunc - thread 140288655877696 starting.
DefaultWorkQueue('Root')::WorkerFunc - thread 140288647484992 starting.
Particle Renderer Type 'billboard' registered
SceneManagerFactory for type 'OctreeSceneManager' registered.
SceneManagerFactory for type 'BspSceneManager' registered.
terminate called after throwing an instance of 'Ogre::ItemIdentityException'
what(): ItemIdentityException: Cannot find an archive factory to deal with archive of type Zip in ArchiveManager::load at /usr/share/vcpkg/buildtrees/ogre/src/eddf310f0b-6ab1152694.clean/OgreMain/src/OgreArchiveManager.cpp (line 60)
fish: “./build/Ogre3D.out” terminated by signal SIGABRT (Abort)