Skip to content

Commit

Permalink
Try running MSVC nmake install from a .cmake script
Browse files Browse the repository at this point in the history
  • Loading branch information
starseeker committed Feb 4, 2025
1 parent a8e0ae9 commit ed8a0fe
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tcl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ if (ENABLE_TCL)

configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tcl_configure.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/tcl_configure.cmake @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tcl_build.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/tcl_build.cmake @ONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/tcl_install.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/tcl_install.cmake @ONLY)

if (NOT MSVC)

Expand Down Expand Up @@ -105,8 +106,7 @@ if (ENABLE_TCL)
CONFIGURE_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/tcl_configure.cmake
BINARY_DIR ${TCL_SRC_DIR}/win
BUILD_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/tcl_build.cmake
INSTALL_COMMAND call ${VCVARS_BAT} && nmake -f makefile.vc install INSTALLDIR=${CMAKE_BUNDLE_INSTALL_PREFIX} SUFX=
COMMAND echo "Running VCVARS_BAT: ${VCVARS_BAT}"
INSTALL_COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/tcl_install.cmake
LOG_CONFIGURE ${EXT_BUILD_QUIET}
LOG_BUILD ${EXT_BUILD_QUIET}
LOG_INSTALL ${EXT_BUILD_QUIET}
Expand Down
24 changes: 24 additions & 0 deletions tcl/tcl_install.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
execute_process(
COMMAND "@VCVARS_BAT@"
)
execute_process(
COMMAND nmake -f makefile.vc install INSTALLDIR=@CMAKE_BUNDLE_INSTALL_PREFIX@ SUFX=
RESULT_VARIABLE TCL_RET
WORKING_DIRECTORY "@TCL_SRC_DIR@/win"
OUTPUT_VARIABLE MSG
ERROR_VARIABLE MSG
)

if (TCL_RET)
message(FATAL_ERROR "Tcl install failed: ${MSG}\n")
endif (TCL_RET)

message("Tcl install succeeded: ${MSG}\n")

# Local Variables:
# tab-width: 8
# mode: cmake
# indent-tabs-mode: t
# End:
# ex: shiftwidth=2 tabstop=8

0 comments on commit ed8a0fe

Please sign in to comment.