@@ -138,13 +138,6 @@ set(sample_sources
138138
139139find_package (Boost 1.71.0 )
140140
141- ######################################################################
142- # add_gtest_dependency
143-
144- function (add_gtest_dependency target )
145- target_link_libraries ("${target} " ${CNL_GTEST_MAIN_TARGET} )
146- endfunction (add_gtest_dependency )
147-
148141######################################################################
149142# add test-unit target
150143
@@ -155,9 +148,8 @@ add_dependencies(test-all test-unit)
155148# test plain - the all.cpp project with *no* tests of compiler flags
156149
157150add_executable (test -unit-plain all .cpp )
158- target_link_libraries (test -unit-plain Cnl )
151+ target_link_libraries (test -unit-plain Cnl cnl_test )
159152add_test (test -unit-plain "${CMAKE_RUNTIME_OUTPUT_DIRECTORY } /test-unit-plain" )
160- add_gtest_dependency (test -unit-plain )
161153add_dependencies (test -unit test -unit-plain )
162154
163155######################################################################
@@ -175,12 +167,9 @@ function(make_test source compile_flags)
175167 add_executable ("${target} " "${source} " )
176168 target_include_directories ("${target} " PRIVATE "${CMAKE_CURRENT_LIST_DIR } " )
177169 set_target_properties ("${target} " PROPERTIES COMPILE_FLAGS "${compile_flags} " )
178- target_link_libraries ("${target} " Cnl )
170+ target_link_libraries ("${target} " Cnl cnl_test )
179171 add_test ("${target} " "${CMAKE_RUNTIME_OUTPUT_DIRECTORY } /${target} " )
180172
181- # Google Test dependency
182- add_gtest_dependency ("${target} " )
183-
184173 # Boost dependency
185174 if (Boost_FOUND)
186175 target_compile_definitions ("${target} " PRIVATE "-DCNL_BOOST_ENABLED" )
0 commit comments