I wanna know how to install a header files on the computer the header file called ihead5.hpp is like this `#include
#include
using namespace std; //
void i5 (int a1,string s1) { /// a simple test fuction
cout << 20 <<s1;
}
`
and the cmakelists.txt is like this : cmake_minimum_required(VERSION 3.28.3) # this is a practice CmakeLists to learn to install headers file in the computer
project(itest5 CXX ) # project name and version
set(CMAKE_EXPORT_COMPILE_COMMANDS)
set(BUILD_BUNDLE_DIR “${PROJECT_BINARY_DIR}/lib”)
set(CMAKE_INSTALL_PREFIX “${BUILD_BUNDLE_DIR}” CACHE PATH “…” FORCE)
add_library(ihead5 ihead5.hpp )
set_target_properties(ihead5 PROPERTIES LINKER_LANGUAGE CXX) # set targets property
include(GNUInstallDirs) #include gnuinstalldir
install(TARGETS ihead5
EXPORT ihead5
ARCHIVE DESTINATION lib) # ihead goes to lib file
install(FILES
EXPORT ihead5.hpp
DESTINATION include) # ihead.hpp goes to include folder but i get thew error when using install command on vscode : [main] Building folder: /home/d22/cmake_oef1/lib1/installtest1/build install [build] Starting build [proc] Executing command: /usr/bin/cmake --build /home/d22/cmake_oef1/lib1/installtest1/build --config Debug --target install -- [build] [1/1 0% :: 0.000] Install the project... [build] -- Install configuration: "Debug" [build] -- Up-to-date: /home/d22/cmake_oef1/lib1/installtest1/build/lib/lib/libihead5.a [build] CMake Error at cmake_install.cmake:50 (file): [build] file INSTALL cannot find "/home/d22/cmake_oef1/lib1/installtest1/EXPORT": [build] No such file or directory. [build] [build] [build] FAILED: CMakeFiles/install.util [build] cd /home/d22/cmake_oef1/lib1/installtest1/build && /usr/bin/cmake -P cmake_install.cmake [build] ninja: build stopped: subcommand failed. [proc] The command: /usr/bin/cmake --build /home/d22/cmake_oef1/lib1/installtest1/build --config Debug --target install -- exited with code: 1 [driver] Build completed: 00:00:00.023 [build] Build finished with exit code 1
Can someone help?
Blockquote