0

I'm a beginner with CMake, but I'm trying to learn new things in practice. I'm trying to build a Ogre3D C++ project, using vcpkg and CMake. This simple project is compiling succesfully, however, during the runtime the program gives some errors when trying to load some of the dlls (with LoadLibrary function). I found that this problem was occuring due to some dependent dlls that were not copied to the output directory. I copied those dependent dlls myself and then the problem was solved.

I'm trying to find a way of making the build script to copy the dlls by itself. Anyone can help me?

My CMakeLists.txt file looks like this:

cmake_minimum_required(VERSION 3.22)
project(Ogre3DTest)

find_package(OGRE CONFIG REQUIRED)

file(GLOB SRC_FILES *.cpp)
add_executable(${PROJECT_NAME} ${SRC_FILES})

target_link_libraries(${PROJECT_NAME} PRIVATE OgreMain OgreBites Codec_STBI OgrePaging)

I found that the missing dlls are from assimp and OgreTerrain. I've tried to include those two targets in the target_link_libraries, but the dlls of these targets still aren't copied.

0 Answers0