CMake build system for Cthugha *looking for testers*

Discussion area about developing or extending OGRE, adding plugins for it or building applications on it. No newbie questions please, use the Help forum for that.
Locked
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by CABAListic »

I would recommend to raise this with the CMake guys, as it does sound like an issue which needs to be addressed in the generator. I can't help any more, though, sorry :)
User avatar
masterfalcon
OGRE Team Member
OGRE Team Member
Posts: 4270
Joined: Sun Feb 25, 2007 4:56 am
Location: Bloomington, MN
x 126
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by masterfalcon »

CABAListic wrote:I would recommend to raise this with the CMake guys, as it does sound like an issue which needs to be addressed in the generator. I can't help any more, though, sorry :)
That's cool. Thanks for lending your thoughts and experience though. There is now a bug in the CMake database, ID 0009117.
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by KungFooMasta »

I just grabbed Ogre from SVN and read through Sinbad's txt file on using CMake, and the instructions are really straightforward, however I'm getting some errors in the CMake GUI app:

Code: Select all

CMake Error at CMakeLists.txt:16 (include):
  include could not find load file:

    PrecompiledHeader


CMake Error at CMakeLists.txt:544 (use_precompiled_header):
  Unknown CMake command "use_precompiled_header".
These variables or functions are used in CMakeLists.txt, from my directory:

Code: Select all

G:\VC9_BuiltFromSource\ogre\OgreMain\CMakeLists.txt
I've searched the forums for these keywords and didn't find any hits.

In the GUI, my

"Where is the source code?" answer is G:/VC9_BuiltFromSource/ogre/OgreMain
"Where to build the binaries?" answer is G:/VC9_BuiltFromSource/ogre/OgreMain/build

I've tried commenting out the use of these variables/functions and other errors pop up. I'm betting I'm missing something fundamental. :(

Here is the CMakeLists.txt if its useful:

Code: Select all

#-------------------------------------------------------------------
# This file is part of the CMake build system for OGRE
#     (Object-oriented Graphics Rendering Engine)
# For the latest info, see http://www.ogre3d.org/
#
# The contents of this file are placed in the public domain. Feel
# free to make use of it in any way you like.
#-------------------------------------------------------------------

############################################################
# OgreMain core library
############################################################

PROJECT(OgreMain)

include(PrecompiledHeader)


# define header and source files for the library
set (HEADER_FILES
  include/asm_math.h
  include/Ogre.h
  include/OgreAlignedAllocator.h
  include/OgreAnimable.h
  include/OgreAnimation.h
  include/OgreAnimationState.h
  include/OgreAnimationTrack.h
  include/OgreAny.h
  include/OgreArchive.h
  include/OgreArchiveFactory.h
  include/OgreArchiveManager.h
  include/OgreAtomicWrappers.h
  include/OgreAutoParamDataSource.h
  include/OgreAxisAlignedBox.h
  include/OgreBillboard.h
  include/OgreBillboardChain.h
  include/OgreBillboardParticleRenderer.h
  include/OgreBillboardSet.h
  include/OgreBitwise.h
  include/OgreBlendMode.h
  include/OgreBone.h
  include/OgreBorderPanelOverlayElement.h
  include/OgreCamera.h
  include/OgreCodec.h
  include/OgreColourValue.h
  include/OgreCommon.h
  include/OgreCompiler2Pass.h
  include/OgreCompositionPass.h
  include/OgreCompositionTargetPass.h
  include/OgreCompositionTechnique.h
  include/OgreCompositor.h
  include/OgreCompositorChain.h
  include/OgreCompositorInstance.h
  include/OgreCompositorManager.h
  include/OgreCompositorScriptCompiler.h
  include/OgreCompositorScriptCompiler2.h
  include/OgreCompositorSerializer.h
  include/OgreConfigDialog.h
  include/OgreConfigFile.h
  include/OgreConfigOptionMap.h
  include/OgreController.h
  include/OgreControllerManager.h
  include/OgreConvexBody.h
  include/OgreDataStream.h
  include/OgreDDSCodec.h
  include/OgreDefaultHardwareBufferManager.h
  include/OgreDistanceLodStrategy.h
  include/OgreDynLib.h
  include/OgreDynLibManager.h
  include/OgreEdgeListBuilder.h
  include/OgreEntity.h
  include/OgreErrorDialog.h
  include/OgreException.h
  include/OgreExternalTextureSource.h
  include/OgreExternalTextureSourceManager.h
  include/OgreFactoryObj.h
  include/OgreFileSystem.h
  include/OgreFont.h
  include/OgreFontManager.h
  include/OgreFrameListener.h
  include/OgreFreeImageCodec.h
  include/OgreFrustum.h
  include/OgreGpuProgram.h
  include/OgreGpuProgramManager.h
  include/OgreGpuProgramParams.h
  include/OgreGpuProgramUsage.h
  include/OgreHardwareBuffer.h
  include/OgreHardwareBufferManager.h
  include/OgreHardwareIndexBuffer.h
  include/OgreHardwareOcclusionQuery.h
  include/OgreHardwarePixelBuffer.h
  include/OgreHardwareVertexBuffer.h
  include/OgreHighLevelGpuProgram.h
  include/OgreHighLevelGpuProgramManager.h
  include/OgreImage.h
  include/OgreImageCodec.h
  include/OgreInstancedGeometry.h
  include/OgreIteratorRange.h
  include/OgreIteratorWrapper.h
  include/OgreIteratorWrappers.h
  include/OgreKeyFrame.h
  include/OgreLight.h
  include/OgreLodListener.h
  include/OgreLodStrategy.h
  include/OgreLodStrategyManager.h
  include/OgreLog.h
  include/OgreLogManager.h
  include/OgreManualObject.h
  include/OgreMaterial.h
  include/OgreMaterialManager.h
  include/OgreMaterialSerializer.h
  include/OgreMath.h
  include/OgreMatrix3.h
  include/OgreMatrix4.h
  include/OgreMemoryAllocatedObject.h
  include/OgreMemoryAllocatorConfig.h
  include/OgreMemoryNedAlloc.h
  include/OgreMemoryStdAlloc.h
  include/OgreMemorySTLAllocator.h
  include/OgreMemoryTracker.h
  include/OgreMesh.h
  include/OgreMeshFileFormat.h
  include/OgreMeshManager.h
  include/OgreMeshSerializer.h
  include/OgreMeshSerializerImpl.h
  include/OgreMovableObject.h
  include/OgreMovablePlane.h
  include/OgreNode.h
  include/OgreNumerics.h
  include/OgreOptimisedUtil.h
  include/OgreOverlay.h
  include/OgreOverlayContainer.h
  include/OgreOverlayElement.h
  include/OgreOverlayElementCommands.h
  include/OgreOverlayElementFactory.h
  include/OgreOverlayManager.h
  include/OgrePanelOverlayElement.h
  include/OgreParticle.h
  include/OgreParticleAffector.h
  include/OgreParticleAffectorFactory.h
  include/OgreParticleEmitter.h
  include/OgreParticleEmitterCommands.h
  include/OgreParticleEmitterFactory.h
  include/OgreParticleIterator.h
  include/OgreParticleScriptCompiler.h
  include/OgreParticleSystem.h
  include/OgreParticleSystemManager.h
  include/OgreParticleSystemRenderer.h
  include/OgrePass.h
  include/OgrePatchMesh.h
  include/OgrePatchSurface.h
  include/OgrePixelCountLodStrategy.h
  include/OgrePixelFormat.h
  include/OgrePlane.h
  include/OgrePlaneBoundedVolume.h
  include/OgrePlatform.h
  include/OgrePlatformInformation.h
  include/OgrePlugin.h
  include/OgrePolygon.h
  include/OgrePose.h
  include/OgrePredefinedControllers.h
  include/OgrePrefabFactory.h
  include/OgrePrerequisites.h
  include/OgreProfiler.h
  include/OgreProgressiveMesh.h
  include/OgreQuaternion.h
  include/OgreRadixSort.h
  include/OgreRay.h
  include/OgreRectangle.h
  include/OgreRectangle2D.h
  include/OgreRenderable.h
  include/OgreRenderOperation.h
  include/OgreRenderQueue.h
  include/OgreRenderQueueInvocation.h
  include/OgreRenderQueueListener.h
  include/OgreRenderQueueSortingGrouping.h
  include/OgreRenderSystem.h
  include/OgreRenderSystemCapabilities.h
  include/OgreRenderSystemCapabilitiesManager.h
  include/OgreRenderSystemCapabilitiesSerializer.h
  include/OgreRenderTarget.h
  include/OgreRenderTargetListener.h
  include/OgreRenderTexture.h
  include/OgreRenderToVertexBuffer.h
  include/OgreRenderWindow.h
  include/OgreResource.h
  include/OgreResourceBackgroundQueue.h
  include/OgreResourceGroupManager.h
  include/OgreResourceManager.h
  include/OgreRibbonTrail.h
  include/OgreRoot.h
  include/OgreRotationalSpline.h
  include/OgreSceneManager.h
  include/OgreSceneManagerEnumerator.h
  include/OgreSceneNode.h
  include/OgreSceneQuery.h
  include/OgreScriptCompiler.h
  include/OgreScriptLexer.h
  include/OgreScriptLoader.h
  include/OgreScriptParser.h
  include/OgreScriptTranslator.h
  include/OgreSearchOps.h
  include/OgreSerializer.h
  include/OgreShadowCameraSetup.h
  include/OgreShadowCameraSetupFocused.h
  include/OgreShadowCameraSetupLiSPSM.h
  include/OgreShadowCameraSetupPlaneOptimal.h
  include/OgreShadowCameraSetupPSSM.h
  include/OgreShadowCaster.h
  include/OgreShadowTextureManager.h
  include/OgreShadowVolumeExtrudeProgram.h
  include/OgreSharedPtr.h
  include/OgreSimpleRenderable.h
  include/OgreSimpleSpline.h
  include/OgreSingleton.h
  include/OgreSkeleton.h
  include/OgreSkeletonFileFormat.h
  include/OgreSkeletonInstance.h
  include/OgreSkeletonManager.h
  include/OgreSkeletonSerializer.h
  include/OgreSphere.h
  include/OgreSpotShadowFadePng.h
  include/OgreStableHeaders.h
  include/OgreStaticFaceGroup.h
  include/OgreStaticGeometry.h
  include/OgreStdHeaders.h
  include/OgreStreamSerialiser.h
  include/OgreString.h
  include/OgreStringConverter.h
  include/OgreStringInterface.h
  include/OgreStringVector.h
  include/OgreSubEntity.h
  include/OgreSubMesh.h
  include/OgreTagPoint.h
  include/OgreTangentSpaceCalc.h
  include/OgreTechnique.h
  include/OgreTextAreaOverlayElement.h
  include/OgreTexture.h
  include/OgreTextureManager.h
  include/OgreTextureUnitState.h
  include/OgreTimer.h
  include/OgreUnifiedHighLevelGpuProgram.h
  include/OgreUserDefinedObject.h
  include/OgreUTFString.h
  include/OgreVector2.h
  include/OgreVector3.h
  include/OgreVector4.h
  include/OgreVertexBoneAssignment.h
  include/OgreVertexIndexData.h
  include/OgreViewport.h
  include/OgreWindowEventUtilities.h
  include/OgreWireBoundingBox.h
  include/OgreWorkQueue.h
  include/OgreZip.h
)

set (SOURCE_FILES
  src/OgreAlignedAllocator.cpp
  src/OgreAnimable.cpp
  src/OgreAnimation.cpp
  src/OgreAnimationState.cpp
  src/OgreAnimationTrack.cpp
  src/OgreArchiveManager.cpp
  src/OgreAutoParamDataSource.cpp
  src/OgreAxisAlignedBox.cpp
  src/OgreBillboard.cpp
  src/OgreBillboardChain.cpp
  src/OgreBillboardParticleRenderer.cpp
  src/OgreBillboardSet.cpp
  src/OgreBone.cpp
  src/OgreBorderPanelOverlayElement.cpp
  src/OgreCamera.cpp
  src/OgreCodec.cpp
  src/OgreColourValue.cpp
  src/OgreCommon.cpp
  src/OgreCompiler2Pass.cpp
  src/OgreCompositionPass.cpp
  src/OgreCompositionTargetPass.cpp
  src/OgreCompositionTechnique.cpp
  src/OgreCompositor.cpp
  src/OgreCompositorChain.cpp
  src/OgreCompositorInstance.cpp
  src/OgreCompositorManager.cpp
  src/OgreCompositorScriptCompiler.cpp
  src/OgreCompositorSerializer.cpp
  src/OgreConfigFile.cpp
  src/OgreControllerManager.cpp
  src/OgreConvexBody.cpp
  src/OgreDataStream.cpp
  src/OgreDDSCodec.cpp
  src/OgreDefaultHardwareBufferManager.cpp
  src/OgreDefaultSceneQueries.cpp
  src/OgreDistanceLodStrategy.cpp
  src/OgreDynLib.cpp
  src/OgreDynLibManager.cpp
  src/OgreEdgeListBuilder.cpp
  src/OgreEntity.cpp
  src/OgreException.cpp
  src/OgreExternalTextureSource.cpp
  src/OgreExternalTextureSourceManager.cpp
  src/OgreFileSystem.cpp
  src/OgreFont.cpp
  src/OgreFontManager.cpp
  src/OgreFreeImageCodec.cpp
  src/OgreFrustum.cpp
  src/OgreGpuProgram.cpp
  src/OgreGpuProgramManager.cpp
  src/OgreGpuProgramParams.cpp
  src/OgreGpuProgramUsage.cpp
  src/OgreHardwareBufferManager.cpp
  src/OgreHardwareIndexBuffer.cpp
  src/OgreHardwareOcclusionQuery.cpp
  src/OgreHardwarePixelBuffer.cpp
  src/OgreHardwareVertexBuffer.cpp
  src/OgreHighLevelGpuProgram.cpp
  src/OgreHighLevelGpuProgramManager.cpp
  src/OgreImage.cpp
  src/OgreImageResampler.h
  src/OgreInstancedGeometry.cpp
  src/OgreKeyFrame.cpp
  src/OgreLight.cpp
  src/OgreLodStrategy.cpp
  src/OgreLodStrategyManager.cpp
  src/OgreLog.cpp
  src/OgreLogManager.cpp
  src/ogremain.map
  src/OgreManualObject.cpp
  src/OgreMaterial.cpp
  src/OgreMaterialManager.cpp
  src/OgreMaterialSerializer.cpp
  src/OgreMath.cpp
  src/OgreMatrix3.cpp
  src/OgreMatrix4.cpp
  src/OgreMemoryAllocatedObject.cpp
  src/OgreMemoryNedAlloc.cpp
  src/OgreMemoryTracker.cpp
  src/OgreMesh.cpp
  src/OgreMeshManager.cpp
  src/OgreMeshSerializer.cpp
  src/OgreMeshSerializerImpl.cpp
  src/OgreMovableObject.cpp
  src/OgreMovablePlane.cpp
  src/OgreNode.cpp
  src/OgreNumerics.cpp
  src/OgreOptimisedUtil.cpp
  src/OgreOptimisedUtilGeneral.cpp
  src/OgreOptimisedUtilSSE.cpp
  src/OgreOverlay.cpp
  src/OgreOverlayContainer.cpp
  src/OgreOverlayElement.cpp
  src/OgreOverlayElementCommands.cpp
  src/OgreOverlayManager.cpp
  src/OgrePanelOverlayElement.cpp
  src/OgreParticle.cpp
  src/OgreParticleEmitter.cpp
  src/OgreParticleEmitterCommands.cpp
  src/OgreParticleIterator.cpp
  src/OgreParticleSystem.cpp
  src/OgreParticleSystemManager.cpp
  src/OgrePass.cpp
  src/OgrePatchMesh.cpp
  src/OgrePatchSurface.cpp
  src/OgrePixelCountLodStrategy.cpp
  src/OgrePixelConversions.h
  src/OgrePixelFormat.cpp
  src/OgrePlane.cpp
  src/OgrePlatformInformation.cpp
  src/OgrePolygon.cpp
  src/OgrePose.cpp
  src/OgrePrecompiledHeaders.cpp
  src/OgrePredefinedControllers.cpp
  src/OgrePrefabFactory.cpp
  src/OgreProfiler.cpp
  src/OgreProgressiveMesh.cpp
  src/OgreQuaternion.cpp
  src/OgreRectangle2D.cpp
  src/OgreRenderQueue.cpp
  src/OgreRenderQueueInvocation.cpp
  src/OgreRenderQueueSortingGrouping.cpp
  src/OgreRenderSystem.cpp
  src/OgreRenderSystemCapabilities.cpp
  src/OgreRenderSystemCapabilitiesManager.cpp
  src/OgreRenderSystemCapabilitiesSerializer.cpp
  src/OgreRenderTarget.cpp
  src/OgreRenderTexture.cpp
  src/OgreRenderToVertexBuffer.cpp
  src/OgreRenderWindow.cpp
  src/OgreResource.cpp
  src/OgreResourceBackgroundQueue.cpp
  src/OgreResourceGroupManager.cpp
  src/OgreResourceManager.cpp
  src/OgreRibbonTrail.cpp
  src/OgreRoot.cpp
  src/OgreRotationSpline.cpp
  src/OgreSceneManager.cpp
  src/OgreSceneManagerEnumerator.cpp
  src/OgreSceneNode.cpp
  src/OgreSceneQuery.cpp
  src/OgreScriptCompiler.cpp
  src/OgreScriptLexer.cpp
  src/OgreScriptParser.cpp
  src/OgreScriptTranslator.cpp
  src/OgreSerializer.cpp
  src/OgreShadowCameraSetup.cpp
  src/OgreShadowCameraSetupFocused.cpp
  src/OgreShadowCameraSetupLiSPSM.cpp
  src/OgreShadowCameraSetupPlaneOptimal.cpp
  src/OgreShadowCameraSetupPSSM.cpp
  src/OgreShadowCaster.cpp
  src/OgreShadowTextureManager.cpp
  src/OgreShadowVolumeExtrudeProgram.cpp
  src/OgreSIMDHelper.h
  src/OgreSimpleRenderable.cpp
  src/OgreSimpleSpline.cpp
  src/OgreSkeleton.cpp
  src/OgreSkeletonInstance.cpp
  src/OgreSkeletonManager.cpp
  src/OgreSkeletonSerializer.cpp
  src/OgreStaticGeometry.cpp
  src/OgreStreamSerialiser.cpp
  src/OgreString.cpp
  src/OgreStringConverter.cpp
  src/OgreStringInterface.cpp
  src/OgreSubEntity.cpp
  src/OgreSubMesh.cpp
  src/OgreTagPoint.cpp
  src/OgreTangentSpaceCalc.cpp
  src/OgreTechnique.cpp
  src/OgreTextAreaOverlayElement.cpp
  src/OgreTexture.cpp
  src/OgreTextureManager.cpp
  src/OgreTextureUnitState.cpp
  src/OgreUnifiedHighLevelGpuProgram.cpp
  src/OgreUserDefinedObject.cpp
  src/OgreVector2.cpp
  src/OgreVector3.cpp
  src/OgreVector4.cpp
  src/OgreVertexIndexData.cpp
  src/OgreViewport.cpp
  src/OgreWindowEventUtilities.cpp
  src/OgreWireBoundingBox.cpp
  src/OgreWorkQueue.cpp
  src/OgreZip.cpp
)

# Add platform specific files
if (WIN32)
  include_directories("include/WIN32")
  set(PLATFORM_HEADER_FILES
    include/WIN32/OgreConfigDialogImp.h
    include/WIN32/OgreErrorDialogImp.h
    include/WIN32/OgreTimerImp.h
  )
  set(PLATFORM_SOURCE_FILES
    src/WIN32/resource.h
    src/WIN32/OgreConfigDialog.cpp
    src/WIN32/OgreErrorDialog.cpp
    src/WIN32/OgreTimer.cpp
    src/WIN32/OgreWin32Resources.rc
    src/WIN32/winres.h
  )  
  set(RESOURCE_FILES
    src/WIN32/resource.h
    src/WIN32/OgreWin32Resources.rc
    src/WIN32/winres.h
  )
  source_group(Resources FILES ${RESOURCE_FILES})
  set(PLATFORM_HEADER_INSTALL "win32")

elseif (APPLE)
  include_directories("include/OSX")
  include_directories("${CMAKE_SOURCE_DIR}/Mac/Ogre/include")
  set(PLATFORM_HEADER_FILES
    include/OSX/OgreConfigDialogImp.h
    include/OSX/OgreErrorDialogImp.h
    include/OSX/OgreTimerImp.h
    # think about relocating these
    ${CMAKE_SOURCE_DIR}/Mac/Ogre/include/macBundlePath.h
    ${CMAKE_SOURCE_DIR}/Mac/Ogre/include/macPlugins.h
    ${CMAKE_SOURCE_DIR}/Mac/Ogre/include/OgreOSXCocoaView.h
  )
  set(PLATFORM_SOURCE_FILES
    src/OSX/OgreConfigDialog.cpp
    src/OSX/OgreErrorDialog.cpp
    src/OSX/OgreTimer.cpp
    src/OgreSearchOps.cpp
    # think about relocating these
    ${CMAKE_SOURCE_DIR}/Mac/Ogre/src/macBundlePath.cpp
    ${CMAKE_SOURCE_DIR}/Mac/Ogre/src/macPlugins.cpp
    ${CMAKE_SOURCE_DIR}/Mac/Ogre/src/OgreOSXCocoaView.mm
  )
  set(PLATFORM_LIBS ${Carbon_LIBRARY_FWK} ${Cocoa_LIBRARY_FWK})
  set(PLATFORM_HEADER_INSTALL "OSX")
elseif (UNIX)
  include_directories(include/GLX ${X11_INCLUDE_DIR})
  set(PLATFORM_HEADER_FILES
    include/GLX/OgreConfigDialogImp.h
    include/GLX/OgreErrorDialogImp.h
    include/GLX/OgreTimerImp.h
  )
  set(PLATFORM_SOURCE_FILES
    src/GLX/GLX_backdrop.h
    src/GLX/OgreConfigDialog.cpp
    src/GLX/OgreErrorDialog.cpp
    src/GLX/OgreTimer.cpp
    src/OgreSearchOps.cpp
  )
  set(PLATFORM_LIBS ${X11_LIBRARIES} ${X11_Xt_LIB} ${XAW_LIBRARY} pthread)
  set(PLATFORM_HEADER_INSTALL "GLX")

endif(WIN32)


# Add needed definitions and nedmalloc include dir
add_definitions(-DOGRE_NONCLIENT_BUILD -DFREEIMAGE_LIB -D_MT -D_USRDLL)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src/nedmalloc)


# setup OgreMain target
add_library(OgreMain ${OGRE_LIB_TYPE} ${PREC_HEADER} ${HEADER_FILES} ${SOURCE_FILES} ${PLATFORM_HEADER_FILES} 

${PLATFORM_SOURCE_FILES})
set_target_properties(OgreMain PROPERTIES VERSION ${OGRE_VERSION} SOVERSION ${OGRE_VERSION_MAJOR})
if (APPLE)
  set_target_properties(OgreMain PROPERTIES	FRAMEWORK TRUE)
  set_target_properties(OgreMain PROPERTIES PUBLIC_HEADER "${HEADER_FILES} ${PLATFORM_HEADER_FILES}" )
  # Framework is called 'Ogre'
  set_target_properties(OgreMain PROPERTIES	OUTPUT_NAME Ogre)
  # Set the INSTALL_PATH so that Frameworks can be local
  set_target_properties(OgreMain
     PROPERTIES BUILD_WITH_INSTALL_RPATH 1
     INSTALL_NAME_DIR "@executable_path/../Frameworks"
  )
endif()
target_link_libraries(OgreMain
  ${ZLIB_LIBRARIES}
  ${ZZip_LIBRARIES}
  ${FreeImage_LIBRARIES}
  ${FREETYPE_LIBRARIES}
  ${PLATFORM_LIBS}
)
if (OGRE_CONFIG_THREADS)
  target_link_libraries(OgreMain ${Boost_LIBRARIES})
endif ()
# specify a precompiled header to use
use_precompiled_header(OgreMain 
  "${CMAKE_CURRENT_SOURCE_DIR}/include/OgreStableHeaders.h"
  "${CMAKE_CURRENT_SOURCE_DIR}/src/OgrePrecompiledHeaders.cpp"
)

# install OgreMain
ogre_config_lib(OgreMain)
install(FILES ${HEADER_FILES}
  DESTINATION include/OGRE
)
install(FILES ${PLATFORM_HEADER_FILES}
  DESTINATION include/OGRE/${PLATFORM_HEADER_INSTALL}
)
Creator of QuickGUI!
dermont
Bugbear
Posts: 812
Joined: Thu Dec 09, 2004 2:51 am
x 42

Re: CMake build system for Cthugha *looking for testers*

Post by dermont »

I think your source path from the GUI should be:
G:/VC9_BuiltFromSource/ogre
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by KungFooMasta »

When using the path you suggested, the Configure seems to run without errors. A lot of variables come up, a few paths but mostly options to include certain build targets like plugins, render systems, etc. However the "Generate" button is not enabled. I'm assuming the Generate button is what will create the .sln/.vcproj's.

Output from Configure:

Code: Select all

Configuring OGRE 1.7.0
Looking for ZLIB...
Found ZLIB: optimized;G:/VC9_BuiltFromSource/ogre/Dependencies/lib/Release/zlib.lib;debug;G:/VC9_BuiltFromSource/ogre/Dependencies/lib/Debug/zlibd.lib
Looking for ZZip...
Found ZZip: optimized;G:/VC9_BuiltFromSource/ogre/Dependencies/lib/Release/zziplib.lib;debug;G:/VC9_BuiltFromSource/ogre/Dependencies/lib/Debug/zziplibd.lib
Looking for FreeImage...
Found FreeImage: optimized;G:/VC9_BuiltFromSource/ogre/Dependencies/lib/Release/freeimage.lib;debug;G:/VC9_BuiltFromSource/ogre/Dependencies/lib/Debug/freeimaged.lib
Looking for FREETYPE...
Found FREETYPE: optimized;G:/VC9_BuiltFromSource/ogre/Dependencies/lib/Release/freetype235.lib;debug;G:/VC9_BuiltFromSource/ogre/Dependencies/lib/Debug/freetype235_d.lib
Looking for DirectX...
DirectX_PREFIX_PATH changed.
Found DirectX: G:/Microsoft DirectX 9.0 SDK (Summer 2004)/Lib/d3d9.lib
DX lib dir: G:/Microsoft DirectX 9.0 SDK (Summer 2004)/Lib
Looking for POCO...
Could not locate POCO
Looking for CEGUI...
Found CEGUI: optimized;G:/VC9_BuiltFromSource/ogre/Dependencies/lib/Release/CEGUIBase.lib;debug;G:/VC9_BuiltFromSource/ogre/Dependencies/lib/Debug/CEGUIBase_d.lib
Looking for OIS...
Found OIS: optimized;G:/VC9_BuiltFromSource/ogre/Dependencies/lib/Release/OIS.lib;debug;G:/VC9_BuiltFromSource/ogre/Dependencies/lib/Debug/OIS_d.lib
Looking for doxygen...
Looking for doxygen... - NOT found
Looking for dot tool...
Looking for dot tool... - NOT found
Looking for CppUnit...
Could not locate CppUnit

-----------------------------------------------------------------------------
-- The following external packages were located on your system.
-- This installation will have the extra features provided by these packages.
+ zlib
+ zziplib
+ freeimage
+ freetype
+ opengl
+ opengles
+ DirectX
+ cg
+ boost
+ boost-thread
+ boost-date_time
+ CEGUI
+ OIS
-----------------------------------------------------------------------------
-- The following OPTIONAL packages could NOT be located on your system.
-- Consider installing them to enable more features from this software.
+ POCO: POCO framework <http://pocoproject.org/>
+ Doxygen: Tool for building API documentation <http://doxygen.org>
+ CppUnit: Library for performing unit tests <http://cppunit.sourceforge.net>
-----------------------------------------------------------------------------

Configuring done
So in summary, I have no vcproj or sln files, so I can't build anything. Not sure why the "Generate" button is disabled, despite the "Configure" working without any red lines or errors that I know of.
Creator of QuickGUI!
dermont
Bugbear
Posts: 812
Joined: Thu Dec 09, 2004 2:51 am
x 42

Re: CMake build system for Cthugha *looking for testers*

Post by dermont »

Try pressing the "Configure" button again, sometimes you have to press it twice, the "Generate" button should then be enabled.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by sinbad »

Yeah, red lines show you what has changed since last time you configured, triggers you to check them, perhaps change them, and confirm by hitting configure again before generating.
User avatar
aerique
Halfling
Posts: 59
Joined: Thu Oct 18, 2007 2:37 pm
Location: The Netherlands
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by aerique »

I don't really have to the time tonight to read this whole thread (I want to continue coding) so ignore this remark if it has already been raised.

In FindOGRE.cmake I had to add "bin/release" to:

Code: Select all

find_library(OGRE_LIBRARY_REL NAMES ${OGRE_LIBRARY_NAMES} HINTS ${OGRE_LIB_SEARCH_PATH} ${OGRE_PKGC_LIBRARY_DIRS} ${OGRE_FRAMEWORK_SEARCH_PATH} PATH_SUFFIXES "" "release" "relwithdebinfo" "minsizerel" "bin/release")
to have CMake find everything it needed.

This was is Windows XP SP3 using MinGW and MSYS (thus: cmake -G "MSYS Makefile") with "OGRE 1.6.1 SDK for Code::Blocks + MinGW C++ Toolbox" installed in a non-default location.

I'm using FindOGRE.cmake, FindPkgMacros.cmake and PreprocessorUtils.cmake in a project of my own (Common Lisp wrappers for Ogre) and I realize the *.cmake files are written for Ogre 1.7 so this probably isn't at all relevant. :wink:
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by jacmoe »

aerique wrote:Common Lisp wrappers for Ogre
Hold on! Wait a minute! CL wrapper for Ogre? :)
Feel free to post anything about your experiences using Common Lisp with Ogre.
I am learning Lisp, and it would be really, really cool to learn Lisp using Ogre. :D


;; Sorry for hi-jacking!
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
dermont
Bugbear
Posts: 812
Joined: Thu Dec 09, 2004 2:51 am
x 42

Re: CMake build system for Cthugha *looking for testers*

Post by dermont »

Can Boost_INCLUDE_DIR(S) be included in the OGRE.pc package file when OGRE_USE_BOOST OR OGRE_CONFIG_THREADS are true to cover cases where the boost headers are supplied via the GUI Boost_INCLUDE_DIR.
User avatar
KungFooMasta
OGRE Contributor
OGRE Contributor
Posts: 2087
Joined: Thu Mar 03, 2005 7:11 am
Location: WA, USA
x 16
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by KungFooMasta »

I just wanted to add that my specific problem was occurring with CMake 2.6-patch 2 (OS is vista, 64 bit). I upgraded to the latest (May, 2.6-patch 4) and the the generate button popped up right after configure, and I'm able to use the vcproj's. :D
Creator of QuickGUI!
Enrico
Gnoblar
Posts: 20
Joined: Thu Jun 07, 2007 12:44 pm

Re: CMake build system for Cthugha *looking for testers*

Post by Enrico »

Hi,

has anybody tried to build Ogre trunk on a 64Bit Linux? I get the following error:
[ 46%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreSearchOps.cpp.o
Linking CXX shared library ../lib/libOgreMain.so
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/libboost_thread-mt.a(thread.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/libboost_thread-mt.a: could not read symbols: Bad value
collect2: ld returned 1 exit status

So I added -fPIC to all compiler flags in ccmake. Unfortunately, no success, I still get:
Linking CXX shared library ../lib/libOgreMain.so
cd /home/enrico/projekte/ogre-trunk/OgreMain && /usr/bin/cmake -E cmake_link_script CMakeFiles/OgreMain.dir/link.txt --verbose=1
/usr/bin/c++ -fPIC -fPIC -O2 -g -shared -Wl,-soname,libOgreMain.so.1 -o ../lib/libOgreMain.so.1.7.0 CMakeFiles/OgreMain.dir/src/OgreAlignedAllocator.cpp.o CMakeFiles/OgreMain.dir/src/OgreAnimable.cpp.o CMakeFiles/OgreMain.dir/src/OgreAnimation.cpp.o CMakeFiles/OgreMain.dir/src/OgreAnimationState.cpp.o CMakeFiles/OgreMain.dir/src/OgreAnimationTrack.cpp.o CMakeFiles/OgreMain.dir/src/OgreArchiveManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreAutoParamDataSource.cpp.o CMakeFiles/OgreMain.dir/src/OgreAxisAlignedBox.cpp.o CMakeFiles/OgreMain.dir/src/OgreBillboard.cpp.o CMakeFiles/OgreMain.dir/src/OgreBillboardChain.cpp.o CMakeFiles/OgreMain.dir/src/OgreBillboardParticleRenderer.cpp.o CMakeFiles/OgreMain.dir/src/OgreBillboardSet.cpp.o CMakeFiles/OgreMain.dir/src/OgreBone.cpp.o CMakeFiles/OgreMain.dir/src/OgreBorderPanelOverlayElement.cpp.o CMakeFiles/OgreMain.dir/src/OgreCamera.cpp.o CMakeFiles/OgreMain.dir/src/OgreCodec.cpp.o CMakeFiles/OgreMain.dir/src/OgreColourValue.cpp.o CMakeFiles/OgreMain.dir/src/OgreCommon.cpp.o CMakeFiles/OgreMain.dir/src/OgreCompiler2Pass.cpp.o CMakeFiles/OgreMain.dir/src/OgreCompositionPass.cpp.o CMakeFiles/OgreMain.dir/src/OgreCompositionTargetPass.cpp.o CMakeFiles/OgreMain.dir/src/OgreCompositionTechnique.cpp.o CMakeFiles/OgreMain.dir/src/OgreCompositor.cpp.o CMakeFiles/OgreMain.dir/src/OgreCompositorChain.cpp.o CMakeFiles/OgreMain.dir/src/OgreCompositorInstance.cpp.o CMakeFiles/OgreMain.dir/src/OgreCompositorManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreCompositorScriptCompiler.cpp.o CMakeFiles/OgreMain.dir/src/OgreCompositorSerializer.cpp.o CMakeFiles/OgreMain.dir/src/OgreConfigFile.cpp.o CMakeFiles/OgreMain.dir/src/OgreControllerManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreConvexBody.cpp.o CMakeFiles/OgreMain.dir/src/OgreDataStream.cpp.o CMakeFiles/OgreMain.dir/src/OgreDDSCodec.cpp.o CMakeFiles/OgreMain.dir/src/OgreDefaultHardwareBufferManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreDefaultSceneQueries.cpp.o CMakeFiles/OgreMain.dir/src/OgreDistanceLodStrategy.cpp.o CMakeFiles/OgreMain.dir/src/OgreDynLib.cpp.o CMakeFiles/OgreMain.dir/src/OgreDynLibManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreEdgeListBuilder.cpp.o CMakeFiles/OgreMain.dir/src/OgreEntity.cpp.o CMakeFiles/OgreMain.dir/src/OgreException.cpp.o CMakeFiles/OgreMain.dir/src/OgreExternalTextureSource.cpp.o CMakeFiles/OgreMain.dir/src/OgreExternalTextureSourceManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreFileSystem.cpp.o CMakeFiles/OgreMain.dir/src/OgreFont.cpp.o CMakeFiles/OgreMain.dir/src/OgreFontManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreFreeImageCodec.cpp.o CMakeFiles/OgreMain.dir/src/OgreFrustum.cpp.o CMakeFiles/OgreMain.dir/src/OgreGpuProgram.cpp.o CMakeFiles/OgreMain.dir/src/OgreGpuProgramManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreGpuProgramParams.cpp.o CMakeFiles/OgreMain.dir/src/OgreGpuProgramUsage.cpp.o CMakeFiles/OgreMain.dir/src/OgreHardwareBufferManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreHardwareIndexBuffer.cpp.o CMakeFiles/OgreMain.dir/src/OgreHardwareOcclusionQuery.cpp.o CMakeFiles/OgreMain.dir/src/OgreHardwarePixelBuffer.cpp.o CMakeFiles/OgreMain.dir/src/OgreHardwareVertexBuffer.cpp.o CMakeFiles/OgreMain.dir/src/OgreHighLevelGpuProgram.cpp.o CMakeFiles/OgreMain.dir/src/OgreHighLevelGpuProgramManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreImage.cpp.o CMakeFiles/OgreMain.dir/src/OgreInstancedGeometry.cpp.o CMakeFiles/OgreMain.dir/src/OgreKeyFrame.cpp.o CMakeFiles/OgreMain.dir/src/OgreLight.cpp.o CMakeFiles/OgreMain.dir/src/OgreLodStrategy.cpp.o CMakeFiles/OgreMain.dir/src/OgreLodStrategyManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreLog.cpp.o CMakeFiles/OgreMain.dir/src/OgreLogManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreManualObject.cpp.o CMakeFiles/OgreMain.dir/src/OgreMaterial.cpp.o CMakeFiles/OgreMain.dir/src/OgreMaterialManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreMaterialSerializer.cpp.o CMakeFiles/OgreMain.dir/src/OgreMath.cpp.o CMakeFiles/OgreMain.dir/src/OgreMatrix3.cpp.o CMakeFiles/OgreMain.dir/src/OgreMatrix4.cpp.o CMakeFiles/OgreMain.dir/src/OgreMemoryAllocatedObject.cpp.o CMakeFiles/OgreMain.dir/src/OgreMemoryNedAlloc.cpp.o CMakeFiles/OgreMain.dir/src/OgreMemoryTracker.cpp.o CMakeFiles/OgreMain.dir/src/OgreMesh.cpp.o CMakeFiles/OgreMain.dir/src/OgreMeshManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreMeshSerializer.cpp.o CMakeFiles/OgreMain.dir/src/OgreMeshSerializerImpl.cpp.o CMakeFiles/OgreMain.dir/src/OgreMovableObject.cpp.o CMakeFiles/OgreMain.dir/src/OgreMovablePlane.cpp.o CMakeFiles/OgreMain.dir/src/OgreNode.cpp.o CMakeFiles/OgreMain.dir/src/OgreNumerics.cpp.o CMakeFiles/OgreMain.dir/src/OgreOptimisedUtil.cpp.o CMakeFiles/OgreMain.dir/src/OgreOptimisedUtilGeneral.cpp.o CMakeFiles/OgreMain.dir/src/OgreOptimisedUtilSSE.cpp.o CMakeFiles/OgreMain.dir/src/OgreOverlay.cpp.o CMakeFiles/OgreMain.dir/src/OgreOverlayContainer.cpp.o CMakeFiles/OgreMain.dir/src/OgreOverlayElement.cpp.o CMakeFiles/OgreMain.dir/src/OgreOverlayElementCommands.cpp.o CMakeFiles/OgreMain.dir/src/OgreOverlayManager.cpp.o CMakeFiles/OgreMain.dir/src/OgrePanelOverlayElement.cpp.o CMakeFiles/OgreMain.dir/src/OgreParticle.cpp.o CMakeFiles/OgreMain.dir/src/OgreParticleEmitter.cpp.o CMakeFiles/OgreMain.dir/src/OgreParticleEmitterCommands.cpp.o CMakeFiles/OgreMain.dir/src/OgreParticleIterator.cpp.o CMakeFiles/OgreMain.dir/src/OgreParticleSystem.cpp.o CMakeFiles/OgreMain.dir/src/OgreParticleSystemManager.cpp.o CMakeFiles/OgreMain.dir/src/OgrePass.cpp.o CMakeFiles/OgreMain.dir/src/OgrePatchMesh.cpp.o CMakeFiles/OgreMain.dir/src/OgrePatchSurface.cpp.o CMakeFiles/OgreMain.dir/src/OgrePixelCountLodStrategy.cpp.o CMakeFiles/OgreMain.dir/src/OgrePixelFormat.cpp.o CMakeFiles/OgreMain.dir/src/OgrePlane.cpp.o CMakeFiles/OgreMain.dir/src/OgrePlatformInformation.cpp.o CMakeFiles/OgreMain.dir/src/OgrePolygon.cpp.o CMakeFiles/OgreMain.dir/src/OgrePose.cpp.o CMakeFiles/OgreMain.dir/src/OgrePrecompiledHeaders.cpp.o CMakeFiles/OgreMain.dir/src/OgrePredefinedControllers.cpp.o CMakeFiles/OgreMain.dir/src/OgrePrefabFactory.cpp.o CMakeFiles/OgreMain.dir/src/OgreProfiler.cpp.o CMakeFiles/OgreMain.dir/src/OgreProgressiveMesh.cpp.o CMakeFiles/OgreMain.dir/src/OgreQuaternion.cpp.o CMakeFiles/OgreMain.dir/src/OgreRectangle2D.cpp.o CMakeFiles/OgreMain.dir/src/OgreRenderQueue.cpp.o CMakeFiles/OgreMain.dir/src/OgreRenderQueueInvocation.cpp.o CMakeFiles/OgreMain.dir/src/OgreRenderQueueSortingGrouping.cpp.o CMakeFiles/OgreMain.dir/src/OgreRenderSystem.cpp.o CMakeFiles/OgreMain.dir/src/OgreRenderSystemCapabilities.cpp.o CMakeFiles/OgreMain.dir/src/OgreRenderSystemCapabilitiesManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreRenderSystemCapabilitiesSerializer.cpp.o CMakeFiles/OgreMain.dir/src/OgreRenderTarget.cpp.o CMakeFiles/OgreMain.dir/src/OgreRenderTexture.cpp.o CMakeFiles/OgreMain.dir/src/OgreRenderToVertexBuffer.cpp.o CMakeFiles/OgreMain.dir/src/OgreRenderWindow.cpp.o CMakeFiles/OgreMain.dir/src/OgreResource.cpp.o CMakeFiles/OgreMain.dir/src/OgreResourceBackgroundQueue.cpp.o CMakeFiles/OgreMain.dir/src/OgreResourceGroupManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreResourceManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreRibbonTrail.cpp.o CMakeFiles/OgreMain.dir/src/OgreRoot.cpp.o CMakeFiles/OgreMain.dir/src/OgreRotationSpline.cpp.o CMakeFiles/OgreMain.dir/src/OgreSceneManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreSceneManagerEnumerator.cpp.o CMakeFiles/OgreMain.dir/src/OgreSceneNode.cpp.o CMakeFiles/OgreMain.dir/src/OgreSceneQuery.cpp.o CMakeFiles/OgreMain.dir/src/OgreScriptCompiler.cpp.o CMakeFiles/OgreMain.dir/src/OgreScriptLexer.cpp.o CMakeFiles/OgreMain.dir/src/OgreScriptParser.cpp.o CMakeFiles/OgreMain.dir/src/OgreScriptTranslator.cpp.o CMakeFiles/OgreMain.dir/src/OgreSerializer.cpp.o CMakeFiles/OgreMain.dir/src/OgreShadowCameraSetup.cpp.oCMakeFiles/OgreMain.dir/src/OgreShadowCameraSetupFocused.cpp.o CMakeFiles/OgreMain.dir/src/OgreShadowCameraSetupLiSPSM.cpp.o CMakeFiles/OgreMain.dir/src/OgreShadowCameraSetupPlaneOptimal.cpp.o CMakeFiles/OgreMain.dir/src/OgreShadowCameraSetupPSSM.cpp.o CMakeFiles/OgreMain.dir/src/OgreShadowCaster.cpp.o CMakeFiles/OgreMain.dir/src/OgreShadowTextureManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreShadowVolumeExtrudeProgram.cpp.o CMakeFiles/OgreMain.dir/src/OgreSimpleRenderable.cpp.o CMakeFiles/OgreMain.dir/src/OgreSimpleSpline.cpp.o CMakeFiles/OgreMain.dir/src/OgreSkeleton.cpp.o CMakeFiles/OgreMain.dir/src/OgreSkeletonInstance.cpp.o CMakeFiles/OgreMain.dir/src/OgreSkeletonManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreSkeletonSerializer.cpp.o CMakeFiles/OgreMain.dir/src/OgreStaticGeometry.cpp.o CMakeFiles/OgreMain.dir/src/OgreStreamSerialiser.cpp.o CMakeFiles/OgreMain.dir/src/OgreString.cpp.o CMakeFiles/OgreMain.dir/src/OgreStringConverter.cpp.o CMakeFiles/OgreMain.dir/src/OgreStringInterface.cpp.o CMakeFiles/OgreMain.dir/src/OgreSubEntity.cpp.o CMakeFiles/OgreMain.dir/src/OgreSubMesh.cpp.o CMakeFiles/OgreMain.dir/src/OgreTagPoint.cpp.o CMakeFiles/OgreMain.dir/src/OgreTangentSpaceCalc.cpp.o CMakeFiles/OgreMain.dir/src/OgreTechnique.cpp.o CMakeFiles/OgreMain.dir/src/OgreTextAreaOverlayElement.cpp.o CMakeFiles/OgreMain.dir/src/OgreTexture.cpp.o CMakeFiles/OgreMain.dir/src/OgreTextureManager.cpp.o CMakeFiles/OgreMain.dir/src/OgreTextureUnitState.cpp.o CMakeFiles/OgreMain.dir/src/OgreUnifiedHighLevelGpuProgram.cpp.o CMakeFiles/OgreMain.dir/src/OgreUserDefinedObject.cpp.o CMakeFiles/OgreMain.dir/src/OgreVector2.cpp.o CMakeFiles/OgreMain.dir/src/OgreVector3.cpp.o CMakeFiles/OgreMain.dir/src/OgreVector4.cpp.o CMakeFiles/OgreMain.dir/src/OgreVertexIndexData.cpp.o CMakeFiles/OgreMain.dir/src/OgreViewport.cpp.o CMakeFiles/OgreMain.dir/src/OgreWindowEventUtilities.cpp.o CMakeFiles/OgreMain.dir/src/OgreWireBoundingBox.cpp.o CMakeFiles/OgreMain.dir/src/OgreWorkQueue.cpp.o CMakeFiles/OgreMain.dir/src/OgreZip.cpp.o CMakeFiles/OgreMain.dir/src/GLX/OgreConfigDialog.cpp.o CMakeFiles/OgreMain.dir/src/GLX/OgreErrorDialog.cpp.o CMakeFiles/OgreMain.dir/src/GLX/OgreTimer.cpp.o CMakeFiles/OgreMain.dir/src/OgreSearchOps.cpp.o -lz -lzzip -lfreeimage -lfreetype -lSM -lICE -lX11 -lXext -lXt -lXaw -lpthread -Wl,-Bstatic -lboost_thread-mt -lboost_date_time-mt -Wl,-Bdynamic
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/libboost_thread-mt.a(thread.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib/libboost_thread-mt.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[2]: *** [lib/libOgreMain.so.1.7.0]
When looking at the verbose output I see that -fPIC was added successfully, e.g.:
[ 46%] Building CXX object OgreMain/CMakeFiles/OgreMain.dir/src/OgreSearchOps.cpp.o
cd /home/enrico/projekte/ogre-trunk/OgreMain && /usr/bin/c++ -DOgreMain_EXPORTS -DBOOST_ALL_NO_LIB -DHAVE_OGRE_BUILDSETTINGS_H -DOGRE_NONCLIENT_BUILD -DFREEIMAGE_LIB -D_MT -D_USRDLL -fPIC -O2 -g -fPIC -I/home/enrico/projekte/ogre-trunk/OgreMain/include -I/home/enrico/projekte/ogre-trunk/include -I/usr/include/freetype2 -I/usr/local/include/CEGUI -I/usr/local/include -I/usr/include/OIS -I/home/enrico/projekte/ogre-trunk/OgreMain/include/GLX -I/home/enrico/projekte/ogre-trunk/OgreMain/src/nedmalloc -msse -pthread -DOGRE_GCC_VISIBILITY -fvisibility=hidden -fPIC -fvisibility-inlines-hidden -o CMakeFiles/OgreMain.dir/src/OgreSearchOps.cpp.o -c /home/enrico/projekte/ogre-trunk/OgreMain/src/OgreSearchOps.cpp

Any ideas?

System: Debian Testing AMD64
I can test tomorrow on a Red Hat 5.3 AMD64 system.


Thanks,
Enrico
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by jacmoe »

I tried the supplied find_ogre cmake script in my own project.
It works on Linux, but fails on Windows.
It gives me this linker directory line:

Code: Select all

optimized\$(OutDir),optimized,D:\ogrehead\sdk\lib\release\OgreMain.lib\$(OutDir),D:\ogrehead\sdk\lib\release\OgreMain.lib,debug\$(OutDir),debug,C:\OgreSDK\lib\OgreMain_d.lib\$(OutDir),C:\OgreSDK\lib\OgreMain_d.lib
How do I fix this? :)
OgreMain_d.lib is not a directory. And what does OgreMain_d do in my release configuration?
Is there anything I've overlooked?
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by CABAListic »

Yeah - The CMake script does *not* give linker directories. Instead, it supplies the libraries themselves with full path, you simply link against them (target_link_libraries). Also, CMake has special directive for library linking, namely the optimized / debug keywords you may spot in that line. CMake automatically picks up the appropriate one for the build type you do, so it is entirely sensible that OgreMain_d is in the line; because it is preceded by 'debug' and will therefore not be used for your release build :)
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by jacmoe »

Alright. It fails in debug, because it cannot find OgreMain.lib - it shouldn't have tried to link to it in the first place..
I will compile in release and report back. :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by jacmoe »

Should I use the ogre_config function in my own project? :)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by jacmoe »

Nope, CABAListic! It does not work. :P

It is not able to find OgreMain.lib - even if it's 'D:\ogrehead\sdk\lib\release\OgreMain.lib' - just like I quoted.
I do not believe that adding 'D:\ogrehead\sdk\lib\release\OgreMain.lib' to my projects Additional Library Directories is a sane thing to do.. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by jacmoe »

Of course!
I am using it wrong - added ${OGRE_LIBRARIES} to my library include directories.. :oops:
Funny how it works on Linux.
I'll just add ${OGRE_LIBRARIES} to TARGET_LINK_LIBRARIES instead. :mrgreen:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by CABAListic »

I told you ;)
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by jacmoe »

Is this the right way to find Ogre and the Terrain component?

Code: Select all

find_package(OGRE COMPONENTS Terrain REQUIRED)
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by CABAListic »

Currently I don't support the COMPONENTS syntax. The FindOgre script simply looks for all components, and you'll get individual results via OGRE_Component_xxx.
(i. e. OGRE_Terrain_FOUND, OGRE_Terrain_INCLUDE_DIRS etc.)
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by jacmoe »

Maybe it's just me, but..
Where does the script assign to OGRE_INCLUDE_DIRS - I see it assigns to OGRE_INCLUDE_DIR at line 188 in the findogre script:

Code: Select all

set(OGRE_INCLUDE_DIR ${OGRE_CONFIG_INCLUDE_DIR} ${OGRE_INCLUDE_DIR})
At line 267 it sets the variable OGRE_LIBRARY_DIRS correctly:

Code: Select all

set(OGRE_LIBRARY_DIRS ${OGRE_LIBRARY_DIR_REL} ${OGRE_LIBRARY_DIR_DBG})
But, and that's the problem - I can't find where it sets OGRE_Terrain_LIBRARIES and OGRE_Terrain_INCLUDE_DIRS?
Look at line 293:

Code: Select all

if (OGRE_Terrain_INCLUDE_DIR AND Ogre_Terrain_LIBRARY)
  set(OGRE_Terrain_FOUND TRUE)
  set(OGRE_Terrain_INCLUDE_DIRS ${OGRE_Terrain_INCLUDE_DIRS})
  set(OGRE_Terrain_LIBRARIES ${OGRE_Terrain_LIBRARIES})
endif ()
Shouldn't it be :

Code: Select all

if (OGRE_Terrain_INCLUDE_DIR AND Ogre_Terrain_LIBRARY)
  set(OGRE_Terrain_FOUND TRUE)
  set(OGRE_Terrain_INCLUDE_DIRS ${OGRE_Terrain_INCLUDE_DIR})
  set(OGRE_Terrain_LIBRARIES ${OGRE_Terrain_LIBRARY})
endif ()
Bear with me. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
CABAListic
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 2903
Joined: Thu Jan 18, 2007 2:48 pm
x 58
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by CABAListic »

Yes, those are typos, seem to affect several of the components, sorry. Anyway, the main Ogre component is using the macro findpkg_finish(OGRE) to set those variables, and the components should also do that, I'll need to change that eventually.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by jacmoe »

Thanks! :)
I'll just use OGRE_${component}_INCLUDE_DIR and OGRE_${component}_LIBRARY_DBG / OGRE_${component}_LIBRARY_REL for now.
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
User avatar
jacmoe
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 20570
Joined: Thu Jan 22, 2004 10:13 am
Location: Denmark
x 179
Contact:

Re: CMake build system for Cthugha *looking for testers*

Post by jacmoe »

I solved it. :)
I added this line to my CMake script:

Code: Select all

SET(CMAKE_DEBUG_POSTFIX "_d")
Then:

Code: Select all

find_package(OGRE 1.7 REQUIRED)
I noticed that it ignores the version - tried asking for OGRE 1.9, and was given OGRE 1.7. :)

And got the right include directories using this:

Code: Select all

include_directories(${OGRE_INCLUDE_DIRS})
include_directories(${OGRE_Terrain_INCLUDE_DIR})
Then, I use this to link it in:

Code: Select all

TARGET_LINK_LIBRARIES(${TARGET} ${OGRE_LIBRARIES} ${OGRE_Terrain_LIBRARY} )
Both debug and release works now. :wink:
/* Less noise. More signal. */
Ogitor Scenebuilder - powered by Ogre, presented by Qt, fueled by Passion.
OgreAddons - the Ogre code suppository.
Locked