You can read his writings for yourself.
Lincoln said saving the union was his "paramount object in this struggle," but didn't say that it was the only objective he would ever have as president or that he'd pursue it at all costs.
Saving the union was the main objective. Others were subordinated to that. But that didn't mean Lincoln was wholly without other concerns.
The fact that he refused to accept the expansion of slavery into the territories as the price of union indicates that.