DSP Builder for Intel® FPGAs (Advanced Blockset): Handbook

ID 683337
Date 3/23/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

3.4.1. Example CMakelist File

Generate project or makefiles using CMakeLists.txt
cmake_minimum_required (VERSION 2.11) project (simple_dut_CModel_atb)
set (simple_dut_CModel_atb 1)
set (simple_dut_CModel_atb 0)

# set by user as a hint
set (MPIR_INC_PATH "" CACHE PATH "MPIR include path (hint)") set (MPIR_LIB_PATH "" CACHE PATH "MPIR library path (hint)") set (MPFR_INC_PATH "" CACHE PATH "MPFR include path (hint)") set (MPFR_LIB_PATH "" CACHE PATH "MPFR library path (hint)")

option(USE_MPIR "Include and link against the MPIR library for models that require arbitrary precision" OFF)
option(USE_MPFR "Include and link against the MPFR library for models that require arbitrary precision floating point" OFF)

include("CMakeFiles.txt")

add_executable(simple_dut_CModel_atb ${cmodel_SRC}) add_definitions(-D_CRT_SECURE_NO_WARNINGS)
if (MSVC)
else()
set(CMAKE_CXX_FLAGS_RELEASE "-O1 -DNDEBUG")
endif()

if(USE_MPIR)
add_definitions(-DCSL_USE_MPIR) find_path(MPIR_INC
NAMES mpir.h
HINTS ${MPIR_INC_PATH}
)
find_library(MPIR_LIB NAMES mpir altera_mpir HINTS ${MPIR_LIB_PATH}
)