cmake_minimum_required(VERSION 3.11 FATAL_ERROR)

# this is for internal use
if("${CMAKE_PROJECT_NAME}" STREQUAL "timemory" AND NOT TIMEMORY_BUILD_C)
    return()
endif()

project(timemory-C-Example LANGUAGES C)

set(EXE_NAME ex_c_timing)
set(COMPONENTS c compile-options analysis-tools)

set(timemory_FIND_COMPONENTS_INTERFACE timemory::c-example)
find_package(timemory REQUIRED COMPONENTS ${COMPONENTS})

add_executable(${EXE_NAME} ${EXE_NAME}.c)
target_link_libraries(${EXE_NAME} timemory::c-example)
install(TARGETS ${EXE_NAME} DESTINATION bin)
