I created very simple project as follows:
├── build
├── CMakeLists.txt
├── main.cpp
# CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(MyApp)
add_executable(my_app main.cpp)
install(TARGETS my_app DESTINATION bin)
set(CPACK_PACKAGE_NAME MyProj)
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
set(CPACK_VERBATIM_VARIABLES TRUE)
include(CPack)
You can think main.cpp as empty file. Here is how i selet generator and build the project.
$ cd build
$ cmake -G "Ninja Multi-Config" ..
$ cmake --build . # <<===== It is working
$ cmake --build . --config Release # <<===== It is working
$ cpack -G "TGZ" # <<===== It is working
$ cpack -G "TGZ" --config Release --verbose # <<===== It is NOT working
The first cpack command(cpack -G "TGZ"
) works as expected. It creates the package files in
tar.gz format. But second cpack command gives below error:
CPack: Enable Verbose
CPack Verbose: Read CPack config file: Release
CPack Verbose: Read CPack configuration file: .../build/Release
CPack Error: Problem reading CPack config file: ".../build/Release"
New contributor
kerem2 kerem2 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.