Skip to content
Snippets Groups Projects
Commit 207ee11f authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

First try to integrate git info in pastis executable

parent d420cb1d
No related branches found
No related tags found
No related merge requests found
......@@ -31,5 +31,18 @@ list(APPEND CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -O3)
add_subdirectory(${CMAKE_SOURCE_DIR}/packages/kokkos)
include_directories(${Kokkos_INCLUDE_DIRS_RET})
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake-modules")
include(GetGitRevisionDescription)
get_git_head_revision(GITREV GITHASH)
git_local_changes(GITHASLOCALCHANGES)
message("git rev ${GITREV} : ${GITHASH} (${GITHASLOCALCHANGES})")
file(WRITE "${CMAKE_BINARY_DIR}/git_revision.hpp" "#define GITREV \"${GITREV}\"\n")
file(APPEND "${CMAKE_BINARY_DIR}/git_revision.hpp" "#define GITHASH \"${GITHASH}\"\n")
file(APPEND "${CMAKE_BINARY_DIR}/git_revision.hpp" "#define GITHASLOCALCHANGES \"${GITHASLOCALCHANGES}\"\n")
include_directories(${CMAKE_BINARY_DIR})
add_executable(pastis main.cpp)
target_link_libraries(pastis kokkos)
#include <iostream>
#include <Kokkos_Core.hpp>
#include <git_revision.hpp>
int main(int argc, char *argv[])
{
std::cout << "It's pastis time!\n";
std::cout << "-----------------\n";
std::cout << "--------------------- git info --------------------------\n";
std::cout << "* branch: " << GITREV << '\n';
std::cout << "* hash: " << GITHASH << '(' << GITHASLOCALCHANGES << ")\n";
std::cout << "---------------------------------------------------------\n";
Kokkos::initialize(argc, argv);
Kokkos::DefaultExecutionSpace::print_configuration(std::cout);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment