/
CMakeLists.txt
45 lines (45 loc) · 2.49 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cmake_minimum_required(VERSION 2.6)
enable_testing()
project(jsonme)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
set(libdir ${CMAKE_INSTALL_PREFIX}/lib)
set(includedir ${CMAKE_INSTALL_PREFIX}/include)
ADD_DEFINITIONS( -Wall -Werror -Weffc++ -Wctor-dtor-privacy -Wuninitialized -Winit-self -Wmissing-include-dirs -Wfloat-equal -Wshadow -Wpointer-arith )
ADD_DEFINITIONS(-DUSE_GOBJECT_JSON_LIB)
#Uncomment the following line for ubuntu 11.10, FIXME: use cmake properly to figure this out.
#ADD_DEFINITIONS( -I/usr/include/json-glib-1.0/ -I/usr/include/glib-2.0/ -I/usr/lib/x86_64-linux-gnu/glib-2.0/include/)
#Uncomment the following line for ubuntu 10.04 LTS.
ADD_DEFINITIONS( -I/usr/include/json-glib-1.0/ -I/usr/include/glib-2.0/ -I/usr/lib/glib-2.0/include )
add_library(jsonme SHARED JsonMeLib.cpp Scalar.cpp Node.cpp ParseError.cpp gobj/GobjectLibImpl.cpp gobj/GobjectImplParser.cpp gobj/GobjectImplFsTopNode.cpp gobj/GobjectImplStringTopNode.cpp gobj/GobjectImplError.cpp gobj/GobjectImplNode.cpp gobj/GobjectImplScalar.cpp gobj/GobjectImplKeys.cpp)
SET_TARGET_PROPERTIES(jsonme PROPERTIES VERSION 1.0.0 SOVERSION 1)
target_link_libraries(jsonme gobject-2.0 json-glib-1.0)
install_targets(/lib jsonme)
install(FILES json-me.hpp DESTINATION include)
add_executable(test_bogusstring tests/bogusstring.cpp)
target_link_libraries(test_bogusstring jsonme)
add_test(tests.bogusstring test_bogusstring)
add_executable(test_bogusfile tests/bogusfile.cpp)
target_link_libraries(test_bogusfile jsonme)
add_test(tests.bogusfile test_bogusfile)
add_executable(test_parsejsonstring tests/parsejsonstring.cpp)
target_link_libraries(test_parsejsonstring jsonme)
add_test(tests.parsejsonstring test_parsejsonstring)
add_executable(test_parsejsonfile tests/parsejsonfile.cpp)
target_link_libraries(test_parsejsonfile jsonme)
add_test(tests.parsejsonfile test_parsejsonfile)
add_executable(test_bogusnode tests/bogusnode.cpp)
target_link_libraries(test_bogusnode jsonme)
add_test(tests.bogusnode test_bogusnode)
add_executable(test_validnode tests/validnode.cpp)
target_link_libraries(test_validnode jsonme)
add_test(tests.validnode test_validnode)
add_executable(test_nodecount tests/nodecount.cpp)
target_link_libraries(test_nodecount jsonme)
add_test(tests.nodecount test_nodecount)
add_executable(test_value tests/value.cpp)
target_link_libraries(test_value jsonme)
add_test(tests.value test_value)
add_executable(test_keys tests/keys.cpp)
target_link_libraries(test_keys jsonme)
add_test(tests.keys test_keys)