Added a Snap package option to the CMake configuration file.

This commit is contained in:
Leon Styhre 2021-11-23 20:38:38 +01:00
parent 241e1c7f01
commit ceefc267b5

View file

@ -39,6 +39,7 @@ option(CLANG_TIDY "Set to ON to build using the clang-tidy static analyzer" ${CL
option(ASAN "Set to ON to build with AddressSanitizer" ${ASAN})
option(TSAN "Set to ON to build with ThreadSanitizer" ${TSAN})
option(UBSAN "Set to ON to build with UndefinedBehaviorSanitizer" ${UBSAN})
option(SNAP_BUILD "Set to ON for a Snap package build" ${SNAP_BUILD})
if(CLANG_TIDY)
find_program(CLANG_TIDY_BINARY NAMES clang-tidy)
@ -283,7 +284,11 @@ if(NOT WIN32 AND NOT APPLE)
endif()
endif()
message("-- Installation prefix is set to " ${CMAKE_INSTALL_PREFIX})
add_definitions(-DES_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
if(SNAP_BUILD)
add_definitions(-DES_INSTALL_PREFIX="/snap/emulationstation/current${CMAKE_INSTALL_PREFIX}")
else()
add_definitions(-DES_INSTALL_PREFIX="${CMAKE_INSTALL_PREFIX}")
endif()
endif()
# For Windows, set the minimum OS version to Windows 7.