0
I have in my CMakeLists.txt
several calls to the add_library
where these call libraries(.lib) are located in the same directory. I would like to import all libs from that directory /lib
without having to use the add_library
and set_target_properties
for each of them.
Cmakelists:
add_library(avcodec STATIC IMPORTED)
set_target_properties(avcodec PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../lib/ffmpeg/lib/avcodec.lib")
add_library(avformat STATIC IMPORTED)
set_target_properties(avformat PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../lib/ffmpeg/lib/avformat.lib")
add_library(avutil STATIC IMPORTED)
set_target_properties(avutil PROPERTIES IMPORTED_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}/../lib/ffmpeg/lib/avutil.lib")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/../lib/ffmpeg/include")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -static-libstdc++ -static -lstdc++ -lwinpthread -D__STDC_CONSTANT_MACROS")
add_executable(appffmpeg)
target_link_libraries(appffmpeg curl avcodec avformat avutil)
Is there any more efficient way to do that?
As I would if I wanted to import all libs and leave some out, example, do not matter postproc.lib
and avfilter.lib
, would have to name all manually on import?