# ********************************* # ************ cmake ************** # ********************************* CMAKE_MINIMUM_REQUIRED(VERSION 2.6) CMAKE_POLICY(SET CMP0043 NEW) CMAKE_POLICY(SET CMP0048 NEW) # Enable debug symbols by default # must be done before project() statement #IF (NOT CMAKE_BUILD_TYPE) # SET(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build (Debug or Release)" FORCE) #ENDIF() # (you can also set it on the command line: -D CMAKE_BUILD_TYPE=Release) # Enable CLANG as default compilers, to change this use # cmake -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=c++ # Note that if compilers are switched on the fly, # the cache is deleted # The version of clang is not compatible with boost::regex on Ubuntu 16.04 :( #IF (NOT DEFINED CMAKE_C_COMPILER) # SET(CMAKE_C_COMPILER "clang")# CACHE STRING "Choose the compiler (c++, g++, clang++)" FORCE) #ENDIF() # #IF (NOT DEFINED CMAKE_CXX_COMPILER) # SET(CMAKE_CXX_COMPILER "clang++")# CACHE STRING "Choose the compiler (c++, g++, clang++)" FORCE) #ENDIF() #SET(CMAKE_VERBOSE_MAKEFILE ON) # ********************************* # ************ Project ************ # ********************************* STRING(TIMESTAMP VERSION %y.%U.%w.%H UTC) MESSAGE(STATUS "FACT++ V${VERSION}") PROJECT(fact++ VERSION ${VERSION}) INCLUDE(GNUInstallDirs) # ======== For config.h.in ========= SET(PACKAGE_MAINTAINER "Thomas Bretz") SET(PACKAGE_BUGREPORT "tbretz@physik.rwth-aachen.de") SET(PACKAGE_URL "https://www.fact-project.org") # ********************************* # ******** FAMOUS / IceACT ******** # ********************************* IF(EXISTS "${CMAKE_SOURCE_DIR}/famous") MESSAGE(STATUS "Compilation of 'famous' enabled.") SET(FOUND_FAMOUS ON) ENDIF() IF(EXISTS "${CMAKE_SOURCE_DIR}/iceact") MESSAGE(STATUS "Compilation of 'iceact' enabled.") SET(FOUND_ICEACT ON) ENDIF() # ********************************* # ********* Requirements ********** # ********************************* # =========== pkg-config ============ FIND_PACKAGE(PkgConfig) FIND_PACKAGE(PackageHandleStandardArgs) # ========== executables ========== FIND_PROGRAM(HELP2MAN_EXECUTABLE help2man) FIND_PROGRAM(JSDOC_EXECUTABLE jsdoc) FIND_PROGRAM(MAILX_EXECUTABLE mailx) FIND_PROGRAM(CURL_EXECUTABLE curl) FIND_PROGRAM(GROFF_EXECUTABLE groff) FIND_PACKAGE_HANDLE_STANDARD_ARGS(groff DEFAULT_MSG GROFF_EXECUTABLE) FIND_PACKAGE_HANDLE_STANDARD_ARGS(curl DEFAULT_MSG CURL_EXECUTABLE) FIND_PACKAGE_HANDLE_STANDARD_ARGS(mailx DEFAULT_MSG MAILX_EXECUTABLE) FIND_PACKAGE_HANDLE_STANDARD_ARGS(jsdoc DEFAULT_MSG JSDOC_EXECUTABLE) FIND_PACKAGE_HANDLE_STANDARD_ARGS(help2man DEFAULT_MSG HELP2MAN_EXECUTABLE) #IF(NOT SOME_COND) # MESSAGE(FATAL_ERROR "At least one required executable was not found") #ENDIF() # =========== libraries ============= SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" ${CMAKE_MODULE_PATH}) # FIXME: Need to check which package finders accept REQUIERED. For all others implement checks FIND_PACKAGE(Threads REQUIRED) # Threads::Threads FIND_PACKAGE(ZLIB REQUIRED) # ZLIB::ZLIB FIND_PACKAGE(OpenGL REQUIRED) # OpenGL::GL OpenGL::GLU / OPENGL_FOUND OPENGL_GLU_FOUND SET(CURSES_NEED_NCURSES ON) FIND_PACKAGE(Curses REQUIRED) # CURSES_FOUND # FIXME : Require panel # FIND_PACKAGE(DBus) => skaypeclient # FIND_PACKAGE(Motif) => did # MOTIF_FOUND FIND_PACKAGE(Readline REQUIRED) FIND_PACKAGE(Panel REQUIRED) FIND_PACKAGE(Nova REQUIRED) FIND_PACKAGE(MySQL REQUIRED) FIND_PACKAGE(MySQL++ REQUIRED) FIND_PACKAGE(V8 REQUIRED) FIND_PACKAGE(Cfitsio REQUIRED) FIND_PACKAGE(CCfits REQUIRED) FIND_PACKAGE(OpenSSL REQUIRED) # Required for boost::asio::ssl #INCLUDE_DIRECTORIES("/usr/include/mysql") # dbus-1 dbus-glib-1 # doxygen #MESSAGE("") #MESSAGE(${V8_LIBRARY}) #MESSAGE(${MYSQLPP_LIBRARY}) #MESSAGE(${PANEL_LIBRARY}) #MESSAGE(${CURSES_LIBRARIES}) #MESSAGE(${CCFITS_LIBRARY}) #MESSAGE(${CFITSIO_LIBRARY}) #MESSAGE(${MYSQL_LIBRARY}) #MESSAGE(${NOVA_LIBRARY}) #MESSAGE(${READLINE_LIBRARY}) #MESSAGE(${OPENSSL_SSL_LIBRARY}) #MESSAGE("") INCLUDE_DIRECTORIES(${MYSQL_INCLUDE_DIR}) # =============== BOOST ============ #SET(Boost_ADDITIONAL_VERSIONS "1.78" "1.78.0" "1.79" "1.79.0") FIND_PACKAGE(Boost 1.54.0 REQUIRED date_time filesystem program_options regex system thread) # =============== QT4 ============== SET(CMAKE_INCLUDE_CURRENT_DIR ON) FIND_PACKAGE(Qt4 REQUIRED QtCore QtGui QtOpenGL QtSql QtXml) FIND_PACKAGE(Qwt REQUIRED) # =========== Enable C++11 =========== SET(CMAKE_CXX_STANDARD 11) SET(CMAKE_C_FLAGS "-pedantic") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Winit-self -Wpointer-arith \ -Wcast-align -Wformat=2 -Woverloaded-virtual \ -Wnon-virtual-dtor -Wshadow") # -Wextra # FIXME: Move that to config.h.in # -D__MARS__ SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} \ -D_REENTRANT -D__LINUX__ \ -DHAVE_ZLIB -DHAVE_ROOT -DHAVE_V8 -DHAVE_SQL -DHAVE_NOVA -DHAVE_FITS \ -DMARSVER=\\\"${VERSION}\\\" \ -DPACKAGE_VERSION=\\\"${VERSION}\\\" \ -DREVISION=\\\"${REVISION}\\\" \ -DPACKAGE_NAME=\\\"FACT++\\\" \ -DPACKAGE_STRING=\\\"FACT++\\\" \ -DPACKAGE_URL=\\\"${PACKAGE_URL}\\\" \ -DPACKAGE_BUGREPORT=\\\"${PACKAGE_BUGREPORT}\\\"" ) # -DBOOST_DISABLE_ASSERTS \ # -DBOOST_NO_STD_LOCALE=1 \ # -DBOOST_REXEG_NO_FWD=1 \ # -DBOOST_NO_MEMBER_TEMPLATES=1 \ # -DBOOST_HAS_ABI_HEADERS=1 \ # Flags required for Dim SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DMIPSEL -DPROTOCOL=1 -Dunix -Dlinux") # --------- config.h ------------- #CONFIGURE_FILE("${PROJECT_SOURCE_DIR}/config.h.in" "${PROJECT_BINARY_DIR}/config.h") #INCLUDE_DIRECTORIES("${PROJECT_BINARY_DIR}") SET(CMAKE_MODULE_PATH $ENV{ROOTSYS}/etc/cmake ${CMAKE_MODULE_PATH}) # You need to tell CMake where to find the ROOT installation. This can be done in a number of ways: # - ROOT built with classic configure/make use the provided $ROOTSYS/etc/cmake/FindROOT.cmake # - ROOT built with CMake. Add in CMAKE_PREFIX_PATH the installation prefix for ROOT #LIST(APPEND CMAKE_PREFIX_PATH $ENV{ROOTSYS}) #---Locate the ROOT package and defines a number of variables (e.g. ROOT_INCLUDE_DIRS) # -lGui -lCore -lCint -lRIO -lNet -lHist -lGraf -lGraf3d -lGpad -lTree # -lRint -lPostscript -lMatrix -lPhysics -lMathCore -lThread # -lASImage -lMinuit -lHistPainter -lThread FIND_PACKAGE(ROOT REQUIRED COMPONENTS GQt) INCLUDE_DIRECTORIES(${ROOT_INCLUDE_DIRS}) #MESSAGE("INCL_DIRS: ${ROOT_INCLUDE_DIRS}") #MESSAGE("LIBS: ${ROOT_LIBRARIES}") #MESSAGE("DEFS: ${ROOT_DEFINITIONS}") #MESSAGE("CXXFLAGS: ${ROOT_CXX_FLAGS}") #MESSAGE("CXFLAGS: ${ROOT_CC_FLAGS}") #MESSAGE("FOUND: ${ROOT_FOUND}") #MESSAGE("FILE: ${ROOT_USE_FILE}") #MESSAGE("DIR: ${CMAKE_CURRENT_SOURCE_DIR}") #ROOT__LIBRARY PATH Full path for each of the ROOT libraries listed in COMPONENTS #ROOT__CMD PATH Full path for each ROOT executable (rootcling, root, hadd, etc.) #ROOT_