simbody/simbody — pull request #197 by chrisdembia (2014-07-16 08:26:26+00:00)
Title: Change CMake for debug builds (on UNIX).

1. Use CMAKE_DEBUG_POSTFIX for all platforms, not just windows.
2. On UNIX, do not name targets differently if building debug.
3. Remove unnecessary debug/optimized qualification in
TARGET_LINK_LIBRARIES for SimTKmath and SimTKcommon. This is perhaps
controversial. Since for a given configuration, there is only one
corresponding target, we needn't specify separate debug/optimized
libraries: there is only one to choose from. Of course, a project
*using* Simbody will need to specify separate debug/optimized libraries
when linking (and the SimbodyConfig file does this). I actually want to
hear what others have to say about this...
4. Visualizer is named as simbody-visualizer_d if in a debug build.
5. Replace instances of _d with CMAKE_DEBUG_POSTFIX, except in
Simbody/examples/InstalledCMakeLists.txt. This is in case we want to
change the postfix, we only need to change it in roughly one place. See
cmake/SimbodyConfig.cmake.in; I verified that this change works (on
Ubuntu).
6. Previously: if on UNIX, CMAKE_BUILD_TYPE would be set to Release by
default (unless it was already set). Now, I'm doing this default setting
if not using MSVC and not using Xcode. MSVC and Xcode are the instances
where CMAKE_BUILD_TYPE is not used.

Notes:
* On all platforms, Debug static libraries are named as
SimTK(common|math|simbody)static_d, as they previously were.
* The CMake cache variables like SimTKCOMMON_LIBRARY_NAME are incorrect,
as they do not account for if we're building as debug or not. They
weren't correct previously either. All they account for is the
namespace. (not static, debug, or VN). Is this misleading?

Addresses #5 and #195.