Page MenuHomeHEPForge

CMakeLists.txt
No OneTemporary

CMakeLists.txt

#----------------------------------------------------------------------
# Copyright (c) 2010-11, Pierre-Antoine Delsart, Kurtis Geerlings, Joey Huston,
# Brian Martin, and Christopher Vermilion
#
#----------------------------------------------------------------------
# This file is part of SpartyJet.
#
# SpartyJet is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# SpartyJet is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with SpartyJet; if not, write to the Free Software
# Foundation, Inc.:
# 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#----------------------------------------------------------------------
# set minimum required cmake version
cmake_minimum_required (VERSION 2.8)
# make sure we are not going to build in the main source directory
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
message (FATAL_ERROR "You should call cmake from inside the build directory as 'cmake ..'")
endif ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
#-------------------------------------------------------------------------------
# global settings
#-------------------------------------------------------------------------------
# set project name and version
project (SpartyJet)
set (SpartyJet_VERSION_MAJOR 3)
set (SpartyJet_VERSION_MINOR 6)
set (BUILD_SHARED_LIBS TRUE)
# set the path where to put the generated libraries and executables
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/libs)
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/libs)
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR}/examples_C)
# set data dir for code that needs to find it
# TODO: Should this go somewhere else? Install dir??
set (SpartyJet_DATADIR \"${PROJECT_SOURCE_DIR}/data\")
# check for ansi compliance and turn on extra warnings
# add_definitions(-ansi -pedantic -Wall -Wextra -Wold-style-cast -Wconversion)
#add_definitions(-ansi -pedantic -Wall)
# force 32bit architecture
# add_definitions(-m32)
# set (CMAKE_EXE_LINKER_FLAGS -m32)
# System-specific flags
# Always use PIC objects
message (STATUS "Configuring for ${CMAKE_SYSTEM_NAME}")
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set (CMAKE_CXX_FLAGS -fpic)
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
set (CMAKE_CXX_FLAGS -fPIC)
set (SJ_LDFLAGS "-undefined dynamic_lookup")
set (CMAKE_SHARED_LIBRARY_SUFFIX ".so") # ROOT demands .so, not .dylib
else (CMAKE_SYSTEM_NAME STREQUAL "Linux")
message (STATUS "Building on this system (${CMAKE_SYSTEM_NAME}) is not tested! Beware!")
endif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
# ROOT linking and includes -- TODO: Put in a FindROOT.cmake
execute_process (COMMAND which root-config
OUTPUT_VARIABLE root_CONFIG
)
if (root_CONFIG)
execute_process (COMMAND root-config --prefix
OUTPUT_VARIABLE ROOTSYS
)
if (ROOTSYS)
string (STRIP ${ROOTSYS} ROOTSYS)
include_directories(${ROOTSYS}/include)
execute_process(COMMAND root-config --libs
OUTPUT_VARIABLE ROOTLIBS
)
execute_process(COMMAND root-config --glibs
OUTPUT_VARIABLE ROOTGLIBS
)
execute_process(COMMAND root-config --ldflags
OUTPUT_VARIABLE ROOTLDFLAGS
)
string (STRIP ${ROOTLIBS} ROOTLIBS)
string (STRIP ${ROOTGLIBS} ROOTGLIBS)
string (STRIP ${ROOTLDFLAGS} ROOTLDFLAGS)
# extra ROOT libs, necessary on some systems?
set (ROOTLIBS ${ROOTLIBS} -lTMVA -lMinuit -lMLP -lXMLIO -lTreePlayer)
find_file (ROOTCINT rootcint PATHS ENV PATH NO_DEFAULT_PATH)
if (ROOTCINT STREQUAL "ROOTCINT-NOTFOUND")
message (FATAL_ERROR "rootcint not found. Make sure ROOT is installed and \$(ROOTSYS)/bin is in your path!")
else (ROOTCINT STREQUAL "ROOTCINT-NOTFOUND")
message (STATUS "Found rootcint at ${ROOTCINT}")
endif (ROOTCINT STREQUAL "ROOTCINT-NOTFOUND")
else (ROOTSYS)
message (FATAL_ERROR "ROOT not found. Make sure ROOT is installed and \$(ROOTSYS)/bin is in your path!")
endif (ROOTSYS)
endif (root_CONFIG)
include_directories(${PROJECT_SOURCE_DIR})
include_directories(${PROJECT_SOURCE_DIR}/UserPlugins/FastPrune-0.4.1/include)
#-------------------------------------------------------------------------------
# Add each subdirectory
#-------------------------------------------------------------------------------
add_subdirectory(External)
include_directories(${fastjet_INCLUDE_DIRS})
foreach (dir JetCore IO FastJetTools JetTools EventShape SpartyDisplay ExternalTools UserPlugins)
add_subdirectory(${dir})
endforeach(dir)
add_dependencies (IO External) # IO depends on stdhep
# executables
add_subdirectory(examples_C)
#-------------------------------------------------------------------------------
# Add a custom target for Python stuff for IDE hotness
#-------------------------------------------------------------------------------
file (GLOB py_SRCS */*.py)
add_custom_target (PYScripts SOURCES ${py_SRCS})
#-------------------------------------------------------------------------------
# configure config.h to pass CMake settings to the source code
#-------------------------------------------------------------------------------
configure_file (
${PROJECT_SOURCE_DIR}/SJconfig.h.in
${PROJECT_SOURCE_DIR}/SJconfig.h
)

File Metadata

Mime Type
text/plain
Expires
Thu, Apr 24, 6:36 AM (1 d, 19 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4882892
Default Alt Text
CMakeLists.txt (5 KB)

Event Timeline