diff --git a/Code/Mantid/Build/CMake/CommonSetup.cmake b/Code/Mantid/Build/CMake/CommonSetup.cmake index 1d4eeea9666d4c412ca093ecb8af8d726ff79432..9efcdfe79aa0a0c38dea61377a90240f62ad296f 100644 --- a/Code/Mantid/Build/CMake/CommonSetup.cmake +++ b/Code/Mantid/Build/CMake/CommonSetup.cmake @@ -76,7 +76,6 @@ endif () 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 () diff --git a/Code/Mantid/Build/CMake/LinuxSetup.cmake b/Code/Mantid/Build/CMake/LinuxSetup.cmake new file mode 100644 index 0000000000000000000000000000000000000000..c39329defe3614ffe8c3f9231607e5b62c02d784 --- /dev/null +++ b/Code/Mantid/Build/CMake/LinuxSetup.cmake @@ -0,0 +1,10 @@ +# Look for tcmalloc. Make it optional, for now at least, but on by default +set ( USE_TCMALLOC ON CACHE BOOL "Flag for replacing regular malloc with tcmalloc" ) +# Note that this is not mandatory, so no REQUIRED +find_package ( Tcmalloc ) +# If not found, or not wanted, just carry on without it +if ( USE_TCMALLOC AND TCMALLOC_FOUND ) + set ( TCMALLOC_LIBRARY ${TCMALLOC_LIBRARIES} ) + # Make a C++ define to use as flags in, e.g. MemoryManager.cpp + add_definitions ( -DUSE_TCMALLOC ) +endif () diff --git a/Code/Mantid/CMakeLists.txt b/Code/Mantid/CMakeLists.txt index 6f7afd7e2d5cdec4be9e5635fc1151b6d4863388..535b9552b4e108d7aea4676464b8e275b287b67a 100644 --- a/Code/Mantid/CMakeLists.txt +++ b/Code/Mantid/CMakeLists.txt @@ -17,20 +17,23 @@ if ( NOT THIRD_PARTY ) endif () endif () +# Call our setup script +include ( CommonSetup ) + +# Add linux-specific things +if ( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" ) + include ( LinuxSetup ) +endif () + # Add compiler options if using gcc if ( CMAKE_COMPILER_IS_GNUCXX ) include ( GNUSetup ) endif () -# Call our setup script -include ( CommonSetup ) - # Now add the components add_subdirectory ( Framework ) - - # Check for Qt find_package ( Qt4 COMPONENTS QtCore QtGui QtOpenGL QtXml QtSvg Qt3Support REQUIRED ) include ( ${QT_USE_FILE} ) @@ -71,5 +74,3 @@ endif () - - diff --git a/Code/Mantid/Framework/CMakeLists.txt b/Code/Mantid/Framework/CMakeLists.txt index bb0bcfd3252935b115101652fd8da2b657b36350..6cedbf33f702e8a8c5a1195fd91b41fa85e40e46 100644 --- a/Code/Mantid/Framework/CMakeLists.txt +++ b/Code/Mantid/Framework/CMakeLists.txt @@ -44,17 +44,6 @@ configure_file ( ${PROJECT_SOURCE_DIR}/${HEADER_DIR}/MantidVersion.h.in # Look for dependencies - bail out if any necessary oned not found ########################################################################### -# Look for tcmalloc. Make it optional, for now at least, but on by default -set ( USE_TCMALLOC ON CACHE BOOL "Flag for replacing regular malloc with tcmalloc" ) -# Note that this is not mandatory, so no REQUIRED -find_package ( Tcmalloc ) -# If not found, or not wanted, just carry on without it -if ( USE_TCMALLOC AND TCMALLOC_FOUND ) - set ( TCMALLOC_LIBRARY ${TCMALLOC_LIBRARIES} ) - # Make a C++ define to use as flags in, e.g. MemoryManager.cpp - add_definitions ( -DUSE_TCMALLOC ) -endif () - # Might just as well link everything to Boost & Poco (found in CommonSetup) set ( MANTIDLIBS ${Boost_LIBRARIES} ${POCO_LIBRARIES} ${TCMALLOC_LIBRARY} ) diff --git a/Code/Mantid/MantidPlot/CMakeLists.txt b/Code/Mantid/MantidPlot/CMakeLists.txt index 2fbea30d25d9f920d3e72cb867560b8d8c07124f..cac074799923e4b95d761ae6da8e5809ee5a9402 100644 --- a/Code/Mantid/MantidPlot/CMakeLists.txt +++ b/Code/Mantid/MantidPlot/CMakeLists.txt @@ -676,14 +676,6 @@ add_definitions ( -DSCRIPTING_MUPARSER ) add_definitions ( -DSCRIPTING_PYTHON ) add_definitions ( -DQSCINTILLA_DLL ) # Will only have an effect on Windows (as is desired) -# ----- USE_TCMALLOC FLAG ----- -set ( USE_TCMALLOC ON CACHE BOOL "Flag for replacing regular malloc with tcmalloc" ) -find_package ( Tcmalloc ) -if ( USE_TCMALLOC AND TCMALLOC_FOUND ) - # Make a C++ define to use as flags - add_definitions ( -DUSE_TCMALLOC ) -endif () - include_directories ( src ) set ( SRC_FILES ${QTIPLOT_SRCS} ${MANTID_SRCS} ${SIP_SRC} )