Use CMAKE_CURRENT_BINARY_DIR instead of CMAKE_BINARY_DIR This allows for building with cmake's add_subdirectory() function.