]> git.donarmstrong.com Git - kiibohd-controller.git/commitdiff
Adding .kll file existence checks to CMake
authorJacob Alexander <haata@kiibohd.com>
Sat, 9 May 2015 20:36:37 +0000 (20:36 +0000)
committerJacob Alexander <haata@kiibohd.com>
Sat, 9 May 2015 20:36:37 +0000 (20:36 +0000)
Lib/CMake/kll.cmake

index 0de02bf0f6060cd650b33d5d9bd715c2707b9068..80d44c176822d5f281b0a7e4155ca5d4376e9fdc 100644 (file)
@@ -57,9 +57,11 @@ set ( pathname "${PROJECT_SOURCE_DIR}/${ScanModulePath}" )
 if ( NOT EXISTS ${pathname}/${BaseMap}.kll )
        set ( BaseMap_Args ${BaseMap_Args} ${pathname}/defaultMap.kll )
        set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/defaultMap.kll )
-else ()
+elseif ( EXISTS "${pathname}/${BaseMap}.kll" )
        set ( BaseMap_Args ${BaseMap_Args} ${pathname}/${BaseMap}.kll )
        set ( KLL_DEPENDS ${KLL_DEPENDS} ${pathname}/${BaseMap}.kll )
+else ()
+       message ( FATAL "Could not find '${BaseMap}.kll'" )
 endif ()
 
 #| Configure DefaultMap if specified
@@ -72,9 +74,11 @@ if ( NOT "${DefaultMap}" STREQUAL "" )
                if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP}.kll" )
                        set ( DefaultMap_Args ${DefaultMap_Args} ${MAP}.kll )
                        set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_BINARY_DIR}/${MAP}.kll )
-               else ()
+               elseif ( EXISTS "${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll" )
                        set ( DefaultMap_Args ${DefaultMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll )
                        set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP}.kll )
+               else ()
+                       message ( FATAL "Could not find '${MAP}.kll'" )
                endif ()
        endforeach ()
 endif ()
@@ -92,9 +96,11 @@ if ( NOT "${PartialMaps}" STREQUAL "" )
                        if ( EXISTS "${PROJECT_BINARY_DIR}/${MAP_PART}.kll" )
                                set ( PartialMap_Args ${PartialMap_Args} ${MAP_PART}.kll )
                                set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_BINARY_DIR}/${MAP_PART}.kll )
-                       else ()
+                       elseif ( EXISTS "${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll" )
                                set ( PartialMap_Args ${PartialMap_Args} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll )
                                set ( KLL_DEPENDS ${KLL_DEPENDS} ${PROJECT_SOURCE_DIR}/kll/layouts/${MAP_PART}.kll )
+                       else ()
+                               message ( FATAL "Could not find '${MAP_PART}.kll'" )
                        endif ()
                endforeach ()
        endforeach ()