diff options
author | Enrico Zini <enrico@enricozini.org> | 2015-09-10 19:52:45 +0200 |
---|---|---|
committer | Enrico Zini <enrico@enricozini.org> | 2015-09-10 19:52:45 +0200 |
commit | c5dd516802af50f8e369e9f520b88dcf28dc77df (patch) | |
tree | b7df739f0cb01abf87bd6cae9cd55bb26920fc94 /ept/CMakeLists.txt | |
parent | 74e4ebe74b307d65d9064357cbf80855afbe059b (diff) | |
parent | ea85d58bc9d619e1511b40a16a630c5da9e60a42 (diff) | |
download | libept-c5dd516802af50f8e369e9f520b88dcf28dc77df.tar.gz |
Merge branch 'notagcoll': removed dependencies on tagcoll and wibble.
Diffstat (limited to 'ept/CMakeLists.txt')
-rw-r--r-- | ept/CMakeLists.txt | 67 |
1 files changed, 20 insertions, 47 deletions
diff --git a/ept/CMakeLists.txt b/ept/CMakeLists.txt index 96e1746..079cd95 100644 --- a/ept/CMakeLists.txt +++ b/ept/CMakeLists.txt @@ -1,35 +1,38 @@ project( ept ) -include( ${WIBBLE_TEST_CMAKE} ) -file( GLOB src *.cpp debtags/*.cc debtags/maint/*.cc - popcon/*.cc popcon/maint/*.cc apt/*.cc axi/*.cc ) +# Find sources and tests +file(GLOB src *.cpp debtags/*.cc debtags/maint/*.cc debtags/coll/*.cc apt/*.cc axi/*.cc utils/*.cc) +file(GLOB tests *-test.cc apt/*-test.cc debtags/*-test.cc axi/*-test.cc) +list(REMOVE_ITEM src ${tests}) +# Find headers file( GLOB h_top *.h ) file( GLOB h_apt apt/*.h ) -file( GLOB h_debtags debtags/*.h debtags/*.tcc ) -file( GLOB h_debtags_maint debtags/maint/*.h debtags/maint/*.tcc ) -file( GLOB h_popcon popcon/*.h ) -file( GLOB h_popcon_maint popcon/maint/*.h ) +file( GLOB h_debtags debtags/*.h ) +file( GLOB h_debtags_maint debtags/maint/*.h ) +file( GLOB h_debtags_coll debtags/coll/*.h ) file( GLOB h_axi axi/*.h ) +file( GLOB h_utils utils/*.h ) -file( GLOB debtagstesth debtags/*.test.h debtags/maint/*.test.h ) -file( GLOB popcontesth popcon/*.test.h ) -file( GLOB apttesth apt/*.test.h ) -file( GLOB axitesth axi/*.test.h ) -set( testh ${debtagstesth} ${popcontesth} - ${apttesth} ${axitesth} ) +#file( GLOB debtagstesth debtags/*.test.h debtags/maint/*.test.h ) +#file( GLOB apttesth apt/*.test.h ) +#file( GLOB axitesth axi/*.test.h ) +#set( testh ${debtagstesth} ${apttesth} ${axitesth} ) include_directories( ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR} ${TAGCOLL_INCLUDE_DIRS} ${WIBBLE_INCLUDE_DIRS} ) link_libraries( ${WIBBLE_LIBRARIES} ${TAGCOLL_LIBRARIES} apt-pkg xapian -lpthread ) -add_definitions( -fexceptions -fPIC -fvisibility=default ) +add_definitions( --std=c++11 -fexceptions -fPIC -fvisibility=default ) add_library( ept SHARED ${src} ) add_library( ept-static STATIC ${src} ) set_target_properties( ept PROPERTIES SOVERSION ${LIBEPT_SOVERSION} CLEAN_DIRECT_OUTPUT 1) set_target_properties( ept-static PROPERTIES SOVERSION ${LIBEPT_SOVERSION} OUTPUT_NAME "ept" CLEAN_DIRECT_OUTPUT 1) -set( TEST_ENV_DIR ${ept_BINARY_DIR}/test-env/ ) +add_executable(test-ept EXCLUDE_FROM_ALL utils/tests-main.cc ${tests}) +target_link_libraries(test-ept ept) +add_test(test-ept test-ept) +add_dependencies(check test-ept) configure_file( ${ept_SOURCE_DIR}/config.h.cmake-in ${ept_BINARY_DIR}/config.h ) @@ -44,36 +47,6 @@ configure_file( ${ept_SOURCE_DIR}/libept.pc.in # regression testing link_directories( ${CMAKE_CURRENT_BINARY_DIR}/../lib ) link_libraries( ept ) -wibble_add_test( ept-test ${testh} ) - -set( datastamp ${CMAKE_CURRENT_BINARY_DIR}/data-stamp ) -set( datadir ${CMAKE_CURRENT_SOURCE_DIR}/test-data ) -set( listfile wherever_debian_._Packages ) - -wibble_check_target( ept-test ${datastamp} ) - -execute_process( COMMAND dpkg --print-architecture OUTPUT_VARIABLE ARCH ) -string( REPLACE "\n" "" ARCH "${ARCH}" ) - -add_custom_command( - OUTPUT ${datastamp} - COMMAND mkdir -p test-env/etc test-env/state/lists/partial - test-env/cache test-env/debtags - test-env/cache/archives/partial test-env/desktop - COMMAND sed -e s,i386,${ARCH}, < ${datadir}/packagelist > test-env/state/lists/${listfile} - COMMAND cp -a ${datadir}/etc/sources.list test-env/etc/ - COMMAND sed -e s,i386,${ARCH}, < ${datadir}/dpkg-status > test-env/dpkg-status - COMMAND cp -a ${datadir}/desktop/*.desktop test-env/desktop/ - COMMAND cp ${datadir}/debtags/package-tags test-env/debtags/package-tags - COMMAND cp ${datadir}/debtags/vocabulary test-env/debtags/vocabulary - COMMAND mkdir -p test-env/debtags/empty - COMMAND mkdir -p test-env/debtags/user - COMMAND mkdir -p test-env/xapian/ - COMMAND mkdir -p test-env/popcon/ - COMMAND mkdir -p test-env/popcon/empty - COMMAND cp -a ${datadir}/popcon/all-popcon-results.txt.gz test-env/popcon/ - COMMAND cp -a ${datadir}/popcon/popularity-contest test-env/popcon/ - COMMAND touch data-stamp ) install( TARGETS ept ept-static LIBRARY DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE} @@ -84,6 +57,6 @@ install( FILES ${h_top} DESTINATION include/ept ) install( FILES ${h_apt} DESTINATION include/ept/apt ) install( FILES ${h_debtags} DESTINATION include/ept/debtags ) install( FILES ${h_debtags_maint} DESTINATION include/ept/debtags/maint ) -install( FILES ${h_popcon} DESTINATION include/ept/popcon ) -install( FILES ${h_popcon_maint} DESTINATION include/ept/popcon/maint ) +install( FILES ${h_debtags_coll} DESTINATION include/ept/debtags/coll ) install( FILES ${h_axi} DESTINATION include/ept/axi ) +install( FILES ${h_utils} DESTINATION include/ept/utils ) |