I would like to set three mutually exclusive options in CMake where an error is raised if more than one of the three options is enables
option(TPL_ENABLE_MPI "enable MPI" OFF)
option(TPL_ENABLE_FFTW "enable Fast Fourier Transform library" OFF)
option(TPL_ENABLE_CUFFT "enable TPL FFTW" OFF)
the three options above have default values to OFF. How to raise a fatal error if more than one is enabled from the command line? I know I can do it with if/elseif but I was wondering if there is CMake module i can use. (I am using CMake 3.21)