Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

Commit

Permalink
CMake + windres: Adding icon to executable
Browse files Browse the repository at this point in the history
  • Loading branch information
thopiekar committed Dec 1, 2017
1 parent 2cf3ae8 commit 736c84d
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 1 deletion.
18 changes: 17 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,26 @@ endif ()

set_target_properties(_CuraEngine PROPERTIES COMPILE_DEFINITIONS "VERSION=\"${CURA_ENGINE_VERSION}\"")

if(WIN32)
message(STATUS "Using windres")
set(RES_FILES "CuraEngine.rc")
set(CMAKE_RC_COMPILER_INIT windres)
ENABLE_LANGUAGE(RC)
SET(CMAKE_RC_COMPILE_OBJECT
"<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>"
)
endif(WIN32)

if (UNIX)
target_link_libraries(_CuraEngine pthread)
endif()
add_executable(CuraEngine src/main.cpp) #Then compile main.cpp as separate executable, and link the library to it.

if (NOT WIN32)
add_executable(CuraEngine src/main.cpp) # Then compile main.cpp as separate executable, and link the library to it.
else()
add_executable(CuraEngine src/main.cpp ${RES_FILES}) # ..., but don't forget the glitter!
endif(NOT WIN32)

target_link_libraries(CuraEngine _CuraEngine)

# Compiling the test environment.
Expand Down
Binary file added CuraEngine.ico
Binary file not shown.
25 changes: 25 additions & 0 deletions CuraEngine.rc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
main ICON "CuraEngine.ico"

1 VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "080904E4"
BEGIN
VALUE "CompanyName", "Ultimaker BV."
VALUE "FileDescription", "Slicing engine for Cura"
VALUE "FileVersion", "1.0"
VALUE "InternalName", "CuraEngine"
VALUE "LegalCopyright", "Ultimaker BV."
VALUE "OriginalFilename", "CuraEngine.exe"
VALUE "ProductName", "CuraEngine"
VALUE "ProductVersion", "1.0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x809, 1252
END
END

0 comments on commit 736c84d

Please sign in to comment.