# CMakeLists.txt # # Description: GREAT-ER Administration tool cmake file # # Authors: # Andre Heinecke # # Copyright: # Copyright (C) 2011 by Intevation GmbH # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2, # or, at your option, any later version as published by the Free # Software Foundation # # 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, write to the Free Software PROJECT( greateradmin ) cmake_minimum_required(VERSION 2.6) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") ################## Greateradmin version ################################ set(CMAKE_GREATERADMIN_VERSION_MAJOR 0) set(CMAKE_GREATERADMIN_VERSION_MINOR 0) set(CMAKE_GREATERADMIN_VERSION_RELEASE 1) set(CMAKE_GREATERADMIN_VERSION_STRING "${CMAKE_GREATERADMIN_VERSION_MAJOR}.${CMAKE_GREATERADMIN_VERSION_MINOR}.${CMAKE_GREATERADMIN_VERSION_RELEASE}") FIND_PACKAGE(wxWidgets 2.8.0 REQUIRED adv core base) FIND_PACKAGE(XercesC 2.8.0 REQUIRED) IF (${XERCESC_VERSION} GREATER 2.8) MESSAGE(SEND_ERROR "Xerces-C version newer then 2.8 is not supported") ENDIF(${XERCESC_VERSION} GREATER 2.8) FIND_PACKAGE(Dagreater_pg REQUIRED) include( ${wxWidgets_USE_FILE} ) add_definitions(-DUNICODE) if(NOT MSVC) add_definitions(-Werror) endif() include_directories(${CMAKE_CURRENT_SOURCE_DIR}, ${wxWidgets_INCLUDE_DIRS}, ${DAGREATER_PG_INCLUDE}) set( greateradmin_BIN_SRCS Administration.cpp AuthenticateDialog.cpp BackgrdDialog.cpp BinobjDialog.cpp CatchmentDialog.cpp ConvXMLChar.cpp DownloadDialog.cpp EnvironmentDialog.cpp EnvtreeDialog.cpp ExportDialog.cpp FixedTextCtrl.cpp GroupDialog.cpp ImportDialog.cpp MainWindow.cpp MessageDialog.cpp MyButton.cpp MyGrid.cpp PanelBackgrd.cpp PanelBase.cpp PanelBinobj.cpp PanelCatchment.cpp PanelEnvironment.cpp PanelEnvtree.cpp PanelGroup.cpp PanelMessage.cpp PanelParatree.cpp PanelPhrase.cpp PanelSession.cpp PanelSubstance.cpp PanelSubsttree.cpp PanelUser.cpp ParatreeDialog.cpp PhraseDialog.cpp PwdDialog.cpp SessionDialog.cpp SubstanceDialog.cpp SubsttreeDialog.cpp UserDialog.cpp XMLStringConv.cpp DTDEntityResolver.cpp ) if(WIN32) set(greateradmin_BIN_SRCS ${greateradmin_BIN_SRCS} Administration.rc) ENDIF(WIN32) add_executable(Administration WIN32 ${greateradmin_BIN_SRCS}) target_link_libraries(Administration ${DAGREATER_PG_LIBRARY} ${wxWidgets_LIBRARIES} ${XERCESC_LIBRARY}) if(MSVC) # Workaround for using differently compiled libs set_target_properties(Administration PROPERTIES LINK_FLAGS /NODEFAULTLIB:libcmt) set_target_properties(Administration PROPERTIES LINK_FLAGS /NODEFAULTLIB:libcmtd) endif(MSVC) install(TARGETS Administration DESTINATION bin) #TODO: should be installed to $(CMAKE_INSTALL_PREFIX)/share/greater/ on Linux install(FILES greater.dtd greater.xsl DESTINATION bin ) if (NOT WIN32) #TODO: should be installed to $(CMAKE_INSTALL_PREFIX)/share/greater/ install(FILES Greater1.xpm DESTINATION bin) endif(NOT WIN32)