@@ -20,18 +20,25 @@ set(CMAKE_CXX_EXTENSIONS OFF)
2020# Add project_options v0.13.1
2121# https://github.com/cpp-best-practices/project_options
2222include (FetchContent)
23- FetchContent_Declare(_project_options
23+ FetchContent_Declare(_project_options
2424 URL https://github.com/cpp-best-practices/project_options/archive/refs/heads/main.zip)
25- # URL https://github.com/cpp-best-practices/project_options/archive/refs/tags/v0.13.1.zip)
25+ # URL https://github.com/cpp-best-practices/project_options/archive/refs/tags/v0.13.1.zip)
2626FetchContent_MakeAvailable(_project_options)
2727include (${_project_options_SOURCE_DIR} /Index.cmake)
2828
2929# uncomment to enable vcpkg:
3030# # Setup vcpkg - should be called before defining project()
3131# run_vcpkg()
3232
33+ set (GIT_SHA "Unknown" CACHE STRING "SHA this build was generated from" )
34+ string (SUBSTRING "${GIT_SHA} " 0 8 GIT_SHORT_SHA)
35+
3336# Set the project name and language
34- project (json2cpp VERSION 0.0.1 DESCRIPTION "Compiles JSON files into `static constexpr` C++ files" LANGUAGES CXX C)
37+ project (
38+ json2cpp
39+ VERSION 0.0.1
40+ DESCRIPTION "Compiles JSON files into `static constexpr` C++ files"
41+ LANGUAGES CXX C)
3542
3643if (GENERATOR_IS_MULTI_CONFIG AND NOT CMAKE_BUILD_TYPE )
3744 # Make sure that all supported configuration types have their
@@ -72,17 +79,14 @@ dynamic_project_options(
7279 # GCC_WARNINGS # Override the defaults for the GCC warnings
7380)
7481
75-
7682if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS "9" )
7783 target_link_libraries (project_options INTERFACE stdc++fs)
7884endif ()
7985
80-
8186target_compile_features (project_options INTERFACE cxx_std_${USER_CXX_STANDARD} )
8287
8388option (ENABLE_LARGE_TESTS "Enable tests and tools that use the Energy+ schema file" ON )
8489
85-
8690# Adding the src:
8791add_subdirectory (src)
8892
@@ -111,4 +115,9 @@ endif()
111115# set the startup project for the "play" button in MSVC
112116set_property (DIRECTORY PROPERTY VS_STARTUP_PROJECT json2cpp)
113117
118+ set (CPACK_PACKAGE_FILE_NAME
119+ "${CMAKE_PROJECT_NAME} -${CMAKE_PROJECT_VERSION} -${GIT_SHORT_SHA} -${CMAKE_SYSTEM_NAME} -${CMAKE_BUILD_TYPE} -${CMAKE_CXX_COMPILER_ID} -${CMAKE_CXX_COMPILER_VERSION} " )
120+
114121include (CPack)
122+
123+
0 commit comments