xref: /btstack/test/mesh/CMakeLists.txt (revision 1d1c93c5a340c6a7a072334c520a11ee27e19ed9)
1*1d1c93c5SMatthias Ringwaldcmake_minimum_required (VERSION 3.5)
2*1d1c93c5SMatthias Ringwaldproject(BTstackMesh)
3*1d1c93c5SMatthias Ringwald
4*1d1c93c5SMatthias Ringwald# add libusb
5*1d1c93c5SMatthias Ringwaldfind_path(LIBUSB_INCLUDE_DIR NAMES libusb.h PATH_SUFFIXES "include" "libusb" "libusb-1.0")
6*1d1c93c5SMatthias Ringwaldfind_library(LIBUSB_LIBRARY NAMES usb-1.0 PATH_SUFFIXES "lib" "lib32" "lib64" "dylib")
7*1d1c93c5SMatthias Ringwaldget_filename_component(LIBUSB_LIBRARY_PATH ${LIBUSB_LIBRARY} DIRECTORY)
8*1d1c93c5SMatthias Ringwaldinclude_directories( ${LIBUSB_INCLUDE_DIR} )
9*1d1c93c5SMatthias Ringwaldlink_directories( ${LIBUSB_LIBRARY_PATH} )
10*1d1c93c5SMatthias Ringwaldlink_libraries( usb-1.0 )
11*1d1c93c5SMatthias Ringwald
12*1d1c93c5SMatthias Ringwaldinclude_directories(../../3rd-party/micro-ecc)
13*1d1c93c5SMatthias Ringwaldinclude_directories(../../3rd-party/tinydir)
14*1d1c93c5SMatthias Ringwaldinclude_directories(../../src)
15*1d1c93c5SMatthias Ringwaldinclude_directories(../../platform/posix)
16*1d1c93c5SMatthias Ringwald# include_directories(../../platform/embedded)
17*1d1c93c5SMatthias Ringwaldinclude_directories(.)
18*1d1c93c5SMatthias Ringwald
19*1d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_SRC       "../../src/*.c" "../../example/sco_demo_util.c")
20*1d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_BLE       "../../src/ble/*.c")
21*1d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_MESH      "../../src/ble/mesh/*.c")
22*1d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_GATT      "../../src/ble/gatt-service/*.c")
23*1d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_UECC      "../../3rd-party/micro-ecc/uECC.c")
24*1d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_POSIX     "../../platform/posix/*.c")
25*1d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_LIBUSB    "../../platform/libusb/*.c")
26*1d1c93c5SMatthias Ringwald
27*1d1c93c5SMatthias Ringwaldfile(GLOB SOURCES_OFF "../../src/ble/le_device_db_memory.c" "../../src/ble/le_device_db_tlv.c")
28*1d1c93c5SMatthias Ringwaldlist(REMOVE_ITEM SOURCES_BLE ${SOURCES_OFF})
29*1d1c93c5SMatthias Ringwald
30*1d1c93c5SMatthias Ringwaldset(SOURCES_MESH_NEW main.c mesh_transport.c provisioner.c provisioning.c provisioning_device.c provisioning_provisioner.c)
31*1d1c93c5SMatthias Ringwald
32*1d1c93c5SMatthias Ringwaldset(SOURCES
33*1d1c93c5SMatthias Ringwald	${SOURCES_POSIX}
34*1d1c93c5SMatthias Ringwald	${SOURCES_LIBUSB}
35*1d1c93c5SMatthias Ringwald	${SOURCES_SRC}
36*1d1c93c5SMatthias Ringwald	${SOURCES_BLE}
37*1d1c93c5SMatthias Ringwald	${SOURCES_MESH}
38*1d1c93c5SMatthias Ringwald	${SOURCES_MESH_NEW}
39*1d1c93c5SMatthias Ringwald	${SOURCES_GATT}
40*1d1c93c5SMatthias Ringwald	${SOURCES_UECC}
41*1d1c93c5SMatthias Ringwald)
42*1d1c93c5SMatthias Ringwaldlist(SORT SOURCES)
43*1d1c93c5SMatthias Ringwald
44*1d1c93c5SMatthias Ringwald# create static lib
45*1d1c93c5SMatthias Ringwaldadd_library(btstack STATIC ${SOURCES})
46*1d1c93c5SMatthias Ringwald
47*1d1c93c5SMatthias Ringwald# list of targets
48*1d1c93c5SMatthias Ringwaldset(TARGETS_C mesh.c)
49*1d1c93c5SMatthias Ringwald
50*1d1c93c5SMatthias Ringwald# create targets
51*1d1c93c5SMatthias Ringwaldforeach(EXAMPLE_FILE ${TARGETS_C})
52*1d1c93c5SMatthias Ringwald	get_filename_component(EXAMPLE ${EXAMPLE_FILE} NAME_WE)
53*1d1c93c5SMatthias Ringwald	message("example ${EXAMPLE}")
54*1d1c93c5SMatthias Ringwald	add_executable(${EXAMPLE} ${EXAMPLE_FILE})
55*1d1c93c5SMatthias Ringwald	target_link_libraries(${EXAMPLE} btstack)
56*1d1c93c5SMatthias Ringwaldendforeach(EXAMPLE_FILE)
57