Thanks to ian for prodding. What do people think of automatically adding BOOL where needed in CMAKE_ARGS, something along the lines of the following construct:
ARGS=-DFLAG1=ON -DFLAG2:BOOL=ON -DFLAG3=ON -DFLAG4=OFF test: echo ${ARGS:S/=ON/:BOOL=ON/g:S/=OFF/:BOOL=OFF/g:S/:BOOL:BOOL/:BOOL/g}