# 添加 gameserver 可执行文件，其 main.cpp 位于 src/server/apps/gameserver/main.cpp
add_executable(gameserver gameserver/main.cpp)

# 添加 centerserver 可执行文件，其 main.cpp 位于 src/server/apps/centerserver/main.cpp
#add_executable(centerserver centerserver/main.cpp)

# 为多配置系统设置输出目录（所有模式均输出到 ${CMAKE_BINARY_DIR}/bin）
foreach(app_target gameserver)
    set_target_properties(${app_target} PROPERTIES
            RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin
            RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin
            RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin
            RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}/bin
            RUNTIME_OUTPUT_DIRECTORY_MINSIZEREL ${CMAKE_BINARY_DIR}/bin
    )

    # 链接公共库 common 以及 deps 中的 boost 库
    target_link_libraries(${app_target} PRIVATE common)
endforeach()
