function(cph_init TARGET)
    target_link_libraries(${TARGET} PRIVATE unity)
endfunction()

function(cph_component_handler TARGET COMPONENT)
    if(cmp_lower STREQUAL timer_core)
        LIST(APPEND DEFINES CPH_ENABLE_TIMER_CORE)
    elseif(cmp_lower STREQUAL wake)
        check_var(${CPH_LIB_PATH}/cph/wake/wake.cpp outvar)
        LIST(APPEND CPH_SOURCES ${outvar})
        check_var(${CPH_LIB_PATH}/cph/wake/crc.cpp outvar)
        LIST(APPEND CPH_SOURCES ${outvar})
    elseif(cmp_lower STREQUAL printf)
    elseif(COMPONENT STREQUAL modbus)
        check_var(${CPH_LIB_PATH}/cph/modbus/mb.cpp outvar)
        LIST(APPEND CPH_SOURCES ${outvar})
        check_var(${CPH_LIB_PATH}/cph/modbus/mbfunccoils.cpp outvar)
        LIST(APPEND CPH_SOURCES ${outvar})
        check_var(${CPH_LIB_PATH}/cph/modbus/mbfuncdisc.cpp outvar)
        LIST(APPEND CPH_SOURCES ${outvar})
        check_var(${CPH_LIB_PATH}/cph/modbus/mbfuncholding.cpp outvar)
        LIST(APPEND CPH_SOURCES ${outvar})
        check_var(${CPH_LIB_PATH}/cph/modbus/mbfuncinput.cpp outvar)
        LIST(APPEND CPH_SOURCES ${outvar})
        check_var(${CPH_LIB_PATH}/cph/modbus/mbfuncother.cpp outvar)
        LIST(APPEND CPH_SOURCES ${outvar})
        check_var(${CPH_LIB_PATH}/cph/modbus/mbqueue.cpp outvar)
        LIST(APPEND CPH_SOURCES ${outvar})
        check_var(${CPH_LIB_PATH}/cph/modbus/mbrtu.cpp outvar)
        LIST(APPEND CPH_SOURCES ${outvar})
        check_var(${CPH_LIB_PATH}/cph/modbus/mbutils.cpp outvar)
        LIST(APPEND CPH_SOURCES ${outvar})
    else()
        MESSAGE(FATAL_ERROR "Cmake CPH Component `${COMPONENT}` is not supported for win32")
    endif()

    if (CPH_SOURCES)
        target_sources(${TARGET} PRIVATE "${CPH_SOURCES}")
    endif()
    if (DEFINES)
        target_compile_definitions(${TARGET} PUBLIC "${DEFINES}")
    endif()



endfunction()