Aloush154 / bullet

Automatically exported from code.google.com/p/bullet
Other
0 stars 0 forks source link

Revisions to CMakeLists.txt #672

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Please change the following line (240) in CMakeLists.txt to:

SET (LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib CACHE PATH "Single output 
directory for building all libraries.")

instead of using CMAKE_BINARY_DIR

The output path shouldn't depend on the "build" path. This makes it jive better 
with CMake's FindBullet.cmake file as well.

Also, please add somewhere near the top (say line 20):

if(MSVC)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
endif()

Original issue reported on code.google.com by alan.wit...@gmail.com on 17 Nov 2012 at 11:44

GoogleCodeExporter commented 8 years ago
There is nobody updating the cmakelists files.

Do you mind creating a patch?

Original comment by erwin.coumans on 24 Nov 2012 at 11:10

GoogleCodeExporter commented 8 years ago
Certainly

Original comment by alan.wit...@gmail.com on 24 Nov 2012 at 11:23

GoogleCodeExporter commented 8 years ago
Patch:

Original comment by alan.wit...@gmail.com on 24 Nov 2012 at 11:23

Attachments:

GoogleCodeExporter commented 8 years ago
The patch breaks the default builds in case you have several configurations 
using the same source tree.

For example 
c:\dev\bullet\win32_double
c:\dev\bullet\win64_double
c:\dev\bullet\win32_single
c:\dev\bullet\win64_single
would all overwrite the same library location in the source tree.

You can override the LIBRARY_OUTPUT_PATH using cmake-gui to the source tree if 
that is what you want.

Also your patch will add the glut include folder to each project, that is not 
desired.

So it looks like you  can already do what you want using the current CMake 
support (aside from the /MP option)

Thanks
Erwin

Original comment by erwin.coumans on 25 Nov 2012 at 5:04

GoogleCodeExporter commented 8 years ago
INCLUDE_DIRECTORIES(${GLUT_INCLUDE_DIR}) needs to be used somewhere, otherwise 
it'll never find glut.h on Windows (unless of course you piggy back it onto 
some other include_dir).  So I guess you could put it in Demos/CMakeList.txt, 
since every demo seems to include "GlutStuff.h"

Original comment by alan.wit...@gmail.com on 25 Nov 2012 at 5:51

Attachments:

GoogleCodeExporter commented 8 years ago
Glut is included in Bullet/Glut and the Windows version uses that. 

Is that not working for you?

Original comment by erwin.coumans on 25 Nov 2012 at 6:05

GoogleCodeExporter commented 8 years ago
Ah, i see what happened. In cmake i saw the following messages:

WARNING: you are using the obsolete 'GLU' package, please use 'OpenGL' instead
Could NOT find GLUT (missing:  GLUT_glut_LIBRARY GLUT_INCLUDE_DIR) 
Win32 using Glut/glut32.lib
WARNING: you are using the obsolete 'GLU' package, please use 'OpenGL' instead
Could NOT find GLUT (missing:  GLUT_INCLUDE_DIR) 

I then went on a mission to fix those errors, but didn't realize it was already 
working.
I guess the easiest way to fix it is to make your own version of FindGLUT.cmake 
that overrides cmake's built-in one, since the glut structure is different from 
what they expect. At this point it probably doesn't matter too much.

Original comment by alan.wit...@gmail.com on 25 Nov 2012 at 6:29

GoogleCodeExporter commented 8 years ago
I had a look at CMake's FindGlut.cmake and it is a mess.

That is why I switched to using premake long ago. Premake is better than cmake 
in almost every perspective. I just keep cmake there because some people use 
it, but I try to avoid spending time on it whenever possible.

I'll write a better replacement for Glut search under windows, without the 
warnings/errors.

Original comment by erwin.coumans on 25 Nov 2012 at 6:56

GoogleCodeExporter commented 8 years ago
we just use our own Glut version, not the one in FindGlut mess

Original comment by erwin.coumans on 17 Nov 2013 at 8:02