summaryrefslogtreecommitdiff
blob: dec482a31bc18ef6d424934d985ee55282c90825 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
--- CMakeLists.txt.orig	2012-09-25 21:47:27.591130679 +0200
+++ CMakeLists.txt	2012-09-25 21:51:02.953508806 +0200
@@ -4,6 +4,7 @@
 # options available for user's input
 OPTION(WANT_DEBUG "Set the debug build and possible additional outputs" OFF)
 OPTION(WANT_INTERNAL_QSCINTILLA "Use internal/bundled QScintilla2 source" OFF)
+OPTION(WANT_INTERNAL_LOKI "Use internal/bundled Loki source" OFF)
 OPTION(ENABLE_ORACLE "Enable/Disable Oracle support at all. Including detection" ON)
 OPTION(ENABLE_PGSQL "Enable/Disable PostgreSQL support. Including detection" ON)
 OPTION(ENABLE_DB2 "Enable/Disable DB2 support. Including detection" ON)
@@ -50,6 +51,7 @@
 INCLUDE(CheckCXXCompilerFlag)
 INCLUDE(CheckTypeSize)
 INCLUDE(TestBigEndian)
+INCLUDE(FindPkgConfig)
 
 #Set the custom CMake module directory where our include/lib finders are
 SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
@@ -197,6 +199,10 @@
     MESSAGE(FATAL_ERROR "No Qt4 found")
 ENDIF(QT_FOUND)
 
+IF (WANT_INTERNAL_LOKI)
+ELSE (WANT_INTERNAL_LOKI)
+  pkg_check_modules(LOKI REQUIRED  ferrisloki)
+ENDIF (WANT_INTERNAL_LOKI)
 
 IF (WANT_INTERNAL_QSCINTILLA)
     MESSAGE(STATUS "QSci: Building with internal copy of QScintilla.")
--- src/CMakeLists.txt.orig	2012-09-25 22:45:20.702694011 +0200
+++ src/CMakeLists.txt	2012-09-25 22:47:39.742124547 +0200
@@ -3,7 +3,10 @@
 
 #Subdirectories
 # ADD_SUBDIRECTORY(i18n)
-ADD_SUBDIRECTORY(loki)
+# Default: loki as 3rd party lib!
+IF (WANT_INTERNAL_LOKI)
+  ADD_SUBDIRECTORY(loki)
+ENDIF(WANT_INTERNAL_LOKI)
 IF (WIN32)
     ADD_SUBDIRECTORY(windows)
 ENDIF (WIN32)
@@ -468,7 +471,9 @@
 QT4_ADD_RESOURCES(TORA_RCC_SRCS ${TORA_RCC_FILES})
 
 
-LINK_DIRECTORIES(./loki)
+IF (WANT_INTERNAL_LOKI)
+  LINK_DIRECTORIES(./loki)
+ENDIF(WANT_INTERNAL_LOKI)
 IF (WIN32)
     LINK_DIRECTORIES(./windows)
 ENDIF (WIN32)
@@ -477,7 +482,10 @@
 ENDIF (WANT_INTERNAL_QSCINTILLA)
 
 
-SET(TORA_LOKI_LIB "tora_loki_lib")
+IF (WANT_INTERNAL_LOKI)
+  SET(LOKI_LIBRARIES "tora_loki_lib")
+  SET(LOKI_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/loki/include)
+ENDIF(WANT_INTERNAL_LOKI)
 IF (WANT_INTERNAL_QSCINTILLA)
     SET (TORA_QSCINTILLA_LIB tora_qscintilla2_lib)
 ENDIF (WANT_INTERNAL_QSCINTILLA)
@@ -493,7 +501,7 @@
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_BINARY_DIR}
   ${QT_INCLUDES}
-  ${CMAKE_CURRENT_SOURCE_DIR}/loki/include
+  ${LOKI_INCLUDE_DIRS}
   ${CMAKE_CURRENT_SOURCE_DIR}/otl
 )
 
@@ -590,7 +598,7 @@
 ENDIF (USE_TROTL)
 
 # static
-TARGET_LINK_LIBRARIES(${EXE_NAME} ${TORA_LOKI_LIB})
+TARGET_LINK_LIBRARIES(${EXE_NAME} ${LOKI_LIBRARIES})
 IF (WANT_INTERNAL_QSCINTILLA)
     TARGET_LINK_LIBRARIES(${EXE_NAME} ${TORA_QSCINTILLA_LIB} ${QT_LIBRARIES})
 ENDIF (WANT_INTERNAL_QSCINTILLA)