@Gitter :gitter.im/cnruby
Code ID: basic_140
Code Name: Hello, install:multi!
Code Status:
- About The Project
CMake
Code of Project- A Demonstration of Building Project
- Final Summary
- References
- Explain
C++
andCMake
Code
CMake
's"Ninja Multi-Config"
CodeCMake
's"install"
Code- install executable commands on Project
- install executable commands on OS
13 if(NOT CMAKE_CONFIGURATION_TYPES)
14 set(
15 CMAKE_CONFIGURATION_TYPES "Debug;Release;RelWithDebInfo"
16 CACHE STRING "specifies available build types" FORCE )
17 endif()
18 if(NOT CMAKE_CROSS_CONFIGS)
19 set( # -DCMAKE_CROSS_CONFIGS="all"
20 CMAKE_CROSS_CONFIGS "all"
21 #CMAKE_CROSS_CONFIGS "Debug;Release;RelWithDebInfo"
22 CACHE STRING "create available config files" FORCE )
23 endif()
4 install(
5 TARGETS ${TARGET_NAME}
6 CONFIGURATIONS Debug
7 RUNTIME
8 DESTINATION ${RUNTIME_INSTALL_DIRECTORY}/Debug/bin
9 )
10 install(
11 TARGETS ${TARGET_NAME}
12 CONFIGURATIONS Release
13 RUNTIME
14 DESTINATION ${CMAKE_INSTALL_PREFIX}/bin
15 )
1 # to install executable to Project for Developer
2 cmake -G"Ninja Multi-Config" -H. -B_build
3 cmake -DCMAKE_BUILD_TYPE=Debug --build _build
4
5 ninja -C _build main_140:Debug
6 ./_bin/Debug/main_140
7
8 ninja -C _build install:Debug
9 ./_install/Debug/bin/main_140
1 # to install executable from source to OS for User
2 cmake -G"Ninja Multi-Config" -H. -B_build
3 cmake -DCMAKE_DEFAULT_BUILD_TYPE=Release _build
4
5 cmake --build _build --target main_140:Release
6 ./_bin/Release/main_140
7
8 sudo cmake --build _build --target install:Release
9 cmake --install _build help
10 sudo cmake --install _build --config Release
11 main_140
12 #sudo ninja -C _build install:Release
@Gitter: gitter.im/cnruby
@Github: github.com/cnruby
@Twitter: twitter.com/cnruby
@Blogspot: cnruby.blogspot.com
- https://cmake.org/cmake/help/latest/command/install.html
- https://www.dealii.org/9.1.1/users/cmakelists.html
- https://cliutils.gitlab.io/modern-cmake/modern-cmake.pdf
git clone https://github.com/cnruby/w3h1_cmake.git basic_140
cd basic_140
git checkout basic_140
code .
.
├── cmake
│ ├── CMakeLists.txt
│ ├── config.h.in
│ ├── multi_config.cmake
│ └── targets.cmake
├── CMakeLists.txt
├── config
│ └── config.hxx
└── src
├── CMakeLists.txt
├── install.cmake
└── main.cxx