how to perform a gcc command by using CMake and make

You should use find_package(CURL) and then you’d just need:

find_package(CURL REQUIRED)
target_link_libraries(curl-try CURL::libcurl)