src/CMakeLists: make project less Windows-only.

This commit is contained in:
Guillaume Jacquemin 2023-10-29 10:36:46 +01:00
parent b19c3e0025
commit bb85c3d6b0
Signed by: williamjcm
SSH key fingerprint: SHA256:AYLOg+iTV0ElElnlu4vqM4edFazVdRiuQB0Y5LoKc4A

View file

@ -20,7 +20,10 @@ set(CMAKE_CXX_EXTENSIONS OFF)
set(SAVETOOL_PROJECT_VERSION 1.5.0-pre)
find_package(Corrade REQUIRED Main Containers Utility)
find_package(Corrade REQUIRED Containers Utility)
if(CORRADE_TARGET_WINDOWS)
find_package(Corrade REQUIRED Main)
endif()
find_package(Magnum REQUIRED GL Sdl2Application)
find_package(MagnumIntegration REQUIRED ImGui)
find_package(CURL REQUIRED HTTPS)
@ -34,6 +37,10 @@ corrade_add_resource(Assets assets.conf)
add_subdirectory(Logger EXCLUDE_FROM_ALL)
add_subdirectory(UESaveFile EXCLUDE_FROM_ALL)
if(CORRADE_TARGET_WINDOWS)
set(SAVETOOL_RC_FILE resource.rc)
endif()
add_executable(MassBuilderSaveTool WIN32
main.cpp
SaveTool/SaveTool.h
@ -93,7 +100,7 @@ add_executable(MassBuilderSaveTool WIN32
Utilities/Crc32.h
FontAwesome/IconsFontAwesome5.h
FontAwesome/IconsFontAwesome5Brands.h
resource.rc
${SAVETOOL_RC_FILE}
${Assets}
)
@ -120,7 +127,6 @@ endif()
target_link_libraries(MassBuilderSaveTool PRIVATE
Corrade::Containers
Corrade::Utility
Corrade::Main
Magnum::Magnum
Magnum::GL
Magnum::Sdl2Application
@ -130,6 +136,12 @@ target_link_libraries(MassBuilderSaveTool PRIVATE
efsw::efsw
libzip::zip
CURL::libcurl_static
)
if(CORRADE_TARGET_WINDOWS)
target_link_libraries(MassBuilderSaveTool PRIVATE
Corrade::Main
imm32
wtsapi32
)
endif()