Knitschi / CMakeProjectFramework

A C++ project infrastructure.
MIT License
2 stars 1 forks source link

Drop multi-config support #13

Open Knitschi opened 4 years ago

Knitschi commented 4 years ago

Allowing the selection of the compiler-configuration after CMake's generate step causes multiplie headaches:

  1. CMake does not allow generator expressions in the OUTPUT argument of add_custom_command(). CPFCMake makes heavy use of that function and working around that limitation requires a lot of complicated and error prone CMake code and brings an performance overhead.
  2. The CMake code gets more complicated because config dependent paths in the build-tree must use harder to read generator expressions.
  3. The Conan Package Manager's support for multi-config packages is lacking.
  4. Creating multi-config packages is harder because the results of multiple builds need to be composed into one package which requires lifting the package creation from the build level up to the build-job level where artefacts of multiple builds are available.

The advantage of allowing multiple configurations is that Visual Studio users are used to being able to select the build configuration in the UI. But practice showed that you can get used to the alternative workflow where you just open one IDE instance for each configuration that you want to build.

In order to remove the above mentioned problems I decided to change the CPFCMake and CPFBuildscripts to only allow one configuration at a time when using the Visual Studio Generator.

TODO: