Hi Farshid,

Can you post the contents of the "buildnumber.h" max header file?

/* This file is automatically generated by the DailyBuild script. */
/* VERSION_STRING is the build's posting, ie. MXXX, Daily, Midday. */
/* VERSION_INT is the last successful major (MXXX) with the letter prefix (M) dropped. */
#if defined(GAME_FREE_VER)
  #define VERSION_STRING  "C000"
  #define VERSION_INT   0
#elif defined(GAME_VER)
  #define VERSION_STRING  "G000"
  #define VERSION_INT   0
#elif defined(WEBVERSION)
  #define VERSION_STRING  "M000"
  #define VERSION_INT   0
#elif defined (DESIGN_VER)
  #define VERSION_STRING  "B000"
  #define VERSION_INT   0
#else // MAX
#define VERSION_STRING "Rampage with PDBs MAX_R121_64_RL 02-22-2011 21:37 143392"
  #define VERSION_INT   121
#endif

Also,
try building using the solution files in the "VisualStudio" folder.
Maybe there is some project setting that CMake isn't setting properly.

Yes, that helped find out what was amiss. The CMake build setup was missing a define _USRDLL. With this defined (and the SetReference() method uncommented) it builds and runs fine.

The modified file is attached. I added the define before adding the src subdirectory, instead of inside each project individually, so it will get added to all projects. That is also the case in the projects under the VisualStudio folder (I checked), so I assume this is OK.

Perhaps you could add a comment as to why this is required (other than "to fix the linker error" I don't know).

Thanks,

J-S
--
______________________________________________________
Jean-Sebastien Guay    [email protected]
                               http://www.cm-labs.com/
                    http://whitestar02.dyndns-web.com/
cmake_minimum_required(VERSION 2.6)

set( ProjectName OSGExp )
project( ${ProjectName} )

set (CMAKE_BUILD_TYPE Release)

list( APPEND CMAKE_MODULE_PATH "${OSGExp_SOURCE_DIR}/CMakeModules" )

################################################################################
# Platform specific definitions
IF(WIN32)
    IF(MSVC)
        # To enable /MP, parralel build on MSVC
        OPTION(WIN32_USE_MP "Set to OFF to diable /MP." ON)
        MARK_AS_ADVANCED(WIN32_USE_MP)
        IF(WIN32_USE_MP)
            SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
        ENDIF(WIN32_USE_MP)

        # Other MSVC compilation flags
        ADD_DEFINITIONS(-D_SCL_SECURE_NO_WARNINGS)
        ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)

    ENDIF(MSVC)
ENDIF (WIN32)

SET(CMAKE_DEBUG_POSTFIX "d" CACHE STRING "add a postfix, usually d")
SET(CMAKE_RELEASE_POSTFIX "" CACHE STRING "add a postfix, usually empty")
SET(CMAKE_RELWITHDEBINFO_POSTFIX "rd" CACHE STRING "add a postfix, usually rd")
SET(CMAKE_MINSIZEREL_POSTFIX "s" CACHE STRING "add a postfix, usually s")

#------------------------------------
# Find Max SDK headers and libraries
#------------------------------------

find_path(MAXSDK_INCLUDE_DIR "max.h"
    HINTS
        $ENV{MAXSDK}
    PATH_SUFFIXES include
)

# If compiling for 64 bit, look for the 64 bit libraries
# In the default Max 2011 SDK install, the 32 bit libraries are
# in ${MAXSDK}/lib, and 64 bit ones are in ${MAXSDK}/x64/lib
SET(MAXSDK_LIB_PATH_SUFFIX "lib")
IF(CMAKE_SIZEOF_VOID_P MATCHES "8")
    SET(MAXSDK_LIB_PATH_SUFFIX "x64/lib")
    MARK_AS_ADVANCED(LIB_POSTFIX)
ENDIF()

find_path(MAXSDK_LIB_DIR "maxutil.lib"
    HINTS
        $ENV{MAXSDK}
    PATH_SUFFIXES ${MAXSDK_LIB_PATH_SUFFIX}
)

SET(MAXSDK_LIBRARIES
        ${MAXSDK_LIB_DIR}/bmm.lib
        ${MAXSDK_LIB_DIR}/core.lib
        ${MAXSDK_LIB_DIR}/geom.lib
        ${MAXSDK_LIB_DIR}/gfx.lib
        ${MAXSDK_LIB_DIR}/mesh.lib
        ${MAXSDK_LIB_DIR}/maxutil.lib
        ${MAXSDK_LIB_DIR}/maxscrpt.lib
        ${MAXSDK_LIB_DIR}/manipsys.lib
        ${MAXSDK_LIB_DIR}/paramblk2.lib
    )

find_path(MAX_DIR "3dsmax.exe"
    # No hints...
)

add_definitions(-D_USRDLL)

add_subdirectory(src)
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to