01a4e74fa87918d896664cace9c02d5cd5ed26de
[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    pipestream.cpp
19    pointer_func.cpp
20    restricted_html.cpp
21    source_track_basics.cpp
22    stringfunc.cpp
23    timefunc.cpp
24    tmpfstream.cpp
25    tracefunc.cpp
26    tribool.cpp
27    userfunc.cpp
28    week.cpp
29 )
30
31 SET(cpp_headers
32     cron.hpp
33     daemonfunc.hpp
34     exception.hxx
35     filefunc.hxx
36     i18n.h
37     i2n_configdata.hpp
38     i2n_configfile.hpp
39     insocketstream.hxx
40     ip_type.hxx
41     ipfunc.hxx
42     log_macros.hpp
43     logfunc.hpp
44     logread.hxx
45     oftmpstream.hxx
46     pidfile.hpp
47     pipestream.hxx
48     pointer_func.hpp
49     restricted_html.hpp
50     source_track_basics.hpp
51     stringfunc.hxx
52     timefunc.hxx
53     tmpfstream.hpp
54     tmpfstream_impl.hpp
55     tracefunc.hpp
56     tribool.hpp
57     userfunc.hpp
58     week.hpp
59 )
60
61 add_library(i2ncommon SHARED ${cpp_sources} ${cpp_headers})
62
63 target_link_libraries(i2ncommon
64                       ${Boost_IOSTREAMS_LIBRARIES}
65                       ${Boost_THREAD_LIBRARIES}
66                       ${ICONV_LIBRARIES}
67                       ${OPENSSL_LIBRARIES})
68
69 set_target_properties(i2ncommon PROPERTIES VERSION ${VERSION} SOVERSION 6)
70 set_target_properties(i2ncommon PROPERTIES OUTPUT_NAME i2ncommon CLEAN_DIRECT_OUTPUT 1)
71
72 add_library(i2ncommon_static STATIC ${cpp_sources} ${cpp_headers})
73 set_target_properties(i2ncommon_static PROPERTIES OUTPUT_NAME i2ncommon CLEAN_DIRECT_OUTPUT 1)
74
75 install(TARGETS i2ncommon
76         LIBRARY DESTINATION lib${LIB_SUFFIX}
77         COMPONENT sharedlibs)
78
79 install(TARGETS i2ncommon_static
80         ARCHIVE DESTINATION lib${LIB_SUFFIX}
81         COMPONENT staticlibs)
82
83 install(FILES ${cpp_headers}
84         DESTINATION include/${PROJECT_NAME}
85         COMPONENT headers)