Change in ESMA_cmake must be in 2 stages. In stage (1) ESMA_cmake detects whether MAPL is providing the new macro, and if not works the way it always has. If it is detected then it uses the new macro.
Once MAPL is being used, the switch in esma_add_library.cmake() should be removed.