Setting OIIO_NAMESPACE


Jeremy Selan <jeremy...@...>
 

Should should not need to set OIIO_NAMESPACE.  Even when you build oiio with a custom namespace,   OIIO_NAMESPACE is a macro that get's baked into the oiio installation.

I've confirmed this works at SPI.  For example, we build ociodisplay and only specify the following...

-D OCIO_BUILD_APPS=YES \
-D OIIO_LIBRARY_PATH=$OIIO_SPCOMP2_LIBDIR \
-D OIIO_INCLUDE_PATH=$OIIO_SPCOMP2_INCLUDEDIR \

Where in OIIO_INCLUDE_PATH, there is version.h, which includes:

#define OIIO_NAMESPACE OpenImageIO_SPI

What's inside your version.h for the OIIO installation?  Does it match the namespace you see for the real symbols for your oiio so? (nm -C -D)

-- Jeremy





On Fri, Dec 9, 2011 at 9:44 AM, Jeff Clifford <j...@...> wrote:
Hi,

It's not setting OCIO_NAMESPACE that is the problem.

It's the need to set OIIO_NAMESPACE - i.e. the OpenImageIO requirement for the apps.  Is there a way to set that - I've tried setting it but it doesn't seem to get passed on.

Thanks,

Jeff.


Malcolm Humphreys wrote:
Hi Jeff,

This gets set line 69 in the main CMakeList.txt file to 'OpenColorIO' if the cmake var OCIO_NAMESPACE is not set.

--snip--
# Set the default namespace
if(NOT OCIO_NAMESPACE)
  set(OCIO_NAMESPACE OpenColorIO CACHE STRING
      "Specify the master OCIO C++ namespace: Options include OpenColorIO OpenColorIO_<YOURFACILITY> etc."
      FORCE)
endif(NOT OCIO_NAMESPACE)
messageonce("Setting Namespace to: ${OCIO_NAMESPACE}")
--snip--

Have you tried from a clean build dir? cmake sometimes has problems if something went wrong on a previous run When it does work you should be able to control this like so 'cmake -DOCIO_NAMESPACE=OCIODNEG ...' flag.

Also which version of cmake are you using? and during the cmake run what does ''Setting Namespace to: XXX" say.

.malcolm

On 10 Dec, 2011,at 03:11 AM, Jeff Clifford <...@...> wrote:

Hi,

When building the apps that come with OpenColorIO I hit the following errors (under gcc):

[EE] /user_data/ARCHIVE/imageworks-OpenColorIO-de86248/src/apps/ocioconvert/main.cpp:37: error: 'OIIO_NAMESPACE' is not a namespace-name

which is fair enough as indeed I haven't defined it.

Is there a proper way to do this with OpenColorIO - the only way I've managed to set it is by appending

     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOIIO_NAMESPACE=OpenImageIO -Wall -Wextra -Wshadow -Wconversion -Wcast-qual -Wformat=2")

it into CMakeListstxt

I would have thought that this define should be set as the default unless overridden by the user with something like

set(OIIO_NAMESPACE "OpenImageIO")

But that has no affect.

Thanks,

Jeff.

P.S.  Trying to set the define on the command line doesn't work either - i.e. with CMAKE_CXX_FLAGS="-DOIIO_NAMESPACE=OpenImageIO"

I end up with this entry in CMakeCache.txt:

CMAKE_CXX_FLAGS=-DOIIO_NAMESPACE:UNINITIALIZED=OpenImageIO

rather than it being added to

CMAKE_CXX_FLAGS:STRING=

- I think this is more my lack of understanding of adding definitions to cmake correctly!


Jeff Clifford <j...@...>
 

Okay thanks Jeremy.

When I'm back at work on Monday I will check. I do know that we aren't using the latest OpenImageIO version (0.8.0 I think) so will check that header file to make sure it contains the #define.

Cheers,

Jeff.

Jeremy Selan wrote:

Should should not need to set OIIO_NAMESPACE. Even when you build oiio with a custom namespace, OIIO_NAMESPACE is a macro that get's baked into the oiio installation.

I've confirmed this works at SPI. For example, we build ociodisplay and only specify the following...

-D OCIO_BUILD_APPS=YES \
-D OIIO_LIBRARY_PATH=$OIIO_SPCOMP2_LIBDIR \
-D OIIO_INCLUDE_PATH=$OIIO_SPCOMP2_INCLUDEDIR \

Where in OIIO_INCLUDE_PATH, there is version.h, which includes:

#define OIIO_NAMESPACE OpenImageIO_SPI

What's inside your version.h for the OIIO installation? Does it match the namespace you see for the real symbols for your oiio so? (nm -C -D)

-- Jeremy





On Fri, Dec 9, 2011 at 9:44 AM, Jeff Clifford <j...@... <mailto:j...@...>> wrote:

Hi,

It's not setting OCIO_NAMESPACE that is the problem.

It's the need to set OIIO_NAMESPACE - i.e. the OpenImageIO
requirement for the apps. Is there a way to set that - I've tried
setting it but it doesn't seem to get passed on.

Thanks,

Jeff.


Malcolm Humphreys wrote:
Hi Jeff,

This gets set line 69 in the main CMakeList.txt file to
'OpenColorIO' if the cmake var OCIO_NAMESPACE is not set.

--snip--
# Set the default namespace
if(NOT OCIO_NAMESPACE)
set(OCIO_NAMESPACE OpenColorIO CACHE STRING
"Specify the master OCIO C++ namespace: Options include
OpenColorIO OpenColorIO_<YOURFACILITY> etc."
FORCE)
endif(NOT OCIO_NAMESPACE)
messageonce("Setting Namespace to: ${OCIO_NAMESPACE}")
--snip--

Have you tried from a clean build dir? cmake sometimes has
problems if something went wrong on a previous run When it does
work you should be able to control this like so 'cmake
-DOCIO_NAMESPACE=OCIODNEG ...' flag.

Also which version of cmake are you using? and during the cmake
run what does ''Setting Namespace to: XXX" say.

.malcolm

On 10 Dec, 2011,at 03:11 AM, Jeff Clifford <j...@...>
<mailto:j...@...> wrote:

Hi,

When building the apps that come with OpenColorIO I hit the
following errors (under gcc):

[EE]
/user_data/ARCHIVE/imageworks-OpenColorIO-de86248/src/apps/ocioconvert/main.cpp:37:
error: 'OIIO_NAMESPACE' is not a namespace-name

which is fair enough as indeed I haven't defined it.

Is there a proper way to do this with OpenColorIO - the only way
I've managed to set it is by appending

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
-DOIIO_NAMESPACE=OpenImageIO -Wall -Wextra -Wshadow -Wconversion
-Wcast-qual -Wformat=2")

it into CMakeListstxt

I would have thought that this define should be set as the
default unless overridden by the user with something like

set(OIIO_NAMESPACE "OpenImageIO")

But that has no affect.

Thanks,

Jeff.

P.S. Trying to set the define on the command line doesn't work
either - i.e. with CMAKE_CXX_FLAGS="-DOIIO_NAMESPACE=OpenImageIO"

I end up with this entry in CMakeCache.txt:

CMAKE_CXX_FLAGS=-DOIIO_NAMESPACE:UNINITIALIZED=OpenImageIO

rather than it being added to

CMAKE_CXX_FLAGS:STRING=

- I think this is more my lack of understanding of adding
definitions to cmake correctly!

------------------------------------------------------------------------

No virus found in this message.
Checked by AVG - www.avg.com <http://www.avg.com>
Version: 10.0.1415 / Virus Database: 2102/4069 - Release Date: 12/09/11


Jeff Clifford <j...@...>
 

Hi,

Checking our version of the OIIO version.h file we have:

#ifndef OIIO_VERSION_H
#define OIIO_VERSION_H

#define OIIO_NAMESPACE_ENTER namespace OpenImageIO
#define OIIO_NAMESPACE_EXIT

#endif // OIIO_VERSION_H


so it looks like no define is done for OIIO_NAMESPACE.

It may well be that the version.h file for OIIO 0.9 or 0.10 may differ from this older version (0.8) we're on.

Jeff.

Jeff Clifford wrote:

Okay thanks Jeremy.

When I'm back at work on Monday I will check.  I do know that we aren't using the latest OpenImageIO version (0.8.0 I think) so will check that header file to make sure it contains the #define.

Cheers,

Jeff.

Jeremy Selan wrote:
Should should not need to set OIIO_NAMESPACE.  Even when you build oiio with a custom namespace,   OIIO_NAMESPACE is a macro that get's baked into the oiio installation.

I've confirmed this works at SPI.  For example, we build ociodisplay and only specify the following...

-D OCIO_BUILD_APPS=YES \
-D OIIO_LIBRARY_PATH=$OIIO_SPCOMP2_LIBDIR \
-D OIIO_INCLUDE_PATH=$OIIO_SPCOMP2_INCLUDEDIR \

Where in OIIO_INCLUDE_PATH, there is version.h, which includes:

#define OIIO_NAMESPACE OpenImageIO_SPI

What's inside your version.h for the OIIO installation?  Does it match the namespace you see for the real symbols for your oiio so? (nm -C -D)

-- Jeremy





On Fri, Dec 9, 2011 at 9:44 AM, Jeff Clifford <j...@... <mailto:j...@...>> wrote:

    Hi,

    It's not setting OCIO_NAMESPACE that is the problem.

    It's the need to set OIIO_NAMESPACE - i.e. the OpenImageIO
    requirement for the apps.  Is there a way to set that - I've tried
    setting it but it doesn't seem to get passed on.

    Thanks,

    Jeff.


    Malcolm Humphreys wrote:
    Hi Jeff,

    This gets set line 69 in the main CMakeList.txt file to
    'OpenColorIO' if the cmake var OCIO_NAMESPACE is not set.

    --snip--
    # Set the default namespace
    if(NOT OCIO_NAMESPACE)
      set(OCIO_NAMESPACE OpenColorIO CACHE STRING
          "Specify the master OCIO C++ namespace: Options include
    OpenColorIO OpenColorIO_<YOURFACILITY> etc."
          FORCE)
    endif(NOT OCIO_NAMESPACE)
    messageonce("Setting Namespace to: ${OCIO_NAMESPACE}")
    --snip--

    Have you tried from a clean build dir? cmake sometimes has
    problems if something went wrong on a previous run When it does
    work you should be able to control this like so 'cmake
    -DOCIO_NAMESPACE=OCIODNEG ...' flag.

    Also which version of cmake are you using? and during the cmake
    run what does ''Setting Namespace to: XXX" say.

    .malcolm

    On 10 Dec, 2011,at 03:11 AM, Jeff Clifford <...@...>
    <mailto:j...@...> wrote:

    Hi,

    When building the apps that come with OpenColorIO I hit the
    following errors (under gcc):

    [EE]
    /user_data/ARCHIVE/imageworks-OpenColorIO-de86248/src/apps/ocioconvert/main.cpp:37:
    error: 'OIIO_NAMESPACE' is not a namespace-name

    which is fair enough as indeed I haven't defined it.

    Is there a proper way to do this with OpenColorIO - the only way
    I've managed to set it is by appending

         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
    -DOIIO_NAMESPACE=OpenImageIO -Wall -Wextra -Wshadow -Wconversion
    -Wcast-qual -Wformat=2")

    it into CMakeListstxt

    I would have thought that this define should be set as the
    default unless overridden by the user with something like

    set(OIIO_NAMESPACE "OpenImageIO")

    But that has no affect.

    Thanks,

    Jeff.

    P.S.  Trying to set the define on the command line doesn't work
    either - i.e. with CMAKE_CXX_FLAGS="-DOIIO_NAMESPACE=OpenImageIO"

    I end up with this entry in CMakeCache.txt:

    CMAKE_CXX_FLAGS=-DOIIO_NAMESPACE:UNINITIALIZED=OpenImageIO

    rather than it being added to

    CMAKE_CXX_FLAGS:STRING=

    - I think this is more my lack of understanding of adding
    definitions to cmake correctly!


------------------------------------------------------------------------

No virus found in this message.
Checked by AVG - www.avg.com <http://www.avg.com>
Version: 10.0.1415 / Virus Database: 2102/4069 - Release Date: 12/09/11


Jeremy Selan <jeremy...@...>
 

Is that really the full contents of version.h (in oiio)?  My installation of version.h has 94 lines. (I am including it as an attachment).

Can you try a local build of OIIO with a more recent version? (I'd recommend 0.10).

It looks like all the OIIO namespacing mojo was locked down december last year.

-- Jeremy


On Mon, Dec 12, 2011 at 7:55 AM, Jeff Clifford <j...@...> wrote:
Hi,

Checking our version of the OIIO version.h file we have:

#ifndef OIIO_VERSION_H
#define OIIO_VERSION_H

#define OIIO_NAMESPACE_ENTER namespace OpenImageIO
#define OIIO_NAMESPACE_EXIT

#endif // OIIO_VERSION_H


so it looks like no define is done for OIIO_NAMESPACE.

It may well be that the version.h file for OIIO 0.9 or 0.10 may differ from this older version (0.8) we're on.

Jeff.


Jeff Clifford wrote:
Okay thanks Jeremy.

When I'm back at work on Monday I will check.  I do know that we aren't using the latest OpenImageIO version (0.8.0 I think) so will check that header file to make sure it contains the #define.

Cheers,

Jeff.

Jeremy Selan wrote:
Should should not need to set OIIO_NAMESPACE.  Even when you build oiio with a custom namespace,   OIIO_NAMESPACE is a macro that get's baked into the oiio installation.

I've confirmed this works at SPI.  For example, we build ociodisplay and only specify the following...

-D OCIO_BUILD_APPS=YES \
-D OIIO_LIBRARY_PATH=$OIIO_SPCOMP2_LIBDIR \
-D OIIO_INCLUDE_PATH=$OIIO_SPCOMP2_INCLUDEDIR \

Where in OIIO_INCLUDE_PATH, there is version.h, which includes:

#define OIIO_NAMESPACE OpenImageIO_SPI

What's inside your version.h for the OIIO installation?  Does it match the namespace you see for the real symbols for your oiio so? (nm -C -D)

-- Jeremy





On Fri, Dec 9, 2011 at 9:44 AM, Jeff Clifford <j...@... <mailto:j...@...>> wrote:

    Hi,

    It's not setting OCIO_NAMESPACE that is the problem.

    It's the need to set OIIO_NAMESPACE - i.e. the OpenImageIO
    requirement for the apps.  Is there a way to set that - I've tried
    setting it but it doesn't seem to get passed on.

    Thanks,

    Jeff.


    Malcolm Humphreys wrote:
    Hi Jeff,

    This gets set line 69 in the main CMakeList.txt file to
    'OpenColorIO' if the cmake var OCIO_NAMESPACE is not set.

    --snip--
    # Set the default namespace
    if(NOT OCIO_NAMESPACE)
      set(OCIO_NAMESPACE OpenColorIO CACHE STRING
          "Specify the master OCIO C++ namespace: Options include
    OpenColorIO OpenColorIO_<YOURFACILITY> etc."
          FORCE)
    endif(NOT OCIO_NAMESPACE)
    messageonce("Setting Namespace to: ${OCIO_NAMESPACE}")
    --snip--

    Have you tried from a clean build dir? cmake sometimes has
    problems if something went wrong on a previous run When it does
    work you should be able to control this like so 'cmake
    -DOCIO_NAMESPACE=OCIODNEG ...' flag.

    Also which version of cmake are you using? and during the cmake
    run what does ''Setting Namespace to: XXX" say.

    .malcolm

    On 10 Dec, 2011,at 03:11 AM, Jeff Clifford <...@...>
    <mailto:j...@...> wrote:

    Hi,

    When building the apps that come with OpenColorIO I hit the
    following errors (under gcc):

    [EE]
    /user_data/ARCHIVE/imageworks-OpenColorIO-de86248/src/apps/ocioconvert/main.cpp:37:
    error: 'OIIO_NAMESPACE' is not a namespace-name

    which is fair enough as indeed I haven't defined it.

    Is there a proper way to do this with OpenColorIO - the only way
    I've managed to set it is by appending

         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
    -DOIIO_NAMESPACE=OpenImageIO -Wall -Wextra -Wshadow -Wconversion
    -Wcast-qual -Wformat=2")

    it into CMakeListstxt

    I would have thought that this define should be set as the
    default unless overridden by the user with something like

    set(OIIO_NAMESPACE "OpenImageIO")

    But that has no affect.

    Thanks,

    Jeff.

    P.S.  Trying to set the define on the command line doesn't work
    either - i.e. with CMAKE_CXX_FLAGS="-DOIIO_NAMESPACE=OpenImageIO"

    I end up with this entry in CMakeCache.txt:

    CMAKE_CXX_FLAGS=-DOIIO_NAMESPACE:UNINITIALIZED=OpenImageIO

    rather than it being added to

    CMAKE_CXX_FLAGS:STRING=

    - I think this is more my lack of understanding of adding
    definitions to cmake correctly!


------------------------------------------------------------------------

No virus found in this message.
Checked by AVG - www.avg.com <http://www.avg.com>
Version: 10.0.1415 / Virus Database: 2102/4069 - Release Date: 12/09/11



Jeff Clifford <j...@...>
 

Hi Jeremy,

I downloaded and built OpenImageIO 0.9 and 0.10 and they both contain:

#define OIIO_NAMESPACE OpenImageIO

(their header files are much bigger as you say).

but 0.8 does not.

Additionally if I set that define and try and build OCIO agianst v0.8 of OIIO it fails with an error:

/user_data/ARCHIVE/imageworks-OpenColorIO-de86248/src/apps/ociodisplay/main.cpp: In function 'void InitImageTexture(const char*)':
[EE] /user_data/ARCHIVE/imageworks-OpenColorIO-de86248/src/apps/ociodisplay/main.cpp:123: error: 'OIIO::TypeDesc' has not been declared

so it looks like version 0.8 of OIIO isn't compatible anyway.

So I'm just going to bump the version of OIIO we use here to 0.10 but it may be worth adding a minimum version check to make sure OIIO is at least version 0.9?

Thanks,

Jeff.


Jeremy Selan wrote:

Is that really the full contents of version.h (in oiio)?  My installation of version.h has 94 lines. (I am including it as an attachment).

Can you try a local build of OIIO with a more recent version? (I'd recommend 0.10).

It looks like all the OIIO namespacing mojo was locked down december last year.

-- Jeremy


On Mon, Dec 12, 2011 at 7:55 AM, Jeff Clifford <j...@...> wrote:
Hi,

Checking our version of the OIIO version.h file we have:

#ifndef OIIO_VERSION_H
#define OIIO_VERSION_H

#define OIIO_NAMESPACE_ENTER namespace OpenImageIO
#define OIIO_NAMESPACE_EXIT

#endif // OIIO_VERSION_H


so it looks like no define is done for OIIO_NAMESPACE.

It may well be that the version.h file for OIIO 0.9 or 0.10 may differ from this older version (0.8) we're on.

Jeff.


Jeff Clifford wrote:
Okay thanks Jeremy.

When I'm back at work on Monday I will check.  I do know that we aren't using the latest OpenImageIO version (0.8.0 I think) so will check that header file to make sure it contains the #define.

Cheers,

Jeff.

Jeremy Selan wrote:
Should should not need to set OIIO_NAMESPACE.  Even when you build oiio with a custom namespace,   OIIO_NAMESPACE is a macro that get's baked into the oiio installation.

I've confirmed this works at SPI.  For example, we build ociodisplay and only specify the following...

-D OCIO_BUILD_APPS=YES \
-D OIIO_LIBRARY_PATH=$OIIO_SPCOMP2_LIBDIR \
-D OIIO_INCLUDE_PATH=$OIIO_SPCOMP2_INCLUDEDIR \

Where in OIIO_INCLUDE_PATH, there is version.h, which includes:

#define OIIO_NAMESPACE OpenImageIO_SPI

What's inside your version.h for the OIIO installation?  Does it match the namespace you see for the real symbols for your oiio so? (nm -C -D)

-- Jeremy





On Fri, Dec 9, 2011 at 9:44 AM, Jeff Clifford <j...@... <mailto:j...@...>> wrote:

    Hi,

    It's not setting OCIO_NAMESPACE that is the problem.

    It's the need to set OIIO_NAMESPACE - i.e. the OpenImageIO
    requirement for the apps.  Is there a way to set that - I've tried
    setting it but it doesn't seem to get passed on.

    Thanks,

    Jeff.


    Malcolm Humphreys wrote:
    Hi Jeff,

    This gets set line 69 in the main CMakeList.txt file to
    'OpenColorIO' if the cmake var OCIO_NAMESPACE is not set.

    --snip--
    # Set the default namespace
    if(NOT OCIO_NAMESPACE)
      set(OCIO_NAMESPACE OpenColorIO CACHE STRING
          "Specify the master OCIO C++ namespace: Options include
    OpenColorIO OpenColorIO_<YOURFACILITY> etc."
          FORCE)
    endif(NOT OCIO_NAMESPACE)
    messageonce("Setting Namespace to: ${OCIO_NAMESPACE}")
    --snip--

    Have you tried from a clean build dir? cmake sometimes has
    problems if something went wrong on a previous run When it does
    work you should be able to control this like so 'cmake
    -DOCIO_NAMESPACE=OCIODNEG ...' flag.

    Also which version of cmake are you using? and during the cmake
    run what does ''Setting Namespace to: XXX" say.

    .malcolm

    On 10 Dec, 2011,at 03:11 AM, Jeff Clifford <...@...>
    <mailto:j...@...> wrote:

    Hi,

    When building the apps that come with OpenColorIO I hit the
    following errors (under gcc):

    [EE]
    /user_data/ARCHIVE/imageworks-OpenColorIO-de86248/src/apps/ocioconvert/main.cpp:37:
    error: 'OIIO_NAMESPACE' is not a namespace-name

    which is fair enough as indeed I haven't defined it.

    Is there a proper way to do this with OpenColorIO - the only way
    I've managed to set it is by appending

         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
    -DOIIO_NAMESPACE=OpenImageIO -Wall -Wextra -Wshadow -Wconversion
    -Wcast-qual -Wformat=2")

    it into CMakeListstxt

    I would have thought that this define should be set as the
    default unless overridden by the user with something like

    set(OIIO_NAMESPACE "OpenImageIO")

    But that has no affect.

    Thanks,

    Jeff.

    P.S.  Trying to set the define on the command line doesn't work
    either - i.e. with CMAKE_CXX_FLAGS="-DOIIO_NAMESPACE=OpenImageIO"

    I end up with this entry in CMakeCache.txt:

    CMAKE_CXX_FLAGS=-DOIIO_NAMESPACE:UNINITIALIZED=OpenImageIO

    rather than it being added to

    CMAKE_CXX_FLAGS:STRING=

    - I think this is more my lack of understanding of adding
    definitions to cmake correctly!


------------------------------------------------------------------------

No virus found in this message.
Checked by AVG - www.avg.com <http://www.avg.com>
Version: 10.0.1415 / Virus Database: 2102/4069 - Release Date: 12/09/11



Jeremy Selan <jeremy...@...>
 

Great to hear that it works with updated OIIO versions.  I didnt realize that it wouldnt work with 0.8.  I'll add a version check (as you suggest).

-- Jeremy


On Tue, Dec 13, 2011 at 2:58 AM, Jeff Clifford <j...@...> wrote:
Hi Jeremy,

I downloaded and built OpenImageIO 0.9 and 0.10 and they both contain:

#define OIIO_NAMESPACE OpenImageIO

(their header files are much bigger as you say).

but 0.8 does not.

Additionally if I set that define and try and build OCIO agianst v0.8 of OIIO it fails with an error:

/user_data/ARCHIVE/imageworks-OpenColorIO-de86248/src/apps/ociodisplay/main.cpp: In function 'void InitImageTexture(const char*)':
[EE] /user_data/ARCHIVE/imageworks-OpenColorIO-de86248/src/apps/ociodisplay/main.cpp:123: error: 'OIIO::TypeDesc' has not been declared

so it looks like version 0.8 of OIIO isn't compatible anyway.

So I'm just going to bump the version of OIIO we use here to 0.10 but it may be worth adding a minimum version check to make sure OIIO is at least version 0.9?

Thanks,

Jeff.



Jeremy Selan wrote:
Is that really the full contents of version.h (in oiio)?  My installation of version.h has 94 lines. (I am including it as an attachment).

Can you try a local build of OIIO with a more recent version? (I'd recommend 0.10).

It looks like all the OIIO namespacing mojo was locked down december last year.

-- Jeremy


On Mon, Dec 12, 2011 at 7:55 AM, Jeff Clifford <j...@...> wrote:
Hi,

Checking our version of the OIIO version.h file we have:

#ifndef OIIO_VERSION_H
#define OIIO_VERSION_H

#define OIIO_NAMESPACE_ENTER namespace OpenImageIO
#define OIIO_NAMESPACE_EXIT

#endif // OIIO_VERSION_H


so it looks like no define is done for OIIO_NAMESPACE.

It may well be that the version.h file for OIIO 0.9 or 0.10 may differ from this older version (0.8) we're on.

Jeff.


Jeff Clifford wrote:
Okay thanks Jeremy.

When I'm back at work on Monday I will check.  I do know that we aren't using the latest OpenImageIO version (0.8.0 I think) so will check that header file to make sure it contains the #define.

Cheers,

Jeff.

Jeremy Selan wrote:
Should should not need to set OIIO_NAMESPACE.  Even when you build oiio with a custom namespace,   OIIO_NAMESPACE is a macro that get's baked into the oiio installation.

I've confirmed this works at SPI.  For example, we build ociodisplay and only specify the following...

-D OCIO_BUILD_APPS=YES \
-D OIIO_LIBRARY_PATH=$OIIO_SPCOMP2_LIBDIR \
-D OIIO_INCLUDE_PATH=$OIIO_SPCOMP2_INCLUDEDIR \

Where in OIIO_INCLUDE_PATH, there is version.h, which includes:

#define OIIO_NAMESPACE OpenImageIO_SPI

What's inside your version.h for the OIIO installation?  Does it match the namespace you see for the real symbols for your oiio so? (nm -C -D)

-- Jeremy





On Fri, Dec 9, 2011 at 9:44 AM, Jeff Clifford <j...@... <mailto:j...@...>> wrote:

    Hi,

    It's not setting OCIO_NAMESPACE that is the problem.

    It's the need to set OIIO_NAMESPACE - i.e. the OpenImageIO
    requirement for the apps.  Is there a way to set that - I've tried
    setting it but it doesn't seem to get passed on.

    Thanks,

    Jeff.


    Malcolm Humphreys wrote:
    Hi Jeff,

    This gets set line 69 in the main CMakeList.txt file to
    'OpenColorIO' if the cmake var OCIO_NAMESPACE is not set.

    --snip--
    # Set the default namespace
    if(NOT OCIO_NAMESPACE)
      set(OCIO_NAMESPACE OpenColorIO CACHE STRING
          "Specify the master OCIO C++ namespace: Options include
    OpenColorIO OpenColorIO_<YOURFACILITY> etc."
          FORCE)
    endif(NOT OCIO_NAMESPACE)
    messageonce("Setting Namespace to: ${OCIO_NAMESPACE}")
    --snip--

    Have you tried from a clean build dir? cmake sometimes has
    problems if something went wrong on a previous run When it does
    work you should be able to control this like so 'cmake
    -DOCIO_NAMESPACE=OCIODNEG ...' flag.

    Also which version of cmake are you using? and during the cmake
    run what does ''Setting Namespace to: XXX" say.

    .malcolm

    On 10 Dec, 2011,at 03:11 AM, Jeff Clifford <...@...>
    <mailto:j...@...> wrote:

    Hi,

    When building the apps that come with OpenColorIO I hit the
    following errors (under gcc):

    [EE]
    /user_data/ARCHIVE/imageworks-OpenColorIO-de86248/src/apps/ocioconvert/main.cpp:37:
    error: 'OIIO_NAMESPACE' is not a namespace-name

    which is fair enough as indeed I haven't defined it.

    Is there a proper way to do this with OpenColorIO - the only way
    I've managed to set it is by appending

         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}
    -DOIIO_NAMESPACE=OpenImageIO -Wall -Wextra -Wshadow -Wconversion
    -Wcast-qual -Wformat=2")

    it into CMakeListstxt

    I would have thought that this define should be set as the
    default unless overridden by the user with something like

    set(OIIO_NAMESPACE "OpenImageIO")

    But that has no affect.

    Thanks,

    Jeff.

    P.S.  Trying to set the define on the command line doesn't work
    either - i.e. with CMAKE_CXX_FLAGS="-DOIIO_NAMESPACE=OpenImageIO"

    I end up with this entry in CMakeCache.txt:

    CMAKE_CXX_FLAGS=-DOIIO_NAMESPACE:UNINITIALIZED=OpenImageIO

    rather than it being added to

    CMAKE_CXX_FLAGS:STRING=

    - I think this is more my lack of understanding of adding
    definitions to cmake correctly!


------------------------------------------------------------------------

No virus found in this message.
Checked by AVG - www.avg.com <http://www.avg.com>
Version: 10.0.1415 / Virus Database: 2102/4069 - Release Date: 12/09/11