file(WRITE 1.txt 1) file(WRITE 2.txt 2) file(WRITE common.txt common) install(FILES 1.txt common.txt DESTINATION bin COMPONENT comp1) install(FILES 2.txt common.txt DESTINATION bin COMPONENT comp2) set(CPACK_GENERATOR ZIP WIX) set(CPACK_COMPONENTS_ALL comp1 comp2) include(CPack)