Hello all i want to ask you such interesting question. I am using fecth_content in my Cmake something like;
FetchContent_Declare( Logger GIT_REPOSITORY https://github.com/fehimkus/MessageLogger.git GIT_TAG main ) FetchContent_MakeAvailable(Logger)
It is pretty straightforward. Right? But i want to give some arguments the Logger’s Cmake, like build on release mode. For that I am writing on the main Cmake something like that;
set(CMAKE_BUILD_TYPE Release)
But, Submodule(fetch_content stuff) does not take this and builded with DEBUG mode.
Then I wrote with cli that;
mkdir -p build && cmake -B build -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=OFF
Surprisingly it is worked! I did not understand why. If anyone can help me about this issue i will be very appreciated. Thank you for your time.
explaining why on cli it is working but inside of the cmake not working ?