forked from FairRootGroup/geant3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
66 lines (53 loc) · 2.54 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#------------------------------------------------
# The Virtual Monte Carlo packages
# Copyright (C) 2014 Ivana Hrivnacova
# All rights reserved.
#
# For the licensing terms see geant4_vmc/LICENSE.
# Contact: [email protected]
#-------------------------------------------------
# Configuration file for CMake build for Geant3 with VMC package.
# Inspired by Geant4, Geant4 VMC and VGM projects.
#
# I. Hrivnacova, 13/06/2014
#--- Enforce an out-of-source builds before anything else ---------------------
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(STATUS "Geant3 requires an out-of-source build.")
message(STATUS "Please remove these files from ${CMAKE_BINARY_DIR} first:")
message(STATUS "CMakeCache.txt")
message(STATUS "CMakeFiles")
message(STATUS "Once these files are removed, create a separate directory")
message(STATUS "and run CMake from there")
message(FATAL_ERROR "in-source build detected")
endif()
#--- Define CMake requirements -------------------------------------------------
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
#--- Prepend our own CMake Modules to the search path --------------------------
set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/cmake
${CMAKE_MODULE_PATH})
#--- Project definitions -------------------------------------------------------
project(Geant3)
set(${PROJECT_NAME}_VERSION_MAJOR "3")
set(${PROJECT_NAME}_VERSION_MINOR "7")
set(${PROJECT_NAME}_VERSION_PATCH "0")
set(${PROJECT_NAME}_VERSION
${${PROJECT_NAME}_VERSION_MAJOR}.${${PROJECT_NAME}_VERSION_MINOR}.${${PROJECT_NAME}_VERSION_PATCH})
#--- Default project build mode ------------------------------------------------
include(VMCBuildMode)
#--- Options -------------------------------------------------------------------
option(Geant3_INSTALL_DATA "Install data directory" ON)
option(BUILD_SHARED_LIBS "Build the dynamic libraries" ON)
option(BUILD_GCALOR "Build the gcalor module" OFF)
#--- Enable Fortran ------------------------------------------------------------
enable_language(Fortran)
#--- Find required packages ----------------------------------------------------
include(Geant3RequiredPackages)
#--- Utility to defined installation lib directory -----------------------------
include(VMCInstallLibDir)
#--- Project library -----------------------------------------------------------
include(Geant3BuildLibrary)
#--- Build project configuration -----------------------------------------------
include(Geant3BuildProject)
#--- CPack ----------------- --------------------------------------------------
include(Geant3CPack)