Skip to content
This repository was archived by the owner on Jun 17, 2025. It is now read-only.
This repository was archived by the owner on Jun 17, 2025. It is now read-only.

CMakeLists issue in examples #306

@PavanMadushanka

Description

@PavanMadushanka

Hi, this is a general issue I saw while compiling the examples. In the CMakeLists.txt files in examples, there is a check to see if $ENV{MDF_PATH} already exists.

# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)

if(NOT DEFINED $ENV{MDF_PATH})
    message(STATUS "foo include dir: $ENV{MDF_PATH}")
    set(ENV{MDF_PATH} ${CMAKE_CURRENT_LIST_DIR}/../..)
endif()
include($ENV{MDF_PATH}/project.cmake)

project(get_started)

I think that if statement does not work as intended due to $ at the beginning.
Believe the correct Cmake syntax should be:

if(NOT DEFINED ENV{MDF_PATH})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions