Skip to content

Commit

Permalink
version.h configured within util
Browse files Browse the repository at this point in the history
  • Loading branch information
LiangliangNan committed Jan 12, 2025
1 parent 6817d9e commit 5855770
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
7 changes: 0 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,6 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${Easy3D_BINARY_DIR}/bin)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${Easy3D_BINARY_DIR}/lib)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${Easy3D_BINARY_DIR}/lib)

### update EASY3D_VERSION_NR and EASY3D_RELEASE_DATE
file(READ "${Easy3D_INCLUDE_DIR}/easy3d/util/version.h" file_content)
string(REGEX REPLACE "EASY3D_VERSION_NR 10[0-9]0[0-9]0[0-9]" "EASY3D_VERSION_NR ${Easy3D_VERSION_NUMBER}" file_content "${file_content}")
string(TIMESTAMP TODAY "%Y%m%d")
string(REGEX REPLACE "EASY3D_RELEASE_DATE [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]" "EASY3D_RELEASE_DATE ${TODAY}" file_content "${file_content}")
file(WRITE ${Easy3D_INCLUDE_DIR}/easy3d/util/version.h "${file_content}")

################################################################################

# Discourage users to build Easy3D directly in its root directory
Expand Down
7 changes: 7 additions & 0 deletions easy3d/util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,13 @@ if (Easy3D_BUILD_SHARED_LIBS)
PRIVATE ELPP_EXPORT_SYMBOLS)
endif ()

### update EASY3D_VERSION_NR and EASY3D_RELEASE_DATE
file(READ "${CMAKE_CURRENT_LIST_DIR}/version.h" file_content)
string(REGEX REPLACE "EASY3D_VERSION_NR 10[0-9]0[0-9]0[0-9]" "EASY3D_VERSION_NR ${Easy3D_VERSION_NUMBER}" file_content "${file_content}")
string(TIMESTAMP TODAY "%Y%m%d")
string(REGEX REPLACE "EASY3D_RELEASE_DATE [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]" "EASY3D_RELEASE_DATE ${TODAY}" file_content "${file_content}")
file(WRITE ${CMAKE_CURRENT_LIST_DIR}/version.h "${file_content}")

install_module(${module})
# Install easylogging++.h to the installation directory
install(FILES "${Easy3D_THIRD_PARTY}/easyloggingpp/easylogging++.h"
Expand Down
2 changes: 1 addition & 1 deletion easy3d/util/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace easy3d {
#define EASY3D_VERSION_NR 1020600

/// Easy3D release date, in the format YYYYMMDD.
#define EASY3D_RELEASE_DATE 20250111
#define EASY3D_RELEASE_DATE 20250112


#endif // EASY3D_UTIL_VERSION_H

0 comments on commit 5855770

Please sign in to comment.