Commit 68fcc291 authored by Eric Cano's avatar Eric Cano
Browse files

Added a cta-lib package, simplified the libraries and turned on the automatic...

Added a cta-lib package, simplified the libraries and turned on the automatic unit testing during rpm build.
parent 34048fda
......@@ -20,9 +20,9 @@ set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-g")
# Generate the compilation variables, if needed
if (NOT DEFINED SKIP_UNIT_TESTS)
message (STATUS "Setting SKIP_UNIT_TESTS to the value of 1")
message (STATUS "Override with -DSKIP_UNIT_TESTS:STRING=0")
set(SKIP_UNIT_TESTS 1)
message (STATUS "Setting SKIP_UNIT_TESTS to the value of 0")
message (STATUS "Override with -DSKIP_UNIT_TESTS:STRING=1")
set(SKIP_UNIT_TESTS 0)
else (NOT DEFINED SKIP_UNIT_TESTS)
message (STATUS "Already set: SKIP_UNIT_TESTS=${SKIP_UNIT_TESTS}")
endif (NOT DEFINED SKIP_UNIT_TESTS)
......@@ -115,7 +115,7 @@ endif (${COMPILE_PACKAGING} STREQUAL "1")
#add_custom_target(test test/castorUnitTests
# COMMENT "Not running the unit tests" VERBATIM)
add_custom_target(test test/unitTests
add_custom_target(test tests/unittests
#
#COMMAND valgrind --track-fds=yes --leak-check=full --demangle=no --gen-suppressions=all --show-reachable=yes --error-exitcode=1 test/castorUnitTests
#COMMAND test/castorThreadedUnitTests
......@@ -123,6 +123,6 @@ add_custom_target(test test/unitTests
#COMMAND valgrind --tool=helgrind -v --demangle=no --conflict-cache-size=30000000 --error-exitcode=1 test/castorThreadedUnitTests
#COMMAND test/castorMultiprocessUnitTests
#COMMAND valgrind --tool=helgrind --error-exitcode=1 test/castorMultiprocessUnitTests
DEPENDS test/unitTests #test/castorThreadedUnitTests test/castorMultiprocessUnitTests test/castorThreadedUnitTests.supp
DEPENDS tests/unittests #test/castorThreadedUnitTests test/castorMultiprocessUnitTests test/castorThreadedUnitTests.supp
COMMENT "Running unit tests" VERBATIM)
......@@ -10,8 +10,7 @@ target_link_libraries (cta ${XROOTD_XRDCL_LIB} ctacommon cryptopp)
include_directories (${CMAKE_SOURCE_DIR}/tapeserver/)
add_executable (ctaAddAdminUser CTAAddAdminUser.cpp )
target_link_libraries (ctaAddAdminUser castorcommon castorserver castorlog
CTAObjectStore ctaOStoreSchedulerDB ctacommon castorutils protobuf ctascheduler
ctanameserver)
ctacommon castorutils protobuf ctascheduler ctanameserver)
install (TARGETS cta ctaAddAdminUser DESTINATION usr/bin)
......@@ -42,6 +42,7 @@ set (COMMON_LIB_SRC_FILES
add_library (ctacommon SHARED
${COMMON_LIB_SRC_FILES})
install (TARGETS ctacommon DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
target_link_libraries (ctacommon
castorcommon
......
......@@ -66,6 +66,7 @@ cd build
%package -n cta-tapeserver
Summary: CERN Tape Archive
Group: Application/CTA
requires: cta-lib
%description -n cta-tapeserver
CERN Tape Archive:
The tape server daemon
......@@ -76,6 +77,7 @@ The tape server daemon
%package -n cta-frontend
Summary: CERN Tape Archive
Group: Application/CTA
requires: cta-lib
%description -n cta-frontend
CERN Tape Archive:
The xroot plugin
......@@ -94,3 +96,16 @@ The xroot plugin
%defattr(-,root,root)
%attr(0755,root,root) %{_bindir}/cta
%attr(0755,root,root) %{_bindir}/ctaAddAdminUser
%package -n cta-lib
Summary: CERN Tape Archive
Group: Application/CTA
%description -n cta-lib
CERN Tape Archive:
The shared libraries
%files -n cta-lib
%defattr(-,root,root)
%attr(0755,root,root) %{_libdir}/libctacommon.so
%attr(0755,root,root) %{_libdir}/libctanameserver.so
%attr(0755,root,root) %{_libdir}/libctaremotens.so
%attr(0755,root,root) %{_libdir}/libctascheduler.so
......@@ -11,6 +11,8 @@ add_library (ctanameserver SHARED
target_link_libraries(ctanameserver castorns castorcommon)
install (TARGETS ctanameserver DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
add_executable(castornstest CastorNameServerTest.cpp)
target_link_libraries(castornstest ctanameserver ctacommon ctascheduler)
......
......@@ -13,6 +13,7 @@ find_package (xrootd REQUIRED)
include_directories (${XROOTD_INCLUDE_DIR} ${XROOTD_PRIVATE_INCLUDE_DIR} ${CMAKE_SOURCE_DIR})
target_link_libraries (ctaremotens ${XROOTD_XRDCL_LIB} ctacommon cryptopp)
install (TARGETS ctaremotens DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
add_library (ctaremotensunittests SHARED
MockRemoteNS.cpp
......
......@@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.6)
find_package (sqlite REQUIRED)
include_directories (${SQLITE3_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
${PROJECT_SOURCE_DIR})
${PROJECT_SOURCE_DIR} ${CMAKE_BINARY_DIR})
set (CTA_SCHEDULER_SRC_FILES
ArchiveJob.cpp
......@@ -30,19 +30,14 @@ set (CTA_SCHEDULER_SRC_FILES
# mockDB/SqliteColumnNameToIndex.cpp
# mockDB/SQLiteStatementDeleter.cpp
MountType.cpp
UserRequest.cpp)
UserRequest.cpp
OStoreDB/OStoreDB.cpp)
add_library (ctascheduler SHARED
${CTA_SCHEDULER_SRC_FILES})
install (TARGETS ctascheduler DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
target_link_libraries (ctascheduler ${SQLITE3_LIBRARY_RELEASE} ctacommon)
include_directories(${CMAKE_BINARY_DIR})
add_library(ctaOStoreSchedulerDB SHARED
OStoreDB/OStoreDB.cpp)
target_link_libraries(ctaOStoreSchedulerDB
CTAObjectStore)
target_link_libraries (ctascheduler ${SQLITE3_LIBRARY_RELEASE} ctacommon CTAObjectStore protobuf)
add_library (ctaschedulerutils SHARED
DummyScheduler.cpp)
......@@ -57,5 +52,4 @@ add_library (ctaschedulerunittests SHARED
target_link_libraries (ctaschedulerunittests ${SQLITE3_LIBRARY_RELEASE})
target_link_libraries(ctaschedulerunittests
ctascheduler
ctaOStoreSchedulerDB)
ctascheduler)
......@@ -74,7 +74,7 @@ add_library(castorTapeServerDaemon
TpconfigLine.cpp
TpconfigLines.cpp)
target_link_libraries(castorTapeServerDaemon castormessages castortapereactor ctacommon ctanameserver ctaremotens ctaOStoreSchedulerDB protobuf CTAObjectStore ctascheduler XrdCtaOfs)
target_link_libraries(castorTapeServerDaemon castormessages castortapereactor ctacommon ctanameserver ctaremotens protobuf ctascheduler XrdCtaOfs)
add_dependencies(castorTapeServerDaemon castormessagesprotobuf)
add_executable(tapeserverd TapeDaemon.cpp)
......
......@@ -8,7 +8,7 @@ include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/tapeserver)
add_library (XrdCtaOfs MODULE XrdCtaFilesystem.cpp XrdCtaFile.cpp OStoreDBWithAgent.cpp BackendPopulator.cpp)
target_link_libraries (XrdCtaOfs ctascheduler ctacommon ctanameserver ctaremotens ctaOStoreSchedulerDB protobuf CTAObjectStore cryptopp)
target_link_libraries (XrdCtaOfs ctascheduler ctacommon ctanameserver ctaremotens protobuf CTAObjectStore cryptopp)
INSTALL (TARGETS XrdCtaOfs DESTINATION usr/${CMAKE_INSTALL_LIBDIR})
INSTALL (FILES xrd.cf.cta DESTINATION ${CMAKE_INSTALL_SYSCONFDIR})
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment