From: <ust...@us...> - 2008-06-30 16:59:03
|
Revision: 2700 http://clucene.svn.sourceforge.net/clucene/?rev=2700&view=rev Author: ustramooner Date: 2008-06-30 09:58:59 -0700 (Mon, 30 Jun 2008) Log Message: ----------- cmake improvements. conformity test script (experimental) Modified Paths: -------------- branches/lucene2_3_2/src/demo/CMakeLists.txt branches/lucene2_3_2/test/CMakeLists.txt Added Paths: ----------- branches/lucene2_3_2/dist-test.sh Added: branches/lucene2_3_2/dist-test.sh =================================================================== --- branches/lucene2_3_2/dist-test.sh (rev 0) +++ branches/lucene2_3_2/dist-test.sh 2008-06-30 16:58:59 UTC (rev 2700) @@ -0,0 +1,40 @@ +#!/bin/sh +#Check compliance with Coding standards... + +TMP=. + +#create environment... +#cmake .. +rm src/CLucene/_clucene-config.h 2>/dev/null + +#create header file for testing of symbols in headers. +echo "#include \"CLucene/StdHeader.h"\" >$TMP/pub-headers.cpp + +#check to see that no #ifdefs exist in headers that don't belong +function checkForIfdefs { + I=0 + grep "#if" $1| while read line; do + I=`expr $I + 1` + if [ $I -gt 1 ]; then + echo $1 has invalid ifdef: $line + exit 1 + fi + done +} + +#iterate all headers +for H in `find ../src/CLucene| grep "\.h$"`; do + BH=`basename $H` + if [ "${BH:0:1}" != "_" ]; then + DH=`dirname ${H:3}` + mkdir -p $DH 2>/dev/null + + cp $H ${H:3} + #checkForIfdefs $H + echo "#include \"${H:7}\"" >>$TMP/pub-headers.cpp + fi +done + +#test if headers contain any symbols: +echo "int main(){return 0;}" >>$TMP/pub-headers.cpp +#g++ -Isrc pub-headers.cpp Modified: branches/lucene2_3_2/src/demo/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/src/demo/CMakeLists.txt 2008-06-30 14:09:55 UTC (rev 2699) +++ branches/lucene2_3_2/src/demo/CMakeLists.txt 2008-06-30 16:58:59 UTC (rev 2700) @@ -2,6 +2,8 @@ INCLUDE_DIRECTORIES( ${clucene-demo_SOURCE_DIR} ) + +#todo: put in common config OPTION(ENABLE_ASCII_MODE "enable ascii support" OFF) @@ -11,6 +13,8 @@ ADD_DEFINITIONS(-D_UNICODE) ENDIF(ENABLE_ASCII_MODE) +file(GLOB_RECURSE HEADERS ${CMAKE_SOURCE_DIR}/test/*.h) + ADD_EXECUTABLE(cl_demo ./DeleteFiles.cpp ./IndexFiles.cpp @@ -19,8 +23,10 @@ ./Statistics.cpp ./stdafx.cpp ./dirent.cpp +${HEADERS} ) + SET_TARGET_PROPERTIES(cl_demo PROPERTIES # VERSION "0.9.16a" # SOVERSION "0.9" Modified: branches/lucene2_3_2/test/CMakeLists.txt =================================================================== --- branches/lucene2_3_2/test/CMakeLists.txt 2008-06-30 14:09:55 UTC (rev 2699) +++ branches/lucene2_3_2/test/CMakeLists.txt 2008-06-30 16:58:59 UTC (rev 2700) @@ -21,6 +21,8 @@ SOURCE_GROUP("store" ./store/*) SOURCE_GROUP("util" ./util/*) +file(GLOB_RECURSE HEADERS ${CMAKE_SOURCE_DIR}/test/*.h) + ADD_EXECUTABLE(cl_test ./tests.cpp ./CuTest.cpp @@ -43,5 +45,8 @@ ./index/TestReuters.cpp ./util/TestPriorityQueue.cpp ./util/English.cpp +${HEADERS} ) + + TARGET_LINK_LIBRARIES(cl_test clucene-core-static) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |