diff --git a/.github/workflows/macos-ci.yml b/.github/workflows/macos-ci.yml index 901981c104..1691995a48 100644 --- a/.github/workflows/macos-ci.yml +++ b/.github/workflows/macos-ci.yml @@ -11,7 +11,7 @@ jobs: build: name: Build runs-on: ${{ matrix.os }} - continue-on-error: false + continue-on-error: true defaults: run: @@ -21,17 +21,26 @@ jobs: fail-fast: false matrix: os: + # x86-64 - macos-13 - # - macos-14 + # M1 processor + #- macos-14 + python-version: + #- 3.12.8 + - 3.13.1 compiler: - - clang - - gcc + - AppleClang + #- clang + #- gcc homebrew-gl: - true - # - false + #- false homebrew-al: - true - - false + #- false + ENABLE_PIE: + - 'ON' + #- 'OFF' steps: @@ -43,12 +52,14 @@ jobs: # - git # - jpeg # - libpng - # - libvorbis + # - ~libvorbis~ # - python - name: Setup Python uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 + id: vega-py-setup with: - python-version: 3.12.8 + python-version: ${{ matrix.python-version }} + update-environment: true # false - name: Install dependencies using homebrew run: brew install boost-python3 gtk+3 gtkglext sdl libvorbis @@ -83,8 +94,13 @@ jobs: env: MY_OS_NAME: macos COMPILER: ${{ matrix.compiler }} - FLAGS: -DCMAKE_FIND_FRAMEWORK=LAST + FLAGS: "-DCMAKE_FIND_FRAMEWORK=LAST -DENABLE_PIE=${{ matrix.ENABLE_PIE }} -DPython3_ROOT_DIR=${{ matrix.vega-py-setup.outputs.python-path }}" OPENALDIR: "$(brew --prefix)/opt/openal-soft" + Python3_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }} + Python_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }} + pythonLocation: ${{ matrix.vega-py-setup.outputs.python-path }} + PYTHONHOME: "" + PYTHONPATH: "" run: script/cibuild $FLAGS - name: Test diff --git a/.github/workflows/macos-release.yml b/.github/workflows/macos-release.yml index 00cf07a532..62c9f657a6 100644 --- a/.github/workflows/macos-release.yml +++ b/.github/workflows/macos-release.yml @@ -13,7 +13,6 @@ jobs: build: name: Build runs-on: ${{ matrix.os }} - continue-on-error: false defaults: run: @@ -23,17 +22,26 @@ jobs: fail-fast: false matrix: os: + # x86-64 - macos-13 - # - macos-14 + # M1 processor + #- macos-14 + python-version: + #- 3.12.8 + - 3.13.1 compiler: - # - clang - - gcc + - AppleClang + #- clang + #- gcc homebrew-gl: - true - # - false + #- false homebrew-al: - true - # - false + #- false + ENABLE_PIE: + - 'ON' + #- 'OFF' steps: @@ -45,12 +53,14 @@ jobs: # - git # - jpeg # - libpng - # - libvorbis + # - ~libvorbis~ # - python - name: Setup Python uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 + id: vega-py-setup with: - python-version: 3.12.8 + python-version: ${{ matrix.python-version }} + update-environment: true # false - name: Install dependencies using homebrew run: brew install boost-python3 gtk+3 gtkglext sdl libvorbis @@ -90,8 +100,13 @@ jobs: env: MY_OS_NAME: macos COMPILER: ${{ matrix.compiler }} - FLAGS: -DCMAKE_FIND_FRAMEWORK=LAST + FLAGS: "-DCMAKE_FIND_FRAMEWORK=LAST -DENABLE_PIE=${{ matrix.ENABLE_PIE }} -DPython3_ROOT_DIR=${{ matrix.vega-py-setup.outputs.python-path }}" OPENALDIR: "$(brew --prefix)/opt/openal-soft" + Python3_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }} + Python_ROOT_DIR: ${{ matrix.vega-py-setup.outputs.python-path }} + pythonLocation: ${{ matrix.vega-py-setup.outputs.python-path }} + PYTHONHOME: "" + PYTHONPATH: "" IS_RELEASE: 1 run: script/cibuild $FLAGS diff --git a/engine/CMakeLists.txt b/engine/CMakeLists.txt index edfc82180c..0e320e9d25 100644 --- a/engine/CMakeLists.txt +++ b/engine/CMakeLists.txt @@ -342,8 +342,8 @@ SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${Vega_Strike_SOURCE_DIR}) FIND_PACKAGE(LinuxDistro REQUIRED) FIND_PACKAGE(Python3 REQUIRED COMPONENTS Development Interpreter) -MESSAGE("++ Python library : ${Python3_LIBRARIES} (${Python3_VERSION})") -MESSAGE("++ Python include dir : ${Python3_INCLUDE_DIRS}") +MESSAGE(STATUS "Python library : ${Python3_LIBRARIES} (${Python3_VERSION})") +MESSAGE(STATUS "Python include dir : ${Python3_INCLUDE_DIRS}") IF (Python3_FOUND) SET(TST_INCLUDES ${Python3_INCLUDE_DIRS}) SET(TST_LIBS ${Python3_LIBRARIES}) @@ -353,62 +353,24 @@ ELSE (Python3_FOUND) ENDIF (Python3_FOUND) # Find Boost with boost_python library -OPTION(USE_SYSTEM_BOOST "Use system boost" ON) -IF (USE_SYSTEM_BOOST) - MESSAGE("++ Using System Boost") - FIND_PACKAGE(Boost) - IF (Boost_FOUND) - - # VERSION_EQUAL / VERSION_GREATER requires a version in the form X.Y.Z - # Until CMake v3.15, Boost_VERSION is in the form as written in boost/version.hpp (e.g. 106700) - # Thus, build the version from parts, which should work across all supported CMake versions - SET(Boost_DERIVED_VERSION "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") - MESSAGE("++ Found System Boost version : ${Boost_DERIVED_VERSION}") - - # With boost version 1.67 and above, python components are specified with a version suffix - # (`python27`, `python38`) instead of their invocation name (`python`, `python3`) - IF (Boost_DERIVED_VERSION VERSION_EQUAL 1.67.0) - SET(Boost_1_67_Or_Later_Result TRUE) - ELSEIF (Boost_DERIVED_VERSION VERSION_GREATER 1.67.0) - SET(Boost_1_67_Or_Later_Result TRUE) - ELSE (Boost_DERIVED_VERSION VERSION_EQUAL 1.67.0) - SET(Boost_1_67_Or_Later_Result FALSE) - ENDIF (Boost_DERIVED_VERSION VERSION_EQUAL 1.67.0) - MESSAGE(STATUS "Boost_1_67_Or_Later_Result: ${Boost_1_67_Or_Later_Result}") - IF (Boost_1_67_Or_Later_Result) - SET(BOOST_PYTHON_COMPONENT "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}") - ELSE (Boost_1_67_Or_Later_Result) - SET(BOOST_PYTHON_COMPONENT "python3") - - # Debian and Debian-based systems up to Boost 1.67 lack libboost_python3.{so|a} - # but have libboost_python-py{major}{minor}.{so|a}. E.g., Ubuntu xenial and - # Debian stretch. - IF (CMAKE_SYSTEM_NAME STREQUAL Linux) - IF (LINUX_CODENAME STREQUAL xenial OR LINUX_CODENAME STREQUAL stretch) - SET(BOOST_PYTHON_COMPONENT "python-py3${Python3_VERSION_MINOR}") - ENDIF (LINUX_CODENAME STREQUAL xenial OR LINUX_CODENAME STREQUAL stretch) - ENDIF (CMAKE_SYSTEM_NAME STREQUAL Linux) - ENDIF (Boost_1_67_Or_Later_Result) - UNSET(Boost_1_67_Or_Later_Result) - - UNSET(Boost_${BOOST_PYTHON_COMPONENT}_FOUND) - MESSAGE("++ Looking for System Boost::python") - FIND_PACKAGE(Boost COMPONENTS ${BOOST_PYTHON_COMPONENT} log log_setup date_time system filesystem thread chrono atomic REQUIRED) - IF (Boost_python3_FOUND) - MESSAGE("++ Found System Boost::python3 : ${Boost_PYTHON3_LIBRARY}") - ELSEIF (Boost_${BOOST_PYTHON_COMPONENT}_FOUND) - MESSAGE("++ Found System Boost::python") - ENDIF (Boost_python3_FOUND) - - SET(BOOST_PYTHON_NO_PY_SIGNATURES 1) - SET(TST_INCLUDES ${TST_INCLUDES} ${Python3_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) - MESSAGE("** Boost_LIBRARIES: ${Boost_LIBRARIES}") - SET(TST_LIBS ${TST_LIBS} ${Boost_LIBRARIES}) - INCLUDE_DIRECTORIES(${TST_INCLUDES}) - ELSE (Boost_FOUND) - MESSAGE(FATAL_ERROR "Cannot find system Boost. Unable to continue.") - ENDIF (Boost_FOUND) -ENDIF (USE_SYSTEM_BOOST) +MESSAGE(STATUS "Always using system Boost now") +SET(BOOST_PYTHON_COMPONENT "python${Python3_VERSION_MAJOR}${Python3_VERSION_MINOR}") +FIND_PACKAGE(Boost COMPONENTS ${BOOST_PYTHON_COMPONENT} log log_setup date_time system filesystem thread chrono atomic program_options REQUIRED) +IF (Boost_FOUND) + # VERSION_EQUAL / VERSION_GREATER requires a version in the form X.Y.Z + # Until CMake v3.15, Boost_VERSION is in the form as written in boost/version.hpp (e.g. 106700) + # Thus, build the version from parts, which should work across all supported CMake versions + SET(Boost_DERIVED_VERSION "${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION}.${Boost_SUBMINOR_VERSION}") + MESSAGE(STATUS "Found System Boost version : ${Boost_DERIVED_VERSION}") + + SET(BOOST_PYTHON_NO_PY_SIGNATURES 1) + SET(TST_INCLUDES ${TST_INCLUDES} ${Python3_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) + MESSAGE("** Boost_LIBRARIES: ${Boost_LIBRARIES}") + SET(TST_LIBS ${TST_LIBS} ${Boost_LIBRARIES}) + INCLUDE_DIRECTORIES(${TST_INCLUDES}) +ELSE (Boost_FOUND) + MESSAGE(FATAL_ERROR "Cannot find system Boost. Unable to continue.") +ENDIF (Boost_FOUND) IF (NOT DISABLE_CLIENT) ########## @@ -1477,7 +1439,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl-gfx1.2-5, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl-gfx1.2-5, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSEIF (DEBIAN_RELEASE_VERSION STREQUAL "bullseye") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython3.9") IF (Boost_DERIVED_VERSION STREQUAL "") @@ -1485,7 +1447,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx1.2-5, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx1.2-5, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSEIF (DEBIAN_RELEASE_VERSION STREQUAL "buster") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython3.7") IF (Boost_DERIVED_VERSION STREQUAL "") @@ -1493,7 +1455,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSEIF (DEBIAN_RELEASE_VERSION STREQUAL "stretch") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython3.5") IF (Boost_DERIVED_VERSION STREQUAL "") @@ -1501,7 +1463,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSE () MESSAGE(SEND_WARNING "!! Unsupported Debian version.") ENDIF () @@ -1515,7 +1477,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, ${VEGA_STRIKE_GLU_DEPENDENCY}, libopengl0, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, ${VEGA_STRIKE_GLU_DEPENDENCY}, libopengl0, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSEIF (LSB_LINUX_DISTRIBUTION_CODENAME STREQUAL "focal") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython3.8") IF (Boost_DERIVED_VERSION STREQUAL "") @@ -1523,7 +1485,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSEIF (LSB_LINUX_DISTRIBUTION_CODENAME STREQUAL "bookworm") # Apparently some versions of Debian have lsb_release after all SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython3.11") IF (Boost_DERIVED_VERSION STREQUAL "") @@ -1531,7 +1493,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSEIF (LSB_LINUX_DISTRIBUTION_CODENAME STREQUAL "bullseye") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython3.9") IF (Boost_DERIVED_VERSION STREQUAL "") @@ -1539,7 +1501,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl-gfx1.2-5, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl-gfx1.2-5, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSEIF (LSB_LINUX_DISTRIBUTION_CODENAME STREQUAL "buster") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython3.7") IF (Boost_DERIVED_VERSION STREQUAL "") @@ -1547,7 +1509,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSEIF (DEBIAN_RELEASE_VERSION STREQUAL "stretch") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython3.5") IF (Boost_DERIVED_VERSION STREQUAL "") @@ -1555,7 +1517,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSEIF (LSB_LINUX_DISTRIBUTION_CODENAME STREQUAL "groovy") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython3.9") IF (Boost_DERIVED_VERSION STREQUAL "") @@ -1563,7 +1525,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSEIF (LSB_LINUX_DISTRIBUTION_CODENAME STREQUAL "hirsute") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython3.9") IF (Boost_DERIVED_VERSION STREQUAL "") @@ -1571,7 +1533,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSEIF (LSB_LINUX_DISTRIBUTION_CODENAME STREQUAL "ulyana") # Linux Mint 20 codename "ulyana" SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython3.8") IF (Boost_DERIVED_VERSION STREQUAL "") @@ -1579,7 +1541,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSEIF (LSB_LINUX_DISTRIBUTION_CODENAME STREQUAL "vanessa") # Linux Mint 20 codename "vanessa" SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython3.10") IF (Boost_DERIVED_VERSION STREQUAL "") @@ -1587,7 +1549,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSEIF (LSB_LINUX_DISTRIBUTION_CODENAME STREQUAL "impish") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython3.10") IF (Boost_DERIVED_VERSION STREQUAL "") @@ -1595,7 +1557,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSEIF (LSB_LINUX_DISTRIBUTION_CODENAME STREQUAL "jammy") SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libpython3.10") IF (Boost_DERIVED_VERSION STREQUAL "") @@ -1603,7 +1565,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") - SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}") + SET(CPACK_DEBIAN_PACKAGE_DEPENDS "${CPACK_DEBIAN_PACKAGE_DEPENDS}, libjpeg62-turbo, libpng16-16, freeglut3, libgtk-3-0, libvorbis0a, libopenal1, libsdl2-gfx2.0.14, xdg-utils, libgl1, libopengl0, ${VEGA_STRIKE_GLU_DEPENDENCY}, libboost-atomic${BOOST_VER}, libboost-chrono${BOOST_VER}, libboost-date-time${BOOST_VER}, libboost-filesystem${BOOST_VER}, libboost-log${BOOST_VER}, libboost-python${BOOST_VER}, libboost-regex${BOOST_VER}, libboost-system${BOOST_VER}, libboost-thread${BOOST_VER}, libboost-program-options${BOOST_VER}") ELSE () MESSAGE(SEND_WARNING "!! Unsupported Debian derivative.") ENDIF () @@ -1646,7 +1608,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) IF (LINUX_ID STREQUAL opensuse-leap) IF (LINUX_VERSION_ID VERSION_EQUAL 15.2 OR LINUX_VERSION_ID VERSION_EQUAL 15.3) SET(CPACK_RPM_PACKAGE_REQUIRES "libboost_python-py3-1_66_0, libpython3_6m1_0") - SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng16-16, libglut3, libgtk-3-0, libvorbis0, libopenal0, libSDL-1_2-0, libglvnd, expat, libboost_log1_66_0, libboost_system1_66_0, libboost_filesystem1_66_0, libboost_thread1_66_0, libboost_regex1_66_0, libboost_chrono1_66_0, libboost_atomic1_66_0") + SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng16-16, libglut3, libgtk-3-0, libvorbis0, libopenal0, libSDL-1_2-0, libglvnd, expat, libboost_log1_66_0, libboost_system1_66_0, libboost_filesystem1_66_0, libboost_thread1_66_0, libboost_regex1_66_0, libboost_chrono1_66_0, libboost_atomic1_66_0, libboost_program_options1_66_0") ELSEIF (LINUX_VERSION_ID VERSION_EQUAL 15.4) IF (Boost_DERIVED_VERSION STREQUAL "") SET(BOOST_VER "1.75.0") @@ -1654,7 +1616,7 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) SET(BOOST_VER "${Boost_DERIVED_VERSION}") ENDIF (Boost_DERIVED_VERSION STREQUAL "") SET(CPACK_RPM_PACKAGE_REQUIRES "libboost_python-py3-${BOOST_VER}, libpython3_10-1_0") - SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng16-16, libglut3, libgtk-3-0, libvorbis0, libopenal0, libSDL-1_2-0, libglvnd, expat, libboost_log${BOOST_VER}, libboost_system${BOOST_VER}, libboost_filesystem${BOOST_VER}, libboost_thread${BOOST_VER}, libboost_regex${BOOST_VER}, libboost_chrono${BOOST_VER}, libboost_atomic${BOOST_VER}") + SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng16-16, libglut3, libgtk-3-0, libvorbis0, libopenal0, libSDL-1_2-0, libglvnd, expat, libboost_log${BOOST_VER}, libboost_system${BOOST_VER}, libboost_filesystem${BOOST_VER}, libboost_thread${BOOST_VER}, libboost_regex${BOOST_VER}, libboost_chrono${BOOST_VER}, libboost_atomic${BOOST_VER}, libboost_program_options${BOOST_VER}") ELSE (LINUX_VERSION_ID VERSION_EQUAL 15.2 OR LINUX_VERSION_ID VERSION_EQUAL 15.3) MESSAGE (SEND_WARNING "!! Unsupported version of openSUSE") SET(CPACK_RPM_PACKAGE_REQUIRES "") @@ -1669,17 +1631,17 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSE (LINUX_VERSION_ID VERSION_GREATER_EQUAL 34) SET(CPACK_RPM_PACKAGE_REQUIRES "python37, boost-python3") ENDIF (LINUX_VERSION_ID VERSION_GREATER_EQUAL 34) - SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic") + SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic, boost-program-options") ELSEIF (LINUX_ID STREQUAL centos) IF (LINUX_VERSION_ID VERSION_GREATER_EQUAL 8.0 AND LINUX_VERSION_ID VERSION_LESS_EQUAL 8.7) SET(CPACK_RPM_PACKAGE_REQUIRES "python39, boost-python3") - SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic") + SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic, boost-program-options") ELSEIF (LINUX_VERSION_ID VERSION_GREATER_EQUAL 8.8 AND LINUX_VERSION_ID VERSION_LESS_EQUAL 8.9) SET(CPACK_RPM_PACKAGE_REQUIRES "python3.11, boost-python3") - SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic") + SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic, boost-program-options") ELSEIF (LINUX_VERSION_ID VERSION_GREATER_EQUAL 9.0 AND LINUX_VERSION_ID VERSION_LESS_EQUAL 9.3) SET(CPACK_RPM_PACKAGE_REQUIRES "python3, boost-python3") - SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic") + SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic, boost-program-options") ELSE () MESSAGE(SEND_WARNING "!! We do not currently support this version of CentOS.") SET(CPACK_RPM_PACKAGE_REQUIRES "") @@ -1687,13 +1649,13 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSEIF (LINUX_ID STREQUAL rhel OR LINUX_ID STREQUAL redhat) IF (LINUX_VERSION_ID VERSION_GREATER_EQUAL 8.0 AND LINUX_VERSION_ID VERSION_LESS_EQUAL 8.7) SET(CPACK_RPM_PACKAGE_REQUIRES "python39, boost-python3") - SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic") + SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic, boost-program-options") ELSEIF (LINUX_VERSION_ID VERSION_GREATER_EQUAL 8.8 AND LINUX_VERSION_ID VERSION_LESS_EQUAL 8.9) SET(CPACK_RPM_PACKAGE_REQUIRES "python3.11, boost-python3") - SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic") + SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic, boost-program-options") ELSEIF (LINUX_VERSION_ID VERSION_GREATER_EQUAL 9.0 AND LINUX_VERSION_ID VERSION_LESS_EQUAL 9.3) SET(CPACK_RPM_PACKAGE_REQUIRES "python3, boost-python3") - SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic") + SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic, boost-program-options") ELSE () MESSAGE(SEND_WARNING "!! This version of Red Hat is not currently supported.") SET(CPACK_RPM_PACKAGE_REQUIRES "") @@ -1701,13 +1663,13 @@ ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) ELSEIF (LINUX_ID STREQUAL rocky) IF (LINUX_VERSION_ID VERSION_GREATER_EQUAL 8.0 AND LINUX_VERSION_ID VERSION_LESS_EQUAL 8.7) SET(CPACK_RPM_PACKAGE_REQUIRES "python39, boost-python3") - SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic") + SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic, boost-program-options") ELSEIF (LINUX_VERSION_ID VERSION_GREATER_EQUAL 8.8 AND LINUX_VERSION_ID VERSION_LESS_EQUAL 8.9) SET(CPACK_RPM_PACKAGE_REQUIRES "python3.11, boost-python3") - SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic") + SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic, boost-program-options") ELSEIF (LINUX_VERSION_ID VERSION_GREATER_EQUAL 9.0 AND LINUX_VERSION_ID VERSION_LESS_EQUAL 9.3) SET(CPACK_RPM_PACKAGE_REQUIRES "python3, boost-python3") - SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic") + SET(CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES}, libjpeg-turbo, libpng, freeglut, gtk3, libvorbis, openal-soft, SDL, libglvnd, expat, boost-log, boost-system, boost-filesystem, boost-thread, boost-regex, boost-chrono, boost-atomic, boost-program-options") ELSE () MESSAGE(SEND_WARNING "!! This version of Rocky Linux is not currently supported.") SET(CPACK_RPM_PACKAGE_REQUIRES "") diff --git a/engine/CMakePresets.json b/engine/CMakePresets.json index e08bada3dd..1d2b5964f2 100644 --- a/engine/CMakePresets.json +++ b/engine/CMakePresets.json @@ -381,7 +381,8 @@ }, "cacheVariables": { "CMAKE_PREFIX_PATH": "/opt/local", - "Boost_INCLUDE_DIR": "/opt/local/libexec/boost/1.81/include" + "Boost_INCLUDE_DIR": "/opt/local/libexec/boost/1.81/include", + "CMAKE_FIND_FRAMEWORK": "LAST" } }, { diff --git a/engine/setup/CMakeLists.txt b/engine/setup/CMakeLists.txt index c9df1c7c6f..286be11e96 100644 --- a/engine/setup/CMakeLists.txt +++ b/engine/setup/CMakeLists.txt @@ -26,74 +26,82 @@ CMAKE_MINIMUM_REQUIRED(VERSION 3.21 FATAL_ERROR) IF (CMAKE_SYSTEM_NAME STREQUAL BEOS OR CMAKE_SYSTEM_NAME STREQUAL Windows) - MESSAGE ("SKIPPING vegasettings - not supported on this platform at this time") + MESSAGE ("SKIPPING vegasettings - not supported on this platform at this time") ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Linux) - #SET_PROPERTY(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "") - SET(VEGASETTINGS_SOURCES - src/c/setup.cpp - src/include/central.cpp - src/include/display_gtk.cpp - src/include/display_dialog.cpp - src/include/file.cpp - src/include/general.cpp - ../src/common/common.cpp - ) + #SET_PROPERTY(DIRECTORY PROPERTY INCLUDE_DIRECTORIES "") + SET(VEGASETTINGS_SOURCES + src/c/setup.cpp + src/include/central.cpp + src/include/display_gtk.cpp + src/include/display_dialog.cpp + src/include/file.cpp + src/include/general.cpp + ../src/common/common.cpp + ) - ADD_EXECUTABLE(vegasettings ${VEGASETTINGS_SOURCES}) - target_compile_definitions(vegasettings PUBLIC "BOOST_ALL_DYN_LINK" "$<$:BOOST_DEBUG_PYTHON>" "$<$:Py_DEBUG>") + ADD_EXECUTABLE(vegasettings ${VEGASETTINGS_SOURCES}) + TARGET_COMPILE_DEFINITIONS(vegasettings PUBLIC "BOOST_ALL_DYN_LINK") - #find GTK3 - FIND_PACKAGE(GTK3 3.0 REQUIRED gtk) - IF(GTK3_FOUND) - SET(GTK_LIBS ${GTK3_LIBRARIES}) - SET(GTK_CFLAGS ${GTK3_DEFINITIONS} -DGTK) - ELSE(GTK3_FOUND) - MESSAGE("Did not find GTK3") - ENDIF(GTK3_FOUND) + #find GTK3 + FIND_PACKAGE(GTK3 3.0 REQUIRED gtk) + IF(GTK3_FOUND) + SET(GTK_LIBS ${GTK3_LIBRARIES}) + SET(GTK_CFLAGS ${GTK3_DEFINITIONS} -DGTK) + ELSE(GTK3_FOUND) + MESSAGE("Did not find GTK3") + ENDIF(GTK3_FOUND) - ADD_DEFINITIONS(${GTK_CFLAGS}) - INCLUDE_DIRECTORIES( + ADD_DEFINITIONS(${GTK_CFLAGS}) + + FIND_PACKAGE(Boost COMPONENTS program_options REQUIRED) + + INCLUDE_DIRECTORIES( ${Vega_Strike_SOURCE_DIR}/setup/src/include ${Vega_Strike_SOURCE_DIR}/src/common ${Vega_Strike_BINARY_DIR} ${GTK3_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} ) - TARGET_LINK_LIBRARIES(vegasettings ${GTK_LIBS}) + TARGET_LINK_LIBRARIES(vegasettings ${GTK_LIBS} ${Boost_LIBRARIES}) - INSTALL(TARGETS vegasettings DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT vegasettings) + INSTALL(TARGETS vegasettings DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT vegasettings) ELSEIF (CMAKE_SYSTEM_NAME STREQUAL Darwin) - SET(VEGASETTINGS_SOURCES - src/c/setup.cpp - src/include/central.cpp - src/include/display_gtk.cpp - src/include/display_dialog.cpp - src/include/file.cpp - src/include/general.cpp - ../src/common/common.cpp - ) + SET(VEGASETTINGS_SOURCES + src/c/setup.cpp + src/include/central.cpp + src/include/display_gtk.cpp + src/include/display_dialog.cpp + src/include/file.cpp + src/include/general.cpp + ../src/common/common.cpp + ) - ADD_EXECUTABLE(vegasettings MACOSX_BUNDLE ${VEGASETTINGS_SOURCES}) - target_compile_definitions(vegasettings PUBLIC "BOOST_ALL_DYN_LINK" "$<$:BOOST_DEBUG_PYTHON>" "$<$:Py_DEBUG>") + ADD_EXECUTABLE(vegasettings MACOSX_BUNDLE ${VEGASETTINGS_SOURCES}) + TARGET_COMPILE_DEFINITIONS(vegasettings PUBLIC "BOOST_ALL_DYN_LINK") - #find GTK3 - FIND_PACKAGE(GTK3 3.0 REQUIRED gtk) - IF(GTK3_FOUND) - SET(GTK_LIBS ${GTK3_LIBRARIES}) - SET(GTK_CFLAGS ${GTK3_DEFINITIONS} -DGTK) - ELSE(GTK3_FOUND) - MESSAGE("Did not find GTK3") - ENDIF(GTK3_FOUND) + #find GTK3 + FIND_PACKAGE(GTK3 3.0 REQUIRED gtk) + IF(GTK3_FOUND) + SET(GTK_LIBS ${GTK3_LIBRARIES}) + SET(GTK_CFLAGS ${GTK3_DEFINITIONS} -DGTK) + ELSE(GTK3_FOUND) + MESSAGE("Did not find GTK3") + ENDIF(GTK3_FOUND) - ADD_DEFINITIONS(${GTK_CFLAGS}) - INCLUDE_DIRECTORIES( - ${Vega_Strike_SOURCE_DIR}/setup/src/include - ${Vega_Strike_SOURCE_DIR}/src/common - ${Vega_Strike_BINARY_DIR} - ${GTK3_INCLUDE_DIRS} - ) - TARGET_LINK_LIBRARIES(vegasettings ${GTK_LIBS}) + ADD_DEFINITIONS(${GTK_CFLAGS}) + + FIND_PACKAGE(Boost COMPONENTS program_options REQUIRED) + + INCLUDE_DIRECTORIES( + ${Vega_Strike_SOURCE_DIR}/setup/src/include + ${Vega_Strike_SOURCE_DIR}/src/common + ${Vega_Strike_BINARY_DIR} + ${GTK3_INCLUDE_DIRS} + ${Boost_INCLUDE_DIRS} + ) + TARGET_LINK_LIBRARIES(vegasettings ${GTK_LIBS} ${Boost_LIBRARIES}) - INSTALL(TARGETS vegasettings DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT vegasettings BUNDLE DESTINATION "/Applications/VegaStrike") + INSTALL(TARGETS vegasettings DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT vegasettings BUNDLE DESTINATION "/Applications/VegaStrike") ELSE () - MESSAGE ("SKIPPING vegasettings - not supported on this platform at this time") + MESSAGE ("SKIPPING vegasettings - not supported on this platform at this time") ENDIF () diff --git a/engine/setup/src/c/setup.cpp b/engine/setup/src/c/setup.cpp index 21781ff99e..e122bb2638 100644 --- a/engine/setup/src/c/setup.cpp +++ b/engine/setup/src/c/setup.cpp @@ -1,5 +1,7 @@ /* - * Copyright (C) 2001-2022 Daniel Horn, David Ranger, pyramid3d, + * setup.cpp + * + * Copyright (C) 2001-2025 Daniel Horn, David Ranger, pyramid3d, * Stephen G. Tuggy, and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -13,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -36,6 +38,8 @@ #endif #include #include +#include + using std::string; using std::vector; char origpath[65536]; @@ -114,16 +118,36 @@ int main(int argc, char *argv[]) { changeToProgramDirectory(argv[0]); { + boost::program_options::options_description setup_options("Vega Strike setup utility"); + setup_options.add_options() + ("target,D", boost::program_options::value(), "Specify data directory, full path expected") + ("help,h", "Show this help and exit") + ; + vector data_paths; - if (argc > 1) { - if (strcmp(argv[1], "--target") == 0 && argc > 2) { - data_paths.push_back(argv[2]); - fprintf(stdout, "Set data directory to %s\n", argv[2]); + try { + auto style = static_cast(boost::program_options::command_line_style::unix_style + | boost::program_options::command_line_style::case_insensitive); + boost::program_options::variables_map vm; + boost::program_options::store(boost::program_options::command_line_parser(argc, argv).options(setup_options).style(style).run(), vm); + boost::program_options::notify(vm); + + if (vm.count("help")) { + std::cout << setup_options << std::endl; + return EXIT_SUCCESS; + } + + if (vm.count("target")) { + data_paths.push_back(vm["target"].as()); + std::cout << "Set data directory to " << vm["target"].as() << std::endl; } else { - fprintf(stderr, "Usage: vegasettings [--target DATADIR]\n"); - return 1; + std::cerr << setup_options << std::endl; + return EXIT_FAILURE; } + } catch (const boost::program_options::error& e) { + std::cerr << setup_options << std::endl; + return EXIT_FAILURE; } #ifdef DATA_DIR @@ -222,4 +246,3 @@ int main(int argc, char *argv[]) { Start(&argc, &argv); return 0; } - diff --git a/engine/src/gfx/ani_texture.h b/engine/src/gfx/ani_texture.h index e4c74a7fae..508afb889d 100644 --- a/engine/src/gfx/ani_texture.h +++ b/engine/src/gfx/ani_texture.h @@ -1,7 +1,7 @@ /* * ani_texture.h * - * Copyright (C) 2001-2023 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Copyright (C) 2001-2025 Daniel Horn, pyramid3d, Stephen G. Tuggy, * Benjamen R. Meyer, and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -15,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -90,29 +90,29 @@ class AnimatedTexture : public Texture { bool done; public: - virtual void setTime(double tim); + void setTime(double tim) override; - virtual double curTime() const { + double curTime() const override { return curtime; } - virtual unsigned int numFrames() const { + unsigned int numFrames() const override { return numframes; } - virtual float framesPerSecond() const { + float framesPerSecond() const override { return 1 / timeperframe; } - virtual unsigned int numLayers() const; + unsigned int numLayers() const override; - virtual unsigned int numPasses() const; + unsigned int numPasses() const override; - virtual bool canMultiPass() const { + bool canMultiPass() const override { return true; } - virtual bool constFrameRate() const { + bool constFrameRate() const override { return constframerate; } diff --git a/engine/src/lin_time.cpp b/engine/src/lin_time.cpp index c0789d4c94..24e5930c66 100644 --- a/engine/src/lin_time.cpp +++ b/engine/src/lin_time.cpp @@ -1,7 +1,7 @@ /* * lin_time.cpp * - * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Copyright (C) 2001-2025 Daniel Horn, pyramid3d, Stephen G. Tuggy, * and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -15,7 +15,7 @@ * * Vega Strike is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License @@ -295,7 +295,7 @@ void UpdateTime() { struct timespec ts; clock_gettime(CLOCK_MONOTONIC, &ts); lasttime = newtime; - newtime = (double) ts.tv_sec + ((double) ts.tv_nsec) * 1.e-9; + newtime = static_cast(ts.tv_sec) + static_cast(ts.tv_nsec) * 1.e-9; elapsedtime = newtime - lasttime; // VS_LOG(trace, (boost::format("lin_time.cpp: UpdateTime(): lasttime is %1%; newtime is %2%; elapsedtime before time compression is %3%") % lasttime % newtime % elapsedtime)); if (first) { diff --git a/engine/src/main.cpp b/engine/src/main.cpp index 4f107b1c0f..36c84d56c0 100644 --- a/engine/src/main.cpp +++ b/engine/src/main.cpp @@ -1,7 +1,7 @@ /* * main.cpp * - * Copyright (C) 2001-2024 Daniel Horn, pyramid3d, Stephen G. Tuggy, + * Copyright (C) 2001-2025 Daniel Horn, pyramid3d, Stephen G. Tuggy, * Benjamen R. Meyer, and other Vega Strike contributors. * * https://github.com/vegastrike/Vega-Strike-Engine-Source @@ -26,6 +26,7 @@ #define PY_SSIZE_T_CLEAN #include #include +#include #include "audio/test.h" #if defined (HAVE_SDL) #include @@ -715,160 +716,193 @@ void bootstrap_main_loop() { ///Draw Texture } -// SGT 2020-07-16 This gets called from main() before initLogging, -// so it gets a pass on not using the Boost logging stuff -const char helpmessage[] = - "Command line options for vegastrike\n" - "\n" - " -D -d \t Specify data directory\n" - " -N -n \t Number of players\n" - " -M -m \t Specify a mod to play\n" - " -P -p \t Specify player location\n" - " -J -j \t Start in a specific system\n" - " -A -a \t Normal resolution (800x600)\n" - " -H -h \t High resolution (1024x768)\n" - " -V -v \t Super high resolution (1280x1024)\n" - " --net \t Networking Enabled (Experimental)\n" - " --debug[=#] \t Enable debugging output, 1 major warnings, 2 medium, 3 developer notes\n" - " --test-audio \t Run audio tests\n" - " --version \t Print the version and exit\n" - "\n"; const char versionmessage[] = // (BenjamenMeyer) this will be `major.minor.patch+githash` once all is said and done "Vega Strike Engine Version " VEGASTRIKE_VERSION_STR "\n" "\n"; std::string ParseCommandLine(int argc, char **lpCmdLine) { - std::string st; std::string retstr; - std::string datatmp; g_game.vsdebug = '0'; - QVector PlayerLocation; - for (int i = 1; i < argc; i++) { - if (lpCmdLine[i][0] == '-') { - std::cerr << "ARG #" << i << " = " << lpCmdLine[i] << std::endl; - std::string input(lpCmdLine[i]); - std::istringstream iStringStream(input); - switch (lpCmdLine[i][1]) { - case 'd': - case 'D': - //Specifying data directory - if (lpCmdLine[i][2] == 0) { - std::cout << "Option -D requires an argument" << std::endl; - exit(1); - } - datatmp = &lpCmdLine[i][2]; - if (VSFileSystem::DirectoryExists(datatmp)) { - VSFileSystem::datadir = datatmp; - } else { - std::cout << "Specified data directory not found... exiting" << std::endl; - exit(1); - } - std::cout << "Using data dir specified on command line : " << datatmp << std::endl; - break; - case 'r': - case 'R': - break; - case 'N': - case 'n': - if (!(lpCmdLine[i][2] == '1' && lpCmdLine[i][3] == '\0')) { - CONFIGFILE = new char[40 + strlen(lpCmdLine[i]) + 1]; - sprintf(CONFIGFILE, "vegastrike.config.%splayer", lpCmdLine[i] + 2); - } - break; - case 'M': - case 'm': - retstr = string(lpCmdLine[i] + 2); - break; - case 'f': - case 'F': - break; - case 'U': - case 'u': - break; - case 'P': - case 'p': - break; - case 'L': - case 'l': - try { - iStringStream.ignore(2); - iStringStream >> PlayerLocation.i; - iStringStream.ignore(1, ','); - iStringStream >> PlayerLocation.j; - iStringStream.ignore(1, ','); - iStringStream >> PlayerLocation.k; - } catch (std::ios_base::failure &inputFailure) { - std::cout << "Error reading coordinates for player location: " << inputFailure.what() - << std::endl; - exit(1); - } - SetPlayerLoc(PlayerLocation, true); - break; - case 'J': - case 'j': //low rez - st = string((lpCmdLine[i]) + 2); - SetPlayerSystem(st, true); - break; - case 'A': //average rez - case 'a': - g_game.y_resolution = 600; - g_game.x_resolution = 800; - break; - case 'H': - case 'h': //high rez - g_game.y_resolution = 768; - g_game.x_resolution = 1024; - break; - case 'V': - case 'v': - g_game.y_resolution = 1024; - g_game.x_resolution = 1280; - break; - case 'G': - case 'g': - break; - case '-': - //long options - if (strcmp(lpCmdLine[i], "--benchmark") == 0) { - try { - iStringStream.ignore(1); - iStringStream >> benchmark; - } catch (std::ios_base::failure &inputFailure) { - std::cout << "Error parsing benchmark value: " << inputFailure.what() << std::endl; - exit(1); - } - i++; - } else if (strcmp(lpCmdLine[i], "--net") == 0) { - //don't ignore the network section of the config file - ignore_network = false; - } else if (strcmp(lpCmdLine[i], "--help") == 0) { - std::cout << helpmessage; - exit(0); - } else if (strcmp(lpCmdLine[i], "--version") == 0) { - std::cout << versionmessage; - exit(0); - } else if (strncmp(lpCmdLine[i], "--debug", 7) == 0) { - if (lpCmdLine[i][7] == 0) { - g_game.vsdebug = 1; - } else if (lpCmdLine[i][8] == 0) { - std::cout << helpmessage; - exit(0); - } - g_game.vsdebug = lpCmdLine[i][8] - '0'; - ++i; - } - break; - } + + boost::program_options::options_description vs_switches("Command line options for vegastrike; short options are case insensitive"); + vs_switches.add_options() + ("target,D", boost::program_options::value(), "Specify data directory, full path expected") + ("num-players,n", boost::program_options::value(), "Number of players") + ("mod,m", boost::program_options::value(), "Specify a mod to play") + // ("player-location,p", boost::program_options::value(), "Specify player location in X, Y, Z coordinates separated by commas") + ("start-in-system,j", boost::program_options::value(), "Start in a specific system") + ("location,l", boost::program_options::value(), "Specify player location") + ("a", "Low resolution (800x600)") + ("h", "Medium-low resolution (1024x768)") + ("v", "Medium resolution (1280x1024)") + ("help,h", "Show this help") + ("version", "Print the version and exit") + ("net", "Networking Enabled (Experimental)") + ("debug", boost::program_options::value()->default_value('0'), "Enable debugging output, 1 major warnings, 2 medium, 3 developer notes") + ("benchmark", boost::program_options::value(), "Benchmark") + ("test-audio", "Run audio tests") // is handled in readCommandLineOptions, here is serves only for help message + ("r", "No-op") + ("f", "No-op") + ("p", "No-op") + ("g", "No-op") + ("u", "No-op") + ; + + boost::program_options::options_description vs_modules; + vs_modules.add_options() + ("mission_name", boost::program_options::value(), "Mission name") + ; + + boost::program_options::options_description vs_options; + vs_options.add(vs_switches).add(vs_modules); + + boost::program_options::positional_options_description vs_positionals; + vs_positionals.add("mission_name", 1); + + auto style = static_cast(boost::program_options::command_line_style::unix_style + | boost::program_options::command_line_style::case_insensitive); + boost::program_options::variables_map cmd_args; + try { + boost::program_options::store( + boost::program_options::command_line_parser(argc, lpCmdLine).options(vs_options).positional(vs_positionals).style(style).run(), + cmd_args + ); + boost::program_options::notify(cmd_args); + } catch (const boost::program_options::error& e) { + VS_LOG(fatal, (boost::format("Failed to parse arguments: %1%") % e.what())); + VS_LOG_FLUSH_EXIT(fatal, (boost::format("%1%") % vs_switches), EXIT_FAILURE); + } + + if (cmd_args.count("help")) { + std::cout << vs_switches << std::endl; + exit(0); + } + + if (cmd_args.count("version")) { + std::cout << versionmessage << std::endl; + exit(0); + } + + if (cmd_args.count("target")) { + std::string datatmp; + datatmp = cmd_args["target"].as(); + if (datatmp.empty()) { + VS_LOG_FLUSH_EXIT(fatal, "Target-data-directory option requires an argument", EXIT_FAILURE); + } else if (VSFileSystem::DirectoryExists(datatmp)) { + VSFileSystem::datadir = datatmp; + VS_LOG(important_info, (boost::format("Using target data directory specified on command line: '%1%'") % datatmp)); } else { - //no "-" before it - it's the mission name - strncpy(mission_name, lpCmdLine[i], 1023); - mission_name[1023] = '\0'; + VS_LOG_FLUSH_EXIT(fatal, (boost::format("Specified target data directory '%1%' not found... exiting") % datatmp), EXIT_FAILURE); + } + } + + if (cmd_args.count("num-players")) { + int num_players = cmd_args["num-players"].as(); + if (num_players > 1 && num_players <= 9) { + CONFIGFILE = new char[42]; + snprintf(CONFIGFILE, 42, "vegastrike.config.%dplayer", num_players); + } else if (num_players != 1) { + VS_LOG(warning, "Specified number of players out of range (1-9)"); + } + } + + if (cmd_args.count("mod")) { + retstr = cmd_args["mod"].as(); + } + + if (cmd_args.count("start-in-system")) { + std::string st; + st = cmd_args["start-in-system"].as(); + SetPlayerSystem(st, true); + } + + if (cmd_args.count("location")) { + QVector PlayerLocation; + try { + std::string input = cmd_args["location"].as(); + std::istringstream iStringStream(input); + iStringStream.ignore(2); + iStringStream >> PlayerLocation.i; + iStringStream.ignore(1, ','); + iStringStream >> PlayerLocation.j; + iStringStream.ignore(1, ','); + iStringStream >> PlayerLocation.k; + } catch (std::ios_base::failure &inputFailure) { + std::cout << "Error reading coordinates for player location: " << inputFailure.what() + << std::endl; + exit(EXIT_FAILURE); + } + SetPlayerLoc(PlayerLocation, true); + } + + if (cmd_args.count("debug")) { + char vs_debug_level_temp = cmd_args["debug"].as(); + switch (vs_debug_level_temp) { + case 0: + g_game.vsdebug = 0; + break; + case 1: + g_game.vsdebug = 1; + break; + case 2: + g_game.vsdebug = 2; + break; + case 3: + g_game.vsdebug = 3; + break; + case '0': + g_game.vsdebug = 0; + break; + case '1': + g_game.vsdebug = 1; + break; + case '2': + g_game.vsdebug = 2; + break; + case '3': + g_game.vsdebug = 3; + break; + default: + VS_LOG_FLUSH_EXIT(fatal, "Invalid debug level specified", EXIT_FAILURE); } } + + if (cmd_args.count("net")) { + //don't ignore the network section of the config file + ignore_network = false; + } + + if (cmd_args.count("benchmark")) { + benchmark = cmd_args["benchmark"].as(); + } + + if (cmd_args.count("test-audio")) { + // This is handled separately, since we have to undefine main first + // return Audio::Test::main(argc, argv); + } + + if (cmd_args.count("a")) { + g_game.x_resolution = 800; + g_game.y_resolution = 600; + } + if (cmd_args.count("h")) { + g_game.x_resolution = 1024; + g_game.y_resolution = 768; + } + if (cmd_args.count("v")) { + g_game.x_resolution = 1280; + g_game.y_resolution = 1024; + } + + if (cmd_args.count("mission_name")) { + strncpy(mission_name, cmd_args["mission_name"].as().c_str(), 1024); + mission_name[1023] = '\0'; + } + if (false == legacy_data_dir_mode) { if (true == VSFileSystem::datadir.empty()) { - VS_LOG_FLUSH_EXIT(fatal, "Data directory not specified.", 1); + VS_LOG_FLUSH_EXIT(fatal, "Data directory not specified.", EXIT_FAILURE); } } diff --git a/engine/vcpkg.json b/engine/vcpkg.json index e7d79b999e..c296ec4fae 100644 --- a/engine/vcpkg.json +++ b/engine/vcpkg.json @@ -15,6 +15,7 @@ "boost-atomic", "boost-assign", "boost-format", + "boost-program-options", "egl-registry", "expat", "freeglut", diff --git a/script/bootstrap-on-macOS-using-MacPorts.sh b/script/bootstrap-on-macOS-using-MacPorts.sh index ab60e68c8e..eb84177e0e 100755 --- a/script/bootstrap-on-macOS-using-MacPorts.sh +++ b/script/bootstrap-on-macOS-using-MacPorts.sh @@ -6,7 +6,7 @@ # # sudo ./script/bootstrap-on-macOS-using-MacPorts.sh # -# Copyright (C) 2024 Stephen G. Tuggy, David Wales, +# Copyright (C) 2024-2025 Stephen G. Tuggy, David Wales, # and other Vega Strike contributors # # This file is part of Vega Strike. @@ -26,8 +26,12 @@ set -e -port install python312 boost181@1.81.0_10+cmake_scripts+no_single+no_static+python312 glib2 gtk3 gtkglext libsdl2 libGLU freeglut xorg-server openal-soft cmake expat libjpeg-turbo libpng libvorbis ninja +port install python312 boost181@1.81.0_12+cmake_scripts+no_single+no_static+python312 glib2 +quartz libepoxy +quartz gtk3 +quartz libsdl2 libGLU freeglut openal-soft cmake expat libjpeg-turbo libpng libvorbis ninja export CMAKE_PREFIX_PATH="/opt/local/" echo "CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH" + +# Keep these lines! Otherwise you will likely get PFNGL... not found errors. +ln -s "$CMAKE_PREFIX_PATH/include/GL" "$CMAKE_PREFIX_PATH/include/OpenGL" +ln -s "$CMAKE_PREFIX_PATH/include/GL" "$CMAKE_PREFIX_PATH/include/GLUT" diff --git a/script/bootstrap-on-macos.sh b/script/bootstrap-on-macos.sh index 05e0e1722d..b070871f90 100644 --- a/script/bootstrap-on-macos.sh +++ b/script/bootstrap-on-macos.sh @@ -53,6 +53,10 @@ do export CMAKE_PREFIX_PATH="$PACKAGE_INSTALLED_PREFIX:$CMAKE_PREFIX_PATH" done +# Keep these lines! Otherwise you will likely get PFNGL... not found errors. +ln -s "$(brew --prefix)/include/GL" "$(brew --prefix)/include/OpenGL" +ln -s "$(brew --prefix)/include/GL" "$(brew --prefix)/include/GLUT" + OPENALDIR="$(brew --prefix openal-soft)" export OPENALDIR diff --git a/script/build b/script/build index 7b318d3ef6..88478dfcb1 100755 --- a/script/build +++ b/script/build @@ -13,7 +13,7 @@ # https://github.com/Taose/Vegastrike-taose/wiki/How-to-Build #==================================== -# Copyright (C) 2020-2022 Stephen G. Tuggy and other Vega Strike contributors. +# Copyright (C) 2020-2025 Stephen G. Tuggy and other Vega Strike contributors. # # https://github.com/vegastrike/Vega-Strike-Engine-Source # @@ -36,7 +36,7 @@ set -e echo "--------------------------" -echo "--- build | 2022-02-25 ---" +echo "--- build | 2025-01-10 ---" echo "--------------------------" #---------------------------------- @@ -77,7 +77,7 @@ cd "${ROOT_DIR}" mkdir -pv "${BIN_DIR}" declare -a files_to_copy_if_they_exist=("${BUILD_DIR}/vegastrike-engine" "${BUILD_DIR}/setup/vegasettings" "${BUILD_DIR}/objconv/vega-meshtool") -declare -a directories_to_copy_if_they_exist=("${BUILD_DIR}/vegastrike-engine.app") +declare -a directories_to_copy_if_they_exist=("${BUILD_DIR}/vegastrike-engine.app", "${BUILD_DIR}/setup/vegasettings.app") for i in "${files_to_copy_if_they_exist[@]}" do