comparison Lib/CMake/kll.cmake @ 324:4bcea20b9cea

Adding .kll file existence checks to CMake
author Jacob Alexander <haata@kiibohd.com>
date Sat, 09 May 2015 20:36:37 +0000
parents 9690998a93b9
children b4f66a698f36
comparison
equal deleted inserted replaced
323:9690998a93b9 324:4bcea20b9cea
55 #| If set BaseMap cannot be found, use default map 55 #| If set BaseMap cannot be found, use default map
56 set ( pathname "${PROJECT_SOURCE_DIR}/${ScanModulePath}" ) 56 set ( pathname "${PROJECT_SOURCE_DIR}/${ScanModulePath}" )
57 if ( NOT EXISTS ${pathname}/${BaseMap}.kll ) 57 if ( NOT EXISTS ${pathname}/${BaseMap}.kll )
58 set ( BaseMap_Args ${BaseMap_Args} ${pathname}/defaultMap.kll ) 58 set ( BaseMap_Args ${BaseMap_Args} ${pathname}/defaultMap.kll )
59 set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/defaultMap.kll ) 59 set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/defaultMap.kll )
60 else () 60 elseif ( EXISTS "${pathname}/${BaseMap}.kll" )
61 set ( BaseMap_Args ${BaseMap_Args} ${pathname}/${BaseMap}.kll ) 61 set ( BaseMap_Args ${BaseMap_Args} ${pathname}/${BaseMap}.kll )
62 set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/${BaseMap}.kll ) 62 set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/${BaseMap}.kll )
63 else ()
64 message ( FATAL "Could not find '${BaseMap}.kll'" )
63 endif () 65 endif ()
64 66
65 #| Configure DefaultMap if specified 67 #| Configure DefaultMap if specified
66 if ( NOT "${DefaultMap}" STREQUAL "" ) 68 if ( NOT "${DefaultMap}" STREQUAL "" )
67 set ( DefaultMap_Args -d ) 69 set ( DefaultMap_Args -d )
70 foreach ( MAP ${MAP_LIST} ) 72 foreach ( MAP ${MAP_LIST} )
71 # Check if kll file is in build directory, otherwise default to layout directory 73 # Check if kll file is in build directory, otherwise default to layout directory
72 if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP}.kll" ) 74 if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP}.kll" )
73 set ( DefaultMap_Args ${DefaultMap_Args} ${MAP}.kll ) 75 set ( DefaultMap_Args ${DefaultMap_Args} ${MAP}.kll )
74 set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_BINARY_DIR}/${MAP}.kll ) 76 set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_BINARY_DIR}/${MAP}.kll )
75 else () 77 elseif ( EXISTS "${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll" )
76 set ( DefaultMap_Args ${DefaultMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll ) 78 set ( DefaultMap_Args ${DefaultMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll )
77 set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll ) 79 set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll )
80 else ()
81 message ( FATAL "Could not find '${MAP}.kll'" )
78 endif () 82 endif ()
79 endforeach () 83 endforeach ()
80 endif () 84 endif ()
81 85
82 #| Configure PartialMaps if specified 86 #| Configure PartialMaps if specified
90 foreach ( MAP_PART ${MAP_LIST} ) 94 foreach ( MAP_PART ${MAP_LIST} )
91 # Check if kll file is in build directory, otherwise default to layout directory 95 # Check if kll file is in build directory, otherwise default to layout directory
92 if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP_PART}.kll" ) 96 if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP_PART}.kll" )
93 set ( PartialMap_Args ${PartialMap_Args} ${MAP_PART}.kll ) 97 set ( PartialMap_Args ${PartialMap_Args} ${MAP_PART}.kll )
94 set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_BINARY_DIR}/${MAP_PART}.kll ) 98 set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_BINARY_DIR}/${MAP_PART}.kll )
95 else () 99 elseif ( EXISTS "${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll" )
96 set ( PartialMap_Args ${PartialMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll ) 100 set ( PartialMap_Args ${PartialMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll )
97 set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll ) 101 set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll )
102 else ()
103 message ( FATAL "Could not find '${MAP_PART}.kll'" )
98 endif () 104 endif ()
99 endforeach () 105 endforeach ()
100 endforeach () 106 endforeach ()
101 endif () 107 endif ()
102 108