CMakeLists.txt 5.73 KB
Newer Older
1
# Look for dependencies - bail out if any necessary ones not found
2
3
4
5
6
7

check_include_files(stdint.h stdint)
if(stdint)
  add_definitions(-DHAVE_STDINT_H)
endif()

8
# MPI-enable build setup
9

10
# Only available on Linux (specifically RedHat), and for a framework-only build
11
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
12
  option(MPI_BUILD "Enable MPI options")
13
14
15
16
17
  if(MPI_BUILD)
    include(MPISetup)
  endif(MPI_BUILD)
endif()

18
option(MPI_EXPERIMENTAL "Enable MPI options")
19
20
21
22
if(MPI_EXPERIMENTAL)
  include(BoostMPI)
endif()

23
# Now add the packages one-by-one, building up the dependencies as we go
24
include(TargetFunctions)
25

26
27
add_custom_target(FrameworkTests) # target for all framework tests
add_dependencies(check FrameworkTests)
28
add_dependencies(FrameworkTests Framework)
29

30

Stephen's avatar
Stephen committed
31
add_subdirectory(Types)
32
add_subdirectory(Json)
33
34
add_subdirectory(Kernel)
add_subdirectory(Parallel)
Stephen's avatar
Stephen committed
35
# HistogramData has header-only dependency on Kernel, so Kernel comes after.
36
37
38
39
40
add_subdirectory(HistogramData)
add_subdirectory(Indexing)
add_subdirectory(Beamline)
add_subdirectory(Geometry)
add_subdirectory(API)
Owen Arnold's avatar
Owen Arnold committed
41
add_subdirectory(NexusGeometry)
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
add_subdirectory(PythonInterface)
add_subdirectory(DataObjects)
add_subdirectory(Catalog)
add_subdirectory(Nexus)
add_subdirectory(DataHandling)
add_subdirectory(Algorithms)
add_subdirectory(WorkflowAlgorithms)
add_subdirectory(CurveFitting)
add_subdirectory(Crystal)
add_subdirectory(ICat)
add_subdirectory(LiveData)
add_subdirectory(RemoteAlgorithms)
add_subdirectory(RemoteJobManagers)
add_subdirectory(SINQ)
add_subdirectory(Muon)
57
add_subdirectory(Reflectometry)
58

59
# If an MPI-enabled build, add in the MPI-specific algorithms package
60
61
62
if(MPI_BUILD)
  add_subdirectory(MPIAlgorithms)
endif()
63

64
add_subdirectory (MDAlgorithms)
65
add_subdirectory (Doxygen)
66
add_subdirectory (ScriptRepository)
67
68
69

# Add a custom target to build all of the Framework

70
71
set(FRAMEWORK_LIBS
    Kernel
72
    Json
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
    HistogramData
    Indexing
    Beamline
    Geometry
    API
    DataObjects
    PythonInterface
    DataHandling
    Nexus
    NexusGeometry
    Algorithms
    CurveFitting
    ICat
    Catalog
    Crystal
    MDAlgorithms
    WorkflowAlgorithms
    LiveData
    RemoteAlgorithms
    RemoteJobManagers
    SINQ
94
    Muon
95
    Reflectometry)
96
97

add_custom_target(Framework DEPENDS ${FRAMEWORK_LIBS})
98

99
100
# Installation settings These need to be here so that a Framework only install
# will pick them up
101
102
#
# N.B. INBUNDLE variable is empty except on Mac (set in DarwinSetup.cmake)
103

Pete Peterson's avatar
Pete Peterson committed
104
# Create instrument directory
105
106
foreach(_bundle ${BUNDLES})
  install(DIRECTORY ../instrument/
107
          DESTINATION ${_bundle}/instrument
108
109
110
111
112
113
114
115
116
          PATTERN "*UNIT_TESTING*"
          EXCLUDE
          PATTERN ".gitignore"
          EXCLUDE)
  # Ships .py files but only ship compiled pyd files for supported platforms.
  if(WIN32) # General windows environment
    if(CMAKE_SIZEOF_VOID_P EQUAL 8) # Recommended way of detecting 64- vs 32-bit
                                    # build Excludes .so files & _win32 binaries
      install(DIRECTORY ../scripts/
117
              DESTINATION ${_bundle}/scripts
118
119
120
121
122
123
124
125
126
127
128
129
130
131
              PATTERN "*.pyc"
              EXCLUDE
              PATTERN ".svn"
              EXCLUDE
              PATTERN ".gitignore"
              EXCLUDE
              PATTERN "*.so"
              EXCLUDE
              PATTERN "*_win32.pyd"
              EXCLUDE
              PATTERN "CMakeLists.txt"
              EXCLUDE
              PATTERN "test"
              EXCLUDE)
Samuel Jackson's avatar
Samuel Jackson committed
132
    else()
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
      # Excludes so files & _win64 binaries
      install(DIRECTORY ../scripts/
              DESTINATION ${_bundle}scripts
              PATTERN "*.pyc"
              EXCLUDE
              PATTERN ".svn"
              EXCLUDE
              PATTERN ".gitignore"
              EXCLUDE
              PATTERN "*.so"
              EXCLUDE
              PATTERN "*_win64.pyd"
              EXCLUDE
              PATTERN "CMakeLists.txt"
              EXCLUDE
              PATTERN "test"
              EXCLUDE)
    endif()

    # Also ship mingw libraries for Inelastic fortran code. We need to do a
    # better job here and build things
154
    file(GLOB MINGW_DLLS "${THIRD_PARTY_DIR}/bin/mingw/*.dll")
155
    install(FILES ${MINGW_DLLS} DESTINATION ${BIN_DIR})
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
  else()
    install(DIRECTORY ../scripts/
            DESTINATION ${_bundle}scripts
            PATTERN "*.pyc"
            EXCLUDE
            PATTERN ".svn"
            EXCLUDE
            PATTERN ".gitignore"
            EXCLUDE
            PATTERN "*_win*.pyd"
            EXCLUDE
            PATTERN "*_lnx64.so"
            EXCLUDE
            PATTERN "CMakeLists.txt"
            EXCLUDE
            PATTERN "test"
            EXCLUDE)
  endif()
Samuel Jackson's avatar
Samuel Jackson committed
174
endforeach()
175

176
177
178
179
180
# THIS MUST BE THE LAST SUB_DIRECTORY ADDED. See Properties/CMakeLists.txt. This
# is included by the top-level CMakeLists if it is a full build but do it here
# for a Framework only
if(NOT FULL_PACKAGE_BUILD)
  add_subdirectory(PostInstall)
181
endif()
Stephen's avatar
Stephen committed
182

183
if (CONDA_BUILD)
Stephen's avatar
Stephen committed
184
185
186
187
188
189
190
191
192
193
194
195
196
197
configure_package_config_file(${CMAKE_SOURCE_DIR}/buildconfig/CMake/MantidFrameworkConfig.cmake.in
  ${CMAKE_CURRENT_BINARY_DIR}/MantidFrameworkConfig.cmake
  INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MantidFramework)

write_basic_package_version_file(
  ${CMAKE_CURRENT_BINARY_DIR}/MantidFrameworkConfigVersion.cmake
  VERSION 1.0.0
  COMPATIBILITY SameMajorVersion )

install(FILES
          "${CMAKE_CURRENT_BINARY_DIR}/MantidFrameworkConfig.cmake"
          "${CMAKE_CURRENT_BINARY_DIR}/MantidFrameworkConfigVersion.cmake"
        DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MantidFramework
)
Stephen's avatar
Stephen committed
198
199
200
201
202
203
204
205

install(FILES
${CMAKE_SOURCE_DIR}/buildconfig/CMake/FindNexus.cmake
${CMAKE_SOURCE_DIR}/buildconfig/CMake/FindJsonCPP.cmake
${CMAKE_SOURCE_DIR}/buildconfig/CMake/FindTBB.cmake
${CMAKE_SOURCE_DIR}/buildconfig/CMake/FindMuParser.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MantidFramework/find_modules
)
206
endif()