Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [cdt-dev] Antwort: [Newsletter] Re: CMake support in Eclipse CDT

Here is an example with the macro defined in the file macros.cmake:
macro(add_my_exe _target _source )
add_executable( ${_target} ${_source} )
    endmacro()

Then you will get the following output.
axel@zeus:~/Programming/cmake-build$ cmake ../cmake-test --trace 2>&1 |grep add_executable
/home/axel/Programming/cmake-test/macros.cmake(3):  add_executable(hello1 hello1.cpp )
/home/axel/Programming/cmake-test/macros.cmake(3):  add_executable(hello2 hello2.cpp )

I have applied the macro in two different subfolders. But the path info is not shown.

   Axel

2015-12-09 21:02 GMT+01:00 Doug Schaefer <dschaefer@xxxxxxx>:
How does CMake know the path? Is it derived from the path of the current CMakeLists file (I.e. not the one with the macro in it?)

From: <cdt-dev-bounces@xxxxxxxxxxx> on behalf of Axel Müller <axel.carl.mueller@xxxxxxxxx>
Reply-To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Date: Wednesday, December 9, 2015 at 10:57 AM
To: "CDT General developers list." <cdt-dev@xxxxxxxxxxx>
Subject: Re: [cdt-dev] Antwort: [Newsletter] Re: CMake support in Eclipse CDT

You will get the name of the target but you will not get the path. cmake --trace will only show the path to the cmake file where the macro is defined. Please note, that your build tree can have several targets and they can have identical names but reside in different paths!
  
   Axel

2015-12-09 16:24 GMT+01:00 Doug Schaefer <dschaefer@xxxxxxx>:
You mean cmake --trace doesn’t show it if add_executable is in a macro? 

_______________________________________________
cdt-dev mailing list
cdt-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/cdt-dev



--
Dr. Axel Müller
Lorbeerweg 8
76149 Karlsruhe

Back to the top