Modernize CMake (1): Boost and libpng (support included in cmake itself)

Version 3.13 was chosen because it introduces target_link_directories and target_link_options,
even though we aren't using them at the moment.
modernize-cmake-1
immibis 2020-07-04 16:44:24 +02:00
parent 6a0234edd5
commit 33a380daba
2 changed files with 6 additions and 5 deletions

View File

@ -3,7 +3,7 @@
# Contains global options and definitions
##
cmake_minimum_required(VERSION 2.8)
cmake_minimum_required(VERSION 3.13)
project(colobot C CXX)

View File

@ -598,9 +598,7 @@ set(LIBS
${SDL2_IMAGE_LIBRARY}
${SDL2_TTF_LIBRARY}
${OPENGL_LIBRARY}
${PNG_LIBRARIES}
${GLEW_LIBRARY}
${Boost_LIBRARIES}
${LIBSNDFILE_LIBRARY}
${OPTIONAL_LIBS}
${PLATFORM_LIBS}
@ -621,9 +619,7 @@ set(SYSTEM_INCLUDES
${SDL2_INCLUDE_DIR}
${SDL2_IMAGE_INCLUDE_DIR}
${SDL2_TTF_INCLUDE_DIR}
${PNG_INCLUDE_DIRS}
${GLEW_INCLUDE_PATH}
${Boost_INCLUDE_DIRS}
${LIBSNDFILE_INCLUDE_DIR}
${LOCALENAME_INCLUDE_DIR}
${PHYSFS_INCLUDE_PATH}
@ -648,6 +644,11 @@ link_directories(
add_library(colobotbase STATIC ${BASE_SOURCES})
target_link_libraries(colobotbase PUBLIC
Boost::system Boost::regex Boost::filesystem
PNG::PNG
)
add_executable(colobot ${MAIN_SOURCES})
target_link_libraries(colobot colobotbase ${LIBS})