Imported Upstream version 2.99.2
[platform/upstream/libsigc++.git] / tests / CMakeLists.txt
1 # Copyright 2016, The libsigc++ Development Team
2 #
3 # This library is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public
5 # License as published by the Free Software Foundation; either
6 # version 2.1 of the License, or (at your option) any later version.
7 #
8 # This library is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 # Lesser General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public
14 # License along with this library; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16
17 enable_testing ()
18
19 function (add_sigcpp_test TEST_SOURCE_FILE)
20         get_filename_component (test_name ${TEST_SOURCE_FILE} NAME_WE)
21         add_executable (${test_name} ${TEST_SOURCE_FILE} testutilities.cc)
22         target_link_libraries (${test_name} sigc-${SIGCXX_API_VERSION})
23         add_test (${test_name} ${CMAKE_CURRENT_BINARY_DIR}/${test_name})
24 endfunction (add_sigcpp_test)
25
26 file(GLOB test_files "test_*.cc")
27 foreach (test_file ${test_files})
28         add_sigcpp_test (${test_file})
29 endforeach()