summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorGravatar Doug Junkins <junkins@foghead.com>2019-03-05 04:57:13 +0000
committerGravatar Dirk Hohndel <dirk@hohndel.org>2019-03-05 09:01:22 -0800
commita29f7b7b32894d5fa2ffefbfed919c8d8f8e0c1e (patch)
treebd9cadc92c3932b6f9c4fa618863357b7a20d20d /CMakeLists.txt
parent10e7835290fef4275fb85e5efc9e37c06887b9e6 (diff)
downloadsubsurface-a29f7b7b32894d5fa2ffefbfed919c8d8f8e0c1e.tar.gz
Add support to compile from source on a Raspberry Pi
Update CMakeLists.txt to test if the CMAKE_SYSTEM_PROCESSOR variable is either armv6l or armv7l. If so, add libGLESv2 to the list of libraries to be linked to support openGL on embedded systems. Update INSTALL file to list the packages needed to be installed on Raspian Stretch or Ubuntu Mate to successfully compile subsurface from source. Signed-off-by: Doug Junkins <junkins@foghead.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt7
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b431fd114..a9addef0c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -186,6 +186,13 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux")
# in some builds we appear to be missing libz for some strange reason...
# Add ssh2 at the end for openSUSE builds (for recent cmake?)
set(SUBSURFACE_LINK_LIBRARIES ${SUBSURFACE_LINK_LIBRARIES} -lssh2 -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)
+ set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ endif()
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
execute_process(
COMMAND sh scripts/get-version linux