cmake_minimum_required(VERSION 3.5) include(ExternalProject) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/yaml-cpp/build/targets) add_subdirectory(yaml-cpp/) set_property(TARGET yaml-cpp PROPERTY POSITION_INDEPENDENT_CODE ON) # lodepng is included (via source file) directly since the developer himself doesn't want to generate a lib, alright fine, we'll do it your way then.