Page 1 of 1

Cannot Propagate Project Name to Components When Compiling

Posted: Sun Dec 24, 2023 5:46 pm
by gamename
Hi,
I am trying to pass my project name to my components.

Here is my "CMakeLists.txt"

Code: Select all

cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(my_project) # Your project name
add_definitions(-DMY_PROJECT_NAME=\"${PROJECT_NAME}\")
But looking at my "compile_commands.json", I only see the `-DMY_PROJECT_NAME=\"${PROJECT_NAME}\"` on the first compile command. It is not present in any other compilation command.

Any suggestions? What am I missing?
TIA,
-T