So I am trying to learn CMake and I want to convert the following
gcc "-DARCH=\"`uname -a`\"" cli_arch.c arch.c
to a CMakeLists.txt file.
This is what I got so far:
Running cmake -DCMAKE_C_COMPILER=/usr/bin/gcc "-DARCH=\"`uname -a`\"" ..
// CMakeLists.txtcmake_minimum_required(VERSION 2.8)project(cli_arch)add_executable(cli_arch cli_arch.c arch.c)
The result I am getting is:
-- The C compiler identification is AppleClang 11.0.3.11030032-- The CXX compiler identification is AppleClang 11.0.3.11030032-- Check for working C compiler: /usr/bin/gcc-- Check for working C compiler: /usr/bin/gcc -- works-- Detecting C compiler ABI info-- Detecting C compiler ABI info - done-- Detecting C compile features-- Detecting C compile features - done-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works-- Detecting CXX compiler ABI info-- Detecting CXX compiler ABI info - done-- Detecting CXX compile features-- Detecting CXX compile features - done-- Configuring done-- Generating doneCMake Warning: Manually-specified variables were not used by the project: ARCH
I am not understanding how to pass the arguments "-DARCH=\"`uname -a`\""
to CMake.