File: CMakeLists.txt

package info (click to toggle)
qca2 2.3.10-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,888 kB
  • sloc: cpp: 59,224; ansic: 814; perl: 133; sh: 89; makefile: 34
file content (68 lines) | stat: -rw-r--r-- 2,244 bytes parent folder | download | duplicates (4)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Use the same path for shared and static plugins
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/${QCA_LIB_NAME}/crypto")
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/${QCA_LIB_NAME}/crypto")

set(PLUGINS "botan;cyrus-sasl;gcrypt;gnupg;logger;nss;ossl;pkcs11;softstore" CACHE INTERNAL "")

# Initialize WITH_${PLUGIN}_PLUGIN cache variables
foreach(PLUGIN IN LISTS PLUGINS)
  set(WITH_${PLUGIN}_PLUGIN "" CACHE STRING "Build ${PLUGIN} plugin")
  string(TOLOWER "${WITH_${PLUGIN}_PLUGIN}" WITH_${PLUGIN}_PLUGIN)
endforeach(PLUGIN IN LISTS PLUGINS)

string(REGEX MATCH "^none|all|auto$" NOT_PLUGIN_LIST "${BUILD_PLUGINS}")

if(NOT_PLUGIN_LIST)
  # BUILD_PLUGINS has "none", "all" or "auto" value
  foreach(PLUGIN IN LISTS PLUGINS)
    # If not defined by user use BUILD_PLUGINS value
    # to decide build or not build the plugin
    if("${WITH_${PLUGIN}_PLUGIN}" STREQUAL "")
      if("${BUILD_PLUGINS}" STREQUAL "all")
        set(WITH_${PLUGIN}_PLUGIN "yes")
      elseif("${BUILD_PLUGINS}" STREQUAL "auto")
        set(WITH_${PLUGIN}_PLUGIN "auto")
      else()
        set(WITH_${PLUGIN}_PLUGIN "no")
      endif()
    elseif(NOT WITH_${PLUGIN}_PLUGIN)
      set(WITH_${PLUGIN}_PLUGIN "no")
    elseif("${WITH_${PLUGIN}_PLUGIN}" STREQUAL "auto")
      set(WITH_${PLUGIN}_PLUGIN "auto")
    else()
      set(WITH_${PLUGIN}_PLUGIN "yes")
    endif()

    # Build plugin if yes or auto
    if(WITH_${PLUGIN}_PLUGIN)
      add_subdirectory("qca-${PLUGIN}")
    else()
      disable_plugin(${PLUGIN})
    endif()
  endforeach(PLUGIN IN LISTS PLUGINS)
else()
  # BUILD_PLUGINS has list plugins to builds
  foreach(PLUGIN IN LISTS PLUGINS)
    list(FIND BUILD_PLUGINS "${PLUGIN}" PLUGIN_INDEX)
    if(PLUGIN_INDEX GREATER -1)
      set(WITH_${PLUGIN}_PLUGIN "yes")
      add_subdirectory("qca-${PLUGIN}")
    else()
      disable_plugin(${PLUGIN})
    endif()
  endforeach(PLUGIN IN LISTS PLUGINS)
endif()

message("")
message("Plugins:")
foreach(PLUGIN IN LISTS PLUGINS)
  message("  qca-${PLUGIN} ${WITH_${PLUGIN}_PLUGIN_INTERNAL}")
endforeach(PLUGIN IN LISTS PLUGINS)

# Currently disabled
#
# IF (WIN32)
#         MESSAGE(STATUS "WinCrypto plugin enabled")
#         ADD_SUBDIRECTORY(qca-wincrypto)
# ENDIF (WIN32)