CMakeLists.txt 831 B

1234567891011121314151617181920212223242526
  1. cmake_minimum_required(VERSION 3.5)
  2. add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/../../../ ${CMAKE_BINARY_DIR}/lib)
  3. include($ENV{IDF_PATH}/tools/cmake/project.cmake)
  4. get_target_property(OPEN62541_SOURCES open62541-object SOURCES)
  5. get_target_property(OPEN62541_INCLUDES open62541-object INCLUDE_DIRECTORIES)
  6. # Create an open62541 component for ESP IDF
  7. set(open62541_component_dir ${CMAKE_CURRENT_LIST_DIR}/components/open62541-lib)
  8. file(MAKE_DIRECTORY ${open62541_component_dir})
  9. file(WRITE ${open62541_component_dir}/CMakeLists.txt "
  10. set(COMPONENT_SRCS ${OPEN62541_SOURCES})
  11. set(COMPONENT_ADD_INCLUDEDIRS ${OPEN62541_INCLUDES})
  12. set(COMPONENT_REQUIRES lwip mbedtls freertos)
  13. register_component()
  14. ")
  15. add_definitions(-DUA_ARCHITECTURE_FREERTOSLWIP)
  16. project(hello-world)
  17. add_dependencies(open62541-lib open62541-code-generation)