-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
67 lines (52 loc) · 2.17 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
#------------------------------------------------------------------------------
# Top Level CMakeLists.txt for Latte Build
#
#------------------------------------------------------------------------------
# Enforce out-of-source builds before anything else
#
if(${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
message(STATUS "gdmlview 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 and override make rules as needed
#
cmake_minimum_required(VERSION 3.3)
#------------------------------------------------------------------------------
# Define the project
#
project(gdmlview VERSION "0.1.0")
#------------------------------------------------------------------------------
# Set up path to internal set of CMake modules.
#
set(CMAKE_MODULE_PATH
${PROJECT_SOURCE_DIR}/cmake
${PROJECT_SOURCE_DIR}/cmake/Modules
${CMAKE_MODULE_PATH})
#------------------------------------------------------------------------------
# Build output
# Output all binaries to single directory based on their type
#
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/outputs/runtime)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/outputs/library)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/outputs/archive)
#------------------------------------------------------------------------------
# Includes for common utilities
#
include(gdmlviewCPackBase)
#------------------------------------------------------------------------------
# Find needed packages
#
find_package(Geant4 9.6 REQUIRED gdml qt NO_MODULE)
# Force static linking of Boost...
#set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED COMPONENTS program_options)
#------------------------------------------------------------------------------
# Add the subdirectories
#
add_subdirectory(src)