2010-08-07 09:10:44 -04:00
|
|
|
# Copyright (C) 2010 Felix Geyer <debfx@fobos.de>
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 2 or (at your option)
|
|
|
|
# version 3 of the License.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2010-08-13 12:08:06 -04:00
|
|
|
project(KeePassX)
|
2010-08-07 09:10:44 -04:00
|
|
|
|
|
|
|
cmake_minimum_required(VERSION 2.6.0)
|
|
|
|
|
2010-09-11 13:49:30 -04:00
|
|
|
set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake )
|
|
|
|
|
2010-08-13 12:08:06 -04:00
|
|
|
option(WITH_TESTS "Enable building of unit tests" ON)
|
2010-08-07 09:10:44 -04:00
|
|
|
|
2010-08-13 12:08:06 -04:00
|
|
|
set( KEEPASSX_VERSION "0.9.0" )
|
|
|
|
|
2010-09-19 10:57:40 -04:00
|
|
|
if(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
add_definitions(-DQT_NO_KEYWORDS -DQT_NO_EXCEPTIONS -fno-exceptions -fno-rtti
|
|
|
|
-ansi -Wall -Wextra -Wundef -Wold-style-cast -Wnon-virtual-dtor -Wcast-align
|
|
|
|
-Wpointer-arith -Wformat-security -Woverloaded-virtual -Wno-long-long)
|
|
|
|
endif(CMAKE_COMPILER_IS_GNUCXX)
|
2010-08-07 09:10:44 -04:00
|
|
|
|
|
|
|
if( APPLE OR MINGW )
|
|
|
|
set( PROGNAME KeePassX )
|
|
|
|
else( APPLE OR MINGW )
|
|
|
|
set( PROGNAME keepassx )
|
|
|
|
endif( APPLE OR MINGW )
|
|
|
|
|
2010-08-13 12:08:06 -04:00
|
|
|
if( WITH_TESTS )
|
|
|
|
enable_testing()
|
|
|
|
set(QT_USE_QTTEST TRUE)
|
|
|
|
endif( WITH_TESTS )
|
|
|
|
|
|
|
|
set(QT_MIN_VERSION "4.6.0")
|
2010-08-07 09:10:44 -04:00
|
|
|
set(QT_USE_QTMAIN TRUE)
|
|
|
|
find_package(Qt4 REQUIRED)
|
|
|
|
include(${QT_USE_FILE})
|
|
|
|
|
2010-08-13 12:08:06 -04:00
|
|
|
find_package(Automoc4 REQUIRED)
|
|
|
|
|
2010-09-11 13:49:30 -04:00
|
|
|
find_package(Libgcrypt REQUIRED)
|
|
|
|
|
2010-08-07 09:10:44 -04:00
|
|
|
add_subdirectory(src)
|
2010-08-13 12:08:06 -04:00
|
|
|
if( WITH_TESTS )
|
|
|
|
add_subdirectory(tests)
|
|
|
|
endif( WITH_TESTS )
|