0

I have the following folder structure :

  • Parent_folder
    • CMakeLists.txt (A)
    • Sub_1_folder
      • CMakeLists.txt (B)
    • Sub_2_folder
      • CMakeLists.txt (C)

Now, In CMakeLists.txt (A) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTrial ")

In CMakeLists.txt (B) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTrail2")

In CMakeLists.txt (C) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DTrail3")

However, towards the end of the code, when I print the CMAKE_C_FLAGS in CMakeLists.txt (A) , it just shows DTrail.

What to do so that DTrail2 and DTrail3 ( changes in sub-directory: It seems they have scope only in their respective sub-folders ) reflect in CMAKE_C_FLAGS of CMakeLists.txt (A) ( parent ).

Is there any method to make changes global ?

Kindly help me !

Dev_Ras
  • 11
  • 2

0 Answers0