cmake_minimum_required(VERSION 3.13..3.18)
project(grbl_sender
        DESCRIPTION "GRBLSender"
        LANGUAGES CXX C
        VERSION "1.0"
        )

# Disable building extras we won't need (pure C++ project)
set(NANOGUI_BUILD_EXAMPLE OFF CACHE BOOL " " FORCE)
set(NANOGUI_BUILD_PYTHON OFF CACHE BOOL " " FORCE)
set(NANOGUI_INSTALL OFF CACHE BOOL " " FORCE)

# Add the configurations from nanogui
add_subdirectory(libs/nanogui)
add_subdirectory(libs/gtest)
include_directories(libs/gtest/googletest/include)

# For reliability of parallel build, make the NanoGUI targets dependencies
set_property(TARGET glfw glfw_objects nanogui PROPERTY FOLDER "dependencies")

# Use C++17, visibility=hidden by default, interprocedural optimization
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_VISIBILITY_PRESET hidden)


add_executable(sender main.cpp grbl.h grbl.cpp grbl_test.cpp grbl_communication.h grbl_communication.cpp machine.h grbl_machine.cpp string_utils.h)
target_link_libraries(sender nanogui gtest gtest_main)