From 08f6c32551e1aba5e22a3fbe142b0a32fa7e0259 Mon Sep 17 00:00:00 2001 From: tomangelo2 Date: Wed, 9 Feb 2022 20:43:35 +0100 Subject: [PATCH 01/16] Update Homebrew installation command --- INSTALL-MacOSX.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL-MacOSX.md b/INSTALL-MacOSX.md index 001241fa..85cc5f28 100644 --- a/INSTALL-MacOSX.md +++ b/INSTALL-MacOSX.md @@ -4,7 +4,7 @@ To compile Colobot on MacOS X, you need to first get Developer Command Line Tool After installing Developer Command Line Tools, you should have basic tools like clang and git installed. After that, you can grab other required packages with Homebrew. So as in instructions on [the project page](http://brew.sh/): ```bash - ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" ``` And then: ```bash From e3ba1a1840de2953946cafa750df80f636d3505b Mon Sep 17 00:00:00 2001 From: tomangelo2 Date: Thu, 10 Feb 2022 19:46:50 +0100 Subject: [PATCH 02/16] Fix compilation errors on MacOS --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 96b534a5..19e2fa0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -106,6 +106,8 @@ elseif("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin") # Platform-dependent implementation of system.h set(SYSTEM_CPP_MODULE "system_macosx.cpp") set(SYSTEM_H_MODULE "system_macosx.h") + # Fix compilation errors in MacOS SDK files + set(CMAKE_CXX_FLAGS "${NORMAL_CXX_FLAGS} -Wno-nullability-extension -Wno-nullability-completeness -Wno-expansion-to-defined -Wno-four-char-constants -Wno-gnu-zero-variadic-macro-arguments -Wno-variadic-macros -Wno-zero-length-array") # To avoid CMake warning set(CMAKE_MACOSX_RPATH 1) elseif("${CMAKE_SYSTEM_NAME}" MATCHES "FreeBSD") From 438e4bba62a511ed7ad178a404c5698a129453da Mon Sep 17 00:00:00 2001 From: tomangelo2 Date: Tue, 13 Sep 2022 19:58:11 +0200 Subject: [PATCH 03/16] First attempt to run MacOS build on Github Actions --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c0792ccf..2fc5861e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,6 +76,46 @@ jobs: name: Test results (${{ matrix.target_os }}, ${{ matrix.host_os }}) path: build/gtestresults.xml if: matrix.target_os == 'linux' + build-macos: + runs-on: ${{ matrix.host_os }} + container: ${{ matrix.container }} + strategy: + matrix: + target_os: [macos] + host_os: [macos-11, macos-12] + container: [''] + fail-fast: false + steps: + - name: Install Colobot dependencies + run: brew install cmake sdl2 sdl2_image sdl2_ttf boost glew physfs flac libsndfile libvorbis vorbis-tools gettext libicns librsvg wget xmlstarlet + if: matrix.container == '' + - uses: actions/checkout@v2 + - name: Checkout the Google Test submodule + run: git submodule update --init -- lib/googletest + - name: Create build directory + run: cmake -E make_directory build + - name: Run CMake (for Mac) + working-directory: build + run: cmake -DCMAKE_INSTALL_PREFIX=/install -DCMAKE_SKIP_INSTALL_RPATH=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEV_BUILD=1 -DPORTABLE=1 -DTOOLS=1 -DTESTS=1 -DDESKTOP=1 -DOPENAL_LIBRARY=/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/OpenAL.framework/OpenAL.tbd .. + if: matrix.target_os == 'macos' + - name: Build + working-directory: build + run: make -j `nproc` + - name: Install + working-directory: build + run: DESTDIR=. make package + - name: Upload build + uses: actions/upload-artifact@v2 + with: + name: ${{matrix.target_os}}-debug + path: build/install + if: matrix.host_os == 'macos-11' + - name: Upload test results + uses: actions/upload-artifact@v2 + with: + name: Test results (${{ matrix.target_os }}, ${{ matrix.host_os }}) + path: build/gtestresults.xml + if: matrix.target_os == 'macos' build-windows: runs-on: windows-2019 strategy: From 2a91d6bf358fb4a3fd703c60bf1fe477fc3f78c3 Mon Sep 17 00:00:00 2001 From: tomangelo2 Date: Tue, 13 Sep 2022 20:14:47 +0200 Subject: [PATCH 04/16] Temporarily remove tests --- .github/workflows/build.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2fc5861e..7dc469fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,7 +96,7 @@ jobs: run: cmake -E make_directory build - name: Run CMake (for Mac) working-directory: build - run: cmake -DCMAKE_INSTALL_PREFIX=/install -DCMAKE_SKIP_INSTALL_RPATH=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEV_BUILD=1 -DPORTABLE=1 -DTOOLS=1 -DTESTS=1 -DDESKTOP=1 -DOPENAL_LIBRARY=/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/OpenAL.framework/OpenAL.tbd .. + run: cmake -DCMAKE_INSTALL_PREFIX=/install -DCMAKE_SKIP_INSTALL_RPATH=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEV_BUILD=1 -DPORTABLE=1 -DDESKTOP=1 -DOPENAL_LIBRARY=/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/OpenAL.framework/OpenAL.tbd .. if: matrix.target_os == 'macos' - name: Build working-directory: build @@ -110,12 +110,6 @@ jobs: name: ${{matrix.target_os}}-debug path: build/install if: matrix.host_os == 'macos-11' - - name: Upload test results - uses: actions/upload-artifact@v2 - with: - name: Test results (${{ matrix.target_os }}, ${{ matrix.host_os }}) - path: build/gtestresults.xml - if: matrix.target_os == 'macos' build-windows: runs-on: windows-2019 strategy: From 0693aa5e1e234338565afeb1afefe90fdc0a927f Mon Sep 17 00:00:00 2001 From: tomangelo2 Date: Tue, 13 Sep 2022 20:45:07 +0200 Subject: [PATCH 05/16] Fix OpenAL library path --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7dc469fd..57d4eead 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,7 +96,7 @@ jobs: run: cmake -E make_directory build - name: Run CMake (for Mac) working-directory: build - run: cmake -DCMAKE_INSTALL_PREFIX=/install -DCMAKE_SKIP_INSTALL_RPATH=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEV_BUILD=1 -DPORTABLE=1 -DDESKTOP=1 -DOPENAL_LIBRARY=/Library/Developer/CommandLineTools/SDKs/MacOSX11.1.sdk/System/Library/Frameworks/OpenAL.framework/OpenAL.tbd .. + run: cmake -DCMAKE_INSTALL_PREFIX=/install -DCMAKE_SKIP_INSTALL_RPATH=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEV_BUILD=1 -DPORTABLE=1 -DDESKTOP=1 -DOPENAL_LIBRARY=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/OpenAL.tbd .. if: matrix.target_os == 'macos' - name: Build working-directory: build From afbf687255f82c61db303dc959dadcc473289fdb Mon Sep 17 00:00:00 2001 From: tomangelo Date: Tue, 13 Sep 2022 21:03:14 +0200 Subject: [PATCH 06/16] Try to fix packaging --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57d4eead..c06bb7fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -103,7 +103,7 @@ jobs: run: make -j `nproc` - name: Install working-directory: build - run: DESTDIR=. make package + run: DESTDIR=. sudo make package - name: Upload build uses: actions/upload-artifact@v2 with: From 87ad81f891cc06b27a0be1e95b2dbdc05cfa400b Mon Sep 17 00:00:00 2001 From: tomangelo Date: Tue, 13 Sep 2022 21:21:49 +0200 Subject: [PATCH 07/16] Don't try to make package for now --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c06bb7fb..40c0f955 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,9 +101,6 @@ jobs: - name: Build working-directory: build run: make -j `nproc` - - name: Install - working-directory: build - run: DESTDIR=. sudo make package - name: Upload build uses: actions/upload-artifact@v2 with: From 4ec0083cd84016dab8b3bf38867d20353d7f4ceb Mon Sep 17 00:00:00 2001 From: tomangelo Date: Tue, 13 Sep 2022 21:48:43 +0200 Subject: [PATCH 08/16] Try to move binary to separate directory --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 40c0f955..9fa57298 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,6 +101,9 @@ jobs: - name: Build working-directory: build run: make -j `nproc` + - name: Install + working-directory: build + run: make -j `nproc` install - name: Upload build uses: actions/upload-artifact@v2 with: From 4c767953ea4e16f049a68449ff2151a05db82f4e Mon Sep 17 00:00:00 2001 From: tomangelo Date: Tue, 13 Sep 2022 21:58:35 +0200 Subject: [PATCH 09/16] Fix path --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9fa57298..58e27161 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,7 +96,7 @@ jobs: run: cmake -E make_directory build - name: Run CMake (for Mac) working-directory: build - run: cmake -DCMAKE_INSTALL_PREFIX=/install -DCMAKE_SKIP_INSTALL_RPATH=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEV_BUILD=1 -DPORTABLE=1 -DDESKTOP=1 -DOPENAL_LIBRARY=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/OpenAL.tbd .. + run: cmake -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_SKIP_INSTALL_RPATH=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEV_BUILD=1 -DPORTABLE=1 -DDESKTOP=1 -DOPENAL_LIBRARY=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/OpenAL.tbd .. if: matrix.target_os == 'macos' - name: Build working-directory: build From 6cc58b872fc1f06e71357a469cbc7da2ad4b1b03 Mon Sep 17 00:00:00 2001 From: tomangelo Date: Wed, 14 Sep 2022 23:25:16 +0200 Subject: [PATCH 10/16] Let's try to get tests instead Making .dmg package needs `data` directory, while `make install` does weird stuff with path, for now I'll skip that. --- .github/workflows/build.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 58e27161..9f8ce4fd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -101,15 +101,17 @@ jobs: - name: Build working-directory: build run: make -j `nproc` - - name: Install + - name: Run tests + # TODO: Maybe run Windows tests using wine as well? working-directory: build - run: make -j `nproc` install - - name: Upload build + run: ./colobot_ut --gtest_output=xml:gtestresults.xml + if: matrix.target_os == 'macos' + - name: Upload test results uses: actions/upload-artifact@v2 with: - name: ${{matrix.target_os}}-debug - path: build/install - if: matrix.host_os == 'macos-11' + name: Test results (${{ matrix.target_os }}, ${{ matrix.host_os }}) + path: build/gtestresults.xml + if: matrix.target_os == 'macos' build-windows: runs-on: windows-2019 strategy: From 708d3cfd46f8c11531e6d2db4e2350ef1811a940 Mon Sep 17 00:00:00 2001 From: tomangelo Date: Wed, 14 Sep 2022 23:58:42 +0200 Subject: [PATCH 11/16] Enable building tests Making .dmg package needs `data` directory, while `make install` does weird stuff with path, for now I'll skip that. --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9f8ce4fd..f75106c5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,7 +96,7 @@ jobs: run: cmake -E make_directory build - name: Run CMake (for Mac) working-directory: build - run: cmake -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_SKIP_INSTALL_RPATH=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEV_BUILD=1 -DPORTABLE=1 -DDESKTOP=1 -DOPENAL_LIBRARY=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/OpenAL.tbd .. + run: cmake -DCMAKE_INSTALL_PREFIX=./install -DCMAKE_SKIP_INSTALL_RPATH=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DDEV_BUILD=1 -DPORTABLE=1 -DTESTS=1 -DDESKTOP=1 -DOPENAL_LIBRARY=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/OpenAL.tbd .. if: matrix.target_os == 'macos' - name: Build working-directory: build From c0669a591b69fc69ada423b2d787249f5625f649 Mon Sep 17 00:00:00 2001 From: tomangelo Date: Thu, 15 Sep 2022 00:12:54 +0200 Subject: [PATCH 12/16] Update INSTALL-MacOSX.md --- INSTALL-MacOSX.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL-MacOSX.md b/INSTALL-MacOSX.md index 85cc5f28..6d392f19 100644 --- a/INSTALL-MacOSX.md +++ b/INSTALL-MacOSX.md @@ -20,7 +20,7 @@ If you've installed everything correctly, the simple way of compiling Colobot wi git clone --recursive https://github.com/colobot/colobot.git mkdir colobot/build cd colobot/build - cmake ../ + cmake -DOPENAL_LIBRARY=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/OpenAL.framework/OpenAL.tbd ../ make ``` From b7cb26822b928cb31e12b3b5178b6a7d21eefe31 Mon Sep 17 00:00:00 2001 From: Emxx52 Date: Sun, 6 Nov 2022 04:12:02 +0100 Subject: [PATCH 13/16] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c501750..002ca535 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -134,7 +134,7 @@ jobs: - name: Install Colobot dependencies uses: lukka/run-vcpkg@v7 with: - vcpkgGitCommitId: 'e809a42f87565e803b2178a0c11263f462d1800a' + vcpkgGitCommitId: '68ad399d5596a540e8a12173c3d189cbc0f82be8' vcpkgTriplet: ${{ matrix.vcpkg_triplet }} vcpkgArguments: 'boost-system boost-filesystem boost-regex boost-lexical-cast boost-bimap boost-algorithm boost-property-tree boost-optional boost-range sdl2 sdl2-ttf sdl2-image glew libpng libwebp tiff gettext libsndfile libvorbis libogg openal-soft physfs mpg123' # SHA-256 hash of the list of packages above, for caching purposes From 21b6572b5b146577687c9dc109507d7614c433fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kapu=C5=9Bci=C5=84ski?= Date: Sat, 26 Nov 2022 17:36:11 +0100 Subject: [PATCH 14/16] Fix for SDL on Windows --- CMakeLists.txt | 13 ++++++++++--- src/CMakeLists.txt | 24 ++++++++++++++++++++---- 2 files changed, 30 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68b4d827..68d707ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -309,13 +309,20 @@ 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}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 10def122..27819d46 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -480,9 +480,6 @@ target_include_directories(colobotbase PUBLIC target_link_libraries(colobotbase PUBLIC CBot localename - SDL2::Core - SDL2::Image - SDL2::TTF OpenGL::GL PNG::PNG GLEW::GLEW @@ -507,6 +504,20 @@ if(mp3lame_FOUND) ) endif() +if(PLATFORM_WINDOWS) + target_link_libraries(colobotbase PUBLIC + $,SDL2::SDL2,SDL2::SDL2-static> + $,SDL2_image::SDL2_image,SDL2_image::SDL2_image-static> + $,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 @@ -601,7 +612,12 @@ endif() if(PLATFORM_WINDOWS) target_sources(colobot PRIVATE ../desktop/colobot.rc) endif() -target_link_libraries(colobot colobotbase SDL2::Main) + +if(PLATFORM_WINDOWS) + target_link_libraries(colobot colobotbase SDL2::SDL2main) +elseif() + target_link_libraries(colobot colobotbase SDL2::Main) +endif() # Install install(TARGETS colobot RUNTIME DESTINATION ${COLOBOT_INSTALL_BIN_DIR}) From 1d8e06c7ba94e65915f80329406596b477cb5bdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kapu=C5=9Bci=C5=84ski?= Date: Sat, 26 Nov 2022 20:00:44 +0100 Subject: [PATCH 15/16] Revert "Fix for SDL on Windows" This reverts commit 21b6572b5b146577687c9dc109507d7614c433fb. --- CMakeLists.txt | 13 +++---------- src/CMakeLists.txt | 24 ++++-------------------- 2 files changed, 7 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 68d707ae..68b4d827 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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}) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 27819d46..10def122 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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 - $,SDL2::SDL2,SDL2::SDL2-static> - $,SDL2_image::SDL2_image,SDL2_image::SDL2_image-static> - $,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}) From 436c316a4ac2d451034d2d7a28349ebf4ce1cfe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Kapu=C5=9Bci=C5=84ski?= Date: Sat, 26 Nov 2022 20:04:44 +0100 Subject: [PATCH 16/16] Updated SDL2 and SDL2_image library names --- cmake/FindSDL2.cmake | 4 ++-- cmake/FindSDL2_image.cmake | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/cmake/FindSDL2.cmake b/cmake/FindSDL2.cmake index 2445d36e..2f2388d0 100644 --- a/cmake/FindSDL2.cmake +++ b/cmake/FindSDL2.cmake @@ -186,7 +186,7 @@ endif() # SDL-2.0 is the name used by FreeBSD ports... # don't confuse it for the version number. find_library(SDL2_LIBRARY - NAMES SDL2 SDL-2.0 + NAMES SDL2 SDL-2.0 SDL2-static HINTS ENV SDL2DIR ${SDL2_NO_DEFAULT_PATH_CMD} @@ -223,7 +223,7 @@ if(NOT SDL2_BUILDING_LIBRARY) HINTS ENV SDL2DIR ${SDL2_NO_DEFAULT_PATH_CMD} - PATH_SUFFIXES lib ${VC_LIB_PATH_SUFFIX} + PATH_SUFFIXES lib lib/manual-link ${VC_LIB_PATH_SUFFIX} PATHS ${SDL2MAIN_LIBRARY_PATHS} DOC "Where the SDL2main library can be found" ) diff --git a/cmake/FindSDL2_image.cmake b/cmake/FindSDL2_image.cmake index 624e9154..f056f4bb 100644 --- a/cmake/FindSDL2_image.cmake +++ b/cmake/FindSDL2_image.cmake @@ -166,7 +166,7 @@ endif() # Search for the SDL2_image library find_library(SDL2_IMAGE_LIBRARY - NAMES SDL2_image + NAMES SDL2_image SDL2_image-static HINTS ENV SDL2IMAGEDIR ENV SDL2DIR