Allow dynamic linking of framework to application
[oonf.git] / src / CMake.link_dynamic
1 # the order of static libraries is important
2 # earlier libraries can use the functions of later, not the
3 # other way around
4
5 # link plugin loader
6 TARGET_LINK_LIBRARIES(${OONF_EXE} static_pluginloader)
7
8 # link static plugins
9 FOREACH(plugin ${OONF_STATIC_PLUGINS})
10     TARGET_LINK_LIBRARIES(${OONF_EXE} static_${plugin})
11 ENDFOREACH(plugin)
12
13 # link core
14 TARGET_LINK_LIBRARIES(${OONF_EXE} ${OONF_LIBPREFIX}_core)
15
16 # link config and common API
17 TARGET_LINK_LIBRARIES(${OONF_EXE} ${OONF_LIBPREFIX}_config)
18 TARGET_LINK_LIBRARIES(${OONF_EXE} ${OONF_LIBPREFIX}_common)
19
20 # link builddata
21 TARGET_LINK_LIBRARIES(${OONF_EXE} static_builddata)
22
23 # link dlopen() library
24 TARGET_LINK_LIBRARIES(${OONF_EXE} ${CMAKE_DL_LIBS})
25
26 # link extra win32 libs
27 IF(WIN32)
28     SET_TARGET_PROPERTIES(${OONF_EXE} PROPERTIES ENABLE_EXPORTS true)
29     TARGET_LINK_LIBRARIES(${OONF_EXE} ws2_32 iphlpapi)
30 ENDIF(WIN32)