I have this weird issue that very few people seem to be having with Ogre3D, where CMake is unable to find (er, "accept") OGREConfig.cmake. Here's my console output:
CMake Error at CMakeLists.txt:10 (find_package):
Could not find a configuration file for package "OGRE" that is compatible
with requested version "1.12.7".
The following configuration files were considered but not accepted:
D:/_lib/ogre/build/sdk/CMake/OGREConfig.cmake, version: 1.12.7 (64bit)
I have no idea if I'm just being a moron or what, but I made sure to set OGRE_DIR in the environment variables and I even built Ogre from source, following instructions to a T. Here's my CMakeLists.txt for the project:
cmake_minimum_required(VERSION 3.17.2)
set(CMAKE_C_COMPILER gcc)
set(CMAKE_CXX_COMPILER g++)
project(OgreProject1 VERSION 0.0.1 LANGUAGES C CXX)
# specify which version and components you need
find_package(
OGRE 1.12.7
COMPONENTS
Bites
RTShaderSystem
REQUIRED
)
# copy resource.cfg next to our binaries where OGRE looks for it
file(COPY ${OGRE_CONFIG_DIR}/resources.cfg DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
# add the source files as usual
add_executable(cmake-good src/main.cpp)
# this also sets the includes and pulls third party dependencies
target_link_libraries(cmake-good OgreBites OgreRTShaderSystem)
This seems like a "me" problem and not an "ogre" problem, so if you could set me in the right direction that would be great. I will edit my post with more information if prompted.
NOTE: If it's important, I built Ogre with MSVC16, and my CMake version is 3.17.2.