From 4d3b60cf461dde4f91e4f8e52039d94c7d4637cb Mon Sep 17 00:00:00 2001 From: Zion Nimchuk Date: Mon, 28 May 2018 13:16:29 -0700 Subject: [PATCH] Unify Linux detection in CMake --- CMakeLists.txt | 2 +- rpcs3/CMakeLists.txt | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc2283f8d0..d23ab25ad5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -47,7 +47,7 @@ include_directories(3rdparty/hidapi/hidapi) if(APPLE) add_subdirectory(3rdparty/hidapi/mac EXCLUDE_FROM_ALL) #list(APPEND LIBS hidapi) -elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") +elseif(CMAKE_SYSTEM MATCHES "Linux") add_subdirectory(3rdparty/hidapi/linux EXCLUDE_FROM_ALL) elseif(MSVC) add_subdirectory(3rdparty/hidapi/windows EXCLUDE_FROM_ALL) diff --git a/rpcs3/CMakeLists.txt b/rpcs3/CMakeLists.txt index 4a9b4a8bde..b235792cd4 100644 --- a/rpcs3/CMakeLists.txt +++ b/rpcs3/CMakeLists.txt @@ -25,7 +25,7 @@ endif() if(NOT Qt5Widgets_FOUND) if(Qt5Widgets_VERSION VERSION_LESS 5.10.0) message("Minimum supported Qt5 version is 5.10.0! You have version ${Qt5Widgets_VERSION} installed, please upgrade!") - if("${CMAKE_SYSTEM}" MATCHES "Linux") + if(CMAKE_SYSTEM MATCHES "Linux") message(FATAL_ERROR "Most distros do not provide an up-to-date version of Qt. If you're on Ubuntu or Linux Mint, there are PPAs you can use to install an up-to-date qt5 version. https://launchpad.net/~beineri/+archive/ubuntu/opt-qt-5.10.1-xenial @@ -43,7 +43,7 @@ before re-running cmake") message("CMake was unable to find Qt5!") if(WIN32) message(FATAL_ERROR "Make sure the QTDIR env variable has been set properly. (for example C:\\Qt\\5.10.1\\msvc2017_64\\)") - elseif("${CMAKE_SYSTEM}" MATCHES "Linux") + elseif(CMAKE_SYSTEM MATCHES "Linux") message(FATAL_ERROR "Make sure to install your distro's qt5 package!") else() message(FATAL_ERROR "You need to have Qt5 installed, look online for instructions on installing Qt5 on ${CMAKE_SYSTEM}.") @@ -93,7 +93,7 @@ if(WIN32) else() add_definitions(-DGL_GLEXT_PROTOTYPES) add_definitions(-DGLX_GLXEXT_PROTOTYPES) - if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR APPLE) + if(CMAKE_SYSTEM MATCHES "Linux" OR APPLE) # We don't want Discord Rich Presence on the BSDs and other OSes add_definitions(-DWITH_DISCORD_RPC) endif() @@ -160,7 +160,7 @@ else() endif() set(ADDITIONAL_LIBS "") -if(${CMAKE_SYSTEM_NAME} MATCHES "Linux") +if(CMAKE_SYSTEM MATCHES "Linux") #on some Linux distros shm_unlink and similar functions are in librt only set(ADDITIONAL_LIBS ${ADDITIONAL_LIBS} "rt") elseif(NOT MSVC AND NOT CMAKE_CXX_FLAGS MATCHES "LIBICONV_PLUG") @@ -430,7 +430,7 @@ else() target_link_libraries(rpcs3 ${OPENAL_LIBRARY} ${OPENGL_LIBRARIES}) if(APPLE) target_link_libraries(rpcs3 hidapi-mac "-framework CoreFoundation" "-framework IOKit") - elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") + elseif(CMAKE_SYSTEM MATCHES "Linux") target_link_libraries(rpcs3 hidapi-hidraw udev) else() target_link_libraries(rpcs3 hidapi-libusb usb) @@ -448,7 +448,7 @@ else() target_link_libraries(rpcs3 png16_static) endif() # Link Discord Rich Presence, but only on Linux - if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") + if(CMAKE_SYSTEM MATCHES "Linux") target_link_libraries(rpcs3 "${RPCS3_SRC_DIR}/../3rdparty/discord-rpc/lib/libdiscord-rpc-linux.a") elseif(APPLE) target_link_libraries(rpcs3 "${RPCS3_SRC_DIR}/../3rdparty/discord-rpc/lib/libdiscord-rpc-mac.a")