mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-27 18:57:17 +00:00
Move IFCOPENSHELL_VERSION definition from IfcParse.h
To prevent recompiling all files that have IfcParse.h include and improve caching.
This commit is contained in:
@@ -91,8 +91,8 @@ option(WITH_ROCKSDB "Support a RocksDB key-value store as a file backend in IfcO
|
|||||||
option(WITH_ZSTD "Use Zstd compression in RocksDB writes" OFF)
|
option(WITH_ZSTD "Use Zstd compression in RocksDB writes" OFF)
|
||||||
|
|
||||||
option(USERSPACE_PYTHON_PREFIX "Installs IfcPython for the current user only instead of system-wide." OFF)
|
option(USERSPACE_PYTHON_PREFIX "Installs IfcPython for the current user only instead of system-wide." OFF)
|
||||||
option(ADD_COMMIT_SHA "Add commit sha and branch in version number, warning results in many rebuilds, requires git" OFF)
|
option(ADD_COMMIT_SHA "Add commit sha and branch in version number, requires git" OFF)
|
||||||
option(VERSION_OVERRIDE "Override the version defined in IfcParse.h with the file VERSION in the repository root" OFF)
|
option(VERSION_OVERRIDE "Override the version defined in buildinfo.cpp with the file VERSION in the repository root" OFF)
|
||||||
|
|
||||||
set(
|
set(
|
||||||
PYTHON_MODULE_INSTALL_DIR
|
PYTHON_MODULE_INSTALL_DIR
|
||||||
@@ -1363,8 +1363,10 @@ if(ADD_COMMIT_SHA)
|
|||||||
message(FATAL_ERROR "Unable to determine commit sha and/or branch")
|
message(FATAL_ERROR "Unable to determine commit sha and/or branch")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_definitions(-DIFCOPENSHELL_BRANCH=${git_branch})
|
target_compile_definitions(IfcParse PRIVATE
|
||||||
add_definitions(-DIFCOPENSHELL_COMMIT=${git_sha})
|
-DIFCOPENSHELL_BRANCH=${git_branch}
|
||||||
|
-DIFCOPENSHELL_COMMIT=${git_sha}
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
endif(ADD_COMMIT_SHA)
|
endif(ADD_COMMIT_SHA)
|
||||||
|
|
||||||
|
|||||||
@@ -1664,7 +1664,7 @@ void fix_quantities(IfcParse::IfcFile& f, bool no_progress, bool quiet, bool std
|
|||||||
latebound_access::set(application, "ApplicationDeveloper", org);
|
latebound_access::set(application, "ApplicationDeveloper", org);
|
||||||
latebound_access::set(application, "Version", std::string(IFCOPENSHELL_VERSION));
|
latebound_access::set(application, "Version", std::string(IFCOPENSHELL_VERSION));
|
||||||
latebound_access::set(application, "ApplicationFullName", std::string("IfcConvert"));
|
latebound_access::set(application, "ApplicationFullName", std::string("IfcConvert"));
|
||||||
latebound_access::set(application, "ApplicationIdentifier", std::string("IfcConvert" IFCOPENSHELL_VERSION));
|
latebound_access::set(application, "ApplicationIdentifier", std::string("IfcConvert") + IFCOPENSHELL_VERSION);
|
||||||
|
|
||||||
auto ownerhist = latebound_access::create(f, "IfcOwnerHistory");
|
auto ownerhist = latebound_access::create(f, "IfcOwnerHistory");
|
||||||
latebound_access::set(ownerhist, "OwningUser", pando);
|
latebound_access::set(ownerhist, "OwningUser", pando);
|
||||||
|
|||||||
@@ -191,7 +191,7 @@ protected:
|
|||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
const std::string& string() { return str; }
|
const std::string& string() { return str; }
|
||||||
Hello() : Command(HELLO), str("IfcOpenShell-" IFCOPENSHELL_VERSION "-0") {}
|
Hello() : Command(HELLO), str("IfcOpenShell-" + std::string(IFCOPENSHELL_VERSION) + "-0") {}
|
||||||
};
|
};
|
||||||
|
|
||||||
class More : public Command {
|
class More : public Command {
|
||||||
|
|||||||
@@ -2706,8 +2706,8 @@ void IfcFile::setDefaultHeaderValues() {
|
|||||||
header().file_name()->settime_stamp(createTimestamp());
|
header().file_name()->settime_stamp(createTimestamp());
|
||||||
header().file_name()->setauthor(string_vector);
|
header().file_name()->setauthor(string_vector);
|
||||||
header().file_name()->setorganization(string_vector);
|
header().file_name()->setorganization(string_vector);
|
||||||
header().file_name()->setpreprocessor_version("IfcOpenShell " IFCOPENSHELL_VERSION);
|
header().file_name()->setpreprocessor_version("IfcOpenShell " + std::string(IFCOPENSHELL_VERSION));
|
||||||
header().file_name()->setoriginating_system("IfcOpenShell " IFCOPENSHELL_VERSION);
|
header().file_name()->setoriginating_system("IfcOpenShell " + std::string(IFCOPENSHELL_VERSION));
|
||||||
header().file_name()->setauthorization(empty_string);
|
header().file_name()->setauthorization(empty_string);
|
||||||
|
|
||||||
header().file_schema()->setschema_identifiers(schema_identifiers);
|
header().file_schema()->setschema_identifiers(schema_identifiers);
|
||||||
|
|||||||
@@ -43,11 +43,8 @@
|
|||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#if defined(IFCOPENSHELL_BRANCH) && defined(IFCOPENSHELL_COMMIT)
|
|
||||||
#define IFCOPENSHELL_VERSION STRINGIFY(IFCOPENSHELL_BRANCH) "-" STRINGIFY(IFCOPENSHELL_COMMIT)
|
extern const char *IFCOPENSHELL_VERSION;
|
||||||
#else
|
|
||||||
#define IFCOPENSHELL_VERSION "0.8.0"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace IfcParse {
|
namespace IfcParse {
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,35 @@
|
|||||||
|
/********************************************************************************
|
||||||
|
* *
|
||||||
|
* This file is part of IfcOpenShell. *
|
||||||
|
* *
|
||||||
|
* IfcOpenShell is free software: you can redistribute it and/or modify *
|
||||||
|
* it under the terms of the Lesser GNU General Public License as published by *
|
||||||
|
* the Free Software Foundation, either version 3.0 of the License, or *
|
||||||
|
* (at your option) any later version. *
|
||||||
|
* *
|
||||||
|
* IfcOpenShell 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 *
|
||||||
|
* Lesser GNU General Public License for more details. *
|
||||||
|
* *
|
||||||
|
* You should have received a copy of the Lesser GNU General Public License *
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
|
||||||
|
* *
|
||||||
|
********************************************************************************/
|
||||||
|
|
||||||
|
/********************************************************************************
|
||||||
|
* *
|
||||||
|
* This file provides functions for loading an IFC file into memory and access *
|
||||||
|
* its entities either by ID, by an IfcSchema::Type or by reference *
|
||||||
|
* *
|
||||||
|
********************************************************************************/
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
#include "macros.h"
|
||||||
|
|
||||||
|
|
||||||
|
#if defined(IFCOPENSHELL_BRANCH) && defined(IFCOPENSHELL_COMMIT)
|
||||||
|
const char *IFCOPENSHELL_VERSION = STRINGIFY(IFCOPENSHELL_BRANCH) "-" STRINGIFY(IFCOPENSHELL_COMMIT);
|
||||||
|
#else
|
||||||
|
const char *IFCOPENSHELL_VERSION = "0.8.0";
|
||||||
|
#endif
|
||||||
@@ -74,7 +74,7 @@ bool GltfSerializer::ready() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GltfSerializer::writeHeader() {
|
void GltfSerializer::writeHeader() {
|
||||||
json_["asset"]["generator"] = "IfcOpenShell IfcConvert " IFCOPENSHELL_VERSION;
|
json_["asset"]["generator"] = "IfcOpenShell IfcConvert " + std::string(IFCOPENSHELL_VERSION);
|
||||||
json_["asset"]["version"] = "2.0";
|
json_["asset"]["version"] = "2.0";
|
||||||
json_["scene"] = 0;
|
json_["scene"] = 0;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user