~ubuntu-branches/ubuntu/wily/qca2/wily-proposed

« back to all changes in this revision

Viewing changes to qca/CMakeLists.txt

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2007-10-27 18:51:54 UTC
  • mfrom: (1.1.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20071027185154-4ir9ys3h2q9fofrw
Tags: 2.0.0-2
Upload to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
PROJECT(QCA)
2
 
 
3
 
OPTION(BUILD_TESTS "Create test" ON)
4
 
 
5
 
set(LIB_SUFFIX "" CACHE STRING "Define suffix of directory name (32/64)" )
6
 
 
7
 
set(LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" CACHE STRING "Directory where lib will install")
8
 
 
9
 
set(PKGCONFIG_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}/pkgconfig/" CACHE STRING "Base directory for pkgconfig files")
10
 
 
11
 
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules" )
12
 
 
13
 
find_package(Qt4 REQUIRED)
14
 
 
15
 
if (APPLE)
16
 
   find_package(Carbon REQUIRED)
17
 
   set(CMAKE_INSTALL_NAME_DIR ${LIB_INSTALL_DIR})
18
 
   set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)
19
 
endif (APPLE)
20
 
 
21
 
if (CMAKE_COMPILER_IS_GNUCXX)
22
 
   if (CMAKE_SYSTEM_NAME MATCHES Linux)
23
 
     add_definitions (-D_BSD_SOURCE)
24
 
     set ( CMAKE_C_FLAGS     "${CMAKE_C_FLAGS} -Wno-long-long -ansi -Wundef -Wcast-align -Werror-implicit-function-declaration -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -Wmissing-format-attribute -fno-common")
25
 
     set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wnon-virtual-dtor -Wno-long-long -ansi -Wundef -Wcast-align -Wchar-subscripts -Wall -W -Wpointer-arith -Wwrite-strings -Wformat-security -fno-check-new -fno-common")
26
 
   endif (CMAKE_SYSTEM_NAME MATCHES Linux)
27
 
endif (CMAKE_COMPILER_IS_GNUCXX)
28
 
 
29
 
add_definitions (${QT_DEFINITIONS})
30
 
INCLUDE_DIRECTORIES(include/QtCrypto/ ${QT_INCLUDES})
31
 
 
32
 
# Always include srcdir and builddir in include path
33
 
# This saves typing ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY} in about every subdir
34
 
set(CMAKE_INCLUDE_CURRENT_DIR ON)
35
 
 
36
 
# put the include dirs which are in the source or build tree
37
 
# before all other include dirs, so the headers in the sources
38
 
# are prefered over the already installed ones
39
 
set(CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
40
 
 
41
 
SET(qca_INCLUDEDIR "${CMAKE_CURRENT_SOURCE_DIR}/include" )
42
 
SET(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/lib${LIB_SUFFIX}" )
43
 
 
44
 
set(qca_PLUGINSDIR "${QT_PLUGINS_DIR}/crypto/")
45
 
MESSAGE(STATUS "Plugins will be installed to " ${qca_PLUGINSDIR})
46
 
 
47
 
include(QcaMacro)
48
 
 
49
 
MESSAGE(STATUS "Checking for certstore..")
50
 
# fixme add OR mac
51
 
IF( WIN32 )
52
 
# USE BUILTIN
53
 
ELSE ( WIN32 )
54
 
  IF ( ENV{QC_CERTSTORE_PATH} )
55
 
    IF(EXISTS ENV{QC_CERTSTORE_PATH})
56
 
      SET( qca_CERTSTORE $ENV{QC_CERTSTORE_PATH})
57
 
    ELSE(EXISTS ENV{QC_CERTSTORE_PATH})
58
 
                  # path to try
59
 
    ENDIF(EXISTS ENV{QC_CERTSTORE_PATH})
60
 
  ELSE( ENV{QC_CERTSTORE_PATH} )
61
 
    SET( toTry
62
 
      "/etc/ssl/certs/ca-certificates.crt"
63
 
      "/usr/share/ssl/cert.pem"
64
 
      "/usr/share/ssl/certs/ca-bundle.crt"
65
 
      "/etc/pki/tls/cert.pem"
66
 
      "/usr/share/curl/curl-ca-bundle.crt"
67
 
    )
68
 
    FOREACH (_current_try ${toTry})
69
 
      IF(EXISTS ${_current_try})
70
 
        SET( qca_CERTSTORE ${_current_try})
71
 
      ENDIF(EXISTS ${_current_try})
72
 
    ENDFOREACH (_current_try)
73
 
  ENDIF( ENV{QC_CERTSTORE_PATH} )
74
 
ENDIF(WIN32)
75
 
 
76
 
IF (qca_CERTSTORE)
77
 
  MESSAGE(STATUS "Found system certstore")
78
 
ELSE (qca_CERTSTORE)
79
 
  MESSAGE(STATUS "Using built in certstore.")
80
 
  SET( qca_CERTSTORE "${CMAKE_CURRENT_SOURCE_DIR}/certs/rootcerts.pem")
81
 
  # note that INSTALL_FILES targets are relative to the current installation prefix...
82
 
  INSTALL_FILES( "/certs" FILES "${CMAKE_CURRENT_SOURCE_DIR}/certs/rootcerts.pem" )
83
 
ENDIF (qca_CERTSTORE)
84
 
MESSAGE(STATUS "certstore path: " ${qca_CERTSTORE})
85
 
ADD_DEFINITIONS( -DQCA_SYSTEMSTORE_PATH="\\\"${qca_CERTSTORE}\\\"" )
86
 
 
87
 
 
88
 
SET( private_HEADERS ${qca_INCLUDEDIR}/QtCrypto/qca_plugin.h ${qca_INCLUDEDIR}/QtCrypto/qca_systemstore.h )
89
 
 
90
 
SET( public_HEADERS 
91
 
  ${qca_INCLUDEDIR}/QtCrypto/qca.h
92
 
  ${qca_INCLUDEDIR}/QtCrypto/qcaprovider.h
93
 
  ${qca_INCLUDEDIR}/QtCrypto/QtCrypto
94
 
  ${qca_INCLUDEDIR}/QtCrypto/qca_export.h
95
 
        ${qca_INCLUDEDIR}/QtCrypto/qca_support.h
96
 
        ${qca_INCLUDEDIR}/QtCrypto/qca_tools.h
97
 
        ${qca_INCLUDEDIR}/QtCrypto/qca_core.h
98
 
        ${qca_INCLUDEDIR}/QtCrypto/qca_textfilter.h
99
 
        ${qca_INCLUDEDIR}/QtCrypto/qca_basic.h
100
 
        ${qca_INCLUDEDIR}/QtCrypto/qca_publickey.h
101
 
        ${qca_INCLUDEDIR}/QtCrypto/qca_cert.h
102
 
        ${qca_INCLUDEDIR}/QtCrypto/qca_keystore.h
103
 
        ${qca_INCLUDEDIR}/QtCrypto/qca_securelayer.h
104
 
        ${qca_INCLUDEDIR}/QtCrypto/qca_securemessage.h
105
 
        ${qca_INCLUDEDIR}/QtCrypto/qpipe.h )
106
 
 
107
 
SET( qca_HEADERS ${private_HEADERS} ${public_HEADERS} )
108
 
 
109
 
#install public headers only
110
 
INSTALL(FILES ${public_HEADERS} DESTINATION "${CMAKE_INSTALL_PREFIX}/include/QtCrypto")
111
 
 
112
 
INCLUDE_DIRECTORIES(${QT_QTCORE_INCLUDE_DIR} "${qca_INCLUDEDIR}/QtCrypto")
113
 
 
114
 
CONFIGURE_FILE("qca.pc.cmake" "${CMAKE_BINARY_DIR}/qca.pc" @ONLY)
115
 
INSTALL(FILES "${CMAKE_BINARY_DIR}/qca.pc" DESTINATION ${PKGCONFIG_INSTALL_PREFIX})
116
 
 
117
 
CONFIGURE_FILE("crypto.prf.cmake" "${CMAKE_BINARY_DIR}/crypto.prf" @ONLY)
118
 
INSTALL(FILES "${CMAKE_BINARY_DIR}/crypto.prf" DESTINATION ${CMAKE_INSTALL_PREFIX}/mkspecs/features)
119
 
 
120
 
add_subdirectory(src)
121
 
add_subdirectory(tools)
122
 
add_subdirectory(plugins)
123
 
if(BUILD_TESTS)
124
 
        ENABLE_TESTING()
125
 
        add_subdirectory(unittest)
126
 
        add_subdirectory(examples)
127
 
endif(BUILD_TESTS)
128