diff --git a/tools/cmake/convert_to_cmake.py b/tools/cmake/convert_to_cmake.py index 80d9296d6..0ba7fa62f 100755 --- a/tools/cmake/convert_to_cmake.py +++ b/tools/cmake/convert_to_cmake.py @@ -161,17 +161,14 @@ def convert_component(project_path, component_path): cflags = v.get("CFLAGS", None) with open(cmakelists_path, "w") as f: - f.write("set(COMPONENT_ADD_INCLUDEDIRS %s)\n\n" % component_add_includedirs) - - f.write("# Edit following two lines to set component requirements (see docs)\n") - f.write("set(COMPONENT_REQUIRES "")\n") - f.write("set(COMPONENT_PRIV_REQUIRES "")\n\n") - if component_srcs is not None: - f.write("set(COMPONENT_SRCS %s)\n\n" % component_srcs) - f.write("register_component()\n") + f.write("idf_component_register(SRCS %s)\n" % component_srcs) + f.write(" INCLUDE_DIRS %s" % component_add_includedirs) + f.write(" # Edit following two lines to set component requirements (see docs)\n") + f.write(" REQUIRES "")\n") + f.write(" PRIV_REQUIRES "")\n\n") else: - f.write("register_config_only_component()\n") + f.write("idf_component_register()\n") if cflags is not None: f.write("target_compile_options(${COMPONENT_LIB} PRIVATE %s)\n" % cflags)