#Generate and install a cmake toolchain file for OpenWatcom 8086 #as share/openwatcom-toolchain.txt containing absolute paths for the compiler #executables and linker we find via find_program(). This allows us to install #a crosscompiler and linker, and then use the toolchain file generated here to #crosscompile other OSD packages. cmake_minimum_required(VERSION 3.6.3) #The generated toolchain file depends on CMAKE_TRY_COMPILE_TARGET_TYPE project (openwatcom-toolchain) #Default values used by the configure step. #You can override these with cmake -DTOOLCHAIN_COMPILER_TARGET etc. set (TOOLCHAIN_SYSTEM_NAME Windows CACHE STRING "Value for CMAKE_SYSTEM_NAME") set (TOOLCHAIN_SYSTEM_VERSION 6.22 CACHE STRING "Value for CMAKE_SYSTEM_VERSION") set (TOOLCHAIN_SYSTEM_PROCESSOR x86 CACHE STRING "Value for CMAKE_SYSTEM_PROCESSOR") #Locate the launcher script for OpenWatcom. #This toolchain file will configure cmake to launch the compiler through a #small launcher script which will set some environment variables prior to #invoking the compiler. find_program (TOOLCHAIN_C_EXECUTABLE openwatcom-launcher.cmd) #find_program (TOOLCHAIN_LINKER_EXECUTABLE wlink ${CMAKE_INSTALL_PREFIX}/binnt binnt) if (TOOLCHAIN_C_EXECUTABLE) message (STATUS "Toolchain will launch the OpenWatcom compiler via " ${TOOLCHAIN_C_EXECUTABLE}) else() message (FATAL_ERROR "Could not find OpenWatcom compiler") endif() #if (TOOLCHAIN_LINKER_EXECUTABLE) # message (STATUS "Toolchain will use linker " ${TOOLCHAIN_LINKER_EXECUTABLE}) #else() # message (FATAL_ERROR "Could not find linker " ${TOOLCHAIN_LINKER}) #endif() #Generate toolchain file openwatcom-toolchain.txt which contains absolute #filenames for the compilers and the linker as given by the following #variables: #TOOLCHAIN_C_EXECUTABLE #TOOLCHAIN_LINKER_EXECUTABLE. configure_file (${CMAKE_CURRENT_LIST_DIR}/toolchain-template.txt ${CMAKE_BINARY_DIR}/openwatcom-toolchain.txt) install (FILES ${CMAKE_BINARY_DIR}/openwatcom-toolchain.txt DESTINATION share)