[Cmake] Using Cross GCC with VC++ ide

Nitin Gupta ngupta at GlobespanVirata . com
Mon, 16 Jun 2003 20:39:01 +0530


Thanks a lot for helping this out! It works.

Now I'm working towards creating an instance of
cmDependInformation by invoking FindDependencies(char *)
for each file from the plugin. Then pass the set of file
(; separated) to SourceFileSetProperty. For this I think
I need to add the a function pointer to cmCAPI cmStaticCAPI
in cmcpluginapi.cxx; say char * cmFindDependencies(char *).
Or is there already a way of doing this?

Then I plan to populate the source file property of each file
so that cmLocalVisualStudio6Generator::WriteDSPFile invokes
WriteCustomRule() with appropriate args. I think this should
take care of all the issues of cross building and browsing
in VC++.

Since all the build configuration can be kept in a <target>.cmake file
in Modules dir as CMake already does of other platforms. It will be good
to hide all this extra processing in plugin/cmake itself and the
developer need not do extra effort of writing an extra custom
command for each source file in its CMakeLists.txt file. Only thing one
would need to do is include <target>.cmake file at the top of its
CMakeList.txt. So for that the plugin should be able to extract
Include files, C flags, link flags, defines, output dir etc.

Please let me know your views about this solution.

Thanks and Regards,
Nitin


> -----Original Message-----
> From: cmake-admin at public . kitware . com
> [mailto:cmake-admin at public . kitware . com]On Behalf Of Bill Hoffman
> Sent: Friday, June 13, 2003 7:56 PM
> To: Nitin Gupta; cmake at public . kitware . com
> Subject: RE: [Cmake] Using Cross GCC with VC++ ide
>
>
> 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
>
>
>
> _______________________________________________
> Cmake mailing list
> Cmake at public . kitware . com
> http://public . kitware . com/mailman/listinfo/cmake
>