#Generate and install a launcher batch file for OpenWatcom 8086 #as bin/openwatcom-launcher.cmd containing absolute paths for the compiler #executable we find via find_program(). cmake_minimum_required(VERSION 3.6.3) project (openwatcom-launcher) find_program (OPENWATCOM_C_EXECUTABLE wcl ${CMAKE_INSTALL_PREFIX}/binnt binnt) if (OPENWATCOM_C_EXECUTABLE) message (STATUS "OpenWatcom compiler launcher will invoke " ${OPENWATCOM_C_EXECUTABLE}) else() message (FATAL_ERROR "Could not find OpenWatcom compiler executable") endif() #The following will be written verbatim to the launcher batch file, so they #must be in native format. #file(TO_NATIVE_PATH "${OPENWATCOM_C_EXECUTABLE}" OPENWATCOM_PATH_IN_DOS_FORMAT) file(TO_NATIVE_PATH "${CMAKE_COMMAND}" CMAKE_COMMAND_IN_DOS_FORMAT) file(TO_NATIVE_PATH "${CMAKE_INSTALL_PREFIX}" PREFIX_IN_DOS_FORMAT) #Generate the compiler launcher which contains the absolute filename of the #compiler executable as given by OPENWATCOM_C_EXECUTABLE. configure_file (${CMAKE_CURRENT_LIST_DIR}/launcher-template.txt ${CMAKE_BINARY_DIR}/openwatcom-launcher.cmd) install (FILES ${CMAKE_BINARY_DIR}/openwatcom-launcher.cmd DESTINATION bin)