Cannot Propagate Project Name to Components When Compiling

gamename
Posts: 32
Joined: Fri Dec 08, 2023 11:33 pm

Cannot Propagate Project Name to Components When Compiling

Postby gamename » Sun Dec 24, 2023 5:46 pm

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

Who is online

Users browsing this forum: Google [Bot], ignisuti and 97 guests