Mercurial > code
comparison CMakeLists.txt @ 219:8fc177bbc4a6
Update some code
author | David Demelier <markand@malikania.fr> |
---|---|
date | Thu, 08 May 2014 22:55:48 +0200 |
parents | |
children | 6a664378c5c4 |
comparison
equal
deleted
inserted
replaced
218:9324b9e0e7b7 | 219:8fc177bbc4a6 |
---|---|
1 # | |
2 # CMakeLists.txt -- code building for common code | |
3 # | |
4 # Copyright (c) 2014 David Demelier <markand@malikania.fr> | |
5 # | |
6 # Permission to use, copy, modify, and/or distribute this software for any | |
7 # purpose with or without fee is hereby granted, provided that the above | |
8 # copyright notice and this permission notice appear in all copies. | |
9 # | |
10 # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 # | |
18 | |
19 # | |
20 # This CMakeLists build system is primarily used for testing all | |
21 # modules. | |
22 # | |
23 cmake_minimum_required(VERSION 2.8.11) | |
24 project(code) | |
25 | |
26 set(CMAKE_MODULE_PATH ${code_SOURCE_DIR}/cmake) | |
27 | |
28 enable_testing() | |
29 | |
30 include_directories( | |
31 ${code_SOURCE_DIR}/C++ | |
32 ) | |
33 | |
34 # Cppunit is the unit tester | |
35 find_package(Cppunit REQUIRED) | |
36 | |
37 function(define_test name sources) | |
38 # The executable | |
39 add_executable( | |
40 ${name} | |
41 ${sources} | |
42 ) | |
43 | |
44 target_include_directories(${name} PRIVATE ${CPPUNIT_INCLUDE_DIR}) | |
45 target_link_libraries(${name} ${CPPUNIT_LIBRARY}) | |
46 add_test(${name}-test ${name}) | |
47 endfunction() | |
48 | |
49 option(WITH_CONVERTER "Enable converter tests" On) | |
50 option(WITH_DIRECTORY "Enable directory tests" On) | |
51 option(WITH_DRIVER "Enable SQL drivers tests" On) | |
52 option(WITH_DYNLIB "Enable DynLib tests" On) | |
53 option(WITH_HASH "Enable hash functions tests" On) | |
54 option(WITH_LUAE "Enable Luae tests" On) | |
55 option(WITH_PACK "Enable pack functions" On) | |
56 option(WITH_PARSER "Enable parser tests" On) | |
57 option(WITH_SOCKET "Enable sockets tests" On) | |
58 option(WITH_UTF8 "Enable Utf8 functions tests" On) | |
59 option(WITH_XMLPARSER "Enable XML tests" On) | |
60 | |
61 if (WITH_DYNLIB) | |
62 add_subdirectory(C++/Tests/DynLib) | |
63 endif () | |
64 | |
65 | |
66 | |
67 |