#Generate and install launcher batch files in the bin directory. These will #set up the the required environment variables and invoke the proper binary #via absolute pathnames. # wcl-launcher.cmd # wlink-launcher.cmd # wlib-launcher.cmd #Each of the above will contain a reference to the full path of executables of #the compiler suite found via find_program(). cmake_minimum_required(VERSION 3.6.3) project (openwatcom-launcher) find_program (OPENWATCOM_WCL_EXECUTABLE wcl ${CMAKE_INSTALL_PREFIX}/binnt binnt) find_program (OPENWATCOM_WLINK_EXECUTABLE wlink ${CMAKE_INSTALL_PREFIX}/binnt binnt) find_program (OPENWATCOM_WLIB_EXECUTABLE wlib ${CMAKE_INSTALL_PREFIX}/binnt binnt) if (OPENWATCOM_WCL_EXECUTABLE) message (STATUS "OpenWatcom compiler launcher will invoke " ${OPENWATCOM_WCL_EXECUTABLE}) else() message (FATAL_ERROR "Could not find OpenWatcom compiler executable wcl") endif() if (OPENWATCOM_WLINK_EXECUTABLE) message (STATUS "OpenWatcom linker launcher will invoke " ${OPENWATCOM_WLINK_EXECUTABLE}) else() message (FATAL_ERROR "Could not find OpenWatcom linker executable wlink") endif() if (OPENWATCOM_WLIB_EXECUTABLE) message (STATUS "OpenWatcom librarian launcher will invoke " ${OPENWATCOM_WLIB_EXECUTABLE}) else() message (FATAL_ERROR "Could not find OpenWatcom librarian executable wlib") endif() #The following will be written verbatim to the launcher batch file, which #expects them to be in native format (ie paths must use backslash). 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}/wcl-launcher-template.txt ${CMAKE_BINARY_DIR}/wcl-launcher.cmd) configure_file (${CMAKE_CURRENT_LIST_DIR}/wlink-launcher-template.txt ${CMAKE_BINARY_DIR}/wlink-launcher.cmd) configure_file (${CMAKE_CURRENT_LIST_DIR}/wlib-launcher-template.txt ${CMAKE_BINARY_DIR}/wlib-launcher.cmd) install (FILES ${CMAKE_BINARY_DIR}/wcl-launcher.cmd ${CMAKE_BINARY_DIR}/wlink-launcher.cmd ${CMAKE_BINARY_DIR}/wlib-launcher.cmd DESTINATION bin)