cmake_minimum_required(VERSION 3.23)
project(stopwatch LANGUAGES CXX VERSION 0.1.0)
include(GNUInstallDirs)
include(CMakePackageConfigHelpers)
# main target
add_library(stopwatch INTERFACE)
# create header file set
target_sources(stopwatch
    INTERFACE
        FILE_SET public_headers
        TYPE HEADERS
        BASE_DIRS 
            "${CMAKE_CURRENT_SOURCE_DIR}/include"
        FILES
            "${CMAKE_CURRENT_SOURCE_DIR}/include/stopwatch/stopwatch.hpp"
            "${CMAKE_CURRENT_SOURCE_DIR}/include/stopwatch/common.hpp"
            "${CMAKE_CURRENT_SOURCE_DIR}/include/stopwatch/cpu_clock.hpp"
)
# install interface headers
target_include_directories(stopwatch
    INTERFACE
        $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
        $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
)
# compile settings
target_compile_features(stopwatch
    INTERFACE
        cxx_std_17
)