Skip to content

cnruby/w3h1_cmake

 
 

Repository files navigation

Hello, Targets!

Building multiple Targets using CMake on Ubuntu 20.04



@Gitter :gitter.im/cnruby
Code ID: basic_124
Code Name: Hello, Targets!

Youtube Video

TABLE of CONTENTS

About The Project

About The Project

Requirements

Install The Library gettext

# For Ubuntu 20.04+
sudo apt-get update
sudo apt-get install -y gettext
sudo apt-get install -y language-pack-de
sudo apt-get install -y language-pack-zh-hans
sudo apt-get install -y language-pack-zh-hant

Get The Code with Shell Commands

git clone https://github.com/cnruby/w3h1_cmake.git basic_124
cd basic_124
git checkout basic_124
code .

The Structure of Project

#<!-- markdown-exec(cmd:cat docs/output/tree.txt) -->#
.
├── cmake
│  ├── CMakeLists.txt
│  ├── config.h.in
│  ├── GetLocaleDir.cmake
│  ├── Initialize.cmake
│  └── TargetAll.cmake
├── CMakeLists.txt
├── config
│  └── config.hxx
└── src
   ├── CMakeLists.txt
   ├── main_apt.cxx
   └── main_debconf.cxx
#<!-- /markdown-exec -->

The Folder's Structure

_image

The Command's Structure of Project on MacOS "basic_123"

_image

The Command's Structure of Project on Ubuntu "basic_124"

The CMake Codes of Project

_image

_image

The Difference of 'CMake' Sources Between MacOS and Ubuntu?

#<!-- markdown-exec(cmd:cat src/CMakeLists.txt) -->#
add_executable(
  apt_main_124
  main_apt.cxx
)
add_executable(
  debconf_main_124
  main_debconf.cxx
)
#<!-- /markdown-exec -->

The Listfile of Folder 'src'

#<!-- markdown-exec(cmd:cat cmake/TargetAll.cmake) -->#
# For Ubuntu
include_directories(${_PROJECT_CONFIG_DIR})
# For MacOS
# include_directories( ${Intl_INCLUDE_DIRS} ${_PROJECT_CONFIG_DIR} )
# include_directories(${Intl_INCLUDE_DIRS} ${_PROJECT_CONFIG_DIR})
# link_directories(${Intl_LIBRARIES})
#<!-- /markdown-exec -->

The Listfile of Folder 'src'

Demonstrate The Development of Project

Demonstrate Building The Project

Demonstrate The Build's Commands

_image

Final Summary

感谢大家观看!

@Gitter: gitter.im/cnruby

@Github: github.com/cnruby

@Twitter: twitter.com/cnruby

@Blogspot: cnruby.blogspot.com

References

General

Important