summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAndrej Shadura <andrewsh@debian.org>2018-05-08 15:59:29 +0200
committerAndrej Shadura <andrewsh@debian.org>2018-05-08 15:59:29 +0200
commit5b8466f7fae0e071c0f4eda13051c93313910028 (patch)
tree7061957f770e5e245ba00666dad912a2d44e7fdc /CMakeLists.txt
Import Upstream version 1.3.7
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt117
1 files changed, 117 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..c8e16d6
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,117 @@
+PROJECT(mcu8051ide)
+
+#
+# INITIALIZE
+#
+
+CMAKE_MINIMUM_REQUIRED(VERSION 2.4.2)
+SET(CMAKE_BUILD_TYPE None)
+SET(CMAKE_COLOR_MAKEFILE ON)
+SET(CMAKE_VERBOSE_MAKEFILE ON)
+SET(CMAKE_INCLUDE_CURRENT_DIR TRUE)
+
+# target directory (for data files)
+SET(target_installation_directory /usr/share/mcu8051ide)
+
+#
+# CONFIGURE
+#
+
+MESSAGE("Check for Tcl Interpreter")
+FIND_PACKAGE(TCL)
+IF(NOT TCL_FOUND)
+ MESSAGE("!!! TCL interpreter not found !!!")
+ENDIF(NOT TCL_FOUND)
+
+FOREACH(library
+ "BWidget 1.8"
+ "Itcl 3.4"
+ "Tcl 8.5"
+ "md5 2.0"
+ "Tk 8.5"
+ "img::png 1.3"
+ "tdom 0.8"
+ "Tclx 8.4"
+)
+ STRING(REGEX REPLACE "\t+.*$" "" library_name ${library})
+ MESSAGE("Check for ${library_name}")
+
+ EXECUTE_PROCESS(
+ COMMAND "./test-lib.sh ${library}"
+ RESULT_VARIABLE library_found
+ )
+
+ IF(NOT library_found)
+ MESSAGE(FATAL_ERROR "Unable to find library: ${library}")
+ ENDIF(NOT library_found)
+
+ENDFOREACH(library)
+
+
+#
+# BUILD
+#
+
+# create launcher
+FILE(WRITE mcu8051ide
+ "#!/bin/sh\n"
+ "exec tclsh ${target_installation_directory}/lib/main.tcl \"$@\"\n"
+)
+
+#
+# INSTALL
+#
+
+# Install icons
+FOREACH(subdir mcu other 16x16 22x22 32x32)
+ FILE(GLOB_RECURSE icons icons/${subdir}/*.png)
+ INSTALL(FILES ${icons} DESTINATION ${target_installation_directory}/icons/${subdir})
+ENDFOREACH(subdir)
+
+# Install source code files
+FOREACH(subdir . bottompanel compiler configdialogs dialogs editor leftpanel lib pale rightpanel simulator simulator/engine utilities)
+ FILE(GLOB lib lib/${subdir}/*.tcl)
+ INSTALL(FILES ${lib} DESTINATION ${target_installation_directory}/lib/${subdir})
+ENDFOREACH(subdir)
+
+# Install documentation files
+FOREACH(subdir handbook)
+ FILE(GLOB doc doc/${subdir}/*)
+ INSTALL(FILES ${doc} DESTINATION ${target_installation_directory}/doc/${subdir})
+ENDFOREACH(subdir)
+
+# Install manual page(s)
+FILE(GLOB man doc/man/*)
+INSTALL(FILES ${man} DESTINATION /usr/share/man/man1)
+
+# Install demonstration project files
+FILE(GLOB demo demo/*)
+INSTALL(FILES ${demo} DESTINATION ${target_installation_directory}/demo)
+
+# Install data files
+FILE(GLOB data data/*)
+INSTALL(FILES ${data} DESTINATION ${target_installation_directory}/data)
+
+# Install translation files
+FILE(GLOB translations translations/*)
+INSTALL(FILES ${translations} DESTINATION ${target_installation_directory}/translations)
+
+# Incstall .desktop spec and application icon
+INSTALL(FILES mcu8051ide.png DESTINATION /usr/share/pixmaps/)
+INSTALL(FILES mcu8051ide.desktop DESTINATION /usr/share/applications/)
+
+# Install launcher
+INSTALL(
+ FILES mcu8051ide
+ DESTINATION /usr/bin
+ PERMISSIONS
+ WORLD_EXECUTE WORLD_READ
+ OWNER_WRITE OWNER_READ OWNER_EXECUTE
+ GROUP_EXECUTE GROUP_READ
+)
+
+# Install misc. files
+INSTALL(
+ FILES ChangeLog LICENSE TODO
+ DESTINATION ${target_installation_directory}
+)