The included CMakeLists file is for the 3ds plugin.

My suggestion is to disable the variable shadowing warnings for this project, 
since it is basically an external library although included as source files. 
The other option is to fix all the variable name reuse for that project, which 
feels kind of unnecessary as lib3ds is pretty much abandoned as project (no 
activity since 2013). Autodesk has also stopped their development of this 
format years ago.

Regards
Björn

________________________________________
Från: osg-users <osg-users-boun...@lists.openscenegraph.org> för Robert Osfield 
<robert.osfi...@gmail.com>
Skickat: den 4 juni 2016 19:42:10
Till: OpenSceneGraph Users
Ämne: Re: [osg-users] Preparing to make 3.5.3 dev release, please test

Hi François,

I have removed the register keyword usage from
Matrix_implementation.cpp and added the "" to the CMakeLists.txt.
These changes are now checked into git mater.

Robert.

On 4 June 2016 at 16:23, François Bérard <francois.ber...@imag.fr> wrote:
> Hi Robert,
>
> On 3/6/16 18:46, Robert Osfield wrote:
>>
>> Rather than add this to the root CMakeLists.txt file I have added a
>> Clang specific section to the src/osgPlugins/cfg/CMakeLists.txt thus:
>>
>> # lex/yacc generated files use register that causes warnings with
>> CLang under OSX so disable this warnings.
>> IF(${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
>>     SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -Wno-deprecated-register)
>> ENDIF()
>>
>> This is now checked into master.  Could remove you your own mds and test
>> this?
>
>
> there is a small pb which breaks the build:
>
> Scanning dependencies of target osgdb_cfg
> [ 79%] Building CXX object
> src/osgPlugins/cfg/CMakeFiles/osgdb_cfg.dir/CameraConfig.cpp.o
> clang: error: no input files
> /bin/sh: -Wno-deprecated-register: command not found
> make[2]: ***
> [src/osgPlugins/cfg/CMakeFiles/osgdb_cfg.dir/CameraConfig.cpp.o] Error 127
> make[1]: *** [src/osgPlugins/cfg/CMakeFiles/osgdb_cfg.dir/all] Error 2
> make: *** [all] Error 2
>
>
> adding double quotes fixes it:
>
>      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-register")
>
> Also, the warning appears in osg/Matrix_implementation.cpp (see attached
> log), you may want to add the definition to the CMakelist of libosg. I tried
> by adding the IF block juste before the SETUP_LIBRARY, it worked. But
> removing the two register keywords in the matrix code may be the best
> approach: they are most probably always ignored by the compilers.
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
# List of C files to be compiled as C++ (else CMake sets ".c" to be compiled as 
pure C)
SET(C_FILES
    lib3ds/lib3ds_io.c        # Modified to support OSG endianness
)

SET(TARGET_SRC
    ReaderWriter3DS.cpp
    WriterNodeVisitor.cpp
    WriterCompareTriangle.cpp

    ${C_FILES}
    lib3ds/lib3ds_atmosphere.c
    lib3ds/lib3ds_background.c
    lib3ds/lib3ds_camera.c
    lib3ds/lib3ds_chunk.c
    lib3ds/lib3ds_chunktable.c
    lib3ds/lib3ds_file.c
    lib3ds/lib3ds_light.c
    lib3ds/lib3ds_material.c
    lib3ds/lib3ds_math.c
    lib3ds/lib3ds_matrix.c
    lib3ds/lib3ds_mesh.c
    lib3ds/lib3ds_node.c
    lib3ds/lib3ds_quat.c
    lib3ds/lib3ds_shadow.c
    lib3ds/lib3ds_track.c
    lib3ds/lib3ds_util.c
    lib3ds/lib3ds_vector.c
    lib3ds/lib3ds_viewport.c
)
SET(TARGET_H
    WriterNodeVisitor.h
    WriterCompareTriangle.h
    lib3ds/lib3ds.h
    lib3ds/lib3ds_impl.h
)

IF (MSVC)
    #disable specific warning level 4 warnings:
    #C4456 declaration of 'c' hides previous local declaration
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4456")
ENDIF(MSVC)
 
#### end var setup  ###
SETUP_PLUGIN(3ds)
ADD_DEFINITIONS( -DLIB3DS_STATIC )        # lib3ds is included, so we need the 
flag
SET_SOURCE_FILES_PROPERTIES(${C_FILES} PROPERTIES LANGUAGE "CXX")        # 
Force some files to be compiled as C++
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to