diff --git a/CMakeLists.txt b/CMakeLists.txt index 76b93c8..b2be719 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,16 @@ cmake_minimum_required(VERSION 3.18) project(Yerbacon VERSION 0.0.1 LANGUAGES C CXX) +if (NOT DEFINED CODENAME) + set(CODENAME "Unknown") + if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/misc/codename.txt") + file(READ "${CMAKE_CURRENT_SOURCE_DIR}/misc/codename.txt" CODENAME) + endif () +endif() + +file(COPY "resources/Yerbacon.manifest" "resources/Yerbacon.ico" DESTINATION "processed") +configure_file("resources/Yerbacon.rc" "processed/Yerbacon.rc" @ONLY) + set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_FLAGS "-Wall") @@ -38,7 +48,7 @@ string(TIMESTAMP TIME "%Y.%m+%d") set(CPACK_PACKAGE_VERSION "${PROJECT_VERSION}-${TIME}") set(CPACK_PACKAGE_VENDOR "Contributor(s)") set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resources/Yerbacon.png") -set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/desc.txt") +set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/misc/desc.txt") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Transpiler for the yerbacon language.") set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt") @@ -48,7 +58,7 @@ set(CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}-${CMAKE_PROJECT_VERSION}-${TI set(CPACK_STRIP_FILES TRUE) include_directories(${CMAKE_CURRENT_LIST_DIR}) -add_executable(ybcon src/main.cpp resources/Yerbacon.rc src/parser/MainParse.cpp src/transpiler/MainTranspile.cpp src/etc/filefuncs.cpp src/etc/lexer.cpp src/headers/lex.hpp src/headers/misc.hpp src/headers/parsing/ParseComponents.hpp src/headers/parsing/StandardComponents.hpp) +add_executable(ybcon src/main.cpp ${CMAKE_CURRENT_BINARY_DIR}/processed/Yerbacon.rc src/parser/MainParse.cpp src/transpiler/MainTranspile.cpp src/etc/filefuncs.cpp src/etc/lexer.cpp src/headers/lex.hpp src/headers/misc.hpp src/headers/parsing/ParseComponents.hpp src/headers/parsing/StandardComponents.hpp) target_compile_definitions(ybcon PRIVATE YBCON_VERSION="${PROJECT_VERSION}") # lpkg = linux package, wpkg = windows package @@ -77,7 +87,7 @@ if (UNIX AND NOT MINGW) install(DIRECTORY src DESTINATION ${CPACK_RPM_SOURCE_PKG_PACKAGING_INSTALL_PREFIX}) install(DIRECTORY resources DESTINATION ${CPACK_RPM_SOURCE_PKG_PACKAGING_INSTALL_PREFIX}) install(DIRECTORY scripts DESTINATION ${CPACK_RPM_SOURCE_PKG_PACKAGING_INSTALL_PREFIX}) - install(FILES CMakeLists.txt desc.txt LICENSE.txt README.md changelog.txt DESTINATION ${CPACK_RPM_SOURCE_PKG_PACKAGING_INSTALL_PREFIX}) + install(FILES CMakeLists.txt misc/desc.txt LICENSE.txt README.md changelog.txt DESTINATION ${CPACK_RPM_SOURCE_PKG_PACKAGING_INSTALL_PREFIX}) else() if (NOT DEFINED CPACK_GENERATOR) set(CPACK_GENERATOR TGZ;STGZ;RPM;DEB) diff --git a/misc/codename.txt b/misc/codename.txt new file mode 100644 index 0000000..d2819cf --- /dev/null +++ b/misc/codename.txt @@ -0,0 +1 @@ +Caterpillar \ No newline at end of file diff --git a/desc.txt b/misc/desc.txt similarity index 100% rename from desc.txt rename to misc/desc.txt diff --git a/resources/Yerbacon.rc b/resources/Yerbacon.rc index 770fe04..0006e33 100644 --- a/resources/Yerbacon.rc +++ b/resources/Yerbacon.rc @@ -3,8 +3,8 @@ 256 ICON "Yerbacon.ico" 1 VERSIONINFO -FILEVERSION 0,0,0,1 -PRODUCTVERSION 0,0,0,1 +FILEVERSION @CMAKE_PROJECT_VERSION_MAJOR@,@CMAKE_PROJECT_VERSION_MINOR@,@CMAKE_PROJECT_VERSION_PATCH@,0 +PRODUCTVERSION @CMAKE_PROJECT_VERSION_MAJOR@,@CMAKE_PROJECT_VERSION_MINOR@,@CMAKE_PROJECT_VERSION_PATCH@ BEGIN BLOCK "StringFileInfo" BEGIN @@ -12,12 +12,12 @@ BEGIN BEGIN VALUE "CompanyName", "" VALUE "FileDescription", "The Yerbacon compiler" - VALUE "FileVersion", "0.0.0.1" + VALUE "FileVersion", "@CMAKE_PROJECT_VERSION@.0" VALUE "InternalName", "Ybcon" VALUE "LegalCopyright", "" - VALUE "OriginalName", "Yerbacon.exe" + VALUE "OriginalName", "ybcon.exe" VALUE "ProductName", "Yerbacon" - VALUE "ProductVersion", "Caterpillar 0.0.0.1" + VALUE "ProductVersion", "@CODENAME@ @CMAKE_PROJECT_VERSION@.0" END END BLOCK "VarFileInfo"