cmake - add version info to netgen.exe on Windows

This commit is contained in:
mhochsteger 2020-11-16 16:10:46 +01:00
parent 54bc0dbf88
commit d7a1dda042
5 changed files with 19 additions and 13 deletions

View File

@ -417,12 +417,12 @@ endif(USE_CGNS)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/netgen_version.hpp ${CMAKE_CURRENT_BINARY_DIR}/netgen_config.hpp DESTINATION ${NG_INSTALL_DIR_INCLUDE}/include COMPONENT netgen_devel) install(FILES ${CMAKE_CURRENT_BINARY_DIR}/netgen_version.hpp ${CMAKE_CURRENT_BINARY_DIR}/netgen_config.hpp DESTINATION ${NG_INSTALL_DIR_INCLUDE}/include COMPONENT netgen_devel)
add_subdirectory(windows)
add_subdirectory(libsrc) add_subdirectory(libsrc)
add_subdirectory(ng) add_subdirectory(ng)
add_subdirectory(tutorials) add_subdirectory(tutorials)
add_subdirectory(py_tutorials) add_subdirectory(py_tutorials)
add_subdirectory(doc) add_subdirectory(doc)
add_subdirectory(windows)
add_subdirectory(nglib) add_subdirectory(nglib)
if (USE_PYTHON) if (USE_PYTHON)
add_subdirectory(python) add_subdirectory(python)

View File

@ -4,13 +4,11 @@ else()
add_definitions(-DINTERNAL_TCL_DEFAULT=0) add_definitions(-DINTERNAL_TCL_DEFAULT=0)
endif() endif()
set(netgen_sources ngappinit.cpp onetcl.cpp)
if(WIN32) if(WIN32)
# add icon to netgen executable # add icon and version info to netgen executable
enable_language(RC) enable_language(RC)
set(netgen_sources ${netgen_sources} ../windows/netgen.rc) # Don't use ccache here due to incompatibility with the resource compiler
# Don't use ccache here due to incompatibility with the resource compiler set_directory_properties(PROPERTIES RULE_LAUNCH_COMPILE "")
set_directory_properties(PROPERTIES RULE_LAUNCH_COMPILE "")
endif(WIN32) endif(WIN32)
if(USE_GUI) if(USE_GUI)
@ -23,6 +21,9 @@ if(USE_GUI)
) )
add_executable(netgen ngappinit.cpp) add_executable(netgen ngappinit.cpp)
if(WIN32)
target_sources(netgen PRIVATE ../windows/netgen.rc)
endif(WIN32)
target_link_libraries( gui PUBLIC nglib ) target_link_libraries( gui PUBLIC nglib )
target_link_libraries( gui PRIVATE ${LIBTOGL} ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES} ${FFMPEG_LIBRARIES} ${X11_Xmu_LIB} ${X11_X11_LIB} ${OCC_LIBRARIES} ) target_link_libraries( gui PRIVATE ${LIBTOGL} ${ZLIB_LIBRARIES} ${JPEG_LIBRARIES} ${FFMPEG_LIBRARIES} ${X11_Xmu_LIB} ${X11_X11_LIB} ${OCC_LIBRARIES} )

1
windows/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
netgen.rc

View File

@ -0,0 +1,4 @@
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/netgen.rc.template"
"${CMAKE_CURRENT_SOURCE_DIR}/netgen.rc"
IMMEDIATE @ONLY)

View File

@ -7,7 +7,7 @@
// //
// Generated from the TEXTINCLUDE 2 resource. // Generated from the TEXTINCLUDE 2 resource.
// //
#include "afxres.h" #include <windows.h>
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS #undef APSTUDIO_READONLY_SYMBOLS
@ -35,8 +35,8 @@ LANGUAGE LANG_GERMAN, SUBLANG_GERMAN
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 5,1,0,0 FILEVERSION @NETGEN_VERSION_MAJOR@,@NETGEN_VERSION_MINOR@,@NETGEN_VERSION_PATCH@,@NETGEN_VERSION_TWEAK@
PRODUCTVERSION 5,1,0,0 PRODUCTVERSION @NETGEN_VERSION_MAJOR@,@NETGEN_VERSION_MINOR@,@NETGEN_VERSION_PATCH@,@NETGEN_VERSION_TWEAK@
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x3L FILEFLAGS 0x3L
@ -51,14 +51,14 @@ BEGIN
BEGIN BEGIN
BLOCK "040904b0" BLOCK "040904b0"
BEGIN BEGIN
VALUE "CompanyName", "Vienna UT" VALUE "CompanyName", "TU Wien"
VALUE "FileDescription", "Netgen Meshing Software" VALUE "FileDescription", "Netgen Meshing Software"
VALUE "FileVersion", "5.1-dev" VALUE "FileVersion", "@NETGEN_VERSION@"
VALUE "InternalName", "Netgen" VALUE "InternalName", "Netgen"
VALUE "LegalCopyright", "GNU Public License (GPL)" VALUE "LegalCopyright", "GNU Public License (GPL)"
VALUE "OriginalFilename", "Netgen.exe" VALUE "OriginalFilename", "Netgen.exe"
VALUE "ProductName", "Netgen" VALUE "ProductName", "Netgen"
VALUE "ProductVersion", "5.1-dev" VALUE "ProductVersion", "@NETGEN_VERSION@"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"