### Install Executable Program Source: https://github.com/sude-/lgogdownloader/blob/master/CMakeLists.txt Installs the built project executable to the specified binary directory. The destination is relative to the installation prefix. ```cmake install(PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}${CMAKE_EXECUTABLE_SUFFIX}" DESTINATION ${INSTALL_BIN_DIR}) ``` -------------------------------- ### Build and Install LGOGDownloader on Debian/Ubuntu Source: https://github.com/sude-/lgogdownloader/blob/master/README.md Configures the build using CMake with Qt GUI support and installs LGOGDownloader on Debian/Ubuntu. ```bash $ cmake -B build -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DUSE_QT_GUI=ON -GNinja $ ninja -Cbuild install ``` -------------------------------- ### Install Dependencies on Fedora Source: https://github.com/sude-/lgogdownloader/blob/master/README.md Installs necessary development libraries and tools for building LGOGDownloader on Fedora systems. ```bash sudo dnf install cmake make gcc gcc-c++ glibc tinyxml2-devel rhash-devel \ libtidy-devel tinyxml-devel jsoncpp-devel libcurl-devel \ boost-devel ``` -------------------------------- ### Install Dependencies on Debian/Ubuntu Source: https://github.com/sude-/lgogdownloader/blob/master/README.md Installs necessary development libraries and tools for building LGOGDownloader on Debian or Ubuntu systems. ```bash # apt install build-essential libcurl4-openssl-dev libboost-regex-dev \ libjsoncpp-dev librhash-dev libtinyxml2-dev libtidy-dev \ libboost-system-dev libboost-filesystem-dev libboost-program-options-dev \ libboost-date-time-dev libboost-iostreams-dev cmake \ pkg-config zlib1g-dev qtwebengine5-dev ninja-build ``` -------------------------------- ### Get Help Source: https://github.com/sude-/lgogdownloader/blob/master/README.md Displays the help text or man page for LGOGDownloader. ```bash lgogdownloader --help ``` ```bash man lgogdownloader ``` -------------------------------- ### Define Installation Directories Source: https://github.com/sude-/lgogdownloader/blob/master/CMakeLists.txt Sets cache variables for installation directories for executables (bin) and resource files (share). These can be overridden by users during configuration. ```cmake set(INSTALL_BIN_DIR bin CACHE PATH "Installation directory for executables") set(INSTALL_SHARE_DIR share CACHE PATH "Installation directory for resource files") ``` -------------------------------- ### Build and Install LGOGDownloader on Fedora Source: https://github.com/sude-/lgogdownloader/blob/master/README.md Configures the build using CMake and compiles LGOGDownloader on Fedora systems. ```bash cmake .. make ``` -------------------------------- ### Use Galaxy API for Game Builds Source: https://github.com/sude-/lgogdownloader/blob/master/README.md Interacts with the Galaxy API to list and install specific game builds. ```bash lgogdownloader --galaxy-platform windows --galaxy-show-builds stardew_valley ``` ```bash lgogdownloader --galaxy-platform windows --galaxy-install stardew_valley/0 ``` ```bash lgogdownloader --galaxy-platform windows --galaxy-install beneath_a_steel_sky/0 --galaxy-no-dependencies ``` -------------------------------- ### List Games and Details Source: https://github.com/sude-/lgogdownloader/blob/master/README.md Lists all available games or details for specific games. ```bash lgogdownloader --list ``` ```bash lgogdownloader --list details --game witcher ``` -------------------------------- ### Login to GOG Account Source: https://github.com/sude-/lgogdownloader/blob/master/README.md Logs into your GOG.com account using LGOGDownloader. ```bash lgogdownloader --login ``` -------------------------------- ### Find GZIP Program Source: https://github.com/sude-/lgogdownloader/blob/master/man/CMakeLists.txt Locates the gzip program using find_program. This is necessary for compressing man pages. ```cmake find_program(GZIP gzip DOC "Location of the gzip program") mark_as_advanced(GZIP) ``` -------------------------------- ### Download Games Source: https://github.com/sude-/lgogdownloader/blob/master/README.md Downloads games with various options for filtering and configuration. ```bash lgogdownloader --download ``` ```bash lgogdownloader --download --game stardew_valley --exclude extras ``` ```bash lgogdownloader --download --threads 6 --platform linux --language en+de,fr ``` ```bash lgogdownloader --download-file tyrian_2000/9543 ``` -------------------------------- ### Man Page Generation Source: https://github.com/sude-/lgogdownloader/blob/master/man/CMakeLists.txt Defines a custom command to compress the man page using gzip if gzip is found. This ensures the man page is built during the CMake process. ```cmake if(GZIP) set(MAN_PAGE "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.1") set(MAN_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.1.gz") add_custom_command( OUTPUT ${MAN_FILE} COMMAND ${GZIP} -c -9 ${MAN_PAGE} > ${MAN_FILE} MAIN_DEPENDENCY ${MAN_PAGE} COMMENT "Building man page" VERBATIM ) add_custom_target(manpage ALL DEPENDS ${MAN_FILE} ${PROJECT_NAME}) install(FILES ${MAN_FILE} DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) else(GZIP) message("WARNING: One of the following is missing: gzip; man page will not be generated") endif(GZIP) ``` -------------------------------- ### Repair Downloaded Files Source: https://github.com/sude-/lgogdownloader/blob/master/README.md Repairs corrupted or missing game files. ```bash lgogdownloader --repair --game beneath_a_steel_sky ``` ```bash lgogdownloader --repair --download --game "^a" ``` -------------------------------- ### Link Qt GUI Libraries Conditionally Source: https://github.com/sude-/lgogdownloader/blob/master/CMakeLists.txt Links Qt Widgets and WebEngineWidgets libraries if the USE_QT_GUI flag is enabled. This is used for projects requiring a graphical user interface with Qt. ```cmake if(USE_QT_GUI) target_link_libraries(${PROJECT_NAME} PRIVATE ${QT}::Widgets ${QT}::WebEngineWidgets ) endif(USE_QT_GUI) ``` -------------------------------- ### Set Compiler Flags for GCC/Clang Source: https://github.com/sude-/lgogdownloader/blob/master/CMakeLists.txt Appends common warning and exception flags (-Wall, -Wextra, -Wno-long-long, -fexceptions) for GCC and Clang compilers. These flags enhance code safety and diagnostics. ```cmake set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-long-long -fexceptions") ``` -------------------------------- ### Set Compiler Flags for MSVC Source: https://github.com/sude-/lgogdownloader/blob/master/CMakeLists.txt Enforces the /W4 warning level for MSVC compiler. If a lower warning level is detected, it's replaced with /W4; otherwise, /W4 is appended. ```cmake if(MSVC) # Force to always compile with W4 if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") string(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") else() set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4") endif() elseif(CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") # Update if necessary set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-long-long -fexceptions") endif() ``` -------------------------------- ### Link -latomic if Atomic Build Fails Source: https://github.com/sude-/lgogdownloader/blob/master/CMakeLists.txt Conditionally links the '-latomic' library if the project fails to build with atomic operations. This ensures compatibility on systems where atomic operations are not implicitly supported. ```cmake set(testAtomicPath "${CMAKE_BINARY_DIR}/test_atomic.cpp") file(WRITE ${testAtomicPath} "#include \n" "int main() { std::atomic i(0); i++; return 0; }\n") try_compile(ATOMIC_BUILD_SUCCEEDED ${CMAKE_BINARY_DIR} ${testAtomicPath}) if (NOT ATOMIC_BUILD_SUCCEEDED) target_link_libraries(${PROJECT_NAME} PRIVATE -latomic ) endif () file(REMOVE ${testAtomicPath}) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.