I have the following CMakeLists.txt file to add third party libraries based on CLion:
# onetbb
include(FetchContent)
FetchContent_Declare(
onetbb
GIT_REPOSITORY https://github.com/oneapi-src/oneTBB.git
GIT_TAG master
)
FetchContent_MakeAvailable(
onetbb
)
target_include_directories(${PROJECT_NAME} PRIVATE
${onetbb_SOURCE_DIR}/include
)
target_link_libraries(${PROJECT_NAME} PRIVATE
onetbb
)
I can write the code without any error, but When I try to build project, I got the following error:
error LNK1104: cannot open file 'onetbb.lib'
I want to know how to solve this problem, someone can give a better way to add third party libraries is better.