What’s your platformio.ini and IDE? There’s no information on which platform (ESP32, other…?) you are working, what crypto/common library you’re referring to or what’s the exact error you get that prompts you to want to add something to the CMakeLists.txt.
I think it has to do with pointing to the crypto library for wpa_supplicant when I was using ESP IDF 3.3, and now 4 has that crypto in a different location that where wpa_supplicant was looking before…
fatal error: crypto/md5_i.h: No such file or directory
Well that’s a board that’s not in the official board list so I can’t judge errors in that without seeing its board JSON file.
Now we’re getting closer. So for the ESP-IDF v3.3 version that “MD5 Internal definition” file md5_i.h is here in esp-idf/components/wpa_supplicant/include/crypto/md5_i.h
But with ESP-IDF v4 it has been moved inside the source folder at esp-idf/components/wpa_supplicant/src/crypto/md5_i.h
Which is not more publically visible because it’s an include directory private to the component itself.
Funilly that header file is actually duplicating information because the MD5Init etc functions are coming from the built-in ROM of the ESP32 and is als declared by rom/md5_hash.h
So have you tried referencing #include <esp32/rom/md5_hash.h instead?
If even that doesn’t work you can also just duplicate this header locally in the project to make the functions known. Or shortly rewrite the code to use mbedtls functions (#include <mbedtls/md5.h) instead, which should be available across all versions at the same location.