diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index db79db09d6..0000000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,152 +0,0 @@ -version: 2.1 -orbs: - discord: antonioned/discord@0.1.0 - discord-win: gelmo/discord-win@0.0.2 - win: circleci/windows@5.0 -jobs: - build-linux64: - docker: - - image: ubuntu:20.04 - environment: - DEBIAN_FRONTEND: noninteractive - DEBCONF_NONINTERACTIVE_SEEN: true - steps: - - run: apt update - - run: apt install -y openssh-client git # CircleCI Deps - - run: apt install -y curl clang cmake build-essential libsdl2-dev libopenal-dev libvorbis-dev libfreetype6-dev libcurl4-gnutls-dev git zip unzip - - checkout - - run: curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip - - run: unzip third-party/steamworks/sdk.zip -d third-party/steamworks - - run: export CC=clang CXX=clang++ - - run: cmake -DBUILD_STEAMLIB=1 ./source - - run: make -j8 - - run: tar -czvf ./source/Linux-x86_64-Release.tar.gz ./source/build/* --exclude ./source/build/*.a --exclude ./source/build/base*/*.a ./source/build/libs/*.a - - discord/status: - fail_only: false - failure_message: ":red_circle: ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_BRANCH} ${CIRCLE_JOB} (${CIRCLE_SHA1}) has failed!" - success_message: ":green_circle: ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_BRANCH} ${CIRCLE_JOB} (${CIRCLE_SHA1}) has succeeded!" - webhook: "${DISCORD_STATUS_WEBHOOK}" - - store_artifacts: - path: ./source/Linux-x86_64-Release.tar.gz - - build-linux64-debug: - docker: - - image: ubuntu:20.04 - environment: - DEBIAN_FRONTEND: noninteractive - DEBCONF_NONINTERACTIVE_SEEN: true - steps: - - run: apt update - - run: apt install -y openssh-client git # CircleCI Deps - - run: apt install -y curl clang cmake build-essential libsdl2-dev libopenal-dev libvorbis-dev libfreetype6-dev libcurl4-gnutls-dev git zip unzip - - checkout - - run: curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip - - run: unzip third-party/steamworks/sdk.zip -d third-party/steamworks - - run: export CC=clang CXX=clang++ - - run: cmake -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_STEAMLIB=1 ./source - - run: make -j8 - - run: tar -czvf ./source/Linux-x86_64-Debug.tar.gz ./source/build/* --exclude ./source/build/*.a --exclude ./source/build/base*/*.a ./source/build/libs/*.a - - discord/status: - fail_only: false - failure_message: ":red_circle: ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_BRANCH} ${CIRCLE_JOB} (${CIRCLE_SHA1}) has failed!" - success_message: ":green_circle: ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_BRANCH} ${CIRCLE_JOB} (${CIRCLE_SHA1}) has succeeded!" - webhook: "${DISCORD_STATUS_WEBHOOK}" - - store_artifacts: - path: ./source/Linux-x86_64-Debug.tar.gz - - build-osx: - macos: - xcode: '13.4.1' - steps: - - checkout - - run: brew update - - run: brew install curl cmake sdl2 openal-soft libvorbis freetype git zip unzip - - run: curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip - - run: unzip third-party/steamworks/sdk.zip -d third-party/steamworks - - run: cmake -DBUILD_STEAMLIB=1 -G Xcode ./source - - run: xcodebuild -project qfusion.xcodeproj/ -jobs 4 -configuration Release -target ALL_BUILD CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO - - run: tar -czvf ./source/OSX-x86_64-Release.tar.gz ./source/build/Release/*.app - - discord/status: - fail_only: false - failure_message: ":red_circle: ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_BRANCH} ${CIRCLE_JOB} (${CIRCLE_SHA1}) has failed!" - success_message: ":green_circle: ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_BRANCH} ${CIRCLE_JOB} (${CIRCLE_SHA1}) has succeeded!" - webhook: "${DISCORD_STATUS_WEBHOOK}" - - store_artifacts: - path: ./source/OSX-x86_64-Release.tar.gz - - build-osx-debug: - macos: - xcode: '13.4.1' - steps: - - checkout - - run: brew update - - run: brew install curl cmake sdl2 openal-soft libvorbis freetype git zip unzip - - run: curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip - - run: unzip third-party/steamworks/sdk.zip -d third-party/steamworks - - run: cmake -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_STEAMLIB=1 -DWF_BUILD_DSYM=ON -G Xcode ./source - - run: xcodebuild -project qfusion.xcodeproj/ -jobs 4 -configuration Debug -target ALL_BUILD CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO - - run: tar -czvf ./source/OSX-x86_64-Debug.tar.gz ./source/build/Debug/*.app - - discord/status: - fail_only: false - failure_message: ":red_circle: ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_BRANCH} ${CIRCLE_JOB} (${CIRCLE_SHA1}) has failed!" - success_message: ":green_circle: ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_BRANCH} ${CIRCLE_JOB} (${CIRCLE_SHA1}) has succeeded!" - webhook: "${DISCORD_STATUS_WEBHOOK}" - - store_artifacts: - path: ./source/OSX-x86_64-Debug.tar.gz - - build-win64: - executor: - name: win/server-2019 - shell: cmd.exe - steps: - - checkout - - run: choco install cmake -y - - run: curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip - - run: 7z x third-party/steamworks/sdk.zip -othird-party/steamworks - - run: - command: cd source; C:\PROGRA~1\CMake\bin\cmake.exe -G "Visual Studio 16 2019" -A "x64" -T "v142" -DBUILD_STEAMLIB=1 . - shell: powershell.exe - - run: msbuild .\source\qfusion.sln /p:configuration=Release /maxcpucount:8 - - run: 7z a win-x86_64-Release.zip .\source\build\Release\* -r -x!*.exp -x!*.lib - - discord-win/status: - fail_only: false - failure_message: ":red_circle: ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_BRANCH} ${CIRCLE_JOB} (${CIRCLE_SHA1}) has failed!" - success_message: ":green_circle: ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_BRANCH} ${CIRCLE_JOB} (${CIRCLE_SHA1}) has succeeded!" - webhook: "${DISCORD_STATUS_WEBHOOK}" - - store_artifacts: - path: .\win-x86_64-Release.zip - - build-win64-debug: - executor: - name: win/server-2019 - shell: cmd.exe - steps: - - checkout - - run: choco install cmake -y - - run: curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip - - run: 7z x third-party/steamworks/sdk.zip -othird-party/steamworks - - run: - command: cd source; C:\PROGRA~1\CMake\bin\cmake.exe -G "Visual Studio 16 2019" -A "x64" -T "v142" -DCMAKE_BUILD_TYPE=DEBUG -DBUILD_STEAMLIB=1 . - shell: powershell.exe - - run: msbuild .\source\qfusion.sln /p:configuration=Debug /maxcpucount:8 - - run: 7z a win-x86_64-Debug.zip .\source\build\Debug\* -r -x!*.exp -x!*.lib - - discord-win/status: - fail_only: false - failure_message: ":red_circle: ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_BRANCH} ${CIRCLE_JOB} (${CIRCLE_SHA1}) has failed!" - success_message: ":green_circle: ${CIRCLE_PROJECT_REPONAME} ${CIRCLE_BRANCH} ${CIRCLE_JOB} (${CIRCLE_SHA1}) has succeeded!" - webhook: "${DISCORD_STATUS_WEBHOOK}" - - store_artifacts: - path: .\win-x86_64-Debug.zip -checkout: - post: - - git submodule update --init --recursive -workflows: - version: 2 - build: - jobs: - - build-linux64 - - build-linux64-debug - - build-osx - - build-osx-debug - - build-win64 - - build-win64-debug diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b501bdd8ae..ed29ccffe9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,21 +8,25 @@ jobs: matrix: config: - { name: "Linux-x86_64-Release", type: "release", cmake_args: "-DBUILD_STEAMLIB=1 -DUSE_GRAPHICS_NRI=1" } - - { name: "Linux-x86_64-Debug", type: "debug", cmake_args: "-DBUILD_STEAMLIB=1 -DUSE_GRAPHICS_NRI=1" } + - { name: "Linux-x86_64-Debug", type: "debug", cmake_args: "-DBUILD_STEAMLIB=1 -DUSE_GRAPHICS_NRI=1"} name: ${{ matrix.config.name }} - runs-on: ubuntu-22.04 + runs-on: ubuntu-20.04 container: - image: ubuntu:22.04 + image: ubuntu:20.04 env: DEBIAN_FRONTEND: noninteractive DEBCONF_NONINTERACTIVE_SEEN: true steps: - - name: Setup - run: | - echo "ACTIONS_CACHE_URL=$ACTIONS_CACHE_URL" >> "$GITHUB_ENV" - echo "ACTIONS_RUNTIME_TOKEN=$ACTIONS_ID_TOKEN_REQUEST_TOKEN" >> "$GITHUB_ENV" - apt update - apt install -y git curl clang cmake build-essential libsdl2-dev libopenal-dev libvorbis-dev libfreetype6-dev libcurl4-gnutls-dev git zip unzip python3 + - name: Add CMake APT repo - glslang requires newer Cmake than provided by 20.04 + uses: gerlero/add-apt-repository@v1 + with: + uri: https://apt.kitware.com/ubuntu/ + key: https://apt.kitware.com/keys/kitware-archive-latest.asc + + - name: Install deps + uses: gerlero/apt-install@v1 + with: + packages: kitware-archive-keyring git curl clang-18 cmake build-essential git zip unzip python3 autoconf libtool meson automake libtool pkg-config python3-jinja2 python3-setuptools libx11-dev libwayland-dev libxkbcommon-dev libegl1-mesa-dev libibus-1.0-dev libxft-dev libxext-dev - name: Checkout repo uses: actions/checkout@v4 @@ -36,43 +40,40 @@ jobs: run: | curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip unzip third-party/steamworks/sdk.zip -d third-party/steamworks - - - name: Setup glslang - working-directory: ./source/glslang - run: | - python3 ./update_glslang_sources.py - name: Building Release if: matrix.config.type == 'release' working-directory: ./source run: | - export CC=clang CXX=clang++ - cmake ${{matrix.config.cmake_args}} -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=Release . + export CC=clang-18 CXX=clang++-18 + cmake -B ./build ${{matrix.config.cmake_args}} -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=Release + cd build make -j8 - name: Building Debug if: matrix.config.type == 'debug' working-directory: ./source run: | - export CC=clang CXX=clang++ - cmake ${{matrix.config.cmake_args}} -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=Debug . + export CC=clang-18 CXX=clang++-18 + cmake -B ./build ${{matrix.config.cmake_args}} -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=Debug + cd build make -j8 - - - name: Unit Test - working-directory: ./source/build + + - name: Unit Test + working-directory: ./source/build/warfork-qfusion shell: bash run: | set -e for exc in ./test/*; do $exc done - + - name: Package warfork - working-directory: ./source/build - run: tar --exclude='*.a' --exclude='base*/*.a' --exclude='libs/*.a' --exclude='test' -zcvf ../${{matrix.config.name}}.tar.gz * + working-directory: ./source/build/warfork-qfusion + run: tar --exclude='*.a' --exclude='base*/*.a' --exclude='libs/*.a' --exclude='test' -zcvf ../${{matrix.config.name}}.tar.gz * - name: Upload warfork artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v3 with: name: ${{matrix.config.name}} path: source/${{matrix.config.name}}.tar.gz @@ -82,21 +83,22 @@ jobs: max-parallel: 1 matrix: config: - - { agent: "macos-12", name: "OSX-x86_64-Release", xcode-version: '13.4.1', type: "release", cmake_args: "-DBUILD_STEAMLIB=1" , build_folder: "Release" } - - { agent: "macos-12", name: "OSX-x86_64-Debug", xcode-version: '13.4.1', type: "debug", cmake_args: "-DBUILD_STEAMLIB=1 -DWF_BUILD_DSYM=ON", build_folder: "Debug" } + - { agent: "macos-13", name: "OSX-x86_64-Release", xcode-version: "15.0.1", type: "release", cmake_args: "-DBUILD_STEAMLIB=1", build_folder: "Release" } + - { agent: "macos-13", name: "OSX-x86_64-Debug", xcode-version: "15.0.1", type: "debug", cmake_args: "-DBUILD_STEAMLIB=1 -DWF_BUILD_DSYM=ON", build_folder: "Debug" } name: ${{ matrix.config.name }} runs-on: ${{ matrix.config.agent }} steps: - - name: Setup + + - name: Replace problem-causing python installation - https://github.com/TeamForbiddenLLC/warfork-qfusion/pull/325 - Fixed in macos-14 shell: bash run: | - echo "ACTIONS_CACHE_URL=$ACTIONS_CACHE_URL" >> "$GITHUB_ENV" - echo "ACTIONS_RUNTIME_TOKEN=$ACTIONS_ID_TOKEN_REQUEST_TOKEN" >> "$GITHUB_ENV" - brew uninstall --force azure-cli - brew uninstall --force aws-sam-cli + brew uninstall --force azure-cli aws-sam-cli brew install python@3 || brew link --overwrite python@3 - brew update - brew install curl cmake sdl2 openal-soft libvorbis freetype git zip unzip + + - name: Install deps + uses: gerlero/brew-install@v1 + with: + packages: cmake git zip unzip libidn2 - name: Checkout repo uses: actions/checkout@v4 @@ -116,23 +118,25 @@ jobs: if: matrix.config.type == 'release' working-directory: ./source run: | - cmake ${{matrix.config.cmake_args}} -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=RELEASE -G Xcode . + cmake -B ./build ${{matrix.config.cmake_args}} -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=RELEASE -G Xcode + cd build xcodebuild -project qfusion.xcodeproj/ -jobs 4 -configuration Release -target ALL_BUILD CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO - name: Building Debug if: matrix.config.type == 'debug' working-directory: ./source run: | - cmake ${{matrix.config.cmake_args}} -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=DEBUG -G Xcode . + cmake -B ./build ${{matrix.config.cmake_args}} -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=DEBUG -G Xcode + cd build xcodebuild -project qfusion.xcodeproj/ -jobs 4 -configuration Debug -target ALL_BUILD CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO - name: Package warfork - working-directory: ./source/build + working-directory: ./source/build/warfork-qfusion run: tar --exclude='test' -czvf ../${{matrix.config.name}}.tar.gz ${{matrix.config.build_folder}}/*.app - + - name: Unit Test - working-directory: ./source/build/${{matrix.config.build_folder}} - run: | + working-directory: ./source/build/warfork-qfusion/${{matrix.config.build_folder}} + run: | set -e for exc in ./test/*[^.dSYM]; do $exc @@ -149,64 +153,56 @@ jobs: max-parallel: 1 matrix: config: - - { agent: "windows-latest", name: "win-x86_64-Release", vs_version: 'Visual Studio 17 2022', type: "release", cmake_args: "-DBUILD_STEAMLIB=1", build_folder: "Release" } - - { agent: "windows-latest", name: "win-x86_64-Debug", vs_version: 'Visual Studio 17 2022', type: "debug", cmake_args: "-DBUILD_STEAMLIB=1 -DWF_BUILD_DSYM=ON", build_folder: "Debug" } - + - { agent: "windows-2019", name: "win-x86_64-Release", vs_version: "Visual Studio 16 2019", type: "release", cmake_args: "-DBUILD_STEAMLIB=1", build_folder: "Release" } + - { agent: "windows-2019", name: "win-x86_64-Debug", vs_version: "Visual Studio 16 2019", type: "debug", cmake_args: "-DBUILD_STEAMLIB=1 -DWF_BUILD_DSYM=ON", build_folder: "Debug" } + name: ${{ matrix.config.name }} runs-on: ${{ matrix.config.agent }} steps: - - name: Setup - run: | - Add-Content -Path $env:GITHUB_ENV -Value "ACTIONS_CACHE_URL=$ACTIONS_CACHE_URL" - Add-Content -Path $env:GITHUB_ENV -Value "ACTIONS_RUNTIME_TOKEN=$ACTIONS_ID_TOKEN_REQUEST_TOKEN" - + - name: Checkout repo uses: actions/checkout@v4 with: submodules: recursive - + - name: Download steamworks sdk run: | curl https://warfork.com/downloads/sdk/ --output third-party/steamworks/sdk.zip 7z x third-party/steamworks/sdk.zip -othird-party/steamworks - - - name: Setup glslang - working-directory: ./source/glslang - run: | - python3 ./update_glslang_sources.py - name: Add msbuild to PATH uses: microsoft/setup-msbuild@v1.1 - name: Building Debug - if: matrix.config.type == 'debug' + if: matrix.config.type == 'debug' working-directory: .\source run: | - cmake ${{matrix.config.cmake_args}} -G "${{matrix.config.vs_version}}" -A x64 -DBUILD_UNIT_TEST=1 . + cmake -B ./build ${{matrix.config.cmake_args}} -G "${{matrix.config.vs_version}}" -A x64 -DBUILD_UNIT_TEST=1 + cd build msbuild qfusion.sln /p:configuration=Debug /maxcpucount:8 - - name: Building Release if: matrix.config.type == 'release' working-directory: .\source run: | - cmake ${{matrix.config.cmake_args}} -G "${{matrix.config.vs_version}}" -A x64 -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=RELEASE . + cmake -B ./build ${{matrix.config.cmake_args}} -G "${{matrix.config.vs_version}}" -A x64 -DBUILD_UNIT_TEST=1 -DCMAKE_BUILD_TYPE=RELEASE + cd build msbuild qfusion.sln /p:configuration=Release /maxcpucount:8 - - - name: Unit Test + + - name: Unit Test shell: bash - working-directory: .\source\build\${{matrix.config.build_folder}} - run: | + working-directory: .\source\build\warfork-qfusion\${{matrix.config.build_folder}} + run: | set -e for exc in ./test/*[^.pdb]; do $exc done - name: Package warfork - working-directory: .\source\build\${{matrix.config.build_folder}} + working-directory: .\source\build\warfork-qfusion\${{matrix.config.build_folder}} run: 7z a ..\..\${{matrix.config.name}}.zip * '-xr!*.exp' '-xr!*.lib' '-xr!test' - + - name: Upload warfork artifact uses: actions/upload-artifact@v3 with: name: ${{matrix.config.name}} - path: source\${{matrix.config.name}}.zip + path: source\${{matrix.config.name}}.zip \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index 39c239b273..af9034349d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,9 +1,30 @@ [submodule "source/NRI"] path = source/NRI url = https://github.com/TeamForbiddenLLC/NRI.git -[submodule "source/vcpkg"] - path = source/vcpkg - url = https://github.com/microsoft/vcpkg.git -[submodule "source/glslang"] - path = source/glslang - url = https://github.com/TeamForbiddenLLC/glslang.git +[submodule "source/extern/glslang"] + path = source/extern/glslang + url = https://github.com/KhronosGroup/glslang.git +[submodule "source/extern/curl"] + path = source/extern/curl + url = https://github.com/curl/curl.git +[submodule "source/extern/stb"] + path = source/extern/stb + url = https://github.com/nothings/stb.git +[submodule "source/extern/zlib"] + path = source/extern/zlib + url = https://github.com/madler/zlib.git +[submodule "source/extern/ogg"] + path = source/extern/ogg + url = https://github.com/xiph/ogg.git +[submodule "source/extern/freetype"] + path = source/extern/freetype + url = https://github.com/freetype/freetype.git +[submodule "source/extern/openal-soft"] + path = source/extern/openal-soft + url = https://github.com/kcat/openal-soft.git +[submodule "source/extern/SDL"] + path = source/extern/SDL + url = https://github.com/libsdl-org/SDL.git +[submodule "source/extern/vorbis"] + path = source/extern/vorbis + url = https://github.com/TeamForbiddenLLC/vorbis.git diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 513bed6560..f14a9000e4 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -1,6 +1,6 @@ project(qfusion) -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.15) message(STATUS "CMAKE_SYSTEM: " ${CMAKE_SYSTEM}) message(STATUS "CMAKE_SYSTEM_NAME: " ${CMAKE_SYSTEM_NAME}) message(STATUS "CMAKE_SYSTEM_VERSION: " ${CMAKE_SYSTEM_VERSION}) @@ -8,6 +8,18 @@ message(STATUS "CMAKE_SYSTEM_PROCESSOR: " ${CMAKE_SYSTEM_PROCESSOR}) set(CMAKE_MODULE_PATH ${CMAKE_HOME_DIRECTORY}/cmake) include(QfusionUtils) +include(OutputDirectory) + +set(CMAKE_SKIP_BUILD_RPATH FALSE) + +# when building, don't use the install RPATH already +# (but later on when installing) +set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) +set(CMAKE_INSTALL_RPATH $ORIGIN/libs) + +# add the automatically determined parts of the RPATH +# which point to directories outside the build tree to the install RPATH +set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE) set(QFUSION_GAME Warfork) if (QFUSION_GAME) @@ -33,6 +45,7 @@ option(GAME_MODULES_ONLY "Only build game modules" OFF) option(BUILD_STEAMLIB "Include the steamlib module (requires Steamworks SDK)" OFF) option(USE_GRAPHICS_NRI "Build using Nvidia NRI" OFF) +option(USE_PACKAGE_ASSETS "package assets" OFF) # We compile third-party libs from source set(ANGELSCRIPT_DIR ${CMAKE_HOME_DIRECTORY}/../third-party/angelscript/sdk/angelscript) @@ -47,27 +60,20 @@ set(MINIZ_DIR ${CMAKE_HOME_DIRECTORY}/../third-party/miniz) set(MINIZ_INCLUDE_DIR ${MINIZ_DIR}) set(MINIZ_SOURCE_DIR ${MINIZ_DIR}) -set(STB_DIR ${CMAKE_HOME_DIRECTORY}/../third-party/stb) -set(STB_INCLUDE_DIR ${STB_DIR}) - set(UTEST_INCLUDE_DIR ${CMAKE_HOME_DIRECTORY}/../third-party/utest) set(DISCORD_DIR ${CMAKE_HOME_DIRECTORY}/../third-party/discord) set(DISCORD_INCLUDE_DIR ${DISCORD_DIR}) -set(OPENAL_DIR ${CMAKE_HOME_DIRECTORY}/../libsrcs/src/openal-soft) -set(OPENAL_INCLUDE_DIR ${OPENAL_DIR}/include/AL) - set(NRI_DIR ${CMAKE_HOME_DIRECTORY}/NRI) set(NRI_INCLUDE_DIR ${CMAKE_HOME_DIRECTORY}/NRI/Include) if (NOT GAME_MODULES_ONLY AND USE_GRAPHICS_NRI) + set(NRI_STATIC_LIBRARY ON) - set(IS_SUBMODULE ON) set(NRI_ENABLE_D3D12_SUPPORT OFF) set(NRI_ENABLE_D3D11_SUPPORT OFF) add_subdirectory(NRI) - add_subdirectory(glslang) endif() # Windows specific settings @@ -78,23 +84,8 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") set(QFUSION_WINDOWS_ARCH "x64") endif() - set(CMAKE_INCLUDE_PATH - "../libsrcs/src/libogg" - "../libsrcs/src/libvorbis" - "../libsrcs/src/libcurl/include" - "../libsrcs/src/libfreetype" - "../libsrcs/src/SDL2/include" - "../libsrcs/src/openal-soft/include/AL" - ) - add_definitions(-D_CRT_SECURE_NO_WARNINGS -DCURL_STATICLIB -DWIN32 -D_WINDOWS) - if (MSVC) - set(CMAKE_LIBRARY_PATH "../libsrcs/lib/win32/${QFUSION_WINDOWS_ARCH}/debug") - else() - set(CMAKE_LIBRARY_PATH "../libsrcs/lib/win32/${QFUSION_WINDOWS_ARCH}/mingw") - endif() - if (MSVC) add_release_link_flags("/LTCG") @@ -111,15 +102,21 @@ endif() # OS X specific settings if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") - set(ARCHS_STANDARD_32_64_BIT "x86_64") # Compile only 64-bit version - set(CMAKE_XCODE_ATTRIBUTE_MACOSX_DEPLOYMENT_TARGET "10.11") # Use 10.11 as deployment target set(CMAKE_XCODE_ATTRIBUTE_GCC_C_LANGUAGE_STANDARD "gnu99") # Use GNU99 standart for compiling C files set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++11") # Use C++11 standart for compiling C++ files set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") # Use modern libc++ instead of libstdc++ - set(CMAKE_FRAMEWORK_PATH "../libsrcs/lib/mac/Frameworks") set(CMAKE_MACOSX_RPATH 1) set(USE_SDL2 1) + # The workaround for try_compile failing with code signing + # since cmake-3.18.2, not required + set(CMAKE_TRY_COMPILE_PLATFORM_VARIABLES + ${CMAKE_TRY_COMPILE_PLATFORM_VARIABLES} + "CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED" + "CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED") + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED NO) + set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED NO) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wno-unused-function -fvisibility=hidden -Winvalid-pch") set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -O0 -D_DEBUG") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fno-strict-aliasing -ffast-math -funroll-loops -msse2") @@ -192,7 +189,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR MINGW) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=500 -Werror=implicit-function-declaration") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -D_POSIX_C_SOURCE=200112L -D_XOPEN_SOURCE=500 ") # default to sdl2 build on non-windows platforms set(USE_SDL2 1) @@ -228,24 +225,16 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") # string(REPLACE "" "" CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_C_CREATE_SHARED_LIBRARY}") # string(REPLACE "" "" CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_C_CREATE_SHARED_MODULE}") - # Remove soname link flags from library linking options - string(REPLACE "" "" CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_C_CREATE_SHARED_LIBRARY}") - string(REPLACE "" "" CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_C_CREATE_SHARED_MODULE}") + ## Remove soname link flags from library linking options + #string(REPLACE "" "" CMAKE_C_CREATE_SHARED_LIBRARY "${CMAKE_C_CREATE_SHARED_LIBRARY}") + #string(REPLACE "" "" CMAKE_C_CREATE_SHARED_MODULE "${CMAKE_C_CREATE_SHARED_MODULE}") - # Remove -rdynamic from link options - string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}") + ## Remove -rdynamic from link options + #string(REPLACE "-rdynamic" "" CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "${CMAKE_SHARED_LIBRARY_LINK_C_FLAGS}") endif() if (NOT GAME_MODULES_ONLY) - find_package(Ogg REQUIRED) - find_package(Vorbis REQUIRED) - find_package(CURL REQUIRED) - find_package(Freetype REQUIRED) - find_package(OpenAL REQUIRED) - if (USE_SDL2) - set(USE_SDL2 1) - find_package(SDL2 REQUIRED) add_definitions(-DUSE_SDL2) endif() endif() @@ -306,6 +295,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") capitalize(QFUSION_CLIENT_NAME) endif() +add_subdirectory(extern) add_subdirectory(qcore) @@ -328,3 +318,14 @@ if (NOT GAME_MODULES_ONLY) add_subdirectory(tv_server) add_subdirectory(client) endif() + + +if(USE_PACKAGE_ASSETS) + add_custom_target(deploy ALL + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${CMAKE_COMMAND} + -DBIN_DIR=${CMAKE_BINARY_DIR} + -DASSET_ROOT=${CMAKE_CURRENT_SOURCE_DIR}/../assets + -P ${CMAKE_CURRENT_SOURCE_DIR}/package_assets.cmake + COMMENT "packaging assets ...") +endif() diff --git a/source/cin/CMakeLists.txt b/source/cin/CMakeLists.txt index a290e466fa..edd5bf8268 100644 --- a/source/cin/CMakeLists.txt +++ b/source/cin/CMakeLists.txt @@ -1,7 +1,5 @@ project(cin) -include_directories(${OGG_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR}) - file(GLOB CIN_HEADERS "*.h" "../gameshared/q_*.h" @@ -19,5 +17,5 @@ else () endif() add_library(cin SHARED ${CIN_SOURCES} ${CIN_HEADERS}) -target_link_libraries(cin PRIVATE ${OGG_LIBRARY} ${VORBIS_LIBRARIES} ${CIN_PLATFORM_LIBRARIES}) +target_link_libraries(cin PRIVATE ogg vorbis vorbisfile ${CIN_PLATFORM_LIBRARIES}) qf_set_output_dir(cin libs) diff --git a/source/client/CMakeLists.txt b/source/client/CMakeLists.txt index dd3707e44c..99b97521ab 100644 --- a/source/client/CMakeLists.txt +++ b/source/client/CMakeLists.txt @@ -2,9 +2,6 @@ project(${QFUSION_CLIENT_NAME}) include_directories(${MINIZ_INCLUDE_DIR} ${CURL_INCLUDE_DIR} ${DISCORD_INCLUDE_DIR}) -if (USE_SDL2 OR (${CMAKE_SYSTEM_NAME} MATCHES "Linux")) - include_directories(${SDL2_INCLUDE_DIR}) -endif() if (NOT QFUSION_MAC_ICON) set(QFUSION_MAC_ICON ../../icons/warfork.icns) @@ -79,7 +76,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") "${DISCORD_INCLUDE_DIR}/discord_register_win.cpp" ) - set(CLIENT_PLATFORM_LIBRARIES ${SDL2_LIBRARY} ${SDL2MAIN_LIBRARY} "ws2_32.lib" "winmm.lib") + set(CLIENT_PLATFORM_LIBRARIES SDL2::SDL2 $ "ws2_32.lib" "winmm.lib") else() file(GLOB CLIENT_PLATFORM_SOURCES "../win32/win_fs.c" @@ -143,11 +140,10 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") "${QFUSION_MAC_INFO_PLIST}" ) - set(CLIENT_PLATFORM_LIBRARIES ${SDL2_LIBRARY} "-framework IOKit" "-framework Cocoa") + set(CLIENT_PLATFORM_LIBRARIES SDL2::SDL2 "-framework IOKit" "-framework Cocoa") set(CLIENT_BINARY_TYPE MACOSX_BUNDLE) set(BUNDLE_RESOURCES - ../../libsrcs/lib/mac/Frameworks ${QFUSION_MAC_ICON} ) if (QFUSION_DATA_DIR) @@ -185,7 +181,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") "${DISCORD_INCLUDE_DIR}/discord_register_linux.cpp" ) - set(CLIENT_PLATFORM_LIBRARIES ${SDL2_LIBRARY} "pthread" "m" "dl" "rt") + set(CLIENT_PLATFORM_LIBRARIES SDL2::SDL2 "pthread" "m" "dl" "rt") else() file(GLOB CLIENT_PLATFORM_SOURCES "../unix/unix_fs.c" @@ -209,7 +205,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") "${DISCORD_INCLUDE_DIR}/discord_register_linux.cpp" ) - set(CLIENT_PLATFORM_LIBRARIES ${SDL2_LIBRARY} "pthread" "dl" "m" "X11" "Xi" "Xext" "Xrandr" "rt") + set(CLIENT_PLATFORM_LIBRARIES SDL2::SDL2 "pthread" "dl" "m" "X11" "Xi" "Xext" "Xrandr" "rt") endif() set(CLIENT_BINARY_TYPE "") @@ -230,8 +226,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") set_target_properties(${QFUSION_CLIENT_NAME} PROPERTIES XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/../Frameworks @executable_path/../Resources/base @executable_path/../Resources/libs") set_source_files_properties(${QFUSION_MAC_ICON} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) - set_source_files_properties(../../libsrcs/lib/mac/Frameworks PROPERTIES MACOSX_PACKAGE_LOCATION .) - if (QFUSION_DATA_DIR) + if (QFUSION_DATA_DIR) set_source_files_properties(${QFUSION_DATA_DIR}/${QFUSION_GAME_DIR} PROPERTIES MACOSX_PACKAGE_LOCATION Resources) set_source_files_properties(${QFUSION_DATA_DIR}/docs PROPERTIES MACOSX_PACKAGE_LOCATION Resources) endif() @@ -250,16 +245,12 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin") add_custom_command(TARGET ${QFUSION_CLIENT_NAME} POST_BUILD COMMAND ${POST_BUILD_CMDS}) elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - add_custom_command(TARGET ${QFUSION_CLIENT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_HOME_DIRECTORY}/../libsrcs/src/openal-soft/bin/Win64/soft_oal.dll ${CMAKE_HOME_DIRECTORY}/build/$(CONFIGURATION)/soft_oal64.dll) - else() - add_custom_command(TARGET ${QFUSION_CLIENT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_HOME_DIRECTORY}/../libsrcs/src/openal-soft/bin/Win64/soft_oal.dll ${CMAKE_HOME_DIRECTORY}/build/$(CONFIGURATION)/soft_oal64.dll) - endif() add_custom_command(TARGET ${QFUSION_CLIENT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_HOME_DIRECTORY}/build/commit.txt ${CMAKE_HOME_DIRECTORY}/build/$(CONFIGURATION)/) add_custom_command(TARGET ${QFUSION_CLIENT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_HOME_DIRECTORY}/build/steam_appid.txt ${CMAKE_HOME_DIRECTORY}/build/$(CONFIGURATION)/) endif() -target_link_libraries(${QFUSION_CLIENT_NAME} PRIVATE ${CURL_LIBRARY} ${CLIENT_PLATFORM_LIBRARIES} ${DISCORD_LIBRARY} ${STEAMSHIMPARENT_LIBRARY}) +target_link_libraries(${QFUSION_CLIENT_NAME} PRIVATE CURL::libcurl ${CLIENT_PLATFORM_LIBRARIES} ${DISCORD_LIBRARY} ${STEAMSHIMPARENT_LIBRARY}) + qf_set_output_dir(${QFUSION_CLIENT_NAME} "") if (BUILD_STEAMLIB) diff --git a/source/cmake/FindOgg.cmake b/source/cmake/FindOgg.cmake deleted file mode 100644 index a0c33eb29d..0000000000 --- a/source/cmake/FindOgg.cmake +++ /dev/null @@ -1,25 +0,0 @@ -# - Find ogg -# Find the native ogg includes and libraries -# -# OGG_INCLUDE_DIR - where to find ogg.h, etc. -# OGG_LIBRARIES - List of libraries when using ogg. -# OGG_FOUND - True if ogg found. - -if(OGG_INCLUDE_DIR) - # Already in cache, be silent - set(OGG_FIND_QUIETLY TRUE) -endif(OGG_INCLUDE_DIR) -find_path(OGG_INCLUDE_DIR ogg/ogg.h PATH_SUFFIXES include) -# MSVC built ogg may be named ogg_static. -# The provided project files name the library with the lib prefix. -find_library(OGG_LIBRARY NAMES ogg ogg_static libogg libogg_static) -# Handle the QUIETLY and REQUIRED arguments and set OGG_FOUND -# to TRUE if all listed variables are TRUE. -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Ogg DEFAULT_MSG OGG_INCLUDE_DIR OGG_LIBRARY) - -set(OGG_LIBRARIES ${OGG_LIBRARY}) - -mark_as_advanced(OGG_INCLUDE_DIR) -mark_as_advanced(OGG_LIBRARY) - diff --git a/source/cmake/FindOpenAL.cmake b/source/cmake/FindOpenAL.cmake deleted file mode 100644 index fa86c11c41..0000000000 --- a/source/cmake/FindOpenAL.cmake +++ /dev/null @@ -1,24 +0,0 @@ -# - Find openal -# Find the native openal includes and libraries -# -# OPENAL_INCLUDE_DIR - where to find al.h, etc. -# OPENAL_LIBRARIES - List of libraries when using openal. -# OPENAL_FOUND - True if openal found. - -if(OPENAL_INCLUDE_DIR) - # Already in cache, be silent - set(OPENAL_FIND_QUIETLY TRUE) -endif(OPENAL_INCLUDE_DIR) -find_path(OPENAL_INCLUDE_DIR al.h PATH_SUFFIXES include) -# MSVC built openal may be named openal_static. -# The provided project files name the library with the lib prefix. -find_library(OPENAL_LIBRARY NAMES openal openal_static libopenal libopenal_static soft_oal OpenAL32 oal al) -# Handle the QUIETLY and REQUIRED arguments and set OPENAL_FOUND -# to TRUE if all listed variables are TRUE. -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(OpenAL DEFAULT_MSG OPENAL_INCLUDE_DIR OPENAL_LIBRARY) - -set(OPENAL_LIBRARIES ${OPENAL_LIBRARY}) - -mark_as_advanced(OPENAL_INCLUDE_DIR) -mark_as_advanced(OPENAL_LIBRARY) \ No newline at end of file diff --git a/source/cmake/FindSDL2.cmake b/source/cmake/FindSDL2.cmake deleted file mode 100644 index c3df78e3f3..0000000000 --- a/source/cmake/FindSDL2.cmake +++ /dev/null @@ -1,163 +0,0 @@ -# Locate SDL2 library -# This module defines -# SDL2_LIBRARY, the name of the library to link against -# SDL2_FOUND, if false, do not try to link to SDL2 -# SDL2_INCLUDE_DIR, where to find SDL.h -# -# This module responds to the the flag: -# SDL2_BUILDING_LIBRARY -# If this is defined, then no SDL2main will be linked in because -# only applications need main(). -# Otherwise, it is assumed you are building an application and this -# module will attempt to locate and set the the proper link flags -# as part of the returned SDL2_LIBRARY variable. -# -# Don't forget to include SDLmain.h and SDLmain.m your project for the -# OS X framework based version. (Other versions link to -lSDL2main which -# this module will try to find on your behalf.) Also for OS X, this -# module will automatically add the -framework Cocoa on your behalf. -# -# -# Additional Note: If you see an empty SDL2_LIBRARY_TEMP in your configuration -# and no SDL2_LIBRARY, it means CMake did not find your SDL2 library -# (SDL2.dll, libsdl2.so, SDL2.framework, etc). -# Set SDL2_LIBRARY_TEMP to point to your SDL2 library, and configure again. -# Similarly, if you see an empty SDL2MAIN_LIBRARY, you should set this value -# as appropriate. These values are used to generate the final SDL2_LIBRARY -# variable, but when these values are unset, SDL2_LIBRARY does not get created. -# -# -# $SDL2DIR is an environment variable that would -# correspond to the ./configure --prefix=$SDL2DIR -# used in building SDL2. -# l.e.galup 9-20-02 -# -# Modified by Eric Wing. -# Added code to assist with automated building by using environmental variables -# and providing a more controlled/consistent search behavior. -# Added new modifications to recognize OS X frameworks and -# additional Unix paths (FreeBSD, etc). -# Also corrected the header search path to follow "proper" SDL guidelines. -# Added a search for SDL2main which is needed by some platforms. -# Added a search for threads which is needed by some platforms. -# Added needed compile switches for MinGW. -# -# On OSX, this will prefer the Framework version (if found) over others. -# People will have to manually change the cache values of -# SDL2_LIBRARY to override this selection or set the CMake environment -# CMAKE_INCLUDE_PATH to modify the search paths. -# -# Note that the header path has changed from SDL2/SDL.h to just SDL.h -# This needed to change because "proper" SDL convention -# is #include "SDL.h", not . This is done for portability -# reasons because not all systems place things in SDL2/ (see FreeBSD). - -#============================================================================= -# Copyright 2003-2009 Kitware, Inc. -# -# Distributed under the OSI-approved BSD License (the "License"); -# see accompanying file Copyright.txt for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even the -# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. -# See the License for more information. -#============================================================================= -# (To distribute this file outside of CMake, substitute the full -# License text for the above reference.) - -SET(SDL2_SEARCH_PATHS - ~/Library/Frameworks - /Library/Frameworks - /usr/local - /usr - /sw # Fink - /opt/local # DarwinPorts - /opt/csw # Blastwave - /opt -) - -FIND_PATH(SDL2_INCLUDE_DIR SDL.h - HINTS - $ENV{SDL2DIR} - PATH_SUFFIXES include/SDL2 - PATHS ${SDL2_SEARCH_PATHS} -) - -FIND_LIBRARY(SDL2_LIBRARY_TEMP - NAMES SDL2 - HINTS - $ENV{SDL2DIR} - PATH_SUFFIXES lib64 lib - PATHS ${SDL2_SEARCH_PATHS} -) - -IF(NOT SDL2_BUILDING_LIBRARY) - IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework") - # Non-OS X framework versions expect you to also dynamically link to - # SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms - # seem to provide SDL2main for compatibility even though they don't - # necessarily need it. - FIND_LIBRARY(SDL2MAIN_LIBRARY - NAMES SDL2main - HINTS - $ENV{SDL2DIR} - PATH_SUFFIXES lib64 lib - PATHS ${SDL2_SEARCH_PATHS} - ) - ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework") -ENDIF(NOT SDL2_BUILDING_LIBRARY) - -# SDL2 may require threads on your system. -# The Apple build may not need an explicit flag because one of the -# frameworks may already provide it. -# But for non-OSX systems, I will use the CMake Threads package. -IF(NOT APPLE) - FIND_PACKAGE(Threads) -ENDIF(NOT APPLE) - -# MinGW needs an additional library, mwindows -# It's total link flags should look like -lmingw32 -lSDL2main -lSDL2 -lmwindows -# (Actually on second look, I think it only needs one of the m* libraries.) -IF(MINGW) - SET(MINGW32_LIBRARY mingw32 CACHE STRING "mwindows for MinGW") -ENDIF(MINGW) - -IF(SDL2_LIBRARY_TEMP) - # For SDL2main - IF(NOT SDL2_BUILDING_LIBRARY) - IF(SDL2MAIN_LIBRARY) - SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP}) - ENDIF(SDL2MAIN_LIBRARY) - ENDIF(NOT SDL2_BUILDING_LIBRARY) - - # For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa. - # CMake doesn't display the -framework Cocoa string in the UI even - # though it actually is there if I modify a pre-used variable. - # I think it has something to do with the CACHE STRING. - # So I use a temporary variable until the end so I can set the - # "real" variable in one-shot. - IF(APPLE) - SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa") - ENDIF(APPLE) - - # For threads, as mentioned Apple doesn't need this. - # In fact, there seems to be a problem if I used the Threads package - # and try using this line, so I'm just skipping it entirely for OS X. - IF(NOT APPLE) - SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT}) - ENDIF(NOT APPLE) - - # For MinGW library - IF(MINGW) - SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP}) - ENDIF(MINGW) - - # Set the final string here so the GUI reflects the final state. - SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found") - # Set the temp variable to INTERNAL so it is not seen in the CMake GUI - SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "") -ENDIF(SDL2_LIBRARY_TEMP) - -INCLUDE(FindPackageHandleStandardArgs) - -FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR) diff --git a/source/cmake/FindVorbis.cmake b/source/cmake/FindVorbis.cmake deleted file mode 100644 index 08b4f9cae4..0000000000 --- a/source/cmake/FindVorbis.cmake +++ /dev/null @@ -1,40 +0,0 @@ -# - Find vorbis -# Find the native vorbis includes and libraries -# -# VORBIS_INCLUDE_DIR - where to find vorbis.h, etc. -# VORBIS_LIBRARIES - List of libraries when using vorbis(file). -# VORBIS_FOUND - True if vorbis found. - -if(VORBIS_INCLUDE_DIR) - # Already in cache, be silent - set(VORBIS_FIND_QUIETLY TRUE) -endif(VORBIS_INCLUDE_DIR) - -find_package(Ogg) -if(OGG_FOUND) - find_path(VORBIS_INCLUDE_DIR vorbis/vorbisfile.h PATH_SUFFIXES include) - # MSVC built vorbis may be named vorbis_static - # The provided project files name the library with the lib prefix. - find_library(VORBIS_LIBRARY NAMES vorbis vorbis_static libvorbis libvorbis_static) - if (NOT ${VORBIS_LIBRARY} MATCHES ".framework") - find_library(VORBISFILE_LIBRARY NAMES vorbisfile vorbisfile_static libvorbisfile libvorbisfile_static) - else() - set(VORBISFILE_LIBRARY ${VORBIS_LIBRARY}) - endif() - # Handle the QUIETLY and REQUIRED arguments and set VORBIS_FOUND - # to TRUE if all listed variables are TRUE. - include(FindPackageHandleStandardArgs) - find_package_handle_standard_args(Vorbis DEFAULT_MSG - VORBIS_INCLUDE_DIR - VORBIS_LIBRARY VORBISFILE_LIBRARY) -endif(OGG_FOUND) - -if(VORBIS_FOUND) - set(VORBIS_LIBRARIES ${VORBISFILE_LIBRARY} ${VORBIS_LIBRARY} - ${OGG_LIBRARY}) -else(VORBIS_FOUND) - set(VORBIS_LIBRARIES) -endif(VORBIS_FOUND) - -mark_as_advanced(VORBIS_INCLUDE_DIR) -mark_as_advanced(VORBIS_LIBRARY VORBISFILE_LIBRARY) diff --git a/source/cmake/OutputDirectory.cmake b/source/cmake/OutputDirectory.cmake new file mode 100644 index 0000000000..dc59233ffe --- /dev/null +++ b/source/cmake/OutputDirectory.cmake @@ -0,0 +1,22 @@ +# Set output directories +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/libs CACHE PATH "Build directory for static libraries and import libraries") +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/libs CACHE PATH "Build directory for shared libraries") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR} CACHE PATH "Build directory for executables") + +# We install outside of the binary dir because our install support muliple platforms to +# be installed together. We also have an exclusion rule in the AP that filters out the +# "install" folder to avoid the AP picking it up +unset(define_with_force) +if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) + set(define_with_force FORCE) +endif() +set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/install CACHE PATH "Install directory" ${define_with_force}) + +cmake_path(ABSOLUTE_PATH CMAKE_BINARY_DIR NORMALIZE OUTPUT_VARIABLE cmake_binary_dir_normalized) +cmake_path(ABSOLUTE_PATH CMAKE_INSTALL_PREFIX NORMALIZE OUTPUT_VARIABLE cmake_install_prefix_normalized) +cmake_path(COMPARE ${cmake_binary_dir_normalized} EQUAL ${cmake_install_prefix_normalized} are_paths_equal) +if(are_paths_equal) + message(FATAL_ERROR "Binary dir is the same path as install prefix, indicate a different install prefix with " + "CMAKE_INSTALL_PREFIX or a different binary dir with -B ") +endif() + diff --git a/source/cmake/QfusionUtils.cmake b/source/cmake/QfusionUtils.cmake index deaf0898ca..67a33504b6 100644 --- a/source/cmake/QfusionUtils.cmake +++ b/source/cmake/QfusionUtils.cmake @@ -46,15 +46,26 @@ macro(find_windows_release_libs libs) set(${libs} ${${libs}_RELEASE} ${${libs}_DEBUG}) endmacro() +macro(qf_add_basewf name dir) + +endmacro() + macro(qf_set_output_dir name dir) foreach (OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES}) string(TOUPPER ${OUTPUTCONFIG} OUTPUTCONFIGUPPERCASE) - set_target_properties(${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIGUPPERCASE} ${CMAKE_HOME_DIRECTORY}/build/${OUTPUTCONFIG}/${dir}) - set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIGUPPERCASE} ${CMAKE_HOME_DIRECTORY}/build/${OUTPUTCONFIG}/${dir}) - set_target_properties(${name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIGUPPERCASE} ${CMAKE_HOME_DIRECTORY}/build/${OUTPUTCONFIG}/${dir}) + set_target_properties(${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_${OUTPUTCONFIGUPPERCASE} ${CMAKE_BINARY_DIR}/warfork-qfusion/${OUTPUTCONFIG}/${dir}) + set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY_${OUTPUTCONFIGUPPERCASE} ${CMAKE_BINARY_DIR}/warfork-qfusion/${OUTPUTCONFIG}/${dir}) + set_target_properties(${name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY_${OUTPUTCONFIGUPPERCASE} ${CMAKE_BINARY_DIR}/warfork-qfusion/${OUTPUTCONFIG}/${dir}) endforeach() - set_target_properties(${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/build/${dir}) - set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/build/${dir}) - set_target_properties(${name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_HOME_DIRECTORY}/build/${dir}) -endmacro() \ No newline at end of file + set_target_properties(${name} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/warfork-qfusion/${dir}) + set_target_properties(${name} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/warfork-qfusion/${dir}) + set_target_properties(${name} PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/warfork-qfusion/${dir}) + + # INSTALL(TARGETS ${name} + # RUNTIME DESTINATION warfork-qfusion/${dir} + # LIBRARY DESTINATION warfork-qfusion/${dir} + # COMPONENT shareware) + set_property(TARGET ${name} PROPERTY IMPORTED_NO_SONAME TRUE) +endmacro() + diff --git a/source/extern/CMakeLists.txt b/source/extern/CMakeLists.txt new file mode 100644 index 0000000000..86799ffdb2 --- /dev/null +++ b/source/extern/CMakeLists.txt @@ -0,0 +1,107 @@ + +if (NOT GAME_MODULES_ONLY) + if(USE_GRAPHICS_NRI) + option(BUILD_EXTERNAL OFF) + option(ENABLE_HLSL OFF) + option(ENABLE_OPT OFF) + option(ENABLE_PCH OFF) + option(ENABLE_CTEST OFF) + + add_subdirectory(glslang) + endif() + +option(ZLIB_BUILD_EXAMPLES "" OFF) +add_subdirectory(zlib) + + #if (USE_SDL2) + + #add_library(SDL2 INTERFACE IMPORTED GLOBAL) + # target_link_libraries(SDL2 INTERFACE SDL2::SDL2) + #else() +option(SDL_RPATH "" OFF) +option(SDL_SHARED "" ON) +option(SDL_STATIC "" OFF) +option(SDL_SHARED_ENABLED_BY_DEFAULT"" OFF) +option(SDL_TEST "" OFF) +option(SDL2_DISABLE_INSTALL "" ON) + +add_subdirectory(SDL) +qf_set_output_dir (SDL2 libs) + + #set_property(TARGET SDL2 PROPERTY IMPORTED_NO_SONAME TRUE) + #set_target_properties(SDL2 PROPERTIES + # BUILD_WITH_INSTALL_RPATH FALSE + # LINK_FLAGS "-Wl,-rpath,$ORIGIN/") + #set_target_properties(SDL2 PROPERTIES FOLDER libs) + # set_target_properties(SDL2main PROPERTIES FOLDER extern) + # set_target_properties(SDL2-static PROPERTIES FOLDER extern) + # set_target_properties(uninstall PROPERTIES FOLDER extern) + # set_target_properties(sdl_headers_copy PROPERTIES FOLDER extern) + + #add_library(SDL2 INTERFACE IMPORTED GLOBAL) + #target_link_libraries(SDL2 INTERFACE SDL2main SDL2-static) + #endif() + + +add_subdirectory(ogg) +set_target_properties(ogg PROPERTIES FOLDER extern) + + +add_subdirectory(freetype) +add_library(Freetype::Freetype INTERFACE IMPORTED GLOBAL) +target_link_libraries(Freetype::Freetype INTERFACE freetype) + +set(OGG_LIBRARY ogg) +set(OGG_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/ogg/include) +add_subdirectory(vorbis) + + +set(LIBTYPE STATIC) +option(FORCE_STATIC_VCRT "" ON) +option(ALSOFT_UTILS "" OFF) +option(ALSOFT_EXAMPLES "" OFF) +option(ALSOFT_UPDATE_BUILD_VERSION "" OFF) +option(ALSOFT_INSTALL "" OFF) +option(ALSOFT_INSTALL_CONFIG "" OFF) +option(ALSOFT_INSTALL_HRTF_DATA "" OFF) +option(ALSOFT_INSTALL_AMBDEC_PRESETS "" OFF) +option(ALSOFT_INSTALL_EXAMPLES "" OFF) +option(ALSOFT_INSTALL_UTILS "" OFF) +add_subdirectory(openal-soft) +set_target_properties(OpenAL PROPERTIES FOLDER extern/openal-soft) +set_target_properties(common PROPERTIES FOLDER extern/openal-soft) +set_target_properties(ex-common PROPERTIES FOLDER extern/openal-soft) +target_compile_definitions(OpenAL PUBLIC AL_LIBTYPE_STATIC) + +option(BUILD_CURL_EXE "" OFF) +option(BUILD_SHARED_LIBS "" OFF) +option(CURL_STATICLIB "" ON) +option(BUILD_MISC_DOCS "" OFF) +option(ENABLE_MANUAL "" OFF) +option(ENABLE_DOCS "" OFF) +option(HTTP_ONLY "" ON) +option(CURL_ZLIB "" OFF) +option(CURL_USE_OPENSSL "" OFF) +option(CURL_USE_LIBPSL "" OFF ) +option(BUILD_TESTING "" OFF ) +option(BUILD_EXAMPLES "" OFF ) +option(CURL_DISABLE_INSTALL "" OFF ) +option(USE_APPLE_IDN "" ON ) +set(CURL_CA_PATH "none" CACHE PATH "") + +set(CMAKE_DEBUG_POSTFIX "" CACHE STRING "Override CMAKE_DEBUG_POSTFIX, which curl sets to '-d'") + +set(ZLIB_DIR "{CMAKE_CURRENT_SOURCE_DIR}/zlib") + +add_subdirectory(curl) + +# set_target_properties(libcurl_static PROPERTIES FOLDER extern) +# if (TARGET libcurl_object) +# set_target_properties(libcurl_object PROPERTIES FOLDER extern) +# endif() +# set_target_properties(curl_uninstall PROPERTIES FOLDER extern) + +endif() + +set(STB_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/stb PARENT_SCOPE) + diff --git a/source/extern/SDL b/source/extern/SDL new file mode 160000 index 0000000000..5adbf3765a --- /dev/null +++ b/source/extern/SDL @@ -0,0 +1 @@ +Subproject commit 5adbf3765a57dc5931c2a3137390bfee2370c945 diff --git a/source/extern/curl b/source/extern/curl new file mode 160000 index 0000000000..699ac9430c --- /dev/null +++ b/source/extern/curl @@ -0,0 +1 @@ +Subproject commit 699ac9430c562d8858ee927607b8ae36f523ab4c diff --git a/source/extern/freetype b/source/extern/freetype new file mode 160000 index 0000000000..81330e1f8a --- /dev/null +++ b/source/extern/freetype @@ -0,0 +1 @@ +Subproject commit 81330e1f8aec49b4ad05c20f4f03497c473e10d0 diff --git a/source/extern/glslang b/source/extern/glslang new file mode 160000 index 0000000000..f754c852a8 --- /dev/null +++ b/source/extern/glslang @@ -0,0 +1 @@ +Subproject commit f754c852a87988eb097a39480c65f704ceb46274 diff --git a/source/extern/ogg b/source/extern/ogg new file mode 160000 index 0000000000..db5c7a49ce --- /dev/null +++ b/source/extern/ogg @@ -0,0 +1 @@ +Subproject commit db5c7a49ce7ebda47b15b78471e78fb7f2483e22 diff --git a/source/extern/openal-soft b/source/extern/openal-soft new file mode 160000 index 0000000000..2fb7538f68 --- /dev/null +++ b/source/extern/openal-soft @@ -0,0 +1 @@ +Subproject commit 2fb7538f6860086a8b6dbfbcf983ed2dffb71edd diff --git a/source/extern/stb b/source/extern/stb new file mode 160000 index 0000000000..5c205738c1 --- /dev/null +++ b/source/extern/stb @@ -0,0 +1 @@ +Subproject commit 5c205738c191bcb0abc65c4febfa9bd25ff35234 diff --git a/source/extern/vorbis b/source/extern/vorbis new file mode 160000 index 0000000000..b0119026d0 --- /dev/null +++ b/source/extern/vorbis @@ -0,0 +1 @@ +Subproject commit b0119026d024862116190fb66b63a0336cdc4ff3 diff --git a/source/extern/zlib b/source/extern/zlib new file mode 160000 index 0000000000..ef24c4c750 --- /dev/null +++ b/source/extern/zlib @@ -0,0 +1 @@ +Subproject commit ef24c4c7502169f016dcd2a26923dbaf3216748c diff --git a/source/ftlib/CMakeLists.txt b/source/ftlib/CMakeLists.txt index e0f595ce5e..c2edb98d4e 100644 --- a/source/ftlib/CMakeLists.txt +++ b/source/ftlib/CMakeLists.txt @@ -1,6 +1,6 @@ project(ftlib) -include_directories(${CURL_INCLUDE_DIR} ${ZLIB_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS}) +include_directories(${CURL_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIRS}) file(GLOB FTLIB_HEADERS "*.h" @@ -19,5 +19,5 @@ else () endif() add_library(ftlib SHARED ${FTLIB_SOURCES} ${FTLIB_HEADERS}) -target_link_libraries(ftlib PRIVATE ${FREETYPE_LIBRARIES} ${FTLIB_PLATFORM_LIBRARIES}) +target_link_libraries(ftlib PRIVATE Freetype::Freetype ${FTLIB_PLATFORM_LIBRARIES} zlib) qf_set_output_dir(ftlib libs) diff --git a/source/glslang b/source/glslang deleted file mode 160000 index 76b52ebf77..0000000000 --- a/source/glslang +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 76b52ebf77833908dc4c0dd6c70a9c357ac720bd diff --git a/source/package_assets.cmake b/source/package_assets.cmake new file mode 100644 index 0000000000..b5674de6cc --- /dev/null +++ b/source/package_assets.cmake @@ -0,0 +1,22 @@ + +if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") + execute_process (COMMAND bash -c "cd ${ASSET_ROOT}/data0_000_21/ && 7z a ${BIN_DIR}/basewf/data0_000_21.pk3 -r") + execute_process (COMMAND bash -c "cd ${ASSET_ROOT}/data0_000_21pure/ && 7z a ${BIN_DIR}/basewf/data0_000_21pure.pk3 -r") + execute_process (COMMAND bash -c "cd ${ASSET_ROOT}/data0_21/ && 7z a ${BIN_DIR}/basewf/data0_21.pk3 *") + execute_process (COMMAND bash -c "cd ${ASSET_ROOT}/data0_21pure/ && 7z a ${BIN_DIR}/basewf/data0_21pure.pk3 -r") + execute_process (COMMAND bash -c "cd ${ASSET_ROOT}/data1_21pure/ && 7z a ${BIN_DIR}/basewf/data1_21pure.pk3 -r") +else() + execute_process (COMMAND bash -c "cd ${ASSET_ROOT}/data0_000_21/ && zip -r ${BIN_DIR}/basewf/data0_000_21.pk3 *") + execute_process (COMMAND bash -c "cd ${ASSET_ROOT}/data0_000_21pure/ && zip -r ${BIN_DIR}/basewf/data0_000_21pure.pk3 *") + execute_process (COMMAND bash -c "cd ${ASSET_ROOT}/data0_21/ && zip -r ${BIN_DIR}/basewf/data0_21.pk3 *") + execute_process (COMMAND bash -c "cd ${ASSET_ROOT}/data0_21pure/ && zip -r ${BIN_DIR}/basewf/data0_21pure.pk3 *") + execute_process (COMMAND bash -c "cd ${ASSET_ROOT}/data1_21pure/ && zip -r ${BIN_DIR}/basewf/data1_21pure.pk3 *") +endif() + +file(COPY ${ASSET_ROOT}/profiles DESTINATION ${BIN_DIR}/basewf/profiles) +file(COPY ${ASSET_ROOT}/configs DESTINATION ${BIN_DIR}/basewf/configs) +file(GLOB CONFIG_FILES + "${ASSET_ROOT}/*.cfg" + "${ASSET_ROOT}/*.md" +) +file(COPY ${CONFIG_FILES} DESTINATION ${BIN_DIR}/basewf) diff --git a/source/ref_gl/CMakeLists.txt b/source/ref_gl/CMakeLists.txt index c6201e3655..dc00dc7952 100644 --- a/source/ref_gl/CMakeLists.txt +++ b/source/ref_gl/CMakeLists.txt @@ -1,9 +1,5 @@ project(ref_gl) -if (USE_SDL2) - include_directories(${SDL2_INCLUDE_DIR}) -endif() - file(GLOB REF_GL_HEADERS "*.h" "../gameshared/q_*.h" @@ -40,7 +36,7 @@ if (USE_SDL2) "../sdl/sdl_qgl.c" ) - set(REF_GL_PLATFORM_LIBRARIES ${SDL2_LIBRARY}) + set(REF_GL_PLATFORM_LIBRARIES SDL2::SDL2) else() if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") file(GLOB REF_GL_PLATFORM_SOURCES @@ -64,4 +60,7 @@ endif() add_library(ref_gl SHARED ${REF_GL_HEADERS} ${REF_GL_COMMON_SOURCES} ${REF_GL_PLATFORM_SOURCES}) target_include_directories(ref_gl PRIVATE ${STB_INCLUDE_DIR} "../ref_base") target_link_libraries(ref_gl PRIVATE ${REF_GL_PLATFORM_LIBRARIES}) + qf_set_output_dir(ref_gl libs) + + diff --git a/source/ref_nri/CMakeLists.txt b/source/ref_nri/CMakeLists.txt index badf74dbb0..676982a9cf 100644 --- a/source/ref_nri/CMakeLists.txt +++ b/source/ref_nri/CMakeLists.txt @@ -1,9 +1,5 @@ project(ref_nri) -if (USE_SDL2) - include_directories(${SDL2_INCLUDE_DIR}) -endif() - file(GLOB REF_NRI_HEADERS "*.h" "../gameshared/q_*.h" @@ -36,7 +32,7 @@ file(GLOB STB_HEADERS add_library(ref_nri SHARED ${REF_NRI_HEADERS} ${REF_NRI_COMMON_SOURCES} ${REF_NRI_PLATFORM_SOURCES}) target_include_directories(ref_nri PRIVATE ${STB_INCLUDE_DIR} "../ref_base" "${NRI_DIR}/External/vulkan/include") target_link_libraries(ref_nri PRIVATE NRI) -target_link_libraries(ref_nri PRIVATE OSDependent glslang MachineIndependent GenericCodeGen glslang-default-resource-limits SPVRemapper SPIRV qcore) +target_link_libraries(ref_nri PRIVATE glslang::glslang glslang::glslang-default-resource-limits glslang::SPIRV glslang::SPVRemapper qcore) target_include_directories(ref_nri PRIVATE ${NRI_INCLUDE_DIR}) target_include_directories(ref_nri PRIVATE ${MINIZ_INCLUDE_DIR}) qf_set_output_dir(ref_nri libs) diff --git a/source/sdl/sdl_win.c b/source/sdl/sdl_win.c index bf313106af..fe87e6bff7 100644 --- a/source/sdl/sdl_win.c +++ b/source/sdl/sdl_win.c @@ -107,6 +107,13 @@ bool R_WIN_InitWindow(win_init_t* init) { } r_winState.sdl_window= SDL_CreateWindow( r_winState.applicationName, SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, init->width, init->height, winFlags); + // Check that the window was successfully created + if (r_winState.sdl_window == NULL) { + // In the case that the window could not be made... + SDL_LogError(SDL_LOG_CATEGORY_ERROR, "Could not create window: %s\n", SDL_GetError()); + return false; + } + SDL_SetWindowPosition( r_winState.sdl_window, init->x, init->y ); if( r_winState.wndproc ) { diff --git a/source/server/CMakeLists.txt b/source/server/CMakeLists.txt index 752886b992..634da5aa7b 100644 --- a/source/server/CMakeLists.txt +++ b/source/server/CMakeLists.txt @@ -84,7 +84,7 @@ else() "../null/sys_vfs_null.c" ) - set(SERVER_PLATFORM_LIBRARIES "pthread" "dl" "m") + set(SERVER_PLATFORM_LIBRARIES "-ldl") set(SERVER_BINARY_TYPE "") endif() @@ -93,7 +93,7 @@ add_dependencies(${QFUSION_SERVER_NAME} angelwrap game) if (BUILD_STEAMLIB) add_dependencies(${QFUSION_SERVER_NAME} wf_steam) endif() -target_link_libraries(${QFUSION_SERVER_NAME} PRIVATE ${CURL_LIBRARY} ${SERVER_PLATFORM_LIBRARIES} ${STEAMSHIMPARENT_LIBRARY}) +target_link_libraries(${QFUSION_SERVER_NAME} PRIVATE CURL::libcurl ${SERVER_PLATFORM_LIBRARIES} ${STEAMSHIMPARENT_LIBRARY}) qf_set_output_dir(${QFUSION_SERVER_NAME} "") set_target_properties(${QFUSION_SERVER_NAME} PROPERTIES COMPILE_DEFINITIONS "DEDICATED_ONLY") diff --git a/source/snd_openal/CMakeLists.txt b/source/snd_openal/CMakeLists.txt index 1809499f79..123d9060f4 100644 --- a/source/snd_openal/CMakeLists.txt +++ b/source/snd_openal/CMakeLists.txt @@ -1,6 +1,6 @@ project(snd_openal) -include_directories(${VORBIS_INCLUDE_DIR} ${OGG_INCLUDE_DIR} ${OPENAL_INCLUDE_DIR} "../snd_common" ".") +include_directories("../snd_common" ".") if (${CMAKE_SYSTEM_NAME} MATCHES "Windows") include_directories("../win32/include") # For al.h @@ -19,11 +19,11 @@ file(GLOB SND_OPENAL_SOURCES ) if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") - set(SND_OPENAL_PLATFORM_LIBRARIES "m" "dl") + set(SND_OPENAL_PLATFORM_LIBRARIES "") else () set(SND_OPENAL_PLATFORM_LIBRARIES "") endif() add_library(snd_openal SHARED ${SND_OPENAL_HEADERS} ${SND_OPENAL_SOURCES}) -target_link_libraries(snd_openal PRIVATE ${OGG_LIBRARY} ${VORBIS_LIBRARIES} ${OPENAL_LIBRARIES} ${SND_OPENAL_PLATFORM_LIBRARIES}) +target_link_libraries(snd_openal PRIVATE ogg vorbis vorbisfile OpenAL::OpenAL ${SND_OPENAL_PLATFORM_LIBRARIES}) qf_set_output_dir(snd_openal libs) diff --git a/source/tv_server/CMakeLists.txt b/source/tv_server/CMakeLists.txt index 1b0abea5c5..88a74e30f2 100644 --- a/source/tv_server/CMakeLists.txt +++ b/source/tv_server/CMakeLists.txt @@ -85,7 +85,7 @@ else() endif() add_executable(${QFUSION_TVSERVER_NAME} ${TV_SERVER_BINARY_TYPE} ${TV_SERVER_HEADERS} ${TV_SERVER_SOURCES} ${TV_SERVER_PLATFORM_SOURCES}) -target_link_libraries(${QFUSION_TVSERVER_NAME} PRIVATE ${CURL_LIBRARY} ${TV_SERVER_PLATFORM_LIBRARIES} ${STEAMSHIMPARENT_LIBRARY}) +target_link_libraries(${QFUSION_TVSERVER_NAME} PRIVATE CURL::libcurl ${TV_SERVER_PLATFORM_LIBRARIES} ${STEAMSHIMPARENT_LIBRARY}) qf_set_output_dir(${QFUSION_TVSERVER_NAME} "")