summaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2011-02-20 00:46:17 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2011-02-20 00:46:17 +0100
commitbeaeb2c95856bb89f9aa4ac7b256d1526f60cde9 (patch)
tree62b173e64ef266d8952bc8f454cca1597a723134 /CMakeLists.txt
parent876d6f498bbf358a23b47edaf8b0d967724b1b94 (diff)
downloadk8055-beaeb2c95856bb89f9aa4ac7b256d1526f60cde9.zip
k8055-beaeb2c95856bb89f9aa4ac7b256d1526f60cde9.tar.gz
add k8055gui
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt36
1 files changed, 35 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d64eeca..d2e3eb5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -24,6 +24,18 @@ SET(CMAKE_CXX_FLAGS "-O2 -fno-implement-inlines")
SET(CMAKE_CXX_FLAGS_RELEASE "")
SET(CMAKE_CXX_FLAGS_DEBUG "-g ")
#
+# COLOR MESSAGES
+#
+string( ASCII 27 _escape)
+function(COLOR_MESSAGE TEXT)
+ if(CMAKE_COLOR_MAKEFILE)
+ MESSAGE(${TEXT})
+ else()
+ string(REGEX REPLACE "${_escape}.[0123456789;]*m" "" __TEXT ${TEXT})
+ MESSAGE(${__TEXT})
+ endif()
+endfunction()
+#
# HEADER LIBRARY FUNCTIONS
#
INCLUDE(CheckIncludeFiles)
@@ -33,5 +45,27 @@ CHECK_INCLUDE_FILES(string.h HAVE_STRING_H)
CHECK_INCLUDE_FILES(stdio.h HAVE_STDIO_H)
CHECK_INCLUDE_FILES(assert.h HAVE_ASSERT_H)
CHECK_INCLUDE_FILES(math.h HAVE_MATH_H)
-ADD_SUBDIRECTORY(libk8055)
+IF (HAVE_USB_H)
+ ADD_SUBDIRECTORY(libk8055)
+ENDIF()
+#
+FIND_PACKAGE(wxWidgets COMPONENTS core base)
+IF(wxWidgets_FOUND)
+ ADD_SUBDIRECTORY(k8055gui)
+ENDIF()
#
+# BUILD SUMMARY
+#
+COLOR_MESSAGE("\n${_escape}[1;36mBuild Summary${_escape}[0m\n--------------------")
+IF (HAVE_USB_H)
+ COLOR_MESSAGE("* ${_escape}[1;35mlibusb${_escape}[0m : ${_escape}[1;32mfound${_escape}[0m build libk8055")
+ELSE()
+ COLOR_MESSAGE("* ${_escape}[1;35mlibusb${_escape}[0m : ${_escape}[1;31mmissing${_escape}[0m unable to build libk8055")
+ MESSAGE( FATAL_ERROR "Abort" )
+ENDIF()
+IF(wxWidgets_FOUND)
+ COLOR_MESSAGE("* ${_escape}[1;35mwxwidget${_escape}[0m : ${_escape}[1;32mfound${_escape}[0m build k8055gui")
+ELSE()
+ COLOR_MESSAGE("* ${_escape}[1;35mwxwidget${_escape}[0m : ${_escape}[1;31mmissing${_escape}[0m unable to build k8055gui")
+ENDIF()
+MESSAGE("")