34 lines
851 B
CMake
34 lines
851 B
CMake
cmake_minimum_required(VERSION 3.16)
|
|
|
|
project(simulator C)
|
|
|
|
# Needed to find GLib
|
|
find_package(PkgConfig REQUIRED)
|
|
pkg_check_modules(GLIB2 REQUIRED glib-2.0 gio-2.0)
|
|
|
|
include_directories(${GLIB2_INCLUDE_DIRS})
|
|
link_directories(${GLIB2_LIBRARY_DIRS})
|
|
add_definitions(${GLIB2_CFLAGS_OTHER})
|
|
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
bluez_inc
|
|
GIT_REPOSITORY https://github.com/weliem/bluez_inc.git
|
|
GIT_TAG main
|
|
)
|
|
|
|
FetchContent_MakeAvailable(bluez_inc)
|
|
|
|
add_executable(simulator main.c)
|
|
|
|
target_link_libraries(simulator PRIVATE Binc ${GLIB2_LIBRARIES})
|
|
|
|
# Integration test binary — forks the simulator binary, needs only pthreads
|
|
add_executable(test_ble test_ble.c)
|
|
target_link_libraries(test_ble PRIVATE pthread)
|
|
add_dependencies(test_ble simulator)
|
|
target_compile_definitions(test_ble PRIVATE
|
|
SIM_BIN="$<TARGET_FILE:simulator>"
|
|
)
|