I am using TagLib as a static library with Visual Studio using CMake with
find_package(TagLib CONFIG)
This works well, but I still have to remember to manually set the TAGLIB_STATIC compile definition. I think instead of having
|
if(NOT BUILD_SHARED_LIBS) |
|
add_definitions(-DTAGLIB_STATIC) |
|
endif() |
in your CMakeLists.txt, it should be
if(NOT BUILD_SHARED_LIBS)
target_compile_definitions(tag PUBLIC TAGLIB_STATIC)
endif()
This should also put the definition in the installed taglib-targets.cmake file, so that when imported, the project using TagLib automatically has the correct compile definition.
I am using TagLib as a static library with Visual Studio using CMake with
This works well, but I still have to remember to manually set the
TAGLIB_STATICcompile definition. I think instead of havingtaglib/CMakeLists.txt
Lines 22 to 24 in 6563cea
in your CMakeLists.txt, it should be
This should also put the definition in the installed
taglib-targets.cmakefile, so that when imported, the project using TagLib automatically has the correct compile definition.