[Cmake] Using Cross GCC with VC++ ide
Bill Hoffman
bill . hoffman at kitware . com
Fri, 13 Jun 2003 10:25:56 -0400
Try this:
Instead of calling SourceFileAddDepend, use SourceFileSetProperty,
and the property is OBJECT_DEPENDS, and the value would be
the depend.
Something like this:
info->CAPI->SourceFileSetProperty((void *)
sf,"OBJECT_DEPENDS", "C:\\ngupta\\test_cmake\\include\\hello.h");
I think that will work.
-Bill
At 08:56 AM 6/13/2003, Nitin Gupta wrote:
>Hi Bill,
> I tried it but it does not work.
> I edited the CMake/Tests/LoadCommand/CMakeCommands/cmTestCommand.c
> example itself. In InitialPass() I added
>
> for(i = 0; i < argc; i++)
> {
> sf = (char*) (info->CAPI->CreateSourceFile());
> if(sf == NULL)
> {
> fprintf(stderr,"*** error creating SourceFile");
> return 1;
> }
> info->CAPI->SourceFileSetName2(sf,
>"LoadedCommand","E:\\Work\\cmake-1.6.7\\Tests\\LoadCommand","cxx",0);
> info->CAPI->SourceFileAddDepend((void *)
>sf,"C:\\ngupta\\test_cmake\\include\\hello.h");
> info->CAPI->AddSource(mf,sf);
> }
>
> and in CMake/Tests/LoadCommand/CMakeCommands/ I added
> CMAKE_TEST_COMMAND(LoadedCommand.cxx)
>
> I know I have hard coded the source and dependency file name in
> the plugin but that is just to test.
>
> In the debugger I could see the depends list of sf getting updated
> with <...>hello.h however the dependency is not emitted in the .dsp
> file generated.
>
> Please help!
>
>Regards,
>Nitin
>
>> -----Original Message-----
>> From: cmake-admin at public . kitware . com
>> [mailto:cmake-admin at public . kitware . com]On Behalf Of Bill Hoffman
>> Sent: Thursday, June 12, 2003 8:37 PM
>> To: Nitin Gupta; cmake at public . kitware . com
>> Subject: RE: [Cmake] Using Cross GCC with VC++ ide
>>
>>
>> There should be no order problem.
>> At the top of the project, you compile
>> and load the new command. Then you can
>> use the command.
>>
>> -Bill
>>
>> At 10:38 AM 6/12/2003, Nitin Gupta wrote:
>>
>> >Hi Bill,
>> > Thanks for your response.
>> >
>> > I think you are suggesting of adding a new command
>> > (say ADD_CUSTOM_DEPEND_GCC(src.c)). In the command
>> > invoke GCC with appropriate preprocessor switch
>> > for src.c for finding header dependencies and then
>> > invoke SourceFileAddDepend list of dependencies.
>> >
>> > Before I try this please let me know if there
>> > any order in which this new command may be used in
>> > CMakeList.txt file relative to other commands. I'm
>> > asking this because these is dependency on
>> > SourceFileAddDepend.
>> >
>> >Thanks and Regards,
>> >Nitin
>> >
>> >> Currently, we support gnu makefiles under cygwin only.
>> >> If you install the cygwin version of cmake it will generate
>> >> gnu makefiles. I think Francis Larrivée was looking into adding
>> >> support for gmake. It should not be that hard to add.
>> >>
>> >>
>> >> I do not think there is a way from a cmake list file to add
>> >> new depends on to a target. However, I think you could
>> >> do it with a cmake plugin. You will want to look at
>> >> this function:
>> >> void (*SourceFileAddDepend) (void *sf, const char *depend);
>> >>
>> >> I think that if you add the depends to the source file, cmake will
>> >> put them in that USERDEP_HACK section.
>> >>
>> >> In the source for cmake, there is an example loadeded command:
>> >>
>> >> CMake/Tests/LoadCommand/
>> >>
>> >>
>> >> -Bill
>> >>
>> >
>> >_______________________________________________
>> >Cmake mailing list
>> >Cmake at public . kitware . com
>> >http://public . kitware . com/mailman/listinfo/cmake
>>
>>
>>
>> _______________________________________________
>> Cmake mailing list
>> Cmake at public . kitware . com
>> http://public . kitware . com/mailman/listinfo/cmake
>>
>
>_______________________________________________
>Cmake mailing list
>Cmake at public . kitware . com
>http://public . kitware . com/mailman/listinfo/cmake