diff --git a/CMakeLists.txt b/CMakeLists.txt index 35328f2c..ec89210e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -76,14 +76,24 @@ OPTION(ENABLE_CYCLIC_CHECK SET(LIB_DESTINATION "lib" CACHE STRING "Define lib output directory name") IF ( ENABLE_NEDMALLOC ) - ADD_DEFINITIONS(-DLPP_USE_NEDMALLOC) + SET(DEFINE_USE_NEDMALLOC "define") +ELSE ( ENABLE_NEDMALLOC ) + SET(DEFINE_USE_NEDMALLOC "undef") ENDIF ( ENABLE_NEDMALLOC ) + +IF ( ENABLE_STANDARD_ALLOCATOR ) + SET(DEFINE_USE_ALLOCATOR "undef") +ELSE ( ENABLE_STANDARD_ALLOCATOR ) + SET(DEFINE_USE_ALLOCATOR "define") +ENDIF ( ENABLE_STANDARD_ALLOCATOR ) + IF ( ENABLE_CYCLIC_CHECK ) - ADD_DEFINITIONS(-DLPP_USE_CYCLIC_CHECK) + SET(DEFINE_USE_CYCLIC_CHECK "define") +ELSE ( ENABLE_CYCLIC_CHECK ) + SET(DEFINE_USE_CYCLIC_CHECK "undef") ENDIF ( ENABLE_CYCLIC_CHECK ) #################################### - #################################### # PLATFORM specific options #################################### @@ -149,6 +159,15 @@ INCLUDE(PCHSupport) #todo: make this optional and make it possible to add more headers - like boost threads +################################# +# generate Config.h +################################# + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/include/Config.h.cmake + ${CMAKE_CURRENT_BINARY_DIR}/include/Config.h @ONLY) + +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/include) + #################################### # The subdirs #################################### @@ -158,7 +177,6 @@ ADD_SUBDIRECTORY (src/contrib) ADD_SUBDIRECTORY (src/demo EXCLUDE_FROM_ALL) ADD_SUBDIRECTORY (src/test) - ################################# # install pkg-config file ################################# @@ -174,7 +192,6 @@ IF(NOT WIN32) DESTINATION ${LIB_DESTINATION}/pkgconfig ) ENDIF(NOT WIN32) - #################################### # Custom targets #################################### diff --git a/include/Config.h b/include/Config.h.cmake similarity index 94% rename from include/Config.h rename to include/Config.h.cmake index 89725fcd..08006207 100644 --- a/include/Config.h +++ b/include/Config.h.cmake @@ -75,13 +75,13 @@ #endif // Define to enable cyclic checking in debug builds -// #define LPP_USE_CYCLIC_CHECK +#@DEFINE_USE_CYCLIC_CHECK@ LPP_USE_CYCLIC_CHECK // Define to use custom allocator (useful in Windows builds and when using nedmalloc) -#define LPP_USE_ALLOCATOR +#@DEFINE_USE_ALLOCATOR@ LPP_USE_ALLOCATOR // Define to use nedmalloc memory allocator -// #define LPP_USE_NEDMALLOC +#@DEFINE_USE_NEDMALLOC@ LPP_USE_NEDMALLOC #ifdef LPP_USE_NEDMALLOC #define EXTSPEC LPPAPI diff --git a/liblucene++-contrib.pc.cmake b/liblucene++-contrib.pc.cmake index 8e02e3e5..f0aa77c4 100644 --- a/liblucene++-contrib.pc.cmake +++ b/liblucene++-contrib.pc.cmake @@ -1,13 +1,13 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix}/bin -libdir=${prefix}/@LIB_DESTINATION@ +libdir=@LIB_DESTINATION@ includedir=${prefix}/include/lucene++ lib=lucene++-contrib Name: liblucene++-contrib Description: Contributions for Lucene++ - a C++ search engine, ported from the popular Apache Lucene Version: @LUCENE++_VERSION@ -Libs: -L${prefix}/@LIB_DESTINATION@/ -l${lib} +Libs: -L@LIB_DESTINATION@/ -l${lib} Cflags: -I${includedir} Requires: liblucene++=@LUCENE++_VERSION@ ~ diff --git a/liblucene++.pc.cmake b/liblucene++.pc.cmake index 3fc09176..2e53c02d 100644 --- a/liblucene++.pc.cmake +++ b/liblucene++.pc.cmake @@ -1,13 +1,13 @@ prefix=@CMAKE_INSTALL_PREFIX@ exec_prefix=${prefix}/bin -libdir=${prefix}/@LIB_DESTINATION@ +libdir=@LIB_DESTINATION@ includedir=${prefix}/include/lucene++ lib=lucene++ Name: liblucene++ Description: Lucene++ - a C++ search engine, ported from the popular Apache Lucene Version: @LUCENE++_VERSION@ -Libs: -L${prefix}/@LIB_DESTINATION@/ -l${lib} +Libs: -L@LIB_DESTINATION@ -l${lib} Cflags: -I${includedir} ~ diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt index c839f563..a77c12fb 100644 --- a/src/core/CMakeLists.txt +++ b/src/core/CMakeLists.txt @@ -13,7 +13,8 @@ file(GLOB_RECURSE lucene_sources ${lucene++-lib_SOURCE_DIR}/util/*.cpp) file(GLOB_RECURSE INTERN_HEADERS ${lucene++-libs_SOURCE_DIR}/include/*.h) -file(GLOB_RECURSE HEADERS ${lucene++-base_SOURCE_DIR}/include/*.h) +file(GLOB_RECURSE HEADERS ${lucene++-base_SOURCE_DIR}/include/*.h + ${lucene++-base_BINARY_DIR}/include/*.h) #C sources... file(GLOB_RECURSE lucene_c_sources