osx - Run c-code with cmake -
i new programming , have several c-files want run terminal in mac. have installed cmake homebrew , seems installed correctly (when type "brew install cmake", message "warning: cmake-3.6.3 installed").
my problem is, don't know type next compile/run file. i'm sorry if seems basic, don't understand answers found on google. have changed directory folder containing files "cd /users/..." , have cmakelist.txt file friend , put in same folder. have tried typing "cmake ." , creates lot of new folders, doesn't print anything. have "printf"-command in main.c.
can tell me, should type make code print terminal?
cmake doesn't run program.
cmake generates makefile. makefile can interpreted "make" calling "make" in same directory (you can specify other names or paths, not needed here). "make" call compiler, linker , maybe other stuff build program. @ end , no errors, have executable named written in "add_executable" instruction in cmakelists.txt. run program should sufficient type "./program_name" in build directory.
one hint: better create subfolder building. "mkdir build && cd build && cmake ../ && make".
Comments
Post a Comment