Migrate libi2ncommon to cmake
[libi2ncommon] / src / CMakeLists.txt
1 include_directories(
2     ${CMAKE_SOURCE_DIR}/src
3     ${CMAKE_SOURCE_DIR}/utils
4     ${ICONV_INCLUDE_DIRS}
5 )
6
7 SET(cpp_sources
8    cron.cpp
9    daemonfunc.cpp
10    filefunc.cpp
11    i18n.cpp
12    i2n_configfile.cpp
13    ipfunc.cpp
14    logfunc.cpp
15    logread.cpp
16    oftmpstream.cpp
17    pidfile.cpp
18    pointer_func.cpp
19    source_track_basics.cpp
20    stringfunc.cpp
21    timefunc.cpp
22    tmpfstream.cpp
23    tracefunc.cpp
24    tribool.cpp
25    userfunc.cpp
26    week.cpp
27 )
28
29 SET(hpp_sources
30     cron.hpp
31     daemonfunc.hpp
32     exception.hxx
33     filefunc.hxx
34     i18n.h
35     i2n_configdata.hpp
36     i2n_configfile.hpp
37     insocketstream.hxx
38     ip_type.hxx
39     ipfunc.hxx
40     log_macros.hpp
41     logfunc.hpp
42     logread.hxx
43     oftmpstream.hxx
44     pidfile.hpp
45     pipestream.hxx
46     pointer_func.hpp
47     source_track_basics.hpp
48     stringfunc.hxx
49     timefunc.hxx
50     tmpfstream.hpp
51     tmpfstream_impl.hpp
52     tracefunc.hpp
53     tribool.hpp
54     userfunc.hpp
55     week.hpp
56 )
57
58 add_library(i2ncommon SHARED ${cpp_sources} ${hpp_sources})
59
60 target_link_libraries(i2ncommon ${Boost_IOSTREAMS_LIBRARIES} ${ICONV_LIBRARIES})
61
62 set_target_properties(i2ncommon PROPERTIES VERSION ${VERSION} SOVERSION ${MAJOR_VERSION})
63
64 install(TARGETS i2ncommon
65         LIBRARY DESTINATION lib
66         COMPONENT sharedlibs)
67
68 install(FILES ${cpp_headers}
69         DESTINATION include
70         COMPONENT headers)