Skip to content
Snippets Groups Projects
Commit 571a91da authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony
Browse files

WIP for changes to 3rdparty library structure

parent b9a192d7
No related branches found
No related tags found
No related merge requests found
###########################################################################
# CMake version check.
# Only versions after 2.8.12 will find the HL component for HDF5
# Require >= 3.3 for Windows as previous versions contained a bug that
# prevented external data from working correctly. Other systems require
# 2.8.12 to avoid recompiling system packages
###########################################################################
cmake_minimum_required ( VERSION 2.8.12 )
if (CMAKE_HOST_WIN32)
cmake_minimum_required ( VERSION 3.3.0 )
else()
cmake_minimum_required ( VERSION 2.8.12 )
endif()
# Define the project name.
project ( Mantid )
# System package target is important for the windows builds as it allows us to package only the dlls and exes and exclude libs. Defaults to empty for other platforms.
set ( SYSTEM_PACKAGE_TARGET "")
......@@ -10,9 +19,6 @@ set ( SYSTEM_PACKAGE_TARGET "")
# Add the path to our custom 'find' modules
set ( CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/buildconfig/CMake")
# Define the project name.
project ( Mantid )
SET (CPACK_INSTALL_CMAKE_PROJECTS
"${CMAKE_BINARY_DIR}" "Mantid" "ALL" "/")
......@@ -32,6 +38,30 @@ set_property(CACHE CPACK_PACKAGE_SUFFIX PROPERTY STRINGS nightly unstable "") #e
#Set package name here
set ( CPACK_PACKAGE_NAME "mantid${CPACK_PACKAGE_SUFFIX}" )
###########################################################################
# Third party for Windows
###########################################################################
if ( CMAKE_HOST_WIN32 )
set ( THIRD_PARTY_DIR ${PROJECT_SOURCE_DIR}/thirdparty CACHE PATH
"Root directory of the third-party dependencies. " )
if( NOT IS_DIRECTORY ${THIRD_PARTY_DIR} )
message ( FATAL_ERROR "Third-party directory '${THIRD_PARTY_DIR}' does not point to a valid directory" )
endif()
# Print out where we think we are looking for 3rd party stuff
set ( THIRD_PARTY_BIN "${THIRD_PARTY_DIR}/bin;${THIRD_PARTY_DIR}/lib/qt4/bin" )
message ( STATUS "Looking for third-dependencies in ${THIRD_PARTY_DIR}. "
" NOTE: Please check '${THIRD_PARTY_BIN}' are on the PATH")
set ( ENV{PATH} "${THIRD_PARTY_BIN};$ENV{PATH}" )
include ( WindowsSetup )
# Settings for generating the windows Nullsoft package via CPack
include ( WindowsNSIS )
endif()
###########################################################################
# Cross-platform setup
###########################################################################
include ( CommonSetup )
###########################################################################
# Check for Qt (DarwinSetup below needs a variable from this)
###########################################################################
......@@ -51,29 +81,6 @@ endif ()
###########################################################################
include ( ParaViewSetup )
###########################################################################
# Set paths to Third_Party for Windows builds
###########################################################################
IF(${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if ( NOT THIRD_PARTY )
set ( THIRD_PARTY "${PROJECT_SOURCE_DIR}/Third_Party" )
endif ()
# Print out where we think we are looking for 3rd party stuff
message (STATUS "Setting THIRD_PARTY to be ${THIRD_PARTY}." )
# Check that the 3rd party directory exists.
if (NOT IS_DIRECTORY "${THIRD_PARTY}")
message ( WARNING "Specified THIRD_PARTY directory doesn't exist!" )
endif()
include ( WindowsSetup )
# Settings for generating the windows Nullsoft package via CPack
include ( WindowsNSIS )
ENDIF()
###########################################################################
# Set paths to Third_Party for Mac builds
###########################################################################
......@@ -89,10 +96,6 @@ if (COVERALLS)
coveralls_turn_on_coverage()
endif()
###########################################################################
# Call our setup script
###########################################################################
include ( CommonSetup )
###########################################################################
# Find qwt. Needs to be version 5
......
......@@ -3,15 +3,9 @@
# OPENCASCADE_LIBRARIES libraries to link against
# OPENCASCADE_FOUND If false, do not try to use OPENCASCADE
find_path ( OPENCASCADE_INCLUDE_DIR Standard.hxx PATHS
/usr/include/opencascade
/usr/include/oce
/usr/local/include/opencascade
/usr/local/include/oce
/usr/local/inc
/opt/OpenCASCADE/inc
${CMAKE_INCLUDE_PATH}/OpenCascade
$ENV{CASROOT}/inc
find_path ( OPENCASCADE_INCLUDE_DIR Standard.hxx
PATHS /opt/OpenCASCADE/inc $ENV{CASROOT}/inc
PATH_SUFFIXES opencascade oce
)
if ( WIN32 )
......
......@@ -5,7 +5,7 @@
find_path ( QWTPLOT3D_INCLUDE_DIR qwt3d_plot.h
/usr/local/include /usr/include/qwtplot3d-qt4 /usr/include/qwtplot3d
${CMAKE_INCLUDE_PATH}/qwtplot3d
${CMAKE_INCLUDE_PATH}/qwtplot3d ${CMAKE_INCLUDE_PATH}/qwtplot3d-qt4
)
if (APPLE)
......
##########################################################################
# Set include and library directories so that CMake finds Third_Party
# Set include and library directories so that CMake finds THIRD_PARTY_DIR
###########################################################################
set ( CMAKE_INCLUDE_PATH "${THIRD_PARTY}/include" )
set ( BOOST_INCLUDEDIR "${THIRD_PARTY}/include" )
set ( CMAKE_INCLUDE_PATH "${THIRD_PARTY_DIR}/include" )
set ( CMAKE_LIBRARY_PATH "${THIRD_PARTY_DIR}/lib" )
set ( CMAKE_PREFIX_PATH "${THIRD_PARTY_DIR};${THIRD_PARTY_DIR}/lib/qt4" )
set ( BOOST_INCLUDEDIR "${CMAKE_INCLUDE_PATH}" )
set ( BOOST_LIBRARYDIR "${CMAKE_LIBRARY_PATH}" )
set ( Boost_NO_SYSTEM_PATHS TRUE )
##########################################################################
# Set the SYSTEM_PACKAGE_TARGET to RUNTIME, on windows to avoid packaging libs
# Set the SYSTEM_PACKAGE_TARGET to RUNTIME as we only want to package
# dlls
###########################################################################
set (SYSTEM_PACKAGE_TARGET RUNTIME)
set (Boost_NO_SYSTEM_PATHS TRUE)
if ( CMAKE_CL_64 )
message ( STATUS "64 bit compiler found" )
set ( CMAKE_LIBRARY_PATH "${THIRD_PARTY}/lib/win64" )
set ( BOOST_LIBRARYDIR "${THIRD_PARTY}/lib/win64" )
else()
message ( STATUS "32 bit compiler found" )
set ( CMAKE_LIBRARY_PATH "${THIRD_PARTY}/lib/win32" )
set ( BOOST_LIBRARYDIR "${THIRD_PARTY}/lib/win32" )
endif()
##########################################################################
# Additional compiler flags
##########################################################################
......@@ -32,50 +27,50 @@ endif()
# /Zc:wchar_t- - Do not treat wchar_t as a builtin type. Required for Qt to
# work with wstring
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /w34296 /w34389 /Zc:wchar_t-" )
# As discussed here: http://code.google.com/p/googletest/issues/detail?id=412
# gtest requires changing the _VARAIDIC_MAX value for VS2012 as it defaults to 5
if ( MSVC_VERSION EQUAL 1700 )
message ( STATUS "Found VS2012 - Increasing maximum number of variadic template arguments to 10" )
add_definitions ( /D _VARIADIC_MAX=10 )
endif ()
#if ( MSVC_VERSION EQUAL 1700 )
# message ( STATUS "Found VS2012 - Increasing maximum number of variadic template arguments to 10" )
# add_definitions ( /D _VARIADIC_MAX=10 )
#endif ()
# Set PCH heap limit, the default does not work when running msbuild from the commandline for some reason
# Any other value lower or higher seems to work but not the default. It it is fine without this when compiling
# in the GUI though...
SET( VISUALSTUDIO_COMPILERHEAPLIMIT 150 )
#SET( VISUALSTUDIO_COMPILERHEAPLIMIT 150 )
# It make or may not already be set so override if it is (assumes if in CXX also in C)
if ( CMAKE_CXX_FLAGS MATCHES "(/Zm)([0-9]+)" )
string ( REGEX REPLACE "(/Zm)([0-9]+)" "\\1${VISUALSTUDIO_COMPILERHEAPLIMIT}" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} )
string ( REGEX REPLACE "(/Zm)([0-9]+)" "\\1${VISUALSTUDIO_COMPILERHEAPLIMIT}" CMAKE_C_FLAGS ${CMAKE_C_FLAGS} )
else()
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Zm${VISUALSTUDIO_COMPILERHEAPLIMIT}" )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm${VISUALSTUDIO_COMPILERHEAPLIMIT}" )
endif()
#if ( CMAKE_CXX_FLAGS MATCHES "(/Zm)([0-9]+)" )
# string ( REGEX REPLACE "(/Zm)([0-9]+)" "\\1${VISUALSTUDIO_COMPILERHEAPLIMIT}" CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} )
# string ( REGEX REPLACE "(/Zm)([0-9]+)" "\\1${VISUALSTUDIO_COMPILERHEAPLIMIT}" CMAKE_C_FLAGS ${CMAKE_C_FLAGS} )
#else()
# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /Zm${VISUALSTUDIO_COMPILERHEAPLIMIT}" )
# set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Zm${VISUALSTUDIO_COMPILERHEAPLIMIT}" )
#endif()
###########################################################################
# On Windows we want to bundle Python. The necessary libraries are in
# Third_Party/lib/win{BITNESS}/Python27
# THIRD_PARTY_DIR/lib/python2.7
###########################################################################
set ( PYTHON_DIR ${THIRD_PARTY_DIR}/lib/python2.7 )
## Set the variables that FindPythonLibs would set
set ( PYTHON_INCLUDE_PATH "${CMAKE_INCLUDE_PATH}/Python27" "${CMAKE_INCLUDE_PATH}/Python27/Include" )
set ( PYTHON_INCLUDE_PATH "${PYTHON_DIR}/Include" )
# Libraries can be in one of two places. This allows it still to build with the old locations
if ( EXISTS "${CMAKE_LIBRARY_PATH}/Python27/libs" )
set ( PYTHON_LIBRARIES "${CMAKE_LIBRARY_PATH}/Python27/libs/python27.lib" )
set ( PYTHON_DEBUG_LIBRARY "${CMAKE_LIBRARY_PATH}/Python27/libs/python27_d.lib" )
else()
set ( PYTHON_LIBRARIES "${CMAKE_LIBRARY_PATH}/Python27/python27.lib" )
set ( PYTHON_DEBUG_LIBRARY "${CMAKE_LIBRARY_PATH}/Python27/python27_d.lib" )
endif()
set ( PYTHON_DEBUG_LIBRARIES ${PYTHON_DEBUG_LIBRARY} )
set ( PYTHON_LIBRARIES "${PYTHON_DIR}/libs/python27.lib" )
# set ( PYTHON_DEBUG_LIBRARY "${CMAKE_LIBRARY_PATH}/Python27/libs/python27_d.lib" )
#set ( PYTHON_DEBUG_LIBRARIES ${PYTHON_DEBUG_LIBRARY} )
## Add debug library into libraries variable
set ( PYTHON_LIBRARIES optimized ${PYTHON_LIBRARIES} debug ${PYTHON_DEBUG_LIBRARIES} )
#set ( PYTHON_LIBRARIES optimized ${PYTHON_LIBRARIES} debug ${PYTHON_DEBUG_LIBRARIES} )
set ( PYTHON_LIBRARIES optimized ${PYTHON_LIBRARIES} )
## The executable
set ( PYTHON_EXECUTABLE "${CMAKE_LIBRARY_PATH}/Python27/python.exe" CACHE FILEPATH "The location of the python executable" FORCE )
set ( PYTHON_EXECUTABLE_DEBUG "${CMAKE_LIBRARY_PATH}/Python27/python_d.exe" CACHE FILEPATH "The location of the debug build of the python executable" FORCE )
set ( PYTHON_EXECUTABLE "${PYTHON_DIR}/python.exe" CACHE FILEPATH "The location of the python executable" FORCE )
#set ( PYTHON_EXECUTABLE_DEBUG "${CMAKE_LIBRARY_PATH}/Python27/python_d.exe" CACHE FILEPATH "The location of the debug build of the python executable" FORCE )
## The "pythonw" executable that avoids raising another terminal when it runs. Used for IPython
set ( PYTHONW_EXECUTABLE "${CMAKE_LIBRARY_PATH}/Python27/pythonw.exe" CACHE FILEPATH "The location of the pythonw executable. This suppresses the new terminal window on startup" FORCE )
set ( PYTHONW_EXECUTABLE "${PYTHON_DIR}/pythonw.exe" CACHE FILEPATH
"The location of the pythonw executable. This suppresses the new terminal window on startup" FORCE )
###########################################################################
# If required, find tcmalloc
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment