Horde3D

Next-Generation Graphics Engine
It is currently 16.04.2024, 05:14

All times are UTC + 1 hour




Post new topic Reply to topic  [ 59 posts ]  Go to page Previous  1, 2, 3, 4

Prefered Build System for Horde3D
Poll ended at 14.05.2008, 20:06
CMake 57%  57%  [ 4 ]
waf 14%  14%  [ 1 ]
Other 29%  29%  [ 2 ]
Total votes : 7
Author Message
PostPosted: 27.05.2008, 18:12 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
So my final root CMakeFiles.txt for CMake 2.4.8 and CMake 2.6 under Windows looks like this:

Code:
cmake_minimum_required(VERSION 2.4)

# Avoid warning under CMake 2.6
IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.4)   
  cmake_policy(SET CMP0003 NEW)
ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.4)

project(Horde3D)

# accumulate list of sources of extension modules
# this can not be done inside the Extensions folder since cmake can only pass variables to subdirectories, never upwards...
set(HORDE3D_EXTENSION_SOURCES)
set(HORDE3D_EXTENSION_INCLUDES)
set(HORDE3D_EXTENSION_INSTALLS)


# terrain extension (check egExtensions.cpp if it's activated)
option(HORDE3D_BUILD_TERRAIN "Build the terrain extension into Horde3D" ON)
if(HORDE3D_BUILD_TERRAIN)
   set(HORDE3D_EXTENSION_SOURCES
      ${HORDE3D_EXTENSION_SOURCES}
      ${Horde3D_SOURCE_DIR}/Extensions/Terrain/Source/terrain.cpp
      ${Horde3D_SOURCE_DIR}/Extensions/Terrain/Source/extension.cpp
      )
   set(HORDE3D_EXTENSION_INSTALLS
      ${HORDE3D_EXTENSION_INSTALLS}
      "installExtension(Horde3DTerrain::getExtensionName, Horde3DTerrain::initExtension, Horde3DTerrain::releaseExtension);\n"
      )
   set(HORDE3D_EXTENSION_INCLUDES
      ${HORDE3D_EXTENSION_INCLUDES}
      "#include \"Extensions/Terrain/Source/extension.h\"\n"
      )
endif(HORDE3D_BUILD_TERRAIN)

IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.4)   
  IF(WIN32)
    SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Horde3D/Binaries
     CACHE STRING "Where binaries and .dll files go" FORCE) 
  ELSE(WIN32)
    SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/Horde3D/Binaries/${CMAKE_SYSTEM_NAME}
       CACHE STRING "Where binaries and .dll files go" FORCE)
  ENDIF(WIN32)
ELSE("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.4)   
  IF(WIN32)
    SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/Horde3D/Binaries
     CACHE STRING "Where executable files go" FORCE) 
   SET(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/Horde3D/Binaries
     CACHE STRING "Where dll files go" FORCE) 
  ELSE(WIN32)
     SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/Horde3D/Binaries/${CMAKE_SYSTEM_NAME}
     CACHE STRING "Where executable files go" FORCE)   
  ENDIF(WIN32)
ENDIF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" GREATER 2.4)

# create egExtensions.cpp
CONFIGURE_FILE(Horde3D/Source/Horde3DEngine/egExtensions_auto_include.h.in ${CMAKE_BINARY_DIR}/egExtensions_auto_include.h)
CONFIGURE_FILE(Horde3D/Source/Horde3DEngine/egExtensions_auto_install.h.in ${CMAKE_BINARY_DIR}/egExtensions_auto_install.h)

add_subdirectory(Horde3D)
add_subdirectory(Extensions)


I think it should work under Linux, too.


Top
 Profile  
Reply with quote  
PostPosted: 27.05.2008, 18:25 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
I've tested your latest file: It works with cmake 2.4 and 2.6. But neither copies the .so files to Binaries/Linux, but the samples work nevertheless. My system installed libHorde3D.so is disabled, so it works using automatic RPATH.


Top
 Profile  
Reply with quote  
PostPosted: 27.05.2008, 18:56 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
While Dll files are considered as "RUNTIME" files by CMake 2.6, I think .so files are not, because of the RPATH settings possibility. I'm not sure, should we place all libraries into the Binaries dir? Personally I would prefer putting all "build" files into the Build directory but this wouldn't allow the samples to run properly because of the Content directory.


Top
 Profile  
Reply with quote  
PostPosted: 27.05.2008, 20:10 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
Either place everything into the Binaries directory or nothing - I'd prefer to have everything contained in the build directory and keeping the source tree clean.

I just thought about passing a define to the samples with the root directory, then we could place the binaries anywhere. CMAKE_SOURCE_DIR would be ideal.


Top
 Profile  
Reply with quote  
PostPosted: 27.05.2008, 20:26 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
CMakeLists.txt:
Code:
CONFIGURE_FILE(Horde3D/Source/config.h.in ${CMAKE_BINARY_DIR}/config.h)


Horde3D/Source/config.h.in:
Code:
#ifndef CONFIG_HEADER
#define CONFIG_HEADER

#define SOURCE_DIR "${CMAKE_SOURCE_DIR}"


#endif

Then SOURCE_DIR is a string constant. Just include "config.h" in every sample and we can construct the content directory. But this also means that every user needs cmake installed and we can't provide workspace files / makefiles for other developers.

How easy / difficult is installing cmake on Windows? Easy enough so that anyone can do it provided we give clear instructions what is needed and how to get it?


Top
 Profile  
Reply with quote  
PostPosted: 28.05.2008, 11:41 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
I finally added the CMake files to the Sourceforge SVN. I changed the egExtensions.cpp a bit to keep the default Visual Studio solution usable. Additionally I removed the precompiled libs and old makefiles and added the GLFW source code instead.

Although I think using CMake is not difficult ( even on Windows :-) ), I talked to Nicolas and we think there should be always a visual studio project for all beginners not familiar with any configuration file based build system. So I think we should take the proposed config.h approach but we should create a default one, that is compatible with the Visual Studio solution. If anyone uses CMake, the file can be overwritten automatically.

Regarding the extensions I would propose switching to a complete dynamic plugin based system. I recently started to configure Horde to export the internal classes. But I think that's something we should add after the release of 1.0.

BTW. We thought about the following roadmap for Horde 1.0

- CMake makefiles (done)
- Bugfix for picking in parallel projection mode
- Bugfix for collision test in terrain extension
- Scissor rectangle support to allow multiple viewports

Unfortunately since we are quite busy at the moment we can't offer any time schedule.


Top
 Profile  
Reply with quote  
PostPosted: 28.05.2008, 13:13 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
That's great!

I think you missed Horde3D/Binaries/Win32/GLFW.dll.

Later, it may be necessary to use cmake to create a real config file on every run to detect system dependent libraries. But for now it should be ok. For beginners it's certainly easier without cmake, we should then document how to modify config.h manually if something does not work. Ideally let the samples output a warning which mentions this as a possible problem.

Extensions:
I've read some of the source code of Ogre3D, maybe just use the techniques from OgrePlatform.h
I think the only real reason for a dynamic plugin system are licensing issues. So we'd distract possible implementers from writing static extensions for 1.0.


Roadmap:
Sounds good.
I'd additionally change pickNode to pickRay as mentioned in another thread. Makes it more versatile and easier for end users of separate collision detection systems. I don't like to duplicate the math in my projects and be forced to have a good linear algebra solution to do the matrix inversion. Especially for small hacks that's way to complicated.

Have you thought about adding some of the language bindings into the svn and release them with 1.0? I'm primarily thinking about my Python bindings here ;) I could send you a clean patch to integrate them into svn.


Top
 Profile  
Reply with quote  
PostPosted: 29.05.2008, 21:24 
Offline
Engine Developer

Joined: 10.09.2006, 15:52
Posts: 1217
Concerning the build system: Great work guys!

Codepoet wrote:
Have you thought about adding some of the language bindings into the svn and release them with 1.0? I'm primarily thinking about my Python bindings here ;) I could send you a clean patch to integrate them into svn.

If the bindings are clean and complete (and not too exotic) I don't see any reason why we shouldn't put them in the releases. Without having had a closer look, I assume that your D bindings satisfy these requirements :)
In the longer term we are also thinking of giving some frequent contributers write access to the svn so it would be easy to keep the bindings up to date.


Top
 Profile  
Reply with quote  
PostPosted: 29.05.2008, 22:31 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
marciano wrote:
If the bindings are clean and complete (and not too exotic) I don't see any reason why we shouldn't put them in the releases. Without having had a closer look, I assume that your D bindings satisfy these requirements :)


Yes my D bindings are ready to go, too. There's only a small change I'm thinking about: Right now all enums are not part of the Horde3D "namespace"...
Developing with Python is even nicer since I can reload classes without reloading my program - automagic code replacement :)

marciano wrote:
In the longer term we are also thinking of giving some frequent contributers write access to the svn so it would be easy to keep the bindings up to date.

great! :mrgreen:


Top
 Profile  
Reply with quote  
PostPosted: 31.05.2008, 17:40 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
The svn cmake does not install the C++ Bindings under Linux.

Add:

Horde3D/Bindings/C++/CMakeLists.txt:
Code:
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
        install(FILES Horde3D.h Horde3DUtils.h
                DESTINATION include/horde3d
                )
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")


Horde3D/Bindings:
Code:
add_subdirectory(C++)


Extensions/Terrain/CMakeLists.txt:
Code:
add_subdirectory(Bindings)
add_subdirectory(Source)
add_subdirectory(Sample)


Top
 Profile  
Reply with quote  
PostPosted: 31.05.2008, 18:22 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
Done. I additionally added the Horde3DTerrain.h in the Extension/Terrain/Bindings/C++/CMakeLists.txt

I have commited it, but wasn't able to test it cause I currently don't have a Linux system available...


Top
 Profile  
Reply with quote  
PostPosted: 31.05.2008, 18:30 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
Small problem:
In Extensions/Terrain/Bindings/C++/CMakeLists.txt we must only install Horde3DTerrain.h, not Horde3D.h / Horde3DUtils.h. Otherwise ok.

Code:
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Windows")

if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
        install(FILES Horde3DTerrain.h
                DESTINATION include/horde3d
                )
endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")

if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")


Top
 Profile  
Reply with quote  
PostPosted: 31.05.2008, 19:02 
Offline
Tool Developer

Joined: 13.11.2007, 11:07
Posts: 1150
Location: Germany
I thought as much. But it was already there before so I didn't removed it. Should be fixed now.


Top
 Profile  
Reply with quote  
PostPosted: 31.05.2008, 19:13 
Offline

Joined: 14.04.2008, 15:06
Posts: 183
Location: Germany
hmm... Now it works.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 59 posts ]  Go to page Previous  1, 2, 3, 4

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 11 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group