fix build with DB_CXX_INCLUDE_PATH

CMAKE_REQUIRED_FLAGS is only used in check_include_file_cxx for the actual build include_directories needs to be used.