You are portraying the abolition of slavery as "optional" rather than the purpose of the war. You made my case for me. Thank you.
So then, we agree that the motivation of Lincoln was to preserve the Union. From the beginning, through the middle and right up to the end of the Civil War.
Here's the bottom line: the Confederate Slave Power wanted to destroy the Union to preserve their "peculiar institution" of slavery.
Lincoln was willing, when the opportunity presented, to destroy slavery to preserve the Union.
That opportunity presented itself as a military classification called "contraband of war", which Lincoln used from the beginning in 1861, but formally published as his Emancipation Proclamation in 1862.
This was followed in 1863 with proposed constitutional amendments to abolish slavery, passed & ratified in 1865.
That's a long story made short.