root / CMakeLists.txt @ 1c440f06
History | View | Annotate | Download (2.8 kB)
| 1 | # WebODF is mostly a JavaScript project. CMake needs to know about the C++ parts |
|---|---|
| 2 | project (WebODF C CXX) |
| 3 | # version 2.8.2 is needed to have support for zip files in external projects |
| 4 | cmake_minimum_required(VERSION 2.8.2) |
| 5 | |
| 6 | # This makefile 'compiles' WebODF using various tools, instruments the code and |
| 7 | # builds and packages programs that use WebODF. |
| 8 | |
| 9 | # Find installed dependencies |
| 10 | find_package(Qt4 4.7.0 COMPONENTS QtCore QtGui QtXml QtNetwork QtWebKit) |
| 11 | if (NOT QT4_FOUND) |
| 12 | message(WARNING "Qt4 with modules QtCore QtGui QtXml QtNetwork QtWebKit was not found. qtjsruntime will no be built.") |
| 13 | endif (NOT QT4_FOUND) |
| 14 | |
| 15 | # java runtime is needed for Closure Compiler |
| 16 | find_package(Java COMPONENTS Runtime) |
| 17 | |
| 18 | if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) |
| 19 | message(FATAL_ERROR "Compiling in the source directortory is not supported. Use for example 'mkdir build; cd build; cmake ..'.") |
| 20 | endif (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) |
| 21 | |
| 22 | # Tools must be obtained to work with: |
| 23 | include (ExternalProject) |
| 24 | |
| 25 | if(Java_JAVA_EXECUTABLE) |
| 26 | # Closure Compiler |
| 27 | ExternalProject_Add( |
| 28 | ClosureCompiler |
| 29 | URL "http://closure-compiler.googlecode.com/files/compiler-20111003.tar.gz" |
| 30 | URL_MD5 6108a6f2c3b3e357f8758a24ea8b01c6 |
| 31 | CONFIGURE_COMMAND "" |
| 32 | BUILD_COMMAND "" |
| 33 | INSTALL_COMMAND "" |
| 34 | ) |
| 35 | set(CLOSURE_JAR ${CMAKE_BINARY_DIR}/ClosureCompiler-prefix/src/ClosureCompiler/compiler.jar)
|
| 36 | endif(Java_JAVA_EXECUTABLE) |
| 37 | |
| 38 | # Rhino |
| 39 | if(Java_JAVA_EXECUTABLE) |
| 40 | ExternalProject_Add( |
| 41 | Rhino |
| 42 | URL "ftp://ftp.mozilla.org/pub/mozilla.org/js/rhino1_7R3.zip" |
| 43 | URL_MD5 99d94103662a8d0b571e247a77432ac5 |
| 44 | CONFIGURE_COMMAND "" |
| 45 | BUILD_COMMAND "" |
| 46 | INSTALL_COMMAND "" |
| 47 | ) |
| 48 | set(RHINO ${CMAKE_BINARY_DIR}/Rhino-prefix/src/Rhino/js.jar)
|
| 49 | endif(Java_JAVA_EXECUTABLE) |
| 50 | |
| 51 | # JSDoc |
| 52 | ExternalProject_Add( |
| 53 | JsDoc |
| 54 | URL "http://jsdoc-toolkit.googlecode.com/files/jsdoc_toolkit-2.4.0.zip" |
| 55 | URL_MD5 a8f78f5ecd24b54501147b2af341a231 |
| 56 | CONFIGURE_COMMAND "" |
| 57 | BUILD_COMMAND "" |
| 58 | INSTALL_COMMAND "" |
| 59 | ) |
| 60 | set(JSDOCDIR ${CMAKE_BINARY_DIR}/JsDoc-prefix/src/JsDoc/jsdoc-toolkit)
|
| 61 | |
| 62 | # Node.JS |
| 63 | ExternalProject_Add( |
| 64 | NodeJS |
| 65 | URL "http://nodejs.org/dist/node-v0.4.12.tar.gz" |
| 66 | URL_MD5 a6375eaa43db5356bf443e25b828ae16 |
| 67 | INSTALL_COMMAND "" |
| 68 | ) |
| 69 | set(NODE ${CMAKE_BINARY_DIR}/NodeJS-prefix/src/NodeJS-build/default/node)
|
| 70 | |
| 71 | # JSCoverage |
| 72 | ExternalProject_Add( |
| 73 | JSCoverage |
| 74 | URL "http://siliconforks.com/jscoverage/download/jscoverage-0.5.1.tar.bz2" |
| 75 | URL_MD5 a70d79a6759367fbcc0bcc18d6866ff3 |
| 76 | PATCH_COMMAND patch -p0 < ${CMAKE_CURRENT_SOURCE_DIR}/JSCoverage.patch
|
| 77 | CONFIGURE_COMMAND "./configure" |
| 78 | BUILD_IN_SOURCE 1 |
| 79 | INSTALL_COMMAND "" |
| 80 | ) |
| 81 | set(JSCOVERAGE ${CMAKE_BINARY_DIR}/JSCoverage-prefix/src/JSCoverage/jscoverage)
|
| 82 | |
| 83 | # Android |
| 84 | find_path(ANDROID_SDK_DIR platform-tools/aapt) |
| 85 | |
| 86 | add_subdirectory(webodf) |
| 87 | add_subdirectory(programs) |