parent
21b6572b5b
commit
1d8e06c7ba
|
@ -309,20 +309,13 @@ include("${colobot_SOURCE_DIR}/cmake/colobot-lint.cmake")
|
|||
##
|
||||
|
||||
find_package(OpenGL 1.4 REQUIRED)
|
||||
find_package(SDL2 REQUIRED)
|
||||
find_package(SDL2_image REQUIRED)
|
||||
find_package(SDL2_ttf REQUIRED)
|
||||
find_package(PNG 1.2 REQUIRED)
|
||||
find_package(Gettext REQUIRED)
|
||||
find_package(PhysFS REQUIRED)
|
||||
|
||||
if(PLATFORM_WINDOWS)
|
||||
find_package(SDL2 CONFIG REQUIRED)
|
||||
find_package(SDL2_image CONFIG REQUIRED)
|
||||
find_package(SDL2_ttf CONFIG REQUIRED)
|
||||
else()
|
||||
find_package(SDL2 REQUIRED)
|
||||
find_package(SDL2_image REQUIRED)
|
||||
find_package(SDL2_ttf REQUIRED)
|
||||
endif()
|
||||
|
||||
set(Boost_USE_STATIC_LIBS ${BOOST_STATIC})
|
||||
set(Boost_USE_MULTITHREADED ON)
|
||||
set(Boost_USE_STATIC_RUNTIME ${USE_STATIC_RUNTIME})
|
||||
|
|
|
@ -480,6 +480,9 @@ target_include_directories(colobotbase PUBLIC
|
|||
target_link_libraries(colobotbase PUBLIC
|
||||
CBot
|
||||
localename
|
||||
SDL2::Core
|
||||
SDL2::Image
|
||||
SDL2::TTF
|
||||
OpenGL::GL
|
||||
PNG::PNG
|
||||
GLEW::GLEW
|
||||
|
@ -504,20 +507,6 @@ if(mp3lame_FOUND)
|
|||
)
|
||||
endif()
|
||||
|
||||
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()
|
||||
|
||||
# Optional libraries
|
||||
if(OPENAL_SOUND)
|
||||
target_sources(colobotbase PRIVATE
|
||||
|
@ -612,12 +601,7 @@ endif()
|
|||
if(PLATFORM_WINDOWS)
|
||||
target_sources(colobot PRIVATE ../desktop/colobot.rc)
|
||||
endif()
|
||||
|
||||
if(PLATFORM_WINDOWS)
|
||||
target_link_libraries(colobot colobotbase SDL2::SDL2main)
|
||||
elseif()
|
||||
target_link_libraries(colobot colobotbase SDL2::Main)
|
||||
endif()
|
||||
target_link_libraries(colobot colobotbase SDL2::Main)
|
||||
|
||||
# Install
|
||||
install(TARGETS colobot RUNTIME DESTINATION ${COLOBOT_INSTALL_BIN_DIR})
|
||||
|
|
Loading…
Reference in New Issue