~timkross/cjdns/cjdns

« back to all changes in this revision

Viewing changes to crypto/test/CMakeLists.txt

  • Committer: cjdelisle
  • Date: 2011-02-16 23:03:00 UTC
  • Revision ID: git-v1:d475c9c10adc25590bea5e7dc5383b32f66d5eb8
First commit for cjdns.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
cmake_minimum_required(VERSION 2.4)
 
2
 
 
3
string(REGEX REPLACE "^.*/" "" main_dir_name ${CMAKE_SOURCE_DIR})
 
4
string(REPLACE ${CMAKE_SOURCE_DIR} ${main_dir_name} this_dir ${CMAKE_CURRENT_SOURCE_DIR})
 
5
message("-- Tests to run for " ${this_dir})
 
6
 
 
7
# Anything in this dir which ends with "test.c" is considered a test.
 
8
file(GLOB tests "*test.c")
 
9
foreach(test_source_fullpath ${tests})
 
10
  string(REGEX REPLACE "^.*/" "" test_source ${test_source_fullpath})
 
11
  string(REPLACE "test.c" "test" test_bin ${test_source})
 
12
  message("     " ${test_source})
 
13
  add_executable(${test_bin} ${test_source})
 
14
  target_link_libraries(${test_bin} crypto benc)
 
15
  add_test(${test_bin} ${test_bin})
 
16
endforeach()
 
17
# Add an empty line after tests.
 
18
message("")