Better fix?
parent
983a9a6e03
commit
bedd24801c
|
@ -483,27 +483,10 @@ target_include_directories(colobotbase PUBLIC
|
||||||
${CMAKE_CURRENT_BINARY_DIR}
|
${CMAKE_CURRENT_BINARY_DIR}
|
||||||
)
|
)
|
||||||
|
|
||||||
if(PLATFORM_WINDOWS)
|
|
||||||
list(APPEND INTERNAL_SDL_LIBRARIES
|
|
||||||
$<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
|
|
||||||
$<IF:$<TARGET_EXISTS:SDL2_image::SDL2_image>,SDL2_image::SDL2_image,SDL2_image::SDL2_image-static>
|
|
||||||
$<IF:$<TARGET_EXISTS:SDL2_ttf::SDL2_ttf>,SDL2_ttf::SDL2_ttf,SDL2_ttf::SDL2_ttf-static>
|
|
||||||
)
|
|
||||||
set(INTERNAL_SDL_MAIN_LIBRARY SDL2::SDL2main)
|
|
||||||
elseif()
|
|
||||||
list(APPEND INTERNAL_SDL_LIBRARIES
|
|
||||||
SDL2::Core
|
|
||||||
SDL2::Image
|
|
||||||
SDL2::TTF
|
|
||||||
)
|
|
||||||
set(INTERNAL_SDL_MAIN_LIBRARY SDL2::Main)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Main libraries
|
# Main libraries
|
||||||
target_link_libraries(colobotbase PUBLIC
|
target_link_libraries(colobotbase PUBLIC
|
||||||
CBot
|
CBot
|
||||||
localename
|
localename
|
||||||
${INTERNAL_SDL_LIBRARIES}
|
|
||||||
OpenGL::GL
|
OpenGL::GL
|
||||||
PNG::PNG
|
PNG::PNG
|
||||||
GLEW::GLEW
|
GLEW::GLEW
|
||||||
|
@ -516,6 +499,20 @@ target_link_libraries(colobotbase PUBLIC
|
||||||
nlohmann_json::nlohmann_json
|
nlohmann_json::nlohmann_json
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(PLATFORM_WINDOWS)
|
||||||
|
target_link_libraries(colobotbase PUBLIC
|
||||||
|
$<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
|
||||||
|
$<IF:$<TARGET_EXISTS:SDL2_image::SDL2_image>,SDL2_image::SDL2_image,SDL2_image::SDL2_image-static>
|
||||||
|
$<IF:$<TARGET_EXISTS:SDL2_ttf::SDL2_ttf>,SDL2_ttf::SDL2_ttf,SDL2_ttf::SDL2_ttf-static>
|
||||||
|
)
|
||||||
|
elseif()
|
||||||
|
target_link_libraries(colobotbase PUBLIC
|
||||||
|
SDL2::Core
|
||||||
|
SDL2::Image
|
||||||
|
SDL2::TTF
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(mpg123_FOUND)
|
if(mpg123_FOUND)
|
||||||
target_link_libraries(colobotbase PUBLIC
|
target_link_libraries(colobotbase PUBLIC
|
||||||
MPG123::libmpg123
|
MPG123::libmpg123
|
||||||
|
@ -624,7 +621,12 @@ endif()
|
||||||
if(PLATFORM_WINDOWS)
|
if(PLATFORM_WINDOWS)
|
||||||
target_sources(colobot PRIVATE ../desktop/colobot.rc)
|
target_sources(colobot PRIVATE ../desktop/colobot.rc)
|
||||||
endif()
|
endif()
|
||||||
target_link_libraries(colobot colobotbase ${INTERNAL_SDL_MAIN_LIBRARY})
|
|
||||||
|
if(PLATFORM_WINDOWS)
|
||||||
|
target_link_libraries(colobot colobotbase SDL2::SDL2main)
|
||||||
|
elseif()
|
||||||
|
target_link_libraries(colobot colobotbase SDL2::Main)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Install
|
# Install
|
||||||
install(TARGETS colobot RUNTIME DESTINATION ${COLOBOT_INSTALL_BIN_DIR})
|
install(TARGETS colobot RUNTIME DESTINATION ${COLOBOT_INSTALL_BIN_DIR})
|
||||||
|
|
Loading…
Reference in New Issue