Page 1 of 1

Cmake builds mangle library names....

Posted: Thu Dec 13, 2012 10:26 pm
by d3x0r
I realize that there's probably a huge base already using bullet as it is; and they rely on the libraries being built with mangled named (POSTFIXed '_Debug').

Personally, i have just added this in a chain for my main cmake, so it inherits all my install rules... and I install into different target directories, and never have release and debug in the same directory; but adding bullet with add_subdirectory( ../bullet/source bullet ) mangles all of my library names to get _Debug suffixed to them.

You can set these properties on a per-target basis instead of modifying global behaviors.

(I also had no idea where to start this thread)

Re: Cmake builds mangle library names....

Posted: Thu Dec 13, 2012 11:38 pm
by Erwin Coumans
d3x0r wrote:I realize that there's probably a huge base already using bullet as it is; and they rely on the libraries being built with mangled named (POSTFIXed '_Debug').

Personally, i have just added this in a chain for my main cmake, so it inherits all my install rules... and I install into different target directories, and never have release and debug in the same directory; but adding bullet with add_subdirectory( ../bullet/source bullet ) mangles all of my library names to get _Debug suffixed to them.

You can set these properties on a per-target basis instead of modifying global behaviors.
The build systems in Bullet as just provided for your convenience, and meant to be customized as you prefer.
Do you have a problem customizing cmake? Some people use cmake, others premake, others autotools and others use their own.
The simplest way to use Bullet is to include all source files under Bullet/src to your project and include the Bullet/src to the include path. That should work.
d3x0r wrote: (I also had no idea where to start this thread)
Why didn't you start this thread in the first forum called "General Bullet Physics Support and Feedback"?

Your thread is not about a demo, but feedback, right?

Re: Cmake builds mangle library names....

Posted: Sat Dec 15, 2012 8:11 pm
by d3x0r
It's not that I cannot configure it, it's that I had to do so much to configure it.

But it's done now; I just would think that being a library target primarily, that one would try to avoid setting global properties like CMAKE_XX_POSTFIX....


--- What I added before including bullet ----
#somewhere near the top...
set( BULLET_SOURCE "${CMAKE_CURRENT_SOURCE_DIR}/../bullet" CACHE STRING "bullet source path " )

#and then later...
IF(EXISTS ${BULLET_SOURCE}/ )

SET(CMAKE_DEBUG_POSTFIX "" CACHE STRING "Adds a postfix for debug-built libraries.")
SET(CMAKE_MINSIZEREL_POSTFIX "" CACHE STRING "Adds a postfix for MinsizeRelease-built libraries.")
SET(CMAKE_RELWITHDEBINFO_POSTFIX "" CACHE STRING "Adds a postfix for ReleaseWithDebug-built libraries.")

set( USE_GLUT OFF )
set( LIBRARY_OUTPUT_PATH ${CMAKE_INSTALL_PREFIX}/lib )
set( INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES OFF )
set( BUILD_INTEL_OPENCL_DEMOS OFF CACHE BOOL "Bullet option default override" )
set( BUILD_MINICL_OPENCL_DEMOS OFF CACHE BOOL "Bullet option default override" )
set( BUILD_CPU_DEMOS OFF CACHE BOOL "Bullet option default override" )
set( BUILD_DEMOS OFF CACHE BOOL "Bullet option default override" )
add_subdirectory( ${BULLET_SOURCE} bullet )
ENDIF(EXISTS ${BULLET_SOURCE}/ )
-------------------------

It's not a huge deal, and it's done now :)

Re: Cmake builds mangle library names....

Posted: Mon Dec 17, 2012 6:28 pm
by d3x0r
Would be nice if you didn't set ....

LIBRARY_OUTPUT_PATH

There should really be two phases, a build, and an install, and the build should not be putting products into the install. The way library_output_path is set, you are building product into the install; so if the build doesn't complete, now you have an incomplete package installed and/or partially mangled.