some windows fixes

todo:
- libstdc++ and related libraries either must be linked statically or copied to outpuŧ folder
- windeployqt currently tries opening the common project (libCommon.a)
This commit is contained in:
rjindael 2023-07-16 20:31:47 -07:00
parent 013b9f513b
commit 88e0a021a7
No known key found for this signature in database
GPG Key ID: D069369C906CCF31
5 changed files with 31 additions and 2 deletions

View File

@ -8,9 +8,10 @@ option(COMPILE_PLAYER "Compile the RNR player" ON)
option(COMPILE_STUDIO "Compile the RNR studio" ON)
option(COMPILE_SERVER "Compile the RNR server" ON)
set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/dist")
set(DEPENDENCIES_DIR ${CMAKE_SOURCE_DIR}/Dependencies)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes -Wno-return-type") # Ignore warnings generated by Luau and Qt
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR}/dist)
add_compile_options(-Wno-attributes -Wno-return-type) # Ignore warnings generated by Luau and Qt
find_package(Boost REQUIRED)
find_package(OGRE REQUIRED COMPONENTS Bites CONFIG)

View File

@ -12,5 +12,13 @@ list(APPEND HEADER
qt_standard_project_setup()
qt_add_library(Common STATIC ${SOURCE} ${HEADER})
if(WIN32)
add_custom_command(TARGET Common POST_BUILD
COMMAND ${TOOL_WINDEPLOYQT}
$<TARGET_FILE:Common>
COMMENT "Running windeployqt..."
)
endif()
target_include_directories(Common PUBLIC Header)
target_link_libraries(Common PUBLIC ${QT6_LIBRARIES_INCL} Engine)

View File

@ -18,6 +18,13 @@ endif()
qt_add_executable(Player ${SOURCE} ${HEADER})
if(WIN32 OR MINGW)
add_custom_command(TARGET Player POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:Player> $<TARGET_RUNTIME_DLLS:Player>
COMMAND_EXPAND_LISTS
)
endif()
target_include_directories(Player PRIVATE Header)
target_link_libraries(Player PRIVATE Common Engine)

View File

@ -9,5 +9,12 @@ endif()
add_executable(Server ${SOURCE} ${HEADER})
if(WIN32 OR MINGW)
add_custom_command(TARGET Server POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:Server> $<TARGET_RUNTIME_DLLS:Server>
COMMAND_EXPAND_LISTS
)
endif()
target_include_directories(Server PRIVATE Header)
target_link_libraries(Server PRIVATE Engine)

View File

@ -18,6 +18,12 @@ endif()
qt_add_executable(Studio ${SOURCE} ${HEADER})
if(WIN32 OR MINGW)
add_custom_command(TARGET Studio POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy -t $<TARGET_FILE_DIR:Studio> $<TARGET_RUNTIME_DLLS:Studio>
COMMAND_EXPAND_LISTS
)
endif()
target_include_directories(Studio PRIVATE Header)
target_link_libraries(Studio PRIVATE Common Engine)