-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathFindCrypt.cmake
More file actions
30 lines (25 loc) · 794 Bytes
/
FindCrypt.cmake
File metadata and controls
30 lines (25 loc) · 794 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Try to find Crypt library and include path.
# Once done this will define
#
# CRYPT_FOUND
# CRYPT_INCLUDE_DIR
# CRYPT_LIBRARIES
find_path(CRYPT_INCLUDE_DIR wincrypt.h)
if(MSVC)
find_library(CRYPT_LIBRARY crypt32.lib)
else()
find_library(CRYPT_LIBRARY crypt32)
endif()
# Handle the REQUIRED argument and set CRYPT_FOUND
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Crypt DEFAULT_MSG CRYPT_LIBRARY CRYPT_INCLUDE_DIR)
mark_as_advanced(CRYPT_INCLUDE_DIR)
mark_as_advanced(CRYPT_LIBRARY)
if(CRYPT_FOUND)
add_definitions(-DCRYPT_SUPPORT)
set(CRYPT_LIBRARIES ${CRYPT_LIBRARY})
endif()
if(MINGW)
set(CMAKE_C_STANDARD_LIBRARIES "${CMAKE_C_STANDARD_LIBRARIES} -lcrypt32")
set(CMAKE_CXX_STANDARD_LIBRARIES "${CMAKE_CXX_STANDARD_LIBRARIES} -lcrypt32")
endif()