Coder Social home page Coder Social logo

Comments (10)

Mair avatar Mair commented on July 28, 2024 1

@C47D Just something to note...
ESP-IDF should automatically include all assets in the components folder which will make the cmakelits.txt file simpler. I'll test it out and let you know

from lv_port_esp32.

C47D avatar C47D commented on July 28, 2024

Hi @Mair,

Thanks for the detailed report, I was able to reproduce the issue and did a quick fix. The source of the issue was that I forgot to add a note about the CMakeLists.txt on the lv_port_esp32 repo and also a typo in the main/CMakeLists.txt on your repo.

Here are the fixes, please let me know if it works for you so I can update the README.

Your application main/CMakeList.txt should look like this (the typo was lvgl_examples, it must be lv_examples):

set (SOURCES main.c)

idf_component_register(SRCS ${SOURCES}
    INCLUDE_DIRS .
    REQUIRES lvgl_esp32_drivers lvgl lv_examples lvgl_tft lvgl_touch)

target_compile_definitions(${COMPONENT_LIB} PRIVATE LV_CONF_INCLUDE_SIMPLE=1)

The file on components/lv_port_esp32/CMakeLists.txt should look like this:

cmake_minimum_required(VERSION 3.5)

# include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(EXTRA_COMPONENT_DIRS components/lvgl_esp32_drivers components/lvgl_esp32_drivers/lvgl_touch components/lvgl_esp32_drivers/lvgl_tft)
# project(lvgl-demo)

With the include and project lines commented out.

Let me know if you have any issues after that changes, I'm able to build the demo application after it.

Regards
Carlos

from lv_port_esp32.

Mair avatar Mair commented on July 28, 2024

@C47D Legend!

The file on components/lv_port_esp32/CMakeLists.txt should look like this:

cmake_minimum_required(VERSION 3.5)

# include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(EXTRA_COMPONENT_DIRS components/lvgl_esp32_drivers components/lvgl_esp32_drivers/lvgl_touch components/lvgl_esp32_drivers/lvgl_tft)
# project(lvgl-demo)

With the include and project lines commented out.

Fixed this for me. Thanks!

from lv_port_esp32.

C47D avatar C47D commented on July 28, 2024

Can you test this?

cmake_minimum_required(VERSION 3.5)

# include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(EXTRA_COMPONENT_DIRS components/lvgl_esp32_drivers components/lvgl_esp32_drivers/lvgl_touch components/lvgl_esp32_drivers/lvgl_tft)

if (NOT DEFINED PROJECT_NAME)
    project(lvgl-demo)
endif (NOT DEFINED PROJECT_NAME)

from lv_port_esp32.

Mair avatar Mair commented on July 28, 2024

In my case the above compiles

from lv_port_esp32.

C47D avatar C47D commented on July 28, 2024

Ok, I will update the README with the following info

cmake_minimum_required(VERSION 3.5)

# include($ENV{IDF_PATH}/tools/cmake/project.cmake)
set(EXTRA_COMPONENT_DIRS components/lvgl_esp32_drivers components/lvgl_esp32_drivers/lvgl_touch components/lvgl_esp32_drivers/lvgl_tft)

if (NOT DEFINED PROJECT_NAME)
    project(lvgl-demo)
endif (NOT DEFINED PROJECT_NAME)

Thanks for testing it tho, I will close the issue.

Regards

from lv_port_esp32.

Mair avatar Mair commented on July 28, 2024

I was kind of hoping to get away with something like

cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(menu_v2_poc)

and for main

set(COMPONENT_SRCS "main.c")
set(COMPONENT_ADD_INCLUDEDIRS "." )
register_component()

But due to the nested components folder the includes don't get picked up :(. In any case happy to go with the above solution,
Thanks again

from lv_port_esp32.

C47D avatar C47D commented on July 28, 2024

Thanks for trying, I've just updated the README with the workaround.

from lv_port_esp32.

maxd avatar maxd commented on July 28, 2024

@C47D I want to clarify the following thing: you are using if (NOT DEFINED PROJECT_NAME) to disable call of project(lvgl-demo). How about to use the same if to disable include directive with no need for make any manual changes (comment this line manually in sub-module repository)?

I have made this:

if (NOT DEFINED PROJECT_NAME)
    include($ENV{IDF_PATH}/tools/cmake/project.cmake)
endif (NOT DEFINED PROJECT_NAME)

and it solved the error:

...
CMake Error at /Users/mdobryakov/.esp-idf/tools/cmake/component.cmake:221 (message):
  CMake Error at
  /Applications/CLion.app/Contents/bin/cmake/mac/share/cmake-3.17/Modules/ExternalProject.cmake:1034
  (define_property):

    define_property command is not scriptable
...

So, looks like with this fix the workaround described in README is not required.

from lv_port_esp32.

Mair avatar Mair commented on July 28, 2024

yes. Another way would be

cmake_minimum_required(VERSION 3.5)
if (NOT DEFINED PROJECT_NAME)
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
endif (NOT DEFINED PROJECT_NAME)
set(EXTRA_COMPONENT_DIRS components/lvgl_esp32_drivers components/lvgl_esp32_drivers/lvgl_touch components/lvgl_esp32_drivers/lvgl_tft)

if (NOT DEFINED PROJECT_NAME)
	project(lvgl-demo)
endif (NOT DEFINED PROJECT_NAME)

from lv_port_esp32.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.