Ogre Version: 14.3.1
Operating System: Windows
Alright, so I'm trying to set up a project which uses Ogre3D as a dependency and having a bit of trouble.
I have added Ogre3D as a git submodule and my project structure looks like this:
Code: Select all
externals/ogre
externals/CMakeLists.txt
CMakeLists.txt
main.cpp
My externals CMakeLists.txt
Code: Select all
# Ogre
add_subdirectory(ogre)
Root CMakeLists.txt
Code: Select all
cmake_minimum_required(VERSION 3.31)
project(OgreTestProject VERSION 0.1.0 LANGUAGES CXX)
cmake_policy(SET CMP0063 NEW)
cmake_policy(SET CMP0048 NEW)
# Add external dependencies
add_subdirectory(externals)
# Add executable
add_executable(OgreTestProject main.cpp)
# Link libraries
target_link_libraries(OgreTestProject PRIVATE OgreBites OgreMain)
# Include directories
target_include_directories(OgreTestProject PRIVATE ${OGRE_INCLUDE_DIRS} ${OGRE_SAMPLES_INCLUDEPATH})
# Set startup project for Visual Studio
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT OgreTestProject )
Now, this mostly works dandy, I am able to configure and generate a Visual Studio project from this and I am able to access the ogre.h header, but when trying to complete the tutorial by creating the application context, when building RelWithDebInfo, I am getting several LNK2005 errors (for pugixml) and a singular LNK1169 error.
I've checked the OGRE_STATIC variable, other than that I should be close to the default configuration.
I'm not incredibly particular about any sort of solution, I just want to compile Ogre3D as an external dependency in my project.
Thanks in advance for any help!