Skip to content
Snippets Groups Projects
Commit e1907c48 authored by Soeren Peters's avatar Soeren Peters
Browse files

Add compiler information to buildInfo.

parent 035f5f56
No related branches found
No related tags found
1 merge request!368Adds copyright headers and compiler information via buildInfo.h
......@@ -26,8 +26,6 @@
// You should have received a copy of the GNU General Public License along
// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
//! \file PointerDefinitions.h
//! \ingroup Core
//! \author Soeren Peters
//=======================================================================================
#ifndef SHARED_POINTER_H
......@@ -45,7 +43,7 @@ template <class T>
using UPtr = std::unique_ptr<T>;
template <class T>
using RPtr = T *;
using RPtr = T*;
template <class T>
using enableSharedFromThis = std::enable_shared_from_this<T>;
......
#=======================================================================================
# ____ ____ __ ______ __________ __ __ __ __
# \ \ | | | | | _ \ |___ ___| | | | | / \ | |
# \ \ | | | | | |_) | | | | | | | / \ | |
# \ \ | | | | | _ / | | | | | | / /\ \ | |
# \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
# \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
# \ \ | | ________________________________________________________________
# \ \ | | | ______________________________________________________________|
# \ \| | | | __ __ __ __ ______ _______
# \ | | |_____ | | | | | | | | | _ \ / _____)
# \ | | _____| | | | | | | | | | | \ \ \_______
# \ | | | | |_____ | \_/ | | | | |_/ / _____ |
# \ _____| |__| |________| \_______/ |__| |______/ (_______/
#
# This file is part of VirtualFluids. VirtualFluids 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.
#
# VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
#
#! \author Soeren Peters
#=======================================================================================
set(buildInfoPath ${CMAKE_BINARY_DIR}/buildInfo)
set(buildInfoFile buildInfo.cpp)
set(buildInfoInput ${CMAKE_CURRENT_LIST_DIR}/buildInfo.in.cpp)
......@@ -7,10 +37,19 @@ get_git_head_revision(git_branch git_commit_hash)
set(COMPILER_FLAGS "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE}} ${CMAKE_CXX_FLAGS}")
site_name(BUILD_computerName)
if( BUILD_VF_DOUBLE_ACCURACY )
set(BUILD_PRECISION "double")
else()
set(BUILD_PRECISION "float")
endif()
get_target_property(BUILD_COMPILE_OPTIONS project_options INTERFACE_COMPILE_OPTIONS)
get_target_property(BUILD_COMPILE_DEFINITIONS project_options INTERFACE_COMPILE_DEFINITIONS)
get_target_property(BUILD_COMPILE_WARNINGS project_warnings INTERFACE_COMPILE_OPTIONS)
configure_file(${buildInfoInput} ${buildInfoPath}/${buildInfoFile})
#message ("buildInfoPath: ${buildInfoPath}")
include_directories(${buildInfoPath})
#set(MY_SRCS ${MY_SRCS} ${buildInfoPath}/${buildInfoFile} ${CMAKE_CURRENT_LIST_DIR}/${buildInfoFileHeader})
set(MY_SRCS ${MY_SRCS} ${buildInfoPath}/${buildInfoFile})
source_group("" FILES ${buildInfoPath}/${buildInfoFile})
#source_group("" FILES ${CMAKE_CURRENT_LIST_DIR}/${buildInfoFileHeader})
\ No newline at end of file
......@@ -26,8 +26,6 @@
// You should have received a copy of the GNU General Public License along
// with VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
//! \file buildInfo.h
//! \ingroup Core
//! \author Soeren Peters
//=======================================================================================
#ifndef buildInfo_H
......@@ -35,21 +33,18 @@
namespace buildInfo
{
const char *gitCommitHash();
const char *gitBranch();
const char *buildType();
const char *compilerFlags();
const char *buildMachine();
const char *projectDir();
const char *binaryDir();
} // namespace buildInfo
#define GIT_COMMIT_HASH buildinfo::gitCommitHash()
#define GIT_BRANCH buildinfo::gitBranch()
#define BUILD_MACHINE buildinfo::buildMachine()
#define PROJECT_DIR buildinfo::projectDir()
#define BINARY_DIR buildinfo::binaryDir()
#define COMPILER_FLAGS buildinfo::compilerFlags()
#define BUILD_TYPE buildinfo::buildType()
const char* gitCommitHash();
const char* gitBranch();
const char* buildType();
const char* compilerFlags();
const char* compilerFlagWarnings();
const char* compilerDefinitions();
const char* buildMachine();
const char* projectDir();
const char* binaryDir();
const char* precision();
} // namespace buildInfo
#endif
//=======================================================================================
// ____ ____ __ ______ __________ __ __ __ __
// \ \ | | | | | _ \ |___ ___| | | | | / \ | |
// \ \ | | | | | |_) | | | | | | | / \ | |
// \ \ | | | | | _ / | | | | | | / /\ \ | |
// \ \ | | | | | | \ \ | | | \__/ | / ____ \ | |____
// \ \ | | |__| |__| \__\ |__| \________/ /__/ \__\ |_______|
// \ \ | | ________________________________________________________________
// \ \ | | | ______________________________________________________________|
// \ \| | | | __ __ __ __ ______ _______
// \ | | |_____ | | | | | | | | | _ \ / _____)
// \ | | _____| | | | | | | | | | | \ \ \_______
// \ | | | | |_____ | \_/ | | | | |_/ / _____ |
// \ _____| |__| |________| \_______/ |__| |______/ (_______/
//
// This file is part of VirtualFluids. VirtualFluids 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.
//
// VirtualFluids 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 VirtualFluids (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
//
//! \author Soeren Peters
//=======================================================================================
namespace buildInfo
{
const char *gitCommitHash() { return "@git_commit_hash@"; }
const char *gitBranch() { return "@git_branch@"; }
const char *buildType() { return "@CMAKE_BUILD_TYPE@"; }
const char *compilerFlags() { return "@COMPILER_FLAGS@"; }
const char *buildMachine() { return "@BUILD_computerName@"; }
const char *projectDir() { return "@CMAKE_SOURCE_DIR@"; }
const char *binaryDir() { return "@CMAKE_BINARY_DIR@"; }
const char* gitCommitHash()
{
return "@git_commit_hash@";
}
const char* gitBranch()
{
return "@git_branch@";
}
const char* buildType()
{
return "@CMAKE_BUILD_TYPE@";
}
const char* compilerFlags()
{
return "@BUILD_COMPILE_OPTIONS@";
}
const char* compilerFlagWarnings()
{
return "@BUILD_COMPILE_WARNINGS@";
}
const char* compilerDefinitions()
{
return "@BUILD_COMPILE_DEFINITIONS@";
}
const char* buildMachine()
{
return "@BUILD_computerName@";
}
const char* projectDir()
{
return "@CMAKE_SOURCE_DIR@";
}
const char* binaryDir()
{
return "@CMAKE_BINARY_DIR@";
}
const char* precision()
{
return "@BUILD_PRECISION@";
}
} // namespace buildInfo
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment