Link static library using CMake
问题 I cannot get the library ${static_library} to statically link using CMake. I have tried hard coding the path and as far as I'm aware TARGET_LINK_LIBRARIES should link this in automatically. ADD_LIBRARY(libraryA STATIC ${source_files}) TARGET_LINK_LIBRARIES(libraryA debug ${static_library}) There is a sub project that links libraryA later in the build ADD_EXECUTABLE(testA ${test_sources}) TARGET_LINK_LIBRARIES(testA libraryA) which has ${static_library} correctly linked in but I need ${static