Allow dynamic linking of framework to application
[oonf.git] / src / core / CMakeLists.txt
1 SET(OONF_CORE_SRCS olsr_cfg.c
2                    olsr_clock.c
3                    olsr_http.c
4                    olsr_interface.c
5                    olsr_logging_cfg.c
6                    olsr_logging.c
7                    olsr_memcookie.c
8                    olsr_netaddr_acl.c
9                    olsr_packet_socket.c
10                    olsr_plugins.c
11                    olsr_socket.c
12                    olsr_stream_socket.c
13                    olsr_telnet.c
14                    olsr_timer.c
15                    olsr.c
16                    os_net_generic.c
17                    os_system_generic.c)
18                    
19 # add os_specific source files
20 IF(WIN32)
21     FILE(GLOB SRCS "os_win32/*.c")    
22     set(OONF_SRCS ${OONF_SRCS} ${SRCS})
23 ENDIF(WIN32)
24
25 IF(LINUX)
26     SET(OONF_CORE_SRCS ${OONF_CORE_SRCS}
27                        os_linux/os_net_linux.c
28                        os_linux/os_system_linux.c)
29 ENDIF(LINUX)
30
31 IF(BSD)
32     FILE(GLOB SRCS "os_bsd/*.c")    
33     set(OONF_SRCS ${OONF_SRCS} ${SRCS})
34 ENDIF(BSD)
35
36 IF(ANDROID)
37     include_directories(src/android)
38     FILE(GLOB SRCS "android/*.c")    
39     set(OONF_SRCS ${OONF_SRCS} ${SRCS})
40 ENDIF(ANDROID)
41
42 ADD_LIBRARY(static_core STATIC ${OONF_CORE_SRCS})
43 ADD_LIBRARY(${OONF_LIBPREFIX}_core SHARED ${OONF_CORE_SRCS})
44
45 IF(WIN32)
46     TARGET_LINK_LIBRARIES(static_core ws2_32 iphlpapi)
47     TARGET_LINK_LIBRARIES(${OONF_LIBPREFIX}_core ws2_32 iphlpapi)
48 ENDIF(WIN32)