File: gd.cmake

package info (click to toggle)
libgd2 2.3.3-13
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 13,396 kB
  • sloc: ansic: 49,708; sh: 5,660; javascript: 1,859; cpp: 1,308; makefile: 345; perl: 197; tcl: 45
file content (18 lines) | stat: -rw-r--r-- 779 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
option(BUILD_TEST "Compile examples in the build tree and enable ctest" OFF)

# This expects TESTS_FILES to already be defined to the lists of tests.
# Extra libs can be passed in as the 1st argument.
MACRO(ADD_GD_TESTS)
	GET_FILENAME_COMPONENT(TEST_PREFIX ${CMAKE_CURRENT_SOURCE_DIR} NAME_WE)
	FOREACH(test_name ${TESTS_FILES})
		SET(test_prog_name "test_${TEST_PREFIX}_${test_name}")
		add_executable(${test_prog_name} "${test_name}.c")
		IF(WIN32)
			target_link_libraries (${test_prog_name} gdTest ${ARGV0})
		ELSE(WIN32)
			target_link_libraries (${test_prog_name} gdTest m ${ARGV0})
		ENDIF(WIN32)
		add_test(NAME ${test_prog_name} COMMAND ${test_prog_name})
		SET_PROPERTY(TEST ${test_prog_name} PROPERTY SKIP_RETURN_CODE 77)
	ENDFOREACH(test_name)
ENDMACRO(ADD_GD_TESTS)