eqemu-server/loginserver/CMakeLists.txt
Knightly e5df0172d0 Load openssl libs from working directory / fix log
- OpenSSL is being copied to the exe directory on build but nothing was loading the local dlls
- Add OpenSSL path loading from the working directory
- Add step to copy legacy.dll for openssl since it is a runtime dll
- This removes the requirement to install OpenSSL on the system
- The working directory can be separate from the exe directory if the user still requires this functionality
- Change logging to always be active when the system starts
2026-05-05 13:42:29 +12:00

50 lines
1.4 KiB
CMake

cmake_minimum_required(VERSION 3.20)
set(eqlogin_sources
account_management.cpp
client.cpp
client_manager.cpp
encryption.cpp
loginserver_command_handler.cpp
loginserver_webserver.cpp
main.cpp
world_server_manager.cpp
world_server.cpp
)
set(eqlogin_headers
account_management.h
client.h
client_manager.h
encryption.h
loginserver_command_handler.h
loginserver_webserver.h
login_server.h
login_types.h
options.h
world_server_manager.h
world_server.h
)
add_compile_definitions(EQEMU_USE_OPENSSL)
add_executable(loginserver ${eqlogin_sources} ${eqlogin_headers})
install(TARGETS loginserver RUNTIME DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
target_link_libraries(loginserver common)
target_include_directories(loginserver PRIVATE ..)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set_property(TARGET loginserver PROPERTY FOLDER executables/servers)
# vcpkg doesn't copy legacy.dll automatically because it is loaded at runtime, not via the import table.
if(WIN32 AND DEFINED VCPKG_INSTALLED_DIR AND DEFINED VCPKG_TARGET_TRIPLET)
add_custom_command(TARGET loginserver POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different
"$<IF:$<CONFIG:Debug>,${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug/bin/legacy.dll,${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/bin/legacy.dll>"
"$<TARGET_FILE_DIR:loginserver>/legacy.dll"
VERBATIM
)
endif()