If you don't want to have the full path embedded in the binary, you do.
As an addendum to my previous answer, the string after the equal sign might
need escaped quoting.
Michael.
On 28.12.2011, at 18:41, J Decker wrote:
> ya - before using the file parameter, find the last / or '\' and prin
ya - before using the file parameter, find the last / or '\' and print
from there forward... you dono't need an absolute or relative path for
that
On Tue, Dec 27, 2011 at 11:17 PM, vivek goel wrote:
> Is there any way to define custom
> macro as given in following answer
> http://stackoverflow.co
set(SRCS a/a.cpp b/b.cpp c/c.cpp d/d.cpp)
foreach(f IN LISTS SRCS)
get_filename_component(b ${f} NAME)
set_source_files_properties(${f} PROPERTIES
COMPILE_DEFINITIONS "MYSRCNAME=${b}")
endforeach()
add_executable(foo ${SRCS})
HTH
Michael
On 12/28/2011 08:17 AM, vivek goel wrote:
> Is
Is there any way to define custom
macro as given in following answer
http://stackoverflow.com/questions/237542/learning-the-source-codes-filename-at-compile-time
with cmake
regards
Vivek Goel
On Tue, Dec 27, 2011 at 11:02 PM, Rolf Eike Beer wrote:
> Am Dienstag, 27. Dezember 2011, 09:18:15 s
On Tue, Dec 27, 2011 at 9:32 AM, Rolf Eike Beer wrote:
> Am Dienstag, 27. Dezember 2011, 09:18:15 schrieb J Decker:
>> On Tue, Dec 27, 2011 at 1:42 AM, Rolf Eike Beer wrote:
>> > Am Dienstag, 27. Dezember 2011, 14:58:32 schrieb vivek goel:
>> >> How can I make cmake to compile source with relativ
Am Dienstag, 27. Dezember 2011, 09:18:15 schrieb J Decker:
> On Tue, Dec 27, 2011 at 1:42 AM, Rolf Eike Beer wrote:
> > Am Dienstag, 27. Dezember 2011, 14:58:32 schrieb vivek goel:
> >> How can I make cmake to compile source with relative path ?
> >>
> >> So that __FILE__ belongs to relative path
On Tue, Dec 27, 2011 at 1:42 AM, Rolf Eike Beer wrote:
> Am Dienstag, 27. Dezember 2011, 14:58:32 schrieb vivek goel:
>> How can I make cmake to compile source with relative path ?
>>
>> So that __FILE__ belongs to relative path of the file
>>
>> or there is another way I can replace __FILE__ with
Am Dienstag, 27. Dezember 2011, 14:58:32 schrieb vivek goel:
> How can I make cmake to compile source with relative path ?
>
> So that __FILE__ belongs to relative path of the file
>
> or there is another way I can replace __FILE__ with some other variable ?
__FILE__ is implemented by the compil
How can I make cmake to compile source with relative path ?
So that __FILE__ belongs to relative path of the file
or there is another way I can replace __FILE__ with some other variable ?
--
regards
Vivek Goel
--
Powered by www.kitware.com
Visit other Kitware open-source projects at
http:/