HSAdmin Backend Domains, E-Mail, Datenbanken
Purodha
2013-02-20 4a7e12928010374d76e677c8ec3ea4f5e63e9487
commit | author | age
c64ab5 1 PROJECT( hsadminc )
CD 2 CMAKE_MINIMUM_REQUIRED( VERSION 2.6 )
3
4 #
5 # look for packages needed for the build to succeed
6 #
7
8 # find boost libraries
9 SET(Boost_USE_MULTITHREADED      ON)
10 SET(Boost_USE_STATIC_RUNTIME    OFF)
11 FIND_PACKAGE( Boost 1.44 REQUIRED COMPONENTS date_time filesystem iostreams regex system unit_test_framework thread )
12
13 # find doxygen
14 FIND_PACKAGE( Doxygen 1.7.3 )
15
16 # find GnuTLS
17 FIND_PACKAGE( GnuTLS 2.8.6 REQUIRED )
18
19
20 #
21 # set compiler and linker flags
22 #
23
24 # compiler
25 SET( CMAKE_CXX_FLAGS_DEBUG "-g3 -O0" )
26 SET( CMAKE_CXX_FLAGS_RELEASE "-O3" )
27 SET( CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g3 -O3" )
28 SET( CMAKE_CXX_FLAGS_MINSIZEREL "-Os" )
29
30 # gcc specific
31 IF( CMAKE_COMPILER_IS_GNUCC )
32     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" )
33     SET( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -std=c++0x" )
34     SET( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -std=c++0x" )
35     SET( CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -std=c++0x" )
36 ENDIF()
37
38 #linker
39 SET( CMAKE_LINK_FLAGS_DEBUG "-g -O0" )
40 SET( CMAKE_LINK_FLAGS_RELEASE "-O3" )
41 SET( CMAKE_LINK_FLAGS_RELWITHDEBINFO "-g -O3" )
42 SET( CMAKE_LINK_FLAGS_MINSIZEREL "-O3" )
43
44 # GNU ld specific
45 IF( CMAKE_COMPILER_IS_GNUCC )
46     SET( CMAKE_LINK_FLAGS_DEBUG "${CMAKE_LINK_FLAGS_RELEASE} --relax" )
47     SET( CMAKE_LINK_FLAGS_RELEASE "${CMAKE_LINK_FLAGS_RELEASE} --relax" )
48     SET( CMAKE_LINK_FLAGS_RELWITHDEBINFO "${CMAKE_LINK_FLAGS_RELWITHDEBINFO} --relax" )
49     SET( CMAKE_LINK_FLAGS_MINSIZEREL "${CMAKE_LINK_FLAGS_MINSIZEREL} -s --gc-sections --relax" )
50 ENDIF()
51
52 # build the release as default
53 SET( CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS_RELEASE} )
54 SET( CMAKE_LINK_FLAGS ${CMAKE_LINK_FLAGS_RELEASE} )
55
56 # make sure the boost include files are available
57 INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIRS} )
58 # all libs that will be linked to hsadminc
59 SET( HSADMINC_LIB ${Boost_LIBRARIES} gnutls )
60
61 # now this is where the source is
62 ADD_SUBDIRECTORY( source )
63
64 # packaging
65 IF( ${UNIX} )
66     SET( CPACK_GNERATOR "DEB;RPM;" )
67     SET( CPACK_PACKAGE_DESCRIPTION "hsadmin command line client" )
68     SET( CPACK_PACKAGE_DESCRIPTION_SUMMARY "a command line tool to access servers of the configuration tool hsadmin developed by Hostsharing e.G." )
69     SET( CPACK_PACKAGE_NAME "hsadminc" )
70
71     SET( CPACK_DEBIAN_PACKAGE_DEPENDS "boost (>= 1.44), gnutls (>= 2.8.6)" )
72     SET( CPACK_PACKAGE_CONTACT "Christof Donat" )
73     SET( CPACK_PACKAGE_VENDOR "Hostsharing e.G." )
74     SET( CPACK_PACKAGE_VERSION_MAJOR "0" )
75     SET( CPACK_PACKAGE_VERSION_MINOR "0" )
76     SET( CPACK_PACKAGE_VERSION_PATCH "1" )
77     SET( VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}" )
78 ENDIF()
79
80 # currently WIN32 is not supported
81 #IF( ${WIN32} )
82 #    SET( CPACK_GNERATOR "NSIS;" )
83 #    SET( CPACK_NSIS_MUI_ICON "" )
84 #    SET( CPACK_NSIS_MUI_UNIICON "" )
85 #    SET( CPACK_PACKAGE_ICON "" )
86 #    SET( CPACK_NSIS_EXTRA_INSTALL_COMMANDS "" )
87 #    SET( CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "" )
88 #    SET( CPACK_NSIS_COMPRESSOR "" )
89 #    SET( CPACK_NSIS_MODIFY_PATH "" )
90 #    SET( CPACK_NSIS_DISPLAY_NAME "" )
91 #    SET( CPACK_NSIS_INSTALLED_ICON_NAME "" )
92 #    SET( CPACK_NSIS_HELP_LINK "" )
93 #    SET( CPACK_NSIS_URL_INFO_ABOUT "" )
94 #    SET( CPACK_NSIS_CONTACT "" )
95 #    SET( CPACK_NSIS_CREATE_ICONS_EXTRA "" )
96 #    SET( CPACK_NSIS_DELETE_ICONS_EXTRA "" )
97 #    SET( CPACK_NSIS_MENU_LINKS "" )
98 #    SET( CPACK_NSIS_MUI_FINISHPAGE_RUN "" )
99 #ENDIF()
100
101 # currently OSX is not supported
102 #IF( ${APPLE} )
103 #    SET( CPACK_GNERATOR "MACOSX_BUNDLE;" )
104 #    SET( CPACK_PACKAGE_FILE_NAME "" )
105 #    SET( CPACK_PACKAGE_ICON "" )
106 #    SET( CPACK_BUNDLE_NAME "" )
107 #    SET( CPACK_BUNDLE_ICON "" )
108 #    SET( CPACK_BUNDLE_PLIST "" )
109 #    SET( CPACK_BUNDLE_STARTUP_COMMAND "" )
110 #ENDIF()
111
112
113 #
114 # doxygen documentation
115 #
116
117 CONFIGURE_FILE( doc/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile )
118 ADD_CUSTOM_TARGET( doxygen ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile )
119 SET_PROPERTY( DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CKEAN_FILES doc )
120 GET_TARGET_PROPERTY( DOC_TARGET doc TYPE )
121 IF( NOT DOC_TARGET )
122     ADD_CUSTOM_TARGET( doc )
123 ENDIF()
124
125 ADD_DEPENDENCIES( doc doxygen )
126
127 SET( DOC_PATH "share/doc/${CPACK_PACKAGE_NAME}-${VERSION}" )
128 INSTALL( DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/html DESTINATION DOC_PATH )
129