build-system: make CMakeLists.txt more consistent

We used two different ways to add to the end of a list. Let's stick with
the more idiomatic one.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Dirk Hohndel 2022-04-10 13:54:57 -10:00
parent 256f58e723
commit 53e153e6d7

View file

@ -151,7 +151,7 @@ include(cmake_variables_helper)
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
include_directories(${CMAKE_OSX_SYSROOT}/usr/include/libxml2)
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -lxml2 -lxslt -lsqlite3)
LIST(APPEND SUBSURFACE_LINK_LIBRARIES -lxml2 -lxslt -lsqlite3)
else()
pkg_config_library(LIBXML libxml-2.0 REQUIRED)
pkg_config_library(LIBSQLITE3 sqlite3 REQUIRED)
@ -245,7 +245,7 @@ if (SUBSURFACE_TARGET_EXECUTABLE MATCHES "DesktopExecutable")
LIST(APPEND QT_EXTRA_COMPONENTS PrintSupport)
# Because Qt5WebKitWidgets isn't a part of the "regular" Qt5, we can't get it the normal way
find_package(Qt5WebKitWidgets REQUIRED)
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} Qt5::WebKitWidgets)
LIST(APPEND SUBSURFACE_LINK_LIBRARIES Qt5::WebKitWidgets)
endif()
elseif (SUBSURFACE_TARGET_EXECUTABLE MATCHES "MobileExecutable")
if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
@ -278,18 +278,18 @@ if(ANDROID)
set(NO_USERMANUAL ON)
set(MAKE_TESTS OFF)
list(APPEND QT_EXTRA_COMPONENTS AndroidExtras)
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -llog)
LIST(APPEND SUBSURFACE_LINK_LIBRARIES -llog)
elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# add pthread to the end of the library list on Linux
# this is only needed on Ubuntu
# but shouldn't hurt on other Linux versions
# in some builds we appear to be missing libz for some strange reason...
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -lz -lpthread)
LIST(APPEND SUBSURFACE_LINK_LIBRARIES -lz -lpthread)
# Test for ARM processor (Raspberry Pi) and add libGLESv2 if found
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l" OR CMAKE_SYSTEM_PROCESSOR STREQUAL "armv6l")
message (STATUS "Found ARM processor. Adding libGLESv2")
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -lGLESv2)
LIST(APPEND SUBSURFACE_LINK_LIBRARIES -lGLESv2)
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
@ -301,7 +301,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
)
find_library(APP_SERVICES_LIBRARY ApplicationServices)
find_library(HID_LIB HidApi)
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${HID_LIB})
LIST(APPEND SUBSURFACE_LINK_LIBRARIES ${HID_LIB})
set(EXTRA_LIBS ${APP_SERVICES_LIBRARY})
set(ICON_FILE ${CMAKE_SOURCE_DIR}/packaging/macosx/Subsurface.icns)
if (SUBSURFACE_TARGET_EXECUTABLE MATCHES "MobileExecutable")
@ -320,7 +320,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set_source_files_properties(${ICON_FILE} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources")
set(SUBSURFACE_PKG MACOSX_BUNDLE ${ICON_FILE})
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -lwsock32 -lws2_32)
LIST(APPEND SUBSURFACE_LINK_LIBRARIES -lwsock32 -lws2_32)
remove_definitions(-DUNICODE)
add_definitions(-mwindows -D_WIN32)
endif()
@ -362,7 +362,7 @@ if(NOT ANDROID)
endif()
#set up the subsurface_link_libraries variable
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} ${LIBDIVECOMPUTER_LIBRARIES} ${LIBGIT2_LIBRARIES} ${LIBUSB_LIBRARIES} ${LIBMTP_LIBRARIES})
LIST(APPEND SUBSURFACE_LINK_LIBRARIES ${LIBDIVECOMPUTER_LIBRARIES} ${LIBGIT2_LIBRARIES} ${LIBUSB_LIBRARIES} ${LIBMTP_LIBRARIES})
if (NOT SUBSURFACE_TARGET_EXECUTABLE MATCHES "DownloaderExecutable")
if(USINGQT6)
if(MAPSUPPORT)
@ -378,7 +378,7 @@ endif()
# hack to build successfully on LGTM
if(DEFINED ENV{LGTM_SRC})
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -lgssapi_krb5 -lhttp_parser)
LIST(APPEND SUBSURFACE_LINK_LIBRARIES -lgssapi_krb5 -lhttp_parser)
endif()
# include translations