hello i am learning to use cmake better and i am now trying to learn to install header files in the computer(linux mint os ) using vscode so that i can use it in different projects and i am struggling a little bit the folders is called: installoefenv1. It has a hpp file called: ihead1.hpp and a CMakeLists.txt in it the iihead1.hpp is written like this:
`#include
#include
using namespace std;
string t1;
void incout (string t1 ) {
cout << t1 << β\nβ;
}`
and the cmakelists is like :
cmake_minimum_required(VERSION 3.22.1) # the minimum requirement
project(installestv1) # project name
set(CMAKE_CXX_VERSION 17)
add_library(ihead1 STATIC ihead1.hpp) # added library
include(GNUInstallDirs)
install(TARGETS ihead1 PUBLIC_HEADER DESTINATION lib) # install target for lib file
install(FILES ihead1.hpp DESTINATION include) # install target for include
``` and when i try to install with cmake install or sudo make install i get this error:`[main] Building folder: /home/jonathan/Documents/cpp.test/install_oefen/build
[main] Configuring project: install_oefen
[proc] Executing command: /usr/bin/cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc-12 --no-warn-unused-cli -S/home/jonathan/Documents/cpp.test/install_oefen -B/home/jonathan/Documents/cpp.test/install_oefen/build -G "Unix Makefiles"
[cmake] Not searching for unused variables given on the command line.
[cmake] -- Configuring done
[cmake] -- Generating done
[cmake] CMake Error: Cannot determine link language for target "ihead1".
[cmake] CMake Error: CMake can not determine linker language for target: ihead1
[cmake] CMake Generate step failed. Build files cannot be regenerated correctly.
[proc] The command: /usr/bin/cmake -DCMAKE_BUILD_TYPE:STRING=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS:BOOL=TRUE -DCMAKE_C_COMPILER:FILEPATH=/usr/bin/gcc-12 --no-warn-unused-cli -S/home/jonathan/Documents/cpp.test/install_oefen -B/home/jonathan/Documents/cpp.test/install_oefen/build -G "Unix Makefiles" exited with code: 1
` can anyone help me ?