File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -23,15 +23,29 @@ if(NOT MICROCHIP_XC8_PATH)
2323 message (FATAL_ERROR
2424 "No Microchip XC8 compiler was found. Please provide the path"
2525 " to an XC8 installation on the command line, for example:\n "
26- "cmake -DMICROCHIP_XC8_PATH=/opt/microchip/xc8/v2.00 ."
26+ " cmake -DMICROCHIP_XC8_PATH=/opt/microchip/xc8/v2.00 . ."
2727 )
2828endif ()
2929
3030
31- set (CMAKE_FIND_ROOT_PATH ${MICROCHIP_XC8_PATH} )
31+ set (CMAKE_FIND_ROOT_PATH " ${MICROCHIP_XC8_PATH} " )
3232
3333# skip compiler search and just use XC8
34- find_program (CMAKE_C_COMPILER "xc8" )
34+ find_program (CMAKE_C_COMPILER "xc8"
35+ PATHS "${MICROCHIP_XC8_PATH} "
36+ PATH_SUFFIXES "bin"
37+ )
38+
39+ if (NOT CMAKE_C_COMPILER)
40+ message (FATAL_ERROR
41+ "The XC8 compiler executable was not found, but what looks"
42+ " like an XC8 installation was found at:\n "
43+ " ${MICROCHIP_XC8_PATH} \n "
44+ "Please provide the path to a working XC8 installation on the"
45+ " command line, for example:\n "
46+ " cmake -DMICROCHIP_XC8_PATH=/opt/microchip/xc8/v2.00 .."
47+ )
48+ endif ()
3549
3650# skip compiler ID since XC8 isn't supported by CMake's test file
3751set (CMAKE_C_COMPILER_ID_RUN 1)
You can’t perform that action at this time.
0 commit comments