Skip to content

Commit

Permalink
CMake|Windows: Install Visual C++ redistributable libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Mar 1, 2015
1 parent 671430d commit a2415db
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doomsday/apps/client/CMakeLists.txt
Expand Up @@ -128,5 +128,21 @@ else ()
deng_install_deployqt (client)
endif ()

if (VC_REDIST_LIBS_DEBUG)
install (PROGRAMS ${VC_REDIST_LIBS_DEBUG}
DESTINATION ${DENG_INSTALL_LIB_DIR}
CONFIGURATIONS Debug
COMPONENT libs
)
endif ()

if (VC_REDIST_LIBS)
install (PROGRAMS ${VC_REDIST_LIBS}
DESTINATION ${DENG_INSTALL_LIB_DIR}
CONFIGURATIONS Release
COMPONENT libs
)
endif ()

deng_codesign (client)
deng_cotire (client include/precompiled.h)
1 change: 1 addition & 0 deletions doomsday/cmake/Packaging.cmake
Expand Up @@ -36,6 +36,7 @@ if (NOT CPack_CMake_INCLUDED)
)
cpack_add_component (libs
DISPLAY_NAME "Runtime Libraries"
REQUIRED
INSTALL_TYPES gui
)
cpack_add_component (client
Expand Down
34 changes: 34 additions & 0 deletions doomsday/cmake/PlatformWindows.cmake
Expand Up @@ -23,4 +23,38 @@ if (MSVC)
# Disable warnings about unreferenced formal parameters (C4100).
append_unique (CMAKE_C_FLAGS "-w14505 -wd4100 -wd4748")
append_unique (CMAKE_CXX_FLAGS "-w14505 -wd4100 -wd4748")

# Locate Visual Studio.
if (MSVC14)
get_filename_component (VS_DIR
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\14.0\\Setup\\VS;ProductDir]
REALPATH CACHE
)
elseif (MSVC12)
get_filename_component (VS_DIR
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\12.0\\Setup\\VS;ProductDir]
REALPATH CACHE
)
elseif (MSVC11)
get_filename_component (VS_DIR
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\11.0\\Setup\\VS;ProductDir]
REALPATH CACHE
)
elseif (MSVC10)
get_filename_component (VS_DIR
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\Setup\\VS;ProductDir]
REALPATH CACHE
)
endif ()

if (NOT DEFINED VC_REDIST_LIBS)
file (GLOB VC_REDIST_LIBS ${VS_DIR}/vc/redist/x86/Microsoft.VC120.CRT/msvc*)
set (VC_REDIST_LIBS ${VC_REDIST_LIBS} CACHE STRING "Visual C++ redistributable libraries")
endif ()
if (NOT DEFINED VC_REDIST_LIBS_DEBUG)
file (GLOB VC_REDIST_LIBS_DEBUG ${VS_DIR}/vc/redist/Debug_NonRedist/x86/Microsoft.VC120.DebugCRT/msvc*)
set (VC_REDIST_LIBS_DEBUG ${VC_REDIST_LIBS_DEBUG} CACHE STRING
"Visual C++ redistributable libraries (debug builds)"
)
endif ()
endif ()

0 comments on commit a2415db

Please sign in to comment.