Skip to main content

Cmake Guide:

 In the middle parts of the below:
https://cmake.org/runningcmake/
"For larger projects like VTK, using ccmake, cmake -i, or CMakeSetup is recommended."
Option -i means interactive.

 

 CMake Guide:

---

 CMake Tutorial:

https://cmake.org/cmake/help/latest/guide/tutorial/index.html#a-basic-starting-point-step-1 

---

 CMakeLists.txt:

cmake_minimum_required(VERSION 3.6.1)

project(Tutorial)


add_executable(Tutorial main_001.c)

---
cmake3 ..
-- The C compiler identification is GNU 4.4.7
-- The CXX compiler identification is GNU 4.4.7
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- 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: /usr/bin/c++
-- Check for working CXX compiler: /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 done
-- Build files have been written to: ..../src/read_006/src/build

---

cmake3 does work well in our project directory.

---

configure_file(TutorialConfig.h.in TutorialConfig.h)
In C++, we could include header_files "main.h" in another header_files "something.h" in base.
And we check the reason why *.h.in exists as configured.

https://ftp.gnu.org/old-gnu/Manuals/autoconf-2.57/html_mono/autoconf.html


---

(20200916: Camke and Edit inside: )
Watching start at 00:00 on the movie:

And Edit inside "CMakeLists.txt", which is empty in the first step "cmake .." in the build folder.
Thank you for their messages:
---
$ grep -R . |grep main\\.c
main.c:#include <stdio.h>
main.c:int main () {
main.c:    printf("hello world!");
main.c:    return 0;
main.c:}
directory.txt:└── main.c
---
$ grep -R . |grep main\\.c
main.c:#include <stdio.h>
main.c:int main () {
main.c:    printf("hello world!");
main.c:    return 0;
main.c:}
directory.txt:└── main.c
---
grep -R . |grep main/.c
 

 

----

And, to the Hello world!

(20200917: Empty cmake3)
$ cmake3 ..
-- Configuring done
-- Generating done
-- Build files have been written to: /home/nakagawa/src/build

---

(20200917: Empty cmake3)
$ cmake3 --build .
Scanning dependencies of target Tutorial
[ 50%] Building C object CMakeFiles/Tutorial.dir/main.c.o
[100%] Linking C executable Tutorial

---
./build/../CMakeLists.txt

cmake_minimum_required(VERSION 3.6.1)

project(Tutorial)

add_executable(Tutorial main.c)
#configure_file(TutorialConfig.h.in TutorialConfig.h)
#configure_file(array_counter.h.in array_counter.h)

---

(20200917: Empty cmake3)
./Tutorial
hello world!

---

Analyzer: get_char (STRUCT_FILE sf): ensured the type of character.

Comments

Popular posts from this blog

ffmpeg: compilation: Makefile

1. Find sub-directory and ... 2. Care of the literature and ... * Parameter print - - - - CONFIG_POSTPROC - - - .PHONY ...  there is a file named  clean . ... - - - - - - - - - - - - .\Makefile File changed time Fri Jun 04 12:29:06 2021 1 :MAIN_MAKEFILE=1 2 :include config.mak 3 : 4 :vpath %.c $(SRC_PATH) 5 :vpath %.cpp $(SRC_PATH) 6 :vpath %.h $(SRC_PATH) 7 :vpath %.inc $(SRC_PATH) 8 :vpath %.m $(SRC_PATH) 9 :vpath %.S $(SRC_PATH) 10 :vpath %.asm $(SRC_PATH) 11 :vpath %.rc $(SRC_PATH) 12 :vpath %.v $(SRC_PATH) 13 :vpath %.texi $(SRC_PATH) 14 :vpath %/fate_config.sh.template $(SRC_PATH) 15 : 16 :AVPROGS-$(CONFIG_FFMPEG) += ffmpeg 17 :AVPROGS-$(CONFIG_FFPLAY) += ffplay 18 :AVPROGS-$(CONFIG_FFPROBE) += ffprobe 19 :AVPROGS-$(CONFIG_FFSERVER) += ffserver 20 : 21 :AVPROGS := $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF)) 22 :INSTPROGS = $(AVPROGS-yes:%=%$(PROGSSUF)$(EXESUF)) ...

Big Leaves:

They are growing this year.Dirt is well for any leaves.Weirds are cut by the machine on the line. 2022/10/09 10:24:08 *

cmake-gui

We could yum-search cmake-gui, install it and boot it so that easily create project files for compilation, which means almost make files as configured: cmake-gui can use VERSION 3.6.1 if you add entry: message is the below: CMake Error: The source directory "...../read_005/src" does not appear to contain CMakeLists.txt. Specify --help for usage, or press the help button on the CMake GUI. We must create CMakeLists.txt but we can select "from UNIX makefile" as "Configure". "cmake-gui" itself is CMake 2.8.12.2 displayed. We could see CmakeCache.txt like the below so that we could not create tags by use of cmak-gui. ######################## # EXTERNAL cache entries ######################## cmake_minimum_required:STRING=VERSION 3.6.1 We'd rather love: cmake_minimum_required(VERSION 3.6.1) cmake-gui version itself must be higher, at least, we think.  (20200911: cmake3-gui) Configured and Generator: Now they are same. --- CMake Error: The source dir...