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