Hi Robert,

I gave projects folders in VS a try, it works for applications, plugins and
examples but not for the osg core libraries.
Attached OsgMacroUtils.cmake is a tiny fix for this. OpenThreads is
addressed seperately.

Mourad

On Wed, Mar 9, 2011 at 2:07 PM, Robert Osfield <[email protected]>wrote:

> Hi Tassilio,
>
> I have just merged and checked in your changes.  I made a few minor
> tweaks to fit in with other changes that I checked in yesterday for
> Android support, fingers crossed my tweaks won't have broken anything.
>
> Could you please try svn/trunk and let me know if everything is working.
>
> Thanks.
> Robert.
>
> On Thu, Feb 24, 2011 at 1:28 PM, Tassilo Glander
> <[email protected]> wrote:
> > Hi,
> >
> > I patched the cmake configuration to support folders, which are really
> handy to organize the many projects in the OSG solution into examples,
> applications and core libs in the IDE.
> > This feature has been introduced to cmake in 2.8.3, on older versions it
> should be ignored silently. I tested on Visual Studio 2008 with cmake 2.8.3
> and 2.8.4.
> >
> > See the screenshots for comparison [img]osg_solution.png[/img]
> >
> > This needs few changes:
> >
> > activate on global cmakelist.txt:
> >
> > [code]set_property(GLOBAL PROPERTY USE_FOLDERS On)[/code]
> >
> > set appropriate folder names for project type in osgMacroUtils.cmake:
> >
> > [code]SET_TARGET_PROPERTIES(${CORELIB_NAME} PROPERTIES FOLDER "OSG
> Core")[/code]
> >
> > similar for examples, applications
> >
> > Thanks,
> > Tassilo
> >
> > ------------------
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=37090#37090
> >
> >
> >
> >
> > Attachments:
> > http://forum.openscenegraph.org//files/buildpatch_131.zip
> > http://forum.openscenegraph.org//files/osg_solution_944.png
> >
> >
> > _______________________________________________
> > osg-submissions mailing list
> > [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
> >
> _______________________________________________
> osg-submissions mailing list
> [email protected]
>
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
# This is mainly for Windows declspec, but other platforms know
# what to do with it.
ADD_DEFINITIONS(-DOPENTHREADS_EXPORTS)

SET(OPENTHREADS_MAJOR_VERSION 2)
SET(OPENTHREADS_MINOR_VERSION 5)
SET(OPENTHREADS_PATCH_VERSION 0)
SET(OPENTHREADS_SOVERSION 12)

SET(OPENTHREADS_VERSION 
${OPENTHREADS_MAJOR_VERSION}.${OPENTHREADS_MINOR_VERSION}.${OPENTHREADS_PATCH_VERSION})

IF(NOT ANDROID)
    INCLUDE(CheckAtomicOps)
ENDIF()

# User Options
OPTION(DYNAMIC_OPENTHREADS "Set to ON to build OpenThreads for dynamic linking. 
 Use OFF for static." ON)
IF(DYNAMIC_OPENTHREADS)
    SET(OPENTHREADS_USER_DEFINED_DYNAMIC_OR_STATIC "SHARED")
ELSE()
    SET(OPENTHREADS_USER_DEFINED_DYNAMIC_OR_STATIC "STATIC")
    SET(OT_LIBRARY_STATIC 1)
ENDIF()

################################################################################
# Set Config file

SET(OPENTHREADS_CONFIG_HEADER 
"${PROJECT_BINARY_DIR}/include/OpenThreads/Config")
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/common/Config.in"
               "${OPENTHREADS_CONFIG_HEADER}")

SET(OPENTHREADS_VERSION_HEADER 
"${PROJECT_SOURCE_DIR}/include/OpenThreads/Version")
CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/common/Version.in"
               "${OPENTHREADS_VERSION_HEADER}")


################################################################################
# Set Version Info resource file

IF(MSVC)
    SET(OPENTHREADS_VERSIONINFO_RC 
"${PROJECT_BINARY_DIR}/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc")
    
CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/PlatformSpecifics/Windows/OpenThreadsVersionInfo.rc.in"
                   "${OPENTHREADS_VERSIONINFO_RC}")
ENDIF()


# INSTALL_FILES(/include/OpenThreads/ FILES "${OPENTHREADS_CONFIG_HEADER}")

################################################################################

SET(HEADER_PATH ${OpenThreads_SOURCE_DIR}/include/OpenThreads)
SET(OpenThreads_PUBLIC_HEADERS
    ${HEADER_PATH}/Atomic
    ${HEADER_PATH}/Barrier
    ${HEADER_PATH}/Block
    ${HEADER_PATH}/Condition
    ${HEADER_PATH}/Exports
    ${HEADER_PATH}/Mutex  
    ${HEADER_PATH}/ReadWriteMutex  
    ${HEADER_PATH}/ReentrantMutex  
    ${HEADER_PATH}/ScopedLock  
    ${HEADER_PATH}/Thread
    ${HEADER_PATH}/Version
    ${OPENTHREADS_CONFIG_HEADER}
)

IF(NOT ANDROID)
# Use our modified version of FindThreads.cmake which has Sproc hacks.
    FIND_PACKAGE(Threads)
ENDIF()
# Do we have sproc?
IF(CMAKE_SYSTEM MATCHES IRIX)
    IF(CMAKE_USE_SPROC_INIT)
        # In this case, only Sproc exists, so no option.
        SET(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS 1)
    ELSE()
        IF(CMAKE_HAVE_SPROC_H)
            OPTION(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS "Set to ON to 
build OpenThreads against sproc instead of pthreads" OFF)
        ENDIF()
    ENDIF()
ENDIF(CMAKE_SYSTEM MATCHES IRIX)

# Add support for using Qt threads
IF(QT4_FOUND)
    OPTION(BUILD_OPENTHREADS_WITH_QT "Build OpenThreads with Qt threading 
support." OFF)
ENDIF()

# Maybe we should be using the FindThreads.cmake module?
IF(ANDROID)
    SUBDIRS(pthreads)
ELSEIF(QT4_FOUND AND BUILD_OPENTHREADS_WITH_QT)
    SUBDIRS(qt)
ELSEIF(WIN32)
    # So I think Cygwin wants to use pthreads
    IF(CYGWIN)
        SUBDIRS(pthreads)
    ELSE()
        # Everybody else including Msys should probably go here
        SUBDIRS(win32) 
        # examples)
    ENDIF()
ELSE()
    IF(UNIX)
        IF(OPENTHREADS_USE_SPROC_INSTEAD_OF_PTHREADS)
            SUBDIRS(sproc)
        ELSE()
            SUBDIRS(pthreads)
        ENDIF()
    ELSE()
        MESSAGE("Sorry, OpenThreads may not support your platform")
    ENDIF()
ENDIF()

# Make sure everyone can find Config
INCLUDE_DIRECTORIES(${PROJECT_BINARY_DIR}/include)

# Generate pkg-config configuration file

CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/packaging/pkgconfig/openthreads.pc.in
        ${PROJECT_BINARY_DIR}/packaging/pkgconfig/openthreads.pc
    @ONLY
    )

INSTALL(FILES ${PROJECT_BINARY_DIR}/packaging/pkgconfig/openthreads.pc 
DESTINATION lib${LIB_POSTFIX}/pkgconfig  COMPONENT libopenthreads-dev)

Attachment: OsgMacroUtils.cmake
Description: Binary data

_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to