ros/catkin — pull request #604 by scpeters (2014-03-05 22:48:04+00:00)
Title: Handle arch-specific library folders #545 (Not ready for merging)

Issue #545 covers problems using `catkin_make_isolated` with projects that use GNUInstallDirs (such as console_bridge, sdformat, simbody, and gazebo). The problem on Ubuntu is that libraries get installed to `lib/x86_64-linux-gnu` and catkin can't find them. I've made a workaround in this pull request, though it hard-codes the suffix. To find the suffix automatically, one can invoke cmake with the following CMakeLists.txt file and parse the output:

~~~
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
project (CMAKE_GNU_DIRS_TEST)
include(GNUInstallDirs)
message (STATUS "CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_LIBDIR}")
~~~

It generates the following output:
~~~
$ cmake .. | grep CMAKE_INSTALL_LIBDIR
-- CMAKE_INSTALL_PREFIX: lib/x86_64-linux-gnu
~~~

I've been using this code in my fork for over 6 months with no problems. It's even able to find cmake config files embedded in places like `lib/x86_64-linux-gnu/cmake/project` (tested with simbody). It's obviously hard-coded for Ubuntu, and I'd be willing to try to generalize it, but no one offered any advice in #545, so I figured making a pull request might spur some discussion.