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

Commit

Permalink
Got packaging working for Windows installers.
Browse files Browse the repository at this point in the history
  • Loading branch information
hach-que committed Nov 11, 2012
1 parent 6bba157 commit ac78f8d
Show file tree
Hide file tree
Showing 5 changed files with 1,044 additions and 8 deletions.
41 changes: 35 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,18 @@ if(${DEPLOYABLE})
message("Deployable builds will also install development")
message("headers for external use.")
message("======================================")
set(LIBRARY_FORMAT SHARED)
if(MSVC)
# MSVC has explicit exporting with dllexport, but we're not going to
# add that to every single function declaration. On Windows, we always
# static link.
set(LIBRARY_FORMAT STATIC)
set(CMAKE_INSTALL_PREFIX "C:/DCPU")
else()
set(LIBRARY_FORMAT SHARED)
endif()
else()
set(LIBRARY_FORMAT STATIC)
endif()
if(CMAKE_HOST_WINDOWS)
set(CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}/DCPU Toolchain")
endif()

# Set compiler options.
set(OUTPUT_EXT "")
Expand Down Expand Up @@ -120,7 +125,7 @@ function(auto_group project)
get_property(srcs TARGET ${project} PROPERTY SOURCES)
foreach(o ${srcs})
get_filename_component(oabs ${o} ABSOLUTE)
file(RELATIVE_PATH i ${${project}_SOURCE_DIR} ${oabs})
file(RELATIVE_PATH i "${${project}_SOURCE_DIR}" "${oabs}")
get_filename_component(ipath ${i} PATH)
get_filename_component(iext ${i} EXT)
if(NOT "${ipath}" STREQUAL "")
Expand Down Expand Up @@ -242,6 +247,19 @@ if(${DEPLOYABLE})
share/dcpu/modules)
endif()

# Additional DLLs to be installed.
if(MSVC)
install(FILES ${QT_BINARY_DIR}/QtCored4.dll DESTINATION bin)
install(FILES ${QT_BINARY_DIR}/QtGuid4.dll DESTINATION bin)
install(FILES ${QT_BINARY_DIR}/QtOpenGLd4.dll DESTINATION bin)
install(FILES ${toolchain_SOURCE_DIR}/third-party/readline/bin/history5.dll DESTINATION bin)
install(FILES ${toolchain_SOURCE_DIR}/third-party/readline/bin/readline5.dll DESTINATION bin)
install(FILES ${toolchain_SOURCE_DIR}/third-party/curl/bin/libcurl.dll DESTINATION bin)
install(FILES ${toolchain_SOURCE_DIR}/third-party/msvcp100d.dll DESTINATION bin)
install(FILES ${toolchain_SOURCE_DIR}/third-party/msvcr100d.dll DESTINATION bin)
install(FILES ${toolchain_SOURCE_DIR}/third-party/pthread/bin/pthreadVC2.dll DESTINATION bin)
endif()

# Configure packaging.
if(MSVC)
set(CPACK_GENERATOR "NSIS")
Expand All @@ -254,7 +272,8 @@ if(${DEPLOYABLE})
set(CPACK_PACKAGE_CONTACT "DCPU-16 Developers")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${toolchain_SOURCE_DIR}/package/DESCRIPTION.txt")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The best set of tools for developing applications on the DCPU-16.")
set(CPACK_PACKAGE_FILE_LICENSE "${toolchain_SOURCE_DIR}/package/LICENSE.txt")
set(CPACK_RESOURCE_FILE_LICENSE "${toolchain_SOURCE_DIR}/package/LICENSE.txt")
set(CPACK_RESOURCE_FILE_README "${toolchain_SOURCE_DIR}/package/DESCRIPTION.txt")
set(CPACK_PACKAGE_NAME "dcputoolchain")
set(CPACK_PACKAGE_VENDOR "DCPU-16 Developers")
set(CPACK_PACKAGE_VERSION_MAJOR "0")
Expand All @@ -264,5 +283,15 @@ if(${DEPLOYABLE})
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "James Rhodes <[email protected]>")
set(CPACK_DEBIAN_PACKAGE_SECTION "Development")

if(MSVC)
set(CMAKE_INSTALL_PREFIX "C:/DCPU")
set(CPACK_PACKAGE_NAME "DCPU-16 Toolchain")
set(CPACK_NSIS_INSTALL_ROOT "C:")
set(CPACK_PACKAGE_INSTALL_DIRECTORY "DCPU")
set(CPACK_NSIS_MODIFY_PATH ON)
set(CPACK_NSIS_MUI_FINISHPAGE_RUN "dtide.exe")
set(CPACK_PACKAGE_EXECUTABLES "dtide;Toolchain IDE")
endif()

include(CPack)
endif()
46 changes: 46 additions & 0 deletions CMakeScripts/NSIS.InstallOptions.ini.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[Settings]
NumFields=5

[Field 1]
Type=label
Text=It is recommended that the DCPU-16 Toolchain is added to the system PATH.
Left=0
Right=-1
Top=0
Bottom=20

[Field 2]
Type=radiobutton
Text=Do not add @CPACK_PACKAGE_NAME@ to the system PATH (tools may not work correctly!)
Left=0
Right=-1
Top=30
Bottom=40
State=0

[Field 3]
Type=radiobutton
Text=Add @CPACK_PACKAGE_NAME@ to the system PATH for all users
Left=0
Right=-1
Top=40
Bottom=50
State=1

[Field 4]
Type=radiobutton
Text=Add @CPACK_PACKAGE_NAME@ to the system PATH for current user
Left=0
Right=-1
Top=50
Bottom=60
State=0

[Field 5]
Type=CheckBox
Text=Create @CPACK_PACKAGE_NAME@ Desktop Icon
Left=0
Right=-1
Top=80
Bottom=90
State=0
Loading

0 comments on commit ac78f8d

Please sign in to comment.