enable pack with cpack, fix error build on lib target.