[CMAKE]
[reactos.git] / dll / win32 / crypt32 / CMakeLists.txt
index 597419d..5240252 100644 (file)
@@ -1,19 +1,20 @@
 
-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")
-
-add_definitions(-D__WINESRC__)
-add_definitions(-D_DLL -D__USE_CRTIMP)
-add_definitions(-D_WINE)
+add_definitions(
+    -D__WINESRC__
+    -D_DLL
+    -D__USE_CRTIMP
+    -D_WINE)
 
 remove_definitions(-D_WIN32_WINNT=0x502)
 add_definitions(-D_WIN32_WINNT=0x600)
 
-
 include_directories(${REACTOS_SOURCE_DIR}/include/reactos/wine)
 
-spec2def(crypt32 ${CMAKE_CURRENT_SOURCE_DIR}/crypt32.spec ${CMAKE_CURRENT_BINARY_DIR}/crypt32.def)
+set_rc_compiler()
+
+spec2def(crypt32.dll crypt32.spec)
 
-add_library(crypt32 SHARED
+list(APPEND SOURCE
     base64.c
     cert.c
     chain.c
@@ -39,17 +40,20 @@ add_library(crypt32 SHARED
     store.c
     str.c
     crypt32.rc
-    version.rc)
+    version.rc
+    ${CMAKE_CURRENT_BINARY_DIR}/crypt32_stubs.c
+    ${CMAKE_CURRENT_BINARY_DIR}/crypt32.def)
 
-set_target_properties(crypt32 PROPERTIES LINK_FLAGS "-Wl,-entry,_DllMain@12")
+add_library(crypt32 SHARED ${SOURCE})
+
+set_module_type(crypt32 win32dll)
 
 target_link_libraries(crypt32
-    ${CMAKE_CURRENT_BINARY_DIR}/crypt32.def
     wine
-    pseh
-    mingw_common
-    -luser32
-    -ladvapi32
-    -lmsvcrt)
+    ${PSEH_LIB}
+    oldnames)
+
+add_importlibs(crypt32 user32 advapi32 msvcrt kernel32 ntdll)
 
-add_dependencies(crypt32 crypt32_def psdk)
+add_cd_file(TARGET crypt32 DESTINATION reactos/system32)
+add_importlib_target(crypt32.spec)