I have this in my main CMakeLists.txt:
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/Install CACHE PATH "install here" FORCE)
set(CMAKE_INSTALL_BINDIR ${CMAKE_BINARY_DIR}/Install/bin CACHE PATH "install here" FORCE)
set(CMAKE_INSTALL_LIBDIR ${CMAKE_BINARY_DIR}/Install/bin/lib CACHE PATH "install here" FORCE)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/lib CACHE PATH "Set search lib dir." FORCE)
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} "${CMAKE_BINARY_DIR}/bin/lib")
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "${CMAKE_BINARY_DIR}/bin/lib")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/lib CACHE PATH "Set search lib dir." FORCE)
set_target_properties(
Common
AuthServer
WorldServer
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/lib
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/lib
RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
)
However this does not make my WorldServer.exe to search in the lib folder located exactly next to it. In order to make my WorldServer.exe start I have to copy all of the .dll files from ./lib folder and place them next to it.
Is there a way to make my .exe search in additional folder for the .dll it needs ?