@Gitter :gitter.im/cnruby
Code ID: basic_127
Code Name: Hello, $PATH!
- About The Project
- Demonstrate Creating a Symbolic Link for a Library
- The Structure of Project
- The Codes of Project
- Final Summary
- References
- The Structures of Project
# For MacOS 10.11+
brew install gettext
# For Ubuntu 20.04+
sudo apt-get install -y gettext
#<!-- markdown-exec(cmd:cat ../get_project.sh) -->#!/bin/bash
# ./get_project.sh <PROJECT_ID>
# ./get_project.sh basic_127
#
PROJECT_HOME=$HOME/Documents/dev/cpp-ws/$1
git clone https://github.com/cnruby/w3h1_cmake.git $PROJECT_HOME
cd $PROJECT_HOME && git checkout $1
code $PROJECT_HOME
#<!-- /markdown-exec -->
#<!-- markdown-exec(cmd:cat shell/ln_gettext_short.sh) -->#!/bin/sh
SOURCE_DIR=/usr/local/opt/gettext
DESTN_DIR=/usr/local
ln -s $SOURCE_DIR/include/libintl.h $DESTN_DIR/include/libintl.h
ln -s $SOURCE_DIR/lib/libintl.dylib $DESTN_DIR/lib/libintl.dylib
ln -s $SOURCE_DIR/lib/libintl.a $DESTN_DIR/lib/libintl.a
#<!-- /markdown-exec -->
#<!-- markdown-exec(cmd:cat src/CMakeLists.txt) -->#
add_executable(
main_127 main.cxx
)
target_include_directories(
main_127
PRIVATE ${_PROJECT_CONFIG_DIR}
)
# link against the library
target_link_libraries(
main_127
PRIVATE Intl
)
#<!-- /markdown-exec -->
#<!-- markdown-exec(cmd:cat cmake/GetLibintl.cmake) -->#
message("\nFROM cmake/GetLibintl.txt")
# find a library 'libintl'
find_package(Intl REQUIRED)
# check if Intl was found
if(Intl_FOUND)
message(STATUS "Intl found\t\t= ${Intl_FOUND}")
message(STATUS "Intl_INCLUDE_DIRS\t= ${Intl_INCLUDE_DIRS}")
message(STATUS "Intl_LIBRARIES\t= ${Intl_LIBRARIES}")
else()
message(FATAL_ERROR "Cannot find Intl")
endif()
message("FROM cmake/GetLibintl.txt")
#<!-- /markdown-exec -->
@Gitter: gitter.im/cnruby
@Github: github.com/cnruby
@Twitter: twitter.com/cnruby
@Blogspot: cnruby.blogspot.com
- https://cmake.org/cmake/help/latest/command/configure_file.html
- https://gitlab.kitware.com/cmake/community/-/wikis/doc/tutorials/How-to-create-a-ProjectConfig.cmake-file
- https://riptutorial.com/cmake/example/26652/generate-a-cplusplus-configure-file-with-cmake
- https://stackoverflow.com/questions/48580399/how-to-ensure-a-generated-config-h-file-is-in-the-include-path
- https://github.com/bast/cmake-example/tree/master/cmake
- https://cmake.org/pipermail/cmake/2006-May/009049.html
- https://discourse.brew.sh/t/failed-to-set-locale-category-lc-numeric-to-en-ru/5092/5
- https://github.com/git/git/blob/master/po/zh_CN.po
- https://www.boost.org/doc/libs/1_57_0/libs/locale/doc/html/messages_formatting.html
- https://cmake.org/cmake/help/v3.0/variable/ENV.html
- https://cmake.org/cmake/help/latest/module/FindIntl.html
- https://stackoverflow.com/questions/1003360/complete-c-i18n-gettext-hello-world-example/1033337
- https://fedoraproject.org/wiki/How_to_do_I18N_through_gettext
- https://stackoverflow.com/questions/1003360/complete-c-i18n-gettext-hello-world-example
- https://stackoverflow.com/questions/21370363/link-error-installing-rcpp-library-not-found-for-lintl
- https://stackoverflow.com/questions/11370684/what-is-libintl-h-and-where-can-i-get-it
#<!-- markdown-exec(cmd:cat docs/output/tree.txt) -->#
.
├── cmake
│ ├── CMakeLists.txt
│ └── config.h.in
├── CMakeLists.txt
├── config
│ └── config.hxx
└── src
├── CMakeLists.txt
└── main.cxx
#<!-- /markdown-exec -->