CMake 指定安装目录,CMake 指定安装路径

CMake 指定安装目录,CMake 指定安装路径。使用CMAKE_INSTALL_PREFIX参数。

一、方法一

cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.linux-arm.cmake -DCMAKE_INSTALL_PREFIX=./ ../
# path to compiler and utilities
# specify the cross compiler
#SET(CMAKE_C_COMPILER arm-linux-gnueabihf-gcc)
SET(CMAKE_C_COMPILER arm-linux-gcc)
 
# Name of the target platform
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_PROCESSOR arm)
 
# Version of the system
SET(CMAKE_SYSTEM_VERSION 1)

二、方法二

在CMakeCache.txt文件中添加变量,须加在 PROJECT(< project_name>) 之后。

SET(CMAKE_INSTALL_PREFIX )
cmake-gui ../

你可能感兴趣的:(嵌入式Linux,C&C++,p2p,gnu,fpga开发)