HSAdmin Backend Domains, E-Mail, Datenbanken
Purodha
2013-02-20 4a7e12928010374d76e677c8ec3ea4f5e63e9487
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
PROJECT( hsadminc )
CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )
 
#
# look for packages needed for the build to succeed
#
 
# find boost libraries
SET(Boost_USE_MULTITHREADED      ON)
SET(Boost_USE_STATIC_RUNTIME    OFF)
FIND_PACKAGE( Boost 1.44 REQUIRED COMPONENTS date_time filesystem iostreams regex system unit_test_framework thread )
 
# find doxygen
FIND_PACKAGE( Doxygen 1.7.3 )
 
# find GnuTLS
FIND_PACKAGE( GnuTLS 2.8.6 REQUIRED )
 
 
#
# set compiler and linker flags
#
 
# compiler
SET( CMAKE_CXX_FLAGS_DEBUG "-g3 -O0" )
SET( CMAKE_CXX_FLAGS_RELEASE "-O3" )
SET( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g3 -O3" )
SET( CMAKE_CXX_FLAGS_MINSIZEREL "-Os" )
 
# gcc specific
IF( CMAKE_COMPILER_IS_GNUCC )
    SET( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wold-style-cast -pedantic -Wall -Wextra -Winit-self -Wshadow -Wconversion -Wlogical-op -Wnormalized=nfc -Winline -std=c++0x" )
    SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++0x" )
    SET( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -std=c++0x" )
    SET( CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -std=c++0x" )
ENDIF()
 
#linker
SET( CMAKE_LINK_FLAGS_DEBUG "-g -O0" )
SET( CMAKE_LINK_FLAGS_RELEASE "-O3" )
SET( CMAKE_LINK_FLAGS_RELWITHDEBINFO "-g -O3" )
SET( CMAKE_LINK_FLAGS_MINSIZEREL "-O3" )
 
# GNU ld specific
IF( CMAKE_COMPILER_IS_GNUCC )
    SET( CMAKE_LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_RELEASE} --relax" )
    SET( CMAKE_LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE} --relax" )
    SET( CMAKE_LINK_FLAGS_RELWITHDEBINFO "${CMAKE_LINK_FLAGS_RELWITHDEBINFO} --relax" )
    SET( CMAKE_LINK_FLAGS_MINSIZEREL "${CMAKE_LINK_FLAGS_MINSIZEREL} -s --gc-sections --relax" )
ENDIF()
 
# build the release as default
SET( CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_RELEASE} )
SET( CMAKE_LINK_FLAGS ${CMAKE_LINK_FLAGS_RELEASE} )
 
# make sure the boost include files are available
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} )
# all libs that will be linked to hsadminc
SET( HSADMINC_LIB ${Boost_LIBRARIES} gnutls )
 
# now this is where the source is
ADD_SUBDIRECTORY( source )
 
# packaging
IF( ${UNIX} )
    SET( CPACK_GNERATOR "DEB;RPM;" )
    SET( CPACK_PACKAGE_DESCRIPTION "hsadmin command line client" )
    SET( CPACK_PACKAGE_DESCRIPTION_SUMMARY "a command line tool to access servers of the configuration tool hsadmin developed by Hostsharing e.G." )
    SET( CPACK_PACKAGE_NAME "hsadminc" )
 
    SET( CPACK_DEBIAN_PACKAGE_DEPENDS "boost (>= 1.44), gnutls (>= 2.8.6)" )
    SET( CPACK_PACKAGE_CONTACT "Christof Donat" )
    SET( CPACK_PACKAGE_VENDOR "Hostsharing e.G." )
    SET( CPACK_PACKAGE_VERSION_MAJOR "0" )
    SET( CPACK_PACKAGE_VERSION_MINOR "0" )
    SET( CPACK_PACKAGE_VERSION_PATCH "1" )
    SET( VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}" )
ENDIF()
 
# currently WIN32 is not supported
#IF( ${WIN32} )
#    SET( CPACK_GNERATOR "NSIS;" )
#    SET( CPACK_NSIS_MUI_ICON "" )
#    SET( CPACK_NSIS_MUI_UNIICON "" )
#    SET( CPACK_PACKAGE_ICON "" )
#    SET( CPACK_NSIS_EXTRA_INSTALL_COMMANDS "" )
#    SET( CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "" )
#    SET( CPACK_NSIS_COMPRESSOR "" )
#    SET( CPACK_NSIS_MODIFY_PATH "" )
#    SET( CPACK_NSIS_DISPLAY_NAME "" )
#    SET( CPACK_NSIS_INSTALLED_ICON_NAME "" )
#    SET( CPACK_NSIS_HELP_LINK "" )
#    SET( CPACK_NSIS_URL_INFO_ABOUT "" )
#    SET( CPACK_NSIS_CONTACT "" )
#    SET( CPACK_NSIS_CREATE_ICONS_EXTRA "" )
#    SET( CPACK_NSIS_DELETE_ICONS_EXTRA "" )
#    SET( CPACK_NSIS_MENU_LINKS "" )
#    SET( CPACK_NSIS_MUI_FINISHPAGE_RUN "" )
#ENDIF()
 
# currently OSX is not supported
#IF( ${APPLE} )
#    SET( CPACK_GNERATOR "MACOSX_BUNDLE;" )
#    SET( CPACK_PACKAGE_FILE_NAME "" )
#    SET( CPACK_PACKAGE_ICON "" )
#    SET( CPACK_BUNDLE_NAME "" )
#    SET( CPACK_BUNDLE_ICON "" )
#    SET( CPACK_BUNDLE_PLIST "" )
#    SET( CPACK_BUNDLE_STARTUP_COMMAND "" )
#ENDIF()
 
 
#
# doxygen documentation
#
 
CONFIGURE_FILE( doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile )
ADD_CUSTOM_TARGET( doxygen ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile )
SET_PROPERTY( DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CKEAN_FILES doc )
GET_TARGET_PROPERTY( DOC_TARGET doc TYPE )
IF( NOT DOC_TARGET )
    ADD_CUSTOM_TARGET( doc )
ENDIF()
 
ADD_DEPENDENCIES( doc doxygen )
 
SET( DOC_PATH "share/doc/${CPACK_PACKAGE_NAME}-${VERSION}" )
INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/html DESTINATION DOC_PATH )