ComputationalRadiationPhysics / contributing

:books: guidelines and styles to contribute to our projects
Creative Commons Attribution 4.0 International
6 stars 10 forks source link

Overtacking of source code from internal projects #57

Open SimeonEhrig opened 3 years ago

SimeonEhrig commented 3 years ago

During my work on creating a CMake installer for cupla, I looked in the Alpaka CMake and found some useful stuff, which I would overtake. Now, there the is the question, if we should cite the original author if yes, how?

sbastrakov commented 3 years ago

I would imagine this should be done same way as for external code: according to the licence of the cited piece. Given we don't always have the same licence, so has to be done on a case-by-case basis.

SimeonEhrig commented 3 years ago

Okay, but I also mean something like this:

# Find cupla version.
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/include/cupla/version.hpp" CUPLA_VERSION_MAJOR_HPP REGEX "#define CUPLA_VERSION_MAJOR ")
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/include/cupla/version.hpp" CUPLA_VERSION_MINOR_HPP REGEX "#define CUPLA_VERSION_MINOR ")
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/include/cupla/version.hpp" CUPLA_VERSION_PATCH_HPP REGEX "#define CUPLA_VERSION_PATCH ")

string(REGEX MATCH "([0-9]+)" CUPLA_VERSION_MAJOR  ${CUPLA_VERSION_MAJOR_HPP})
string(REGEX MATCH "([0-9]+)" CUPLA_VERSION_MINOR  ${CUPLA_VERSION_MINOR_HPP})
string(REGEX MATCH "([0-9]+)" CUPLA_VERSION_PATCH  ${CUPLA_VERSION_PATCH_HPP})

set(PACKAGE_VERSION "${CUPLA_VERSION_MAJOR}.${CUPLA_VERSION_MINOR}.${CUPLA_VERSION_PATCH}")

Should I mentioned, that I copied it from alpaka?

sbastrakov commented 3 years ago

I am not sure. I probably would, but also can see the case for not doing it