bf6e4a091588fd181c8ff0f5e50240ac363a7681
[oonf.git] / src / tests / CMakeLists.txt
1 # add test directories
2 include_directories(.)
3
4 function (oonf_create_test executable source libraries)
5     # create executable
6     ADD_EXECUTABLE(${executable} ${source})
7
8     add_dependencies(build_tests ${executable})
9
10     TARGET_LINK_LIBRARIES(${executable} ${libraries})
11     TARGET_LINK_LIBRARIES(${executable} static_cunit)
12
13     # link regex for windows and android
14     IF (WIN32 OR ANDROID)
15         TARGET_LINK_LIBRARIES(${executable} oonf_regex)
16     ENDIF(WIN32 OR ANDROID)
17
18     # link extra win32 libs
19     IF(WIN32)
20         SET_TARGET_PROPERTIES(${executable} PROPERTIES ENABLE_EXPORTS true)
21         TARGET_LINK_LIBRARIES(${executable} ws2_32 iphlpapi)
22     ENDIF(WIN32)
23
24     ADD_TEST(NAME ${executable} COMMAND ${executable})
25 endfunction (oonf_create_test)
26
27 add_subdirectory(cunit)
28 add_subdirectory(common)
29 add_subdirectory(config)
30 add_subdirectory(rfc5444)