Process the rc file even more, add a EXENAME variable in the CMakeLists.txt file and also change the CMake install prefix for mingw.

This commit is contained in:
Username404 2021-03-13 18:49:53 +01:00
parent 693a0374c9
commit ddb892e7fa
Signed by: Username404-59
GPG Key ID: 7AB361FBB257A5D1
3 changed files with 12 additions and 10 deletions

View File

@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.18) cmake_minimum_required(VERSION 3.18)
project(Yerbacon VERSION 0.0.1 LANGUAGES C CXX) project(Yerbacon VERSION 0.0.1 LANGUAGES C CXX)
set(EXENAME "ybcon")
if (NOT DEFINED CODENAME) if (NOT DEFINED CODENAME)
set(CODENAME "Unknown") set(CODENAME "Unknown")
@ -8,7 +9,7 @@ if (NOT DEFINED CODENAME)
endif () endif ()
endif() endif()
file(COPY "resources/Yerbacon.manifest" "resources/Yerbacon.ico" DESTINATION "processed") file(COPY "resources/Yerbacon.manifest" "resources/icon.ico" DESTINATION "processed")
configure_file("resources/Yerbacon.rc" "processed/Yerbacon.rc" @ONLY) configure_file("resources/Yerbacon.rc" "processed/Yerbacon.rc" @ONLY)
set(CMAKE_CXX_STANDARD 20) set(CMAKE_CXX_STANDARD 20)
@ -58,7 +59,7 @@ set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${CMAKE_PROJECT_VERSION}-${TIME}")
set(CPACK_STRIP_FILES TRUE) set(CPACK_STRIP_FILES TRUE)
include_directories(${CMAKE_CURRENT_LIST_DIR}) include_directories(${CMAKE_CURRENT_LIST_DIR})
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) add_executable(${EXENAME} 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="${CODENAME} ${PROJECT_VERSION}") target_compile_definitions(ybcon PRIVATE YBCON_VERSION="${CODENAME} ${PROJECT_VERSION}")
# lpkg = linux package, wpkg = windows package # lpkg = linux package, wpkg = windows package
@ -101,14 +102,15 @@ if (UNIX AND NOT MINGW)
elseif(MINGW OR MSVC) elseif(MINGW OR MSVC)
set(CMAKE_EXE_LINKER_FLAGS "-static -static-libstdc++ ${CMAKE_EXE_LINKER_FLAGS}") set(CMAKE_EXE_LINKER_FLAGS "-static -static-libstdc++ ${CMAKE_EXE_LINKER_FLAGS}")
set(CPACK_PACKAGE_FILE_NAME "${PNAME}_wpkg") set(CPACK_PACKAGE_FILE_NAME "${PNAME}_wpkg")
set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resources/Yerbacon.ico") set(CPACK_NSIS_MUI_ICON "${CMAKE_CURRENT_SOURCE_DIR}/resources/icon.ico")
set(CPACK_NSIS_MUI_UNIICON "${CMAKE_CURRENT_SOURCE_DIR}/resources/Yerbacon.ico") set(CPACK_NSIS_MUI_UNIICON "${CMAKE_CURRENT_SOURCE_DIR}/resources/icon.ico")
set(CPACK_NSIS_DEFINES "RequestExecutionLevel highest") set(CPACK_NSIS_DEFINES "RequestExecutionLevel highest")
set(CPACK_SYSTEM_NAME "Win32-${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}") set(CPACK_SYSTEM_NAME "Win32-${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
set(CPACK_TOPLEVEL_TAG "Win32-${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}") set(CPACK_TOPLEVEL_TAG "Win32-${CMAKE_CXX_COMPILER_ARCHITECTURE_ID}")
set(CPACK_NSIS_MODIFY_PATH ON) set(CPACK_NSIS_MODIFY_PATH ON)
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON) set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
set(CPACK_GENERATOR ZIP;NSIS) set(CPACK_GENERATOR ZIP;NSIS)
set(CMAKE_INSTALL_PREFIX "C:\\progs\\")
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ybcon.exe DESTINATION bin) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/ybcon.exe DESTINATION bin)
endif() endif()
include(CPack) include(CPack)

View File

@ -1,6 +1,6 @@
1 24 "Yerbacon.manifest" 1 24 "@PROJECT_NAME@.manifest"
256 ICON "Yerbacon.ico" 256 ICON "@PROJECT_NAME@.ico"
1 VERSIONINFO 1 VERSIONINFO
FILEVERSION @CMAKE_PROJECT_VERSION_MAJOR@,@CMAKE_PROJECT_VERSION_MINOR@,@CMAKE_PROJECT_VERSION_PATCH@,0 FILEVERSION @CMAKE_PROJECT_VERSION_MAJOR@,@CMAKE_PROJECT_VERSION_MINOR@,@CMAKE_PROJECT_VERSION_PATCH@,0
@ -11,12 +11,12 @@ BEGIN
BLOCK "040904E4" BLOCK "040904E4"
BEGIN BEGIN
VALUE "CompanyName", "" VALUE "CompanyName", ""
VALUE "FileDescription", "The Yerbacon compiler" VALUE "FileDescription", "@CPACK_PACKAGE_DESCRIPTION_SUMMARY@"
VALUE "FileVersion", "@CMAKE_PROJECT_VERSION@.0" VALUE "FileVersion", "@CMAKE_PROJECT_VERSION@.0"
VALUE "InternalName", "Ybcon" VALUE "InternalName", "@EXENAME@"
VALUE "LegalCopyright", "" VALUE "LegalCopyright", ""
VALUE "OriginalName", "ybcon.exe" VALUE "OriginalName", "@EXENAME@.exe"
VALUE "ProductName", "Yerbacon" VALUE "ProductName", "@PROJECT_NAME@"
VALUE "ProductVersion", "@CODENAME@ @CMAKE_PROJECT_VERSION@.0" VALUE "ProductVersion", "@CODENAME@ @CMAKE_PROJECT_VERSION@.0"
END END
END END

View File

Before

Width:  |  Height:  |  Size: 96 KiB

After

Width:  |  Height:  |  Size: 96 KiB