diff options
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 117 |
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} +) |