xref: /btstack/test/mesh/CMakeLists.txt (revision 46f4dee88b770f92d9b49aef640613c02a8659de)
11d1c93c5SMatthias Ringwaldcmake_minimum_required (VERSION 3.5)
21d1c93c5SMatthias Ringwaldproject(BTstackMesh)
31d1c93c5SMatthias Ringwald
41d1c93c5SMatthias Ringwald# add libusb
51d1c93c5SMatthias Ringwaldfind_path(LIBUSB_INCLUDE_DIR NAMES libusb.h PATH_SUFFIXES "include" "libusb" "libusb-1.0")
61d1c93c5SMatthias Ringwaldfind_library(LIBUSB_LIBRARY NAMES usb-1.0 PATH_SUFFIXES "lib" "lib32" "lib64" "dylib")
71d1c93c5SMatthias Ringwaldget_filename_component(LIBUSB_LIBRARY_PATH ${LIBUSB_LIBRARY} DIRECTORY)
81d1c93c5SMatthias Ringwaldinclude_directories( ${LIBUSB_INCLUDE_DIR} )
91d1c93c5SMatthias Ringwaldlink_directories( ${LIBUSB_LIBRARY_PATH} )
101d1c93c5SMatthias Ringwaldlink_libraries( usb-1.0 )
111d1c93c5SMatthias Ringwald
121d1c93c5SMatthias Ringwaldinclude_directories(../../3rd-party/micro-ecc)
131d1c93c5SMatthias Ringwaldinclude_directories(../../3rd-party/tinydir)
141d1c93c5SMatthias Ringwaldinclude_directories(../../src)
151d1c93c5SMatthias Ringwaldinclude_directories(../../platform/posix)
161d1c93c5SMatthias Ringwald# include_directories(../../platform/embedded)
171d1c93c5SMatthias Ringwaldinclude_directories(.)
181d1c93c5SMatthias Ringwald
191d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_SRC       "../../src/*.c" "../../example/sco_demo_util.c")
201d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_BLE       "../../src/ble/*.c")
211d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_MESH      "../../src/ble/mesh/*.c")
221d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_GATT      "../../src/ble/gatt-service/*.c")
231d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_UECC      "../../3rd-party/micro-ecc/uECC.c")
241d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_POSIX     "../../platform/posix/*.c")
251d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_LIBUSB    "../../platform/libusb/*.c")
261d1c93c5SMatthias Ringwald
271d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_OFF "../../src/ble/le_device_db_memory.c" "../../src/ble/le_device_db_tlv.c")
281d1c93c5SMatthias Ringwaldlist(REMOVE_ITEM SOURCES_BLE ${SOURCES_OFF})
291d1c93c5SMatthias Ringwald
30*46f4dee8SMatthias Ringwaldset(SOURCES_MESH_NEW main.c mesh_transport.c mesh_foundation.c mesh_keys.c mesh_virtual_addresses.c mesh_peer.c provisioner.c provisioning.c provisioning_device.c provisioning_provisioner.c)
311d1c93c5SMatthias Ringwald
321d1c93c5SMatthias Ringwaldset(SOURCES
331d1c93c5SMatthias Ringwald	${SOURCES_POSIX}
341d1c93c5SMatthias Ringwald	${SOURCES_LIBUSB}
351d1c93c5SMatthias Ringwald	${SOURCES_SRC}
361d1c93c5SMatthias Ringwald	${SOURCES_BLE}
371d1c93c5SMatthias Ringwald	${SOURCES_MESH}
381d1c93c5SMatthias Ringwald	${SOURCES_MESH_NEW}
391d1c93c5SMatthias Ringwald	${SOURCES_GATT}
401d1c93c5SMatthias Ringwald	${SOURCES_UECC}
411d1c93c5SMatthias Ringwald)
421d1c93c5SMatthias Ringwaldlist(SORT SOURCES)
431d1c93c5SMatthias Ringwald
441d1c93c5SMatthias Ringwald# create static lib
451d1c93c5SMatthias Ringwaldadd_library(btstack STATIC ${SOURCES})
461d1c93c5SMatthias Ringwald
471d1c93c5SMatthias Ringwald# list of targets
481d1c93c5SMatthias Ringwaldset(TARGETS_C mesh.c)
491d1c93c5SMatthias Ringwald
501d1c93c5SMatthias Ringwald# create targets
511d1c93c5SMatthias Ringwaldforeach(EXAMPLE_FILE ${TARGETS_C})
521d1c93c5SMatthias Ringwald	get_filename_component(EXAMPLE ${EXAMPLE_FILE} NAME_WE)
531d1c93c5SMatthias Ringwald	message("example ${EXAMPLE}")
541d1c93c5SMatthias Ringwald	add_executable(${EXAMPLE} ${EXAMPLE_FILE})
551d1c93c5SMatthias Ringwald	target_link_libraries(${EXAMPLE} btstack)
561d1c93c5SMatthias Ringwaldendforeach(EXAMPLE_FILE)
57