|
@@ -32,36 +32,36 @@ set (CMAKE_SYSTEM_NAME Linux)
|
|
|
set (CMAKE_SYSTEM_VERSION 1)
|
|
set (CMAKE_SYSTEM_VERSION 1)
|
|
|
|
|
|
|
|
# specify the cross compiler
|
|
# specify the cross compiler
|
|
|
-file (TO_CMAKE_PATH "$ENV{RASPI_TOOL}" RASPI_TOOL)
|
|
|
|
|
-if (NOT EXISTS ${RASPI_TOOL}/arm-linux-gnueabihf-gcc)
|
|
|
|
|
|
|
+file (TO_CMAKE_PATH "$ENV{RPI_TOOL}" RPI_TOOL)
|
|
|
|
|
+if (NOT EXISTS ${RPI_TOOL}/arm-linux-gnueabihf-gcc)
|
|
|
message (FATAL_ERROR "Could not find Raspberry Pi cross compilation tool. "
|
|
message (FATAL_ERROR "Could not find Raspberry Pi cross compilation tool. "
|
|
|
- "Use RASPI_TOOL environment variable to specify the location of the toolchain.")
|
|
|
|
|
|
|
+ "Use RPI_TOOL environment variable to specify the location of the toolchain.")
|
|
|
endif ()
|
|
endif ()
|
|
|
-set (CMAKE_C_COMPILER ${RASPI_TOOL}/arm-linux-gnueabihf-gcc CACHE PATH "C compiler")
|
|
|
|
|
-set (CMAKE_CXX_COMPILER ${RASPI_TOOL}/arm-linux-gnueabihf-c++ CACHE PATH "C++ compiler")
|
|
|
|
|
-set (CMAKE_ASM_COMPILER ${RASPI_TOOL}/arm-linux-gnueabihf-gcc CACHE PATH "assembler")
|
|
|
|
|
-set (CMAKE_STRIP ${RASPI_TOOL}/arm-linux-gnueabihf-strip CACHE PATH "strip")
|
|
|
|
|
-set (CMAKE_AR ${RASPI_TOOL}/arm-linux-gnueabihf-ar CACHE PATH "archive")
|
|
|
|
|
-set (CMAKE_LINKER ${RASPI_TOOL}/arm-linux-gnueabihf-ld CACHE PATH "linker")
|
|
|
|
|
-set (CMAKE_NM ${RASPI_TOOL}/arm-linux-gnueabihf-nm CACHE PATH "nm")
|
|
|
|
|
-set (CMAKE_OBJCOPY ${RASPI_TOOL}/arm-linux-gnueabihf-objcopy CACHE PATH "objcopy")
|
|
|
|
|
-set (CMAKE_OBJDUMP ${RASPI_TOOL}/arm-linux-gnueabihf-objdump CACHE PATH "objdump")
|
|
|
|
|
-set (CMAKE_RANLIB ${RASPI_TOOL}/arm-linux-gnueabihf-ranlib CACHE PATH "ranlib")
|
|
|
|
|
|
|
+set (CMAKE_C_COMPILER ${RPI_TOOL}/arm-linux-gnueabihf-gcc CACHE PATH "C compiler")
|
|
|
|
|
+set (CMAKE_CXX_COMPILER ${RPI_TOOL}/arm-linux-gnueabihf-c++ CACHE PATH "C++ compiler")
|
|
|
|
|
+set (CMAKE_ASM_COMPILER ${RPI_TOOL}/arm-linux-gnueabihf-gcc CACHE PATH "assembler")
|
|
|
|
|
+set (CMAKE_STRIP ${RPI_TOOL}/arm-linux-gnueabihf-strip CACHE PATH "strip")
|
|
|
|
|
+set (CMAKE_AR ${RPI_TOOL}/arm-linux-gnueabihf-ar CACHE PATH "archive")
|
|
|
|
|
+set (CMAKE_LINKER ${RPI_TOOL}/arm-linux-gnueabihf-ld CACHE PATH "linker")
|
|
|
|
|
+set (CMAKE_NM ${RPI_TOOL}/arm-linux-gnueabihf-nm CACHE PATH "nm")
|
|
|
|
|
+set (CMAKE_OBJCOPY ${RPI_TOOL}/arm-linux-gnueabihf-objcopy CACHE PATH "objcopy")
|
|
|
|
|
+set (CMAKE_OBJDUMP ${RPI_TOOL}/arm-linux-gnueabihf-objdump CACHE PATH "objdump")
|
|
|
|
|
+set (CMAKE_RANLIB ${RPI_TOOL}/arm-linux-gnueabihf-ranlib CACHE PATH "ranlib")
|
|
|
|
|
|
|
|
# specify the system root
|
|
# specify the system root
|
|
|
if (NOT BCM_VC_INCLUDE_DIRS)
|
|
if (NOT BCM_VC_INCLUDE_DIRS)
|
|
|
# Keep invalidating the cache until we found the BCM library and its include directory which hopefully also mean we have found the correct SYSROOT
|
|
# Keep invalidating the cache until we found the BCM library and its include directory which hopefully also mean we have found the correct SYSROOT
|
|
|
- unset (RASPI_SYSROOT CACHE)
|
|
|
|
|
|
|
+ unset (RPI_SYSROOT CACHE)
|
|
|
unset (CMAKE_INSTALL_PREFIX CACHE)
|
|
unset (CMAKE_INSTALL_PREFIX CACHE)
|
|
|
- file (TO_CMAKE_PATH "$ENV{RASPI_ROOT}" RASPI_ROOT)
|
|
|
|
|
- if (NOT EXISTS ${RASPI_ROOT})
|
|
|
|
|
|
|
+ file (TO_CMAKE_PATH "$ENV{RPI_ROOT}" RPI_ROOT)
|
|
|
|
|
+ if (NOT EXISTS ${RPI_ROOT})
|
|
|
message (FATAL_ERROR "Could not find Raspberry Pi system root. "
|
|
message (FATAL_ERROR "Could not find Raspberry Pi system root. "
|
|
|
- "Use RASPI_ROOT environment variable to specify the location of system root.")
|
|
|
|
|
|
|
+ "Use RPI_ROOT environment variable to specify the location of system root.")
|
|
|
endif ()
|
|
endif ()
|
|
|
- set (RASPI_SYSROOT ${RASPI_ROOT} CACHE PATH "Path to Raspberry Pi SYSROOT")
|
|
|
|
|
- mark_as_advanced (RASPI_SYSROOT CMAKE_TOOLCHAIN_FILE)
|
|
|
|
|
- set (CMAKE_FIND_ROOT_PATH ${RASPI_SYSROOT})
|
|
|
|
|
- set (CMAKE_INSTALL_PREFIX "${RASPI_SYSROOT}/usr/local" CACHE PATH "Install path prefix, prepended onto install directories.")
|
|
|
|
|
|
|
+ set (RPI_SYSROOT ${RPI_ROOT} CACHE PATH "Path to Raspberry Pi SYSROOT")
|
|
|
|
|
+ mark_as_advanced (RPI_SYSROOT CMAKE_TOOLCHAIN_FILE)
|
|
|
|
|
+ set (CMAKE_FIND_ROOT_PATH ${RPI_SYSROOT})
|
|
|
|
|
+ set (CMAKE_INSTALL_PREFIX "${RPI_SYSROOT}/usr/local" CACHE PATH "Install path prefix, prepended onto install directories.")
|
|
|
endif ()
|
|
endif ()
|
|
|
|
|
|
|
|
# only search programs, libraries, and headers in the target directories
|
|
# only search programs, libraries, and headers in the target directories
|