how to perform a gcc command by using CMake and make

Hello everyone, I’m trying to create a statically linked lib-curl executable using CMake but I get undefined reference errors when I try to ‘make’ it, although I can successfully compile it with:
"gcc -static main.c -o curl-try -pthread -lcurl curl-config --static-libs"

my file tree:
proj/build -> empty

The CMakelists.txt file:
cmake_minimum_required(VERSION 3.9)
set(CURL_LIBRARY “-lcurl”)
find_package(CURL REQUIRED COMPONENTS libcurl curl-config)
add_executable(curl-try main.c)
target_link_libraries(curl-try ${CURL_LIBRARIES} )

I’ve some questions could you please answer me;

1-So, what would be the correct CMakelists.txt file without exceeding CMake’ s standart Way ?

2-Which variables should I set to let CMake create the correct makefile?

3-How do I call curl-config executable correctly to get static-libs to link main.c file.

4-When I add curl-config --static-libs to CMAKE_EXE_LINKER_FLAGS it says curl-config not found but I can successfully call curl config from terminal why it is so ? and how can I overcome that

Thank you, I’m so happy to know that there is such Forum like that.
I’m looking forward to your answers.

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

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