Skip to content

Commit e33a0ae

Browse files
author
Alan Wright
committed
Merge pull request #27 from hasselmm/packaging
Packaging
2 parents f173112 + 05e98a0 commit e33a0ae

File tree

5 files changed

+31
-13
lines changed

5 files changed

+31
-13
lines changed

CMakeLists.txt

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,24 @@ OPTION(ENABLE_CYCLIC_CHECK
7676
SET(LIB_DESTINATION "lib" CACHE STRING "Define lib output directory name")
7777

7878
IF ( ENABLE_NEDMALLOC )
79-
ADD_DEFINITIONS(-DLPP_USE_NEDMALLOC)
79+
SET(DEFINE_USE_NEDMALLOC "define")
80+
ELSE ( ENABLE_NEDMALLOC )
81+
SET(DEFINE_USE_NEDMALLOC "undef")
8082
ENDIF ( ENABLE_NEDMALLOC )
83+
84+
IF ( ENABLE_STANDARD_ALLOCATOR )
85+
SET(DEFINE_USE_ALLOCATOR "undef")
86+
ELSE ( ENABLE_STANDARD_ALLOCATOR )
87+
SET(DEFINE_USE_ALLOCATOR "define")
88+
ENDIF ( ENABLE_STANDARD_ALLOCATOR )
89+
8190
IF ( ENABLE_CYCLIC_CHECK )
82-
ADD_DEFINITIONS(-DLPP_USE_CYCLIC_CHECK)
91+
SET(DEFINE_USE_CYCLIC_CHECK "define")
92+
ELSE ( ENABLE_CYCLIC_CHECK )
93+
SET(DEFINE_USE_CYCLIC_CHECK "undef")
8394
ENDIF ( ENABLE_CYCLIC_CHECK )
8495
####################################
8596

86-
8797
####################################
8898
# PLATFORM specific options
8999
####################################
@@ -149,6 +159,15 @@ INCLUDE(PCHSupport)
149159
#todo: make this optional and make it possible to add more headers - like boost threads
150160

151161

162+
#################################
163+
# generate Config.h
164+
#################################
165+
166+
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/Config.h.cmake
167+
${CMAKE_CURRENT_BINARY_DIR}/include/Config.h @ONLY)
168+
169+
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include)
170+
152171
####################################
153172
# The subdirs
154173
####################################
@@ -158,7 +177,6 @@ ADD_SUBDIRECTORY (src/contrib)
158177
ADD_SUBDIRECTORY (src/demo EXCLUDE_FROM_ALL)
159178
ADD_SUBDIRECTORY (src/test)
160179

161-
162180
#################################
163181
# install pkg-config file
164182
#################################
@@ -174,7 +192,6 @@ IF(NOT WIN32)
174192
DESTINATION ${LIB_DESTINATION}/pkgconfig )
175193
ENDIF(NOT WIN32)
176194

177-
178195
####################################
179196
# Custom targets
180197
####################################

include/Config.h renamed to include/Config.h.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,13 @@
7575
#endif
7676

7777
// Define to enable cyclic checking in debug builds
78-
// #define LPP_USE_CYCLIC_CHECK
78+
#@DEFINE_USE_CYCLIC_CHECK@ LPP_USE_CYCLIC_CHECK
7979

8080
// Define to use custom allocator (useful in Windows builds and when using nedmalloc)
81-
#define LPP_USE_ALLOCATOR
81+
#@DEFINE_USE_ALLOCATOR@ LPP_USE_ALLOCATOR
8282

8383
// Define to use nedmalloc memory allocator
84-
// #define LPP_USE_NEDMALLOC
84+
#@DEFINE_USE_NEDMALLOC@ LPP_USE_NEDMALLOC
8585

8686
#ifdef LPP_USE_NEDMALLOC
8787
#define EXTSPEC LPPAPI

liblucene++-contrib.pc.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
prefix=@CMAKE_INSTALL_PREFIX@
22
exec_prefix=${prefix}/bin
3-
libdir=${prefix}/@LIB_DESTINATION@
3+
libdir=@LIB_DESTINATION@
44
includedir=${prefix}/include/lucene++
55
lib=lucene++-contrib
66

77
Name: liblucene++-contrib
88
Description: Contributions for Lucene++ - a C++ search engine, ported from the popular Apache Lucene
99
Version: @LUCENE++_VERSION@
10-
Libs: -L${prefix}/@LIB_DESTINATION@/ -l${lib}
10+
Libs: -L@LIB_DESTINATION@/ -l${lib}
1111
Cflags: -I${includedir}
1212
Requires: liblucene++=@LUCENE++_VERSION@
1313
~

liblucene++.pc.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
prefix=@CMAKE_INSTALL_PREFIX@
22
exec_prefix=${prefix}/bin
3-
libdir=${prefix}/@LIB_DESTINATION@
3+
libdir=@LIB_DESTINATION@
44
includedir=${prefix}/include/lucene++
55
lib=lucene++
66

77
Name: liblucene++
88
Description: Lucene++ - a C++ search engine, ported from the popular Apache Lucene
99
Version: @LUCENE++_VERSION@
10-
Libs: -L${prefix}/@LIB_DESTINATION@/ -l${lib}
10+
Libs: -L@LIB_DESTINATION@ -l${lib}
1111
Cflags: -I${includedir}
1212
~
1313

src/core/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ file(GLOB_RECURSE lucene_sources
1313
${lucene++-lib_SOURCE_DIR}/util/*.cpp)
1414

1515
file(GLOB_RECURSE INTERN_HEADERS ${lucene++-libs_SOURCE_DIR}/include/*.h)
16-
file(GLOB_RECURSE HEADERS ${lucene++-base_SOURCE_DIR}/include/*.h)
16+
file(GLOB_RECURSE HEADERS ${lucene++-base_SOURCE_DIR}/include/*.h
17+
${lucene++-base_BINARY_DIR}/include/*.h)
1718

1819
#C sources...
1920
file(GLOB_RECURSE lucene_c_sources

0 commit comments

Comments
 (0)