How does CPack know whether it should create a source o binary package?

I have set CPACK_PROJECT_CONFIG_FILE and in that config file I have a if(CPACK_GENERATOR MATCHES "^(7Z|TBZ2|TGZ|TXZ|TZ|TZST|ZIP)$"). The thing is that I want to create both source and binary TGZ packages, and I only want that if() to apply if it’s a source package.
When asking myself what variable should I check to know whether it’s a source or binary package I ended up asking myself how does CPack even know whether it should create a source o binary package. The CPackConfig.cmake and CPackSourceConfig.cmake files generated by the CPack module are not that different and I simply use cpack --config with one file or another, I don’t use an extra flag to say source or binary package.

OK, from what I can see there is really no concept of source vs binary packaging for cpack. CPackConfig.cmake simply happens to set only CPACK_INSTALL_CMAKE_PROJECTS and CPackSourceConfig.cmake sets only CPACK_INSTALLED_DIRECTORIES. You could potentially have both in a single cpack config file…