THRIFT-3909 Fix c_glib static lib CMake build

This closes #1072
diff --git a/lib/c_glib/test/CMakeLists.txt b/lib/c_glib/test/CMakeLists.txt
index 95876ed..45ef41f 100644
--- a/lib/c_glib/test/CMakeLists.txt
+++ b/lib/c_glib/test/CMakeLists.txt
@@ -54,47 +54,48 @@
 )
 
 add_library(testgenc STATIC ${testgenc_SOURCES})
-target_link_libraries(testgenc thrift_c_glib)
+LINK_AGAINST_THRIFT_LIBRARY(testgenc thrift_c_glib)
 
 
 add_executable(testserialization testserialization.c)
-target_link_libraries(testserialization testgenc thrift_c_glib)
+target_link_libraries(testserialization testgenc)
+LINK_AGAINST_THRIFT_LIBRARY(testserialization thrift_c_glib)
 add_test(NAME testserialization COMMAND testserialization)
 
 add_executable(testapplicationexception testapplicationexception.c)
-target_link_libraries(testapplicationexception thrift_c_glib)
+LINK_AGAINST_THRIFT_LIBRARY(testapplicationexception thrift_c_glib)
 add_test(NAME testapplicationexception COMMAND testapplicationexception)
 
 add_executable(testtransportsocket testtransportsocket.c)
-target_link_libraries(testtransportsocket thrift_c_glib)
+LINK_AGAINST_THRIFT_LIBRARY(testtransportsocket thrift_c_glib)
 add_test(NAME testtransportsocket COMMAND testtransportsocket)
 
 add_executable(testbinaryprotocol testbinaryprotocol.c)
-target_link_libraries(testbinaryprotocol thrift_c_glib)
+LINK_AGAINST_THRIFT_LIBRARY(testbinaryprotocol thrift_c_glib)
 add_test(NAME testbinaryprotocol COMMAND testbinaryprotocol)
 
 add_executable(testcompactprotocol testcompactprotocol.c)
-target_link_libraries(testcompactprotocol thrift_c_glib)
+LINK_AGAINST_THRIFT_LIBRARY(testcompactprotocol thrift_c_glib)
 add_test(NAME testcompactprotocol COMMAND testcompactprotocol)
 
 add_executable(testbufferedtransport testbufferedtransport.c)
-target_link_libraries(testbufferedtransport thrift_c_glib)
+LINK_AGAINST_THRIFT_LIBRARY(testbufferedtransport thrift_c_glib)
 add_test(NAME testbufferedtransport COMMAND testbufferedtransport)
 
 add_executable(testframedtransport testframedtransport.c)
-target_link_libraries(testframedtransport thrift_c_glib)
+LINK_AGAINST_THRIFT_LIBRARY(testframedtransport thrift_c_glib)
 add_test(NAME testframedtransport COMMAND testframedtransport)
 
 add_executable(testfdtransport testfdtransport.c)
-target_link_libraries(testfdtransport thrift_c_glib)
+LINK_AGAINST_THRIFT_LIBRARY(testfdtransport thrift_c_glib)
 add_test(NAME testfdtransport COMMAND testfdtransport)
 
 add_executable(testmemorybuffer testmemorybuffer.c)
-target_link_libraries(testmemorybuffer thrift_c_glib)
+LINK_AGAINST_THRIFT_LIBRARY(testmemorybuffer thrift_c_glib)
 add_test(NAME testmemorybuffer COMMAND testmemorybuffer)
 
 add_executable(testsimpleserver testsimpleserver.c)
-target_link_libraries(testsimpleserver thrift_c_glib)
+LINK_AGAINST_THRIFT_LIBRARY(testsimpleserver thrift_c_glib)
 add_test(NAME testsimpleserver COMMAND testsimpleserver)
 
 add_executable(testdebugproto testdebugproto.c)
@@ -130,7 +131,7 @@
     )
 
     add_library(testgenc_cpp STATIC ${testgenc_cpp_SOURCES})
-    target_link_libraries(testgenc_cpp thrift)
+    LINK_AGAINST_THRIFT_LIBRARY(testgenc_cpp thrift)
 
     #HACK: testthrifttestclient.cpp includes ThriftTest.h without gen-*/ prefixes
     # so we include it here