slice2cpp and include paths

Edward BishopEdward Bishop Member EdwardOrganization: SonyProject: Automated Test ✭✭
I have a include/naming problem. I have a slice file TVxx.ice:
=====================================================
#include <Tuner.ice>

module Services {

interface TVxx extends Tuner {
// ...
};

};
=====================================================


and slice2cpp generates TVxx.h:
.
.
.
#include <Tuner.h>
.
.
.

but Tuner.h conflicts wth Tuner.h in the microsoft platform sdk.
So, I can rename Tuner to something less generic, but I was
wondering if there is some slice2cpp directive that would
cause it to generate instead
.
.
.
#include <MyObscureDirectory/Tuner.h>
.
.
.

Thanks
-Edward

Comments

  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    Hi,

    The translator doesn't provide a way to change the pathname of included files in the way you want. The strategy we recommend is to place your Slice files in a sufficiently unique subdirectory and change your Slice files accordingly. For example:
    #include <TV/Tuner.ice>
    ...
    
    You'll probably find the --include-dir useful as well. Take a look at section 6.15.1 of the Ice manual for more information. You can also examine the build process that we use for the Ice sources if you need an example.

    Hope that helps,
    - Mark
Sign In or Register to comment.