bladeRF/CMakeLists.txt
Jon Szymaniak ea15c91c25 fx3_firmware: Use CMake for project configuration and Makefile generation
The combination of CMake and a custom Makefile/toolchain.mk was messy.

This change is to achieve better consistency with the CMake-oriented
workflow of the remainder of the project software and to make it easier
to maintain and change in the future. (CMake options may be used to
enable/disable features.)
2016-04-06 16:06:06 -04:00

51 lines
1.6 KiB
CMake

cmake_minimum_required(VERSION 2.8)
#####################################################################
# Choose which major components to build
#####################################################################
option(ENABLE_HOST_BUILD
"Build the bladeRF host components"
ON
)
option(ENABLE_FX3_BUILD
"Build the Cypress FX3 firmware component. Be sure to define FX3_SDK_PATH"
OFF
)
#####################################################################
# Flag for development version vs tagged release
#####################################################################
option(TAGGED_RELEASE
"Indicates that this is a tagged release. Drops '-git' flag."
OFF
)
if(TAGGED_RELEASE)
set(VERSION_INFO_EXTRA "")
else()
set(VERSION_INFO_EXTRA "git")
endif()
#####################################################################
# Build components
#####################################################################
if(ENABLE_HOST_BUILD)
add_subdirectory(host)
else()
message(STATUS "Skipping host component build")
endif()
if(ENABLE_FX3_BUILD)
include(ExternalProject)
ExternalProject_Add(fx3_firmware
DOWNLOAD_COMMAND ""
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/fx3_firmware"
CMAKE_ARGS "-DFX3_SDK_PATH=${FX3_SDK_PATH};-DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/fx3_firmware/cmake/fx3-toolchain.cmake"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/fx3_firmware"
PREFIX "${CMAKE_CURRENT_BINARY_DIR}/fx3_firmware"
INSTALL_COMMAND ""
)
else()
message(STATUS "Skipping FX3 firmware build")
endif()