#--- dump_nonlocal_field ------------------------------------------------------ cmake_minimum_required(VERSION 3.15) project(dump_nonlocal_field VERSION 1.0.0 LANGUAGES C CXX) #--- check for git ------------------------------------------------------------ find_package(Git REQUIRED) #--- check for ROOT ----------------------------------------------------------- find_package(ROOT 6.18 REQUIRED COMPONENTS Gui MathMore Minuit2 XMLParser) if (ROOT_mathmore_FOUND) execute_process(COMMAND root-config --bindir OUTPUT_VARIABLE ROOT_BINDIR) string(STRIP ${ROOT_BINDIR} ROOT_BINDIR) execute_process(COMMAND root-config --version OUTPUT_VARIABLE ROOT_VERSION_USED) string(STRIP ${ROOT_VERSION_USED} ROOT_VERSION_USED) execute_process(COMMAND root-config --incdir OUTPUT_VARIABLE ROOT_INC) string(STRIP ${ROOT_INC} ROOT_INC) message("-- Found ROOT: ${ROOT_BINDIR} (found version: ${ROOT_VERSION})") #---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY) include(${ROOT_USE_FILE}) endif (ROOT_mathmore_FOUND) #--- check for boost ---------------------------------------------------------- find_package(Boost REQUIRED COMPONENTS system filesystem ) message(STATUS "Boost libs: ${Boost_LIBRARIES}") #--- check for fftw3 ---------------------------------------------------------- #find_package(FFTW3 REQUIRED) # Get the current working branch execute_process( COMMAND git rev-parse --abbrev-ref HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE ) # Get the latest abbreviated commit hash of the working branch execute_process( COMMAND git log -1 --pretty="%h, %ci" WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} OUTPUT_VARIABLE GIT_CURRENT_SHA1 OUTPUT_STRIP_TRAILING_WHITESPACE ) #--- feed dnlf_config.h ----------------------------------------- set(HAVE_DNLF_CONFIG_H 1 CACHE INTERNAL "dnlf_config.h is available") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/dnlf_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/dnlf_config.h) add_executable(dump_nonlocal_field dump_nonlocal_field.cpp) target_compile_options(dump_nonlocal_field BEFORE PRIVATE "-DHAVE_CONFIG_H" "-DHAVE_DNLF_CONFIG_H" "${HAVE_GIT_REV_H}") target_include_directories(dump_nonlocal_field BEFORE PRIVATE $ $ $ $ $ $ $ $ ) target_link_libraries(dump_nonlocal_field ${ROOT_LIBRARIES} ${MUSRFIT_LIBS} PNL_PippardFitter) #--- installation info -------------------------------------------------------- install( TARGETS dump_nonlocal_field RUNTIME DESTINATION bin )