Skip to content

Commit 9d793db

Browse files
authored
Merge pull request #559 from 5schatten/cross_compiling
CMakeList.txt: added CMAKE_FIND_ROOT_PATH for cross compiling
2 parents 289d89a + 48663c0 commit 9d793db

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

CMakeLists.txt

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,23 @@ elseif(GL)
2020
set(GLSystem "Desktop OpenGL" CACHE STRING "The OpenGL system to be used")
2121
#-------------------------------------------------------------------------------
2222
#check if we're running on Raspberry Pi
23-
elseif(EXISTS "/opt/vc/include/bcm_host.h")
23+
elseif(EXISTS "${CMAKE_FIND_ROOT_PATH}/opt/vc/include/bcm_host.h")
2424
MESSAGE("bcm_host.h found")
2525
set(BCMHOST found)
2626
set(GLSystem "OpenGL ES" CACHE STRING "The OpenGL system to be used")
2727
#-------------------------------------------------------------------------------
2828
#check if we're running on OSMC Vero4K
29-
elseif(EXISTS "/opt/vero3/lib/libMali.so")
29+
elseif(EXISTS "${CMAKE_FIND_ROOT_PATH}/opt/vero3/lib/libMali.so")
3030
MESSAGE("libMali.so found")
3131
set(VERO4K found)
3232
set(GLSystem "OpenGL ES" CACHE STRING "The OpenGL system to be used")
3333
#-------------------------------------------------------------------------------
3434
#check if we're running on olinuxino / odroid / etc
35-
elseif(EXISTS "/usr/lib/libMali.so" OR
36-
EXISTS "/usr/lib/arm-linux-gnueabihf/libMali.so" OR
37-
EXISTS "/usr/lib/aarch64-linux-gnu/libMali.so" OR
38-
EXISTS "/usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so" OR
39-
EXISTS "/usr/lib/arm-linux-gnueabihf/libmali.so")
35+
elseif(EXISTS "${CMAKE_FIND_ROOT_PATH}/usr/lib/libMali.so" OR
36+
EXISTS "${CMAKE_FIND_ROOT_PATH}/usr/lib/arm-linux-gnueabihf/libMali.so" OR
37+
EXISTS "${CMAKE_FIND_ROOT_PATH}/usr/lib/aarch64-linux-gnu/libMali.so" OR
38+
EXISTS "${CMAKE_FIND_ROOT_PATH}/usr/lib/arm-linux-gnueabihf/mali-egl/libmali.so" OR
39+
EXISTS "${CMAKE_FIND_ROOT_PATH}/usr/lib/arm-linux-gnueabihf/libmali.so")
4040
MESSAGE("libMali.so found")
4141
set(GLSystem "OpenGL ES" CACHE STRING "The OpenGL system to be used")
4242
else()
@@ -142,15 +142,15 @@ endif()
142142

143143
if(DEFINED BCMHOST)
144144
LIST(APPEND COMMON_INCLUDE_DIRS
145-
"/opt/vc/include"
146-
"/opt/vc/include/interface/vcos"
147-
"/opt/vc/include/interface/vmcs_host/linux"
148-
"/opt/vc/include/interface/vcos/pthreads"
145+
"${CMAKE_FIND_ROOT_PATH}/opt/vc/include"
146+
"${CMAKE_FIND_ROOT_PATH}/opt/vc/include/interface/vcos"
147+
"${CMAKE_FIND_ROOT_PATH}/opt/vc/include/interface/vmcs_host/linux"
148+
"${CMAKE_FIND_ROOT_PATH}/opt/vc/include/interface/vcos/pthreads"
149149
)
150150
#add include directory for Vero4K
151151
elseif(DEFINED VERO4K)
152152
LIST(APPEND COMMON_INCLUDE_DIRS
153-
"/opt/vero3/include"
153+
"${CMAKE_FIND_ROOT_PATH}/opt/vero3/include"
154154
)
155155
else()
156156
if(${GLSystem} MATCHES "Desktop OpenGL")
@@ -168,11 +168,11 @@ endif()
168168
#define libraries and directories
169169
if(DEFINED BCMHOST)
170170
link_directories(
171-
"/opt/vc/lib"
171+
"${CMAKE_FIND_ROOT_PATH}/opt/vc/lib"
172172
)
173173
elseif(DEFINED VERO4K)
174174
link_directories(
175-
"/opt/vero3/lib"
175+
"${CMAKE_FIND_ROOT_PATH}/opt/vero3/lib"
176176
)
177177
endif()
178178

0 commit comments

Comments
 (0)