i can compile project with pure g++ command, but i can't do same with cmake. Sorry for dumb question. I just start to work with cmake and google won't give me any solutions.
This is working fine
g++ -static main.cpp -o test -Wl,-Bstatic -lresolv -lutil -lstdc++
But when i compile with cmake i receive such errors
undefined reference to `ns_initparse'
undefined reference to `ns_parserr'
undefined reference to `forkpty'
My cmake file
cmake_minimum_required(VERSION 3.16)
project(test)
set(CMAKE_CXX_STANDARD 11)
add_link_options("-static")
add_compile_options("-lresolv -lutil") #it's like this options won't set
add_executable(test Source/main.cpp)