summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2014-10-24 22:22:26 +0000
committerandreas <andreas@daaaf23c-2e50-4459-9457-1e69db5a47bf>2014-10-24 22:22:26 +0000
commit7e51bf3804e50ea063fcc97b2682a32a8505902f (patch)
tree6a6097216708049b5dd7a4c43020c85aafb046a1 /CMakeLists.txt
parent4a9912f516bf096c6f8c6259b3fc6ba4b95b8d69 (diff)
added Function, Property and Object classes; added CMakeLists entries for the mozjs-24 library (the Firefox JavaScript engine which is available as Package on Fedora); added Doxygen target to makefile
git-svn-id: file:///var/local/svn/basicwriter@75 daaaf23c-2e50-4459-9457-1e69db5a47bf
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt48
1 files changed, 45 insertions, 3 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index df4155f..268a391 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -18,15 +18,47 @@
# Basic Project Definitions and Dependencies #
################################################################################
-PROJECT(basicwriter)
+PROJECT(ousia)
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)
# Option for enabling testing. Turn on with 'cmake -Dtest=ON'.
OPTION(test "Build all tests." OFF) # Makes boolean 'test' available.
+# Option for building the documentation.
+FIND_PACKAGE(Doxygen)
+OPTION(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND})
+
# Enable C++11 and all warnings
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O0 -Wall -pedantic -std=c++11")
+# Use PkgConfig to find mozjs-24
+FIND_PACKAGE(PkgConfig REQUIRED)
+PKG_CHECK_MODULES(MOZJS REQUIRED mozjs-24)
+
+################################################################################
+# Inclusion of doxygen #
+################################################################################
+
+IF(BUILD_DOCUMENTATION)
+ IF(NOT DOXYGEN_FOUND)
+ MESSAGE(FATAL_ERROR "Doxygen is needed to build the documentation.")
+ ENDIF()
+
+ SET(DOXYFILE_IN ${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in)
+ SET(DOXYFILE ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile)
+
+ CONFIGURE_FILE(${DOXYFILE_IN} ${DOXYFILE} @ONLY)
+
+ ADD_CUSTOM_TARGET(doc
+ COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile}
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
+ COMMENT "Generating API documentation with Doxygen"
+ VERBATIM)
+
+ INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION share/doc)
+ENDIF()
+
+
################################################################################
# Inclusion of gtest #
################################################################################
@@ -46,9 +78,19 @@ ENDIF()
# Commands for building Ousía #
################################################################################
-# Includ directories
+# Include directories
INCLUDE_DIRECTORIES(
src/
+ ${MOZJS_INCLUDE_DIRS}
+)
+
+# Link directories
+LINK_DIRECTORIES(
+ ${MOZJS_LIBRARY_DIRS}
+)
+
+ADD_DEFINITIONS(
+ ${MOZJS_CFLAGS_OTHER}
)
# ousia_utils library
@@ -61,7 +103,7 @@ ADD_LIBRARY(ousia_script
src/core/script/Function.cpp
src/core/script/Variant.cpp
src/core/script/ScriptEngine.cpp
- src/core/script/
+ src/core/script/Object.cpp
)
# Link the ousia executable against ousia_core