[CMAKE]
[reactos.git] / dll / win32 / dnsapi / CMakeLists.txt
index 044df74..fbd4659 100644 (file)
@@ -1,16 +1,16 @@
 
-set(CMAKE_C_CREATE_SHARED_LIBRARY "<CMAKE_C_COMPILER> <CMAKE_SHARED_LIBRARY_C_FLAGS> <LINK_FLAGS> <CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS> -o <TARGET> <OBJECTS> <LINK_LIBRARIES> -L${REACTOS_BINARY_DIR}/lib/3rdparty/mingw")
+include_directories(
+    include
+    ${REACTOS_SOURCE_DIR}/lib/3rdparty/adns/src
+    ${REACTOS_SOURCE_DIR}/lib/3rdparty/adns/adns_win32)
 
-include_directories(include)
-include_directories(${REACTOS_SOURCE_DIR}/lib/3rdparty/adns/src)
-include_directories(${REACTOS_SOURCE_DIR}/lib/3rdparty/adns/adns_win32)
+add_definitions(
+    -D_DLL -D__USE_CRTIMP
+    -DADNS_JGAA_WIN32)
 
-add_definitions(-D_DLL -D__USE_CRTIMP)
-add_definitions(-DADNS_JGAA_WIN32)
+spec2def(dnsapi.dll dnsapi.spec)
 
-spec2def(dnsapi ${CMAKE_CURRENT_SOURCE_DIR}/dnsapi.spec ${CMAKE_CURRENT_BINARY_DIR}/dnsapi.def)
-
-list(APPEND SOURCE 
+list(APPEND SOURCE
     dnsapi/adns.c
     dnsapi/context.c
     dnsapi/memory.c
@@ -18,23 +18,22 @@ list(APPEND SOURCE
     dnsapi/query.c
     dnsapi/record.c
     dnsapi/stubs.c
-    dnsapi.rc)
+    dnsapi.rc
+    ${CMAKE_CURRENT_BINARY_DIR}/dnsapi.def)
 
 add_library(dnsapi SHARED
     ${CMAKE_CURRENT_BINARY_DIR}/dnsapi_precomp.h.gch
     ${SOURCE})
 
-set_target_properties(dnsapi PROPERTIES LINK_FLAGS "-Wl,-entry,0")
+set_entrypoint(dnsapi 0)
 
-target_link_libraries(dnsapi
-    ${CMAKE_CURRENT_BINARY_DIR}/dnsapi.def
-    adns
-    ${REACTOS_SOURCE_DIR}/dll/win32/user32/libuser32.a
-    -lws2_32
-    ${REACTOS_SOURCE_DIR}/dll/win32/msvcrt/libmsvcrt.a
-    -liphlpapi
-    ${REACTOS_SOURCE_DIR}/dll/win32/kernel32/libkernel32.a
-    ${REACTOS_SOURCE_DIR}/dll/ntdll/libntdll.a)
+target_link_libraries(dnsapi adns)
+if(MSVC)
+    target_link_libraries(dnsapi msvcsup)
+endif()
 
+add_importlibs(dnsapi user32 ws2_32 iphlpapi msvcrt kernel32 ntdll)
 add_pch(dnsapi ${CMAKE_CURRENT_SOURCE_DIR}/dnsapi/precomp.h ${SOURCE})
-add_dependencies(dnsapi dnsapi_def psdk)
+add_dependencies(dnsapi psdk)
+add_cd_file(TARGET dnsapi DESTINATION reactos/system32 FOR all)
+add_importlib_target(dnsapi.spec)