Changeset 19010 for trunk/Mars


Ignore:
Timestamp:
04/27/18 20:29:14 (7 years ago)
Author:
tbretz
Message:
Updated the header, project and version definition, added help2man, fixed Wformat=1 which is Wformat in clang, some simplification.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/CMakeLists.txt

    r18957 r19010  
    1 # ------------ cmake --------------
    2 CMAKE_MINIMUM_REQUIRED(VERSION 3.0 FATAL_ERROR)
     1# *********************************
     2# ************ cmake **************
     3# *********************************
     4CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
     5CMAKE_POLICY(SET CMP0043 NEW)
    36CMAKE_POLICY(SET CMP0048 NEW)
    47
     
    1013# (you can also set it on the command line: -D CMAKE_BUILD_TYPE=Release)
    1114
    12 # --------- Project --------------
    13 PROJECT(Mars VERSION 1.8.3.13)
    14 
    15 # ------- For config.h.in --------
    16 SET(PACKAGE_MAINTAINER "Thomas Bretz")
    17 SET(PACKAGE_BUGREPORT  "tbretz@physik.rwth-aachen.de")
    18 #SET(PACKAGE_URL        "")
     15# Enable CLANG as default compilers, to change this use
     16# cmake -DCMAKE_C_COMPILER=cc -DCMAKE_CXX_COMPILER=c++
     17# Note that if compilers are switched on the fly,
     18# the cache is deleted
     19
     20IF (NOT DEFINED CMAKE_C_COMPILER)
     21        SET(CMAKE_C_COMPILER   "clang")#   CACHE STRING "Choose the compiler (c++, g++, clang++)" FORCE)
     22ENDIF()
     23#
     24IF (NOT DEFINED CMAKE_CXX_COMPILER)
     25        SET(CMAKE_CXX_COMPILER "clang++")# CACHE STRING "Choose the compiler (c++, g++, clang++)" FORCE)
     26ENDIF()
    1927
    2028#SET(CMAKE_VERBOSE_MAKEFILE ON)
     
    2533#CHECK_TYPE_SIZE("int"   SIZEOF_INT)
    2634
     35
     36
     37# *********************************
     38# ************ Project ************
     39# *********************************
     40
     41STRING(TIMESTAMP VERSION %y.%U.%w.%H UTC)
     42
     43MESSAGE(STATUS "Mars V${VERSION}")
     44
     45PROJECT(mars VERSION ${VERSION})
     46
     47INCLUDE(GNUInstallDirs)
     48
     49# ======== For config.h.in =========
     50SET(PACKAGE_MAINTAINER "Thomas Bretz")
     51SET(PACKAGE_BUGREPORT  "tbretz@physik.rwth-aachen.de")
     52SET(PACKAGE_URL        "https://git.rwth-aachen.de/tbretz/bd/wikis/home")
     53
     54
     55
     56# *********************************
     57# ********* Requirements **********
     58# *********************************
     59
     60# =========== help2man ============
     61FIND_PROGRAM(HELP2MAN_EXECUTABLE help2man)
     62
    2763# =========== pkg-config ============
    2864FIND_PACKAGE(PkgConfig)
     
    6298SET(CMAKE_CXX_FLAGS
    6399        "${CMAKE_CXX_FLAGS} -Wall -Winit-self -Wpointer-arith \
    64          -Wcast-align -Wformat=1 -Woverloaded-virtual \
     100         -Wcast-align -Wformat -Woverloaded-virtual \
    65101         -Wnon-virtual-dtor -Wshadow -fPIC") # -Wextra
    66102
     
    206242        OPTIONS -p -D__MARS__ -DHAVE_ZLIB)
    207243
    208 ADD_LIBRARY(mars SHARED dictionary/MARS.cxx)
    209 TARGET_LINK_LIBRARIES(mars ${ROOT_LIBRARIES})
    210 TARGET_LINK_LIBRARIES(mars ${NOVA_LIBRARY})
    211 TARGET_LINK_LIBRARIES(mars ZLIB::ZLIB)
     244ADD_LIBRARY(mars SHARED dictionary/MARS.cxx) # CMAKE_POSITION_INDEPENDENT_CODE
     245TARGET_LINK_LIBRARIES(mars
     246        ZLIB::ZLIB
     247        ${NOVA_LIBRARY}
     248        ${ROOT_LIBRARIES})
     249
    212250
    213251FOREACH(DIR ${DIRECTORIES})
Note: See TracChangeset for help on using the changeset viewer.