Newer
Older
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
67
68
69
70
71
72
# This is mainly here so you don't get a complaint when running cmake
cmake_minimum_required (VERSION 2.6)
# Add the path to our custom 'find' modules
set ( CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../Build/CMake")
# Define the project name.
project (MantidFramework)
# TODO: split this off into a separate file
if ( WIN32 )
add_definitions ( -DWIN32 -D_WINDOWS -DMS_VISUAL_STUDIO )
add_definitions ( -D_USE_MATH_DEFINES -DNOMINMAX )
add_definitions ( -DGSL_DLL )
set ( CMAKE_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../Third_Party/include )
set ( BOOST_INCLUDEDIR "../../Third_Party/include" )
if ( CMAKE_CL_64 )
set ( CMAKE_LIBRARY_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../Third_Party/lib/win64 )
set ( BOOST_LIBRARIES "../../Third_Party/lib/win64" )
else ()
set ( BOOST_LIBRARIES "../../Third_Party/lib/win32" )
endif ()
endif ()
# If building as a stand-alone project, call our common setup script
if ( NOT COMMONSETUP_DONE )
include ( CommonSetup )
endif ()
###########################################################################
# This section deals with creating the MantidVersion.h header
###########################################################################
if ( Subversion_FOUND )
# extract working copy information for SOURCE_DIR into Framework_XXX variables
Subversion_WC_INFO(${PROJECT_SOURCE_DIR} Framework)
else ()
# Just use a dummy version number and print a warning
message ( "Subversion not found - using 0 for revision number in MantidVersion.h" )
set ( Framework_WC_REVISION 0 )
endif ()
# Create the header with the revision number in
set ( HEADER_DIR Kernel/inc/MantidKernel )
configure_file ( ${PROJECT_SOURCE_DIR}/${HEADER_DIR}/MantidVersion.h.in
${PROJECT_SOURCE_DIR}/${HEADER_DIR}/MantidVersion.h
)
###########################################################################
# Look for dependencies - bail out if any not found
###########################################################################
# Might just as well link everything to Boost & Poco
set ( MANTIDLIBS ${Boost_LIBRARIES} ${POCO_LIBRARIES} )
# gsl is currently needed by Geometry, Algorithms & Curvefitting
find_package ( GSL REQUIRED )
###########################################################################
# Look for OpenMP and set compiler flags if found
###########################################################################
find_package ( OpenMP )
if ( OPENMP_FOUND )
# add_definitions ( ${OpenMP_CXX_FLAGS} )
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
endif ()
###########################################################################
# Now add the packages one-by-one, building up the dependencies as we go
###########################################################################
add_custom_target ( FrameworkTests ) # target for all framework tests
include_directories (Kernel/inc)
add_subdirectory (Kernel)
set ( MANTIDLIBS ${MANTIDLIBS} Kernel )
include_directories (Geometry/inc)
# muParser needed by Geometry and subsequent packages
include_directories ( ${MUPARSER_INCLUDE_DIR} )
set ( MANTIDLIBS ${MANTIDLIBS} ${MUPARSER_LIBRARIES} )
add_subdirectory (Geometry)
set ( MANTIDLIBS ${MANTIDLIBS} Geometry )
include_directories (API/inc)
add_subdirectory (API)
set ( MANTIDLIBS ${MANTIDLIBS} API )
add_subdirectory (PythonAPI)
# TODO: add_subdirectory (MatlabAPI)
include_directories (DataObjects/inc)
add_subdirectory (DataObjects)
set ( MANTIDLIBS ${MANTIDLIBS} DataObjects )
add_subdirectory (DataHandling)
add_subdirectory (Nexus)
add_subdirectory (Algorithms)
add_subdirectory (CurveFitting)
add_subdirectory (ICat)
Michael Reuter
committed
if ( MAKE_VATES )
add_subdirectory (MDDataObjects)
add_subdirectory (MDAlgorithms)
Russell Taylor
committed
endif ()
###########################################################################
# Add a custom target to build all of the Framework
###########################################################################
set ( FRAMEWORK_LIBS Kernel Geometry API PythonAPI DataObjects
DataHandling Nexus Algorithms CurveFitting ICat
)
Michael Reuter
committed
if ( MAKE_VATES )
Russell Taylor
committed
set ( FRAMEWORK_LIBS ${FRAMEWORK_LIBS} MDDataObjects MDAlgorithms )
endif ()
add_custom_target ( Framework DEPENDS ${FRAMEWORK_LIBS} )