Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Load SDL2
- find_program(LSB_RELEASE_EXEC lsb_release)
- execute_process(COMMAND ${LSB_RELEASE_EXEC} -is OUTPUT_VARIABLE LSB_RELEASE_ID_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE)
- message("Your distro is ${LSB_RELEASE_ID_SHORT}")
- find_package(SDL2 REQUIRED)
- if ("${LSB_RELEASE_ID_SHORT}" STREQUAL "Arch")
- message("Arch distro detected, using Arch CMake linkage")
- target_link_libraries(ProjectName SDL2::SDL2)
- else ()
- message("Non-Arch distro detected, using normal linkage")
- string(STRIP ${SDL2_LIBRARIES} SDL2_LIBRARIES) # Fix because CMake is stupid, remove trailing spaces
- include_directories(ProjectName ${SDL2_INCLUDE_DIRS})
- target_link_libraries(ProjectName ${SDL2_LIBRARIES})
- endif ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement