summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-02-17 23:30:55 +0100
committerAndreas Stöckel <astoecke@techfak.uni-bielefeld.de>2015-02-17 23:30:55 +0100
commitbbc8b5a18f8b2f5ec0ae1de6e60c23464bd799b5 (patch)
treed326477484aed1619a3d1ac0bc83cc4a70889f6f /CMakeLists.txt
parent343d1628e47232c34ac90c9084a05c44923ca91b (diff)
Automatically enable testing if google test is present
Add option for installing gedit highlighter
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt29
1 files changed, 24 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15e2f32..81ed626 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -19,15 +19,26 @@
################################################################################
PROJECT(ousia)
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8.9)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.7)
+
+# Option for enabling testing. Turn on with 'cmake -DTEST=ON'. Needs gtest to
+# be available in the lib/ folder. Download using the "download_dependencies.sh"
+# script.
+OPTION(TEST "Build all tests." OFF)
+IF (EXISTS lib/gtest-1.7.0)
+ SET(TEST ON)
+ENDIF()
-# Option for enabling testing. Turn on with 'cmake -DTEST=ON'.
-# TODO: Automatically activate tests if gtest is available
-OPTION(TEST "Build all tests." OFF) # Makes boolean 'test' available.
+# Set to ON to install the GtkSourceview highlighter for osml
+OPTION(INSTALL_GEDIT_HIGHLIGHTER
+ "Installs the GtkSourceview 3.0 highlighter for OSML, enables highlighting in gedit"
+ OFF)
# Option for building the documentation.
FIND_PACKAGE(Doxygen)
-OPTION(BUILD_DOCUMENTATION "Create and install the HTML based API documentation (requires Doxygen)" ${DOXYGEN_FOUND})
+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} -Wall -pedantic-errors -std=c++11")
@@ -423,3 +434,11 @@ INSTALL(DIRECTORY data/ DESTINATION share/ousia
INSTALL(TARGETS ousia
RUNTIME DESTINATION bin
)
+
+IF(INSTALL_GEDIT_HIGHLIGHTER)
+ INSTALL(FILES contrib/gtksourceview-3.0/language-specs/ousia.lang
+ DESTINATION share/gtksourceview-3.0/language-specs
+ PERMISSIONS
+ OWNER_READ GROUP_READ WORLD_READ
+ OWNER_WRITE)
+ENDIF()