Showing posts from August, 2014

Variant invocations of function members using C++11

This post addresses the case of wrapping functions for reflection for the aim of supporting run-time invocation through variant parameters.  This is the case of reflection frameworks and codes that makes C++ classes accessible to scripting runtimes such as Boost.Python.

I will focus on the case of exposed functions that are bound to a specific instance.

The approach taken here is based on constructs of C++11, in particular the variadic templates, std::function type, and auto return types.

cmakego: Simpler access to external libraries in CMake

CMake has greatly simplified the process of building libraries and applications across different platforms, and it is adopted by several large projects. Libraries can be easily found through find_package but the result of the lookup has to be manually added to the target through different commands. This post discusses how include the external libraries in an easier way:

add_executable(glapp1 glapp1.cpp ...)
target_link_libraries(glapp1 p::glew p::glfw p::boost ...)

The usage of cmakego is similar to the one of packages or meta-packages such as catkin:

find_package(cmakego REQUIRED COMPONENTS glew glfw)

For boost the sub-components can be specified as:

set(CMAKEGO_BOOST program_options)
find_package(cmakego REQUIRED COMPONENTS boost)

Details after the break.

For a general package management of sources there is catkin for the ROS world and hunter for the others.