Commit 129253f7 authored by Valerio Bertone's avatar Valerio Bertone
Browse files

Setting environment variables using cmake

parent 86441633
......@@ -77,6 +77,25 @@ find_package(LHAPDF REQUIRED)
include_directories(${QT_INCLUDE_DIRS} ${SFML_INCLUDE_DIR} ${CLN_INCLUDE_DIR} ${ElementaryUtils_INCLUDE_DIR} ${NumA++_INCLUDE_DIR} ${Apfel++_INCLUDE_DIR} ${LHAPDF_INCLUDE_DIR})
include_directories(include)
# ENVIRONMENT VARIABLES ========================================================================
execute_process(COMMAND bash -c "cd ../../elementary-utils/; git branch --show-current" OUTPUT_VARIABLE ELEMUTILS_BRANCH)
execute_process(COMMAND bash -c "cd ../../elementary-utils/; git rev-parse HEAD;" OUTPUT_VARIABLE ELEMUTILS_REVISION)
string(REGEX REPLACE "\n$" "" ELEMUTILS_BRANCH "${ELEMUTILS_BRANCH}")
string(REGEX REPLACE "\n$" "" ELEMUTILS_REVISION "${ELEMUTILS_REVISION}")
execute_process(COMMAND bash -c "cd ../../numa/; git branch --show-current" OUTPUT_VARIABLE NUMA_BRANCH)
execute_process(COMMAND bash -c "cd ../../numa/; git rev-parse HEAD;" OUTPUT_VARIABLE NUMA_REVISION)
string(REGEX REPLACE "\n$" "" NUMA_BRANCH "${NUMA_BRANCH}")
string(REGEX REPLACE "\n$" "" NUMA_REVISION "${NUMA_REVISION}")
execute_process(COMMAND bash -c "git branch --show-current" OUTPUT_VARIABLE PARTONS_BRANCH)
execute_process(COMMAND bash -c "git rev-parse HEAD" OUTPUT_VARIABLE PARTONS_REVISION)
string(REGEX REPLACE "\n$" "" PARTONS_BRANCH "${PARTONS_BRANCH}")
string(REGEX REPLACE "\n$" "" PARTONS_REVISION "${PARTONS_REVISION}")
configure_file("${CMAKE_SOURCE_DIR}/data/config/environment_configuration.dat.in" "${CMAKE_SOURCE_DIR}/data/config/environment_configuration.dat")
# FINALIZE ==================================================================================
# generate list of source files
......
......@@ -368,3 +368,4 @@ if(SFML_FOUND AND NOT SFML_FIND_QUIETLY)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(SFML REQUIRED_VARS SFML_LIBRARIES VERSION_VAR SFML_VERSION_MINOR)
endif()
set(SFML_VERSION "${SFML_VERSION_MAJOR}-${SFML_VERSION_MINOR}-${SFML_VERSION_PATCH}")
\ No newline at end of file
# environment_configuration.dat
# The content of this file is stored in the database during the insertion of data,
# so latter one can easily reproduce the used computational environment.
system: @CMAKE_SYSTEM_NAME@ @CMAKE_SYSTEM_VERSION@
g++: @CMAKE_CXX_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@
qt: @Qt5Core_VERSION@
smfl: @SFML_VERSION@
cln: @CLN_VERSION@
gsl: @GSL_VERSION@
apfel++: @Apfel++_VERSION@
lhapdf: @LHAPDF_VERSION@
elementary-utils: @ELEMUTILS_BRANCH@/@ELEMUTILS_REVISION@
numa: @NUMA_BRANCH@/@NUMA_REVISION@
partons: @PARTONS_BRANCH@/@PARTONS_REVISION@
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment