Compare mode, set output on match (CCP1IF bit is set) - PIC16F88 microcontroller
I've done this by having the compare match trigger an interrupt, and then the interrupt toggles the pin by reading the data.

Sorry, my example is in assembler, but you should get the gist:

(inside the interrupt service code)

    btfss   PIR1,CCP1IF     ; is there a timer 1/compare interrupt?
    goto    INotTmr1

    ;; process timer 1 interrupt.
    clrf    TMR1L           ; clear timer 1
    clrf    TMR1H           ; clear timer 1
    bcf     PIR1,CCP1IF     ; clear compare match interrupt bit.
    btfss   PORTC,LED1      ; is led1 hi?
    goto    ITmr11          ; no.
    bcf     PORTC,LED1      ; lower led1 bit.
    goto    INotTmr1        ; done.
ITmr11                      ; led1 bit was low.
    bsf     PORTC,LED1      ; raise led1 bit.
INotTmr1                    ; end of timer 1 interrupt code.


(in the setup code)

    ;; set up timer 1
    movlw   b'00000000'     ; set up timer 1.
    movwf   T1CON           ; set up timer 1.
    movlw   b'00001010'     ; timer 1 compare throws interrupt.
    movwf   CCP1CON         ; set up compare mode.
    movlw   h'ff'           ; init compare value.
    movwf   CCPR1L          ; set up initial compare (invalid)
    movwf   CCPR1H          ; set up initial compare (invalid)


then turn on timer 1 when you are ready to start toggling

Good luck with your project.