Commit d37ddf02 authored by Matthieu Dorier's avatar Matthieu Dorier

improved dependency management in cmake files

parent 713b84c9
......@@ -7,10 +7,11 @@
# -DCMAKE_PREFIX_PATH='/dir1;/dir2;/dir3'
#
cmake_minimum_required (VERSION 3.0)
cmake_minimum_required (VERSION 3.14)
project (hepnos CXX)
add_definitions (-g)
set (CMAKE_CXX_STANDARD 14)
# add our cmake module directory to the path
set (CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
......@@ -35,7 +36,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
# packages we depend on
include (xpkg-import)
find_package (mercury CONFIG REQUIRED)
find_package (Boost REQUIRED COMPONENTS serialization system filesystem)
find_package (Boost REQUIRED COMPONENTS serialization)
include_directories(${Boost_INCLUDE_DIRS})
xpkg_import_module (margo REQUIRED margo)
xpkg_import_module (sdskv-client REQUIRED sdskv-client)
......
......@@ -44,6 +44,7 @@ DataStore& DataStore::operator=(DataStore&& other) {
m_impl->cleanup();
}
m_impl = std::move(other.m_impl);
return *this;
}
DataStore::~DataStore() {
......
......@@ -5,40 +5,42 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test-util.sh ${CMAKE_CURRENT_BINARY_D
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test-util.sh ${CMAKE_CURRENT_BINARY_DIR}/test-util.sh COPYONLY)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/config.yaml ${CMAKE_CURRENT_BINARY_DIR}/config.yaml COPYONLY)
set (BOOST_DEPS Boost::serialization)
add_executable(example example.cpp)
target_link_libraries(example hepnos ${Boost_LIBRARIES})
target_link_libraries(example hepnos ${BOOST_DEPS})
set(CTEST_ENVIRONMENT "MKTEMP=mktemp" "TIMEOUT=timeout")
add_executable(DataStoreTest DataStoreTest.cpp HEPnOSTestMain.cpp)
target_link_libraries(DataStoreTest cppunit hepnos)
target_link_libraries(DataStoreTest ${CPPUNIT_LIBRARIES} hepnos)
add_executable(DataSetTest DataSetTest.cpp HEPnOSTestMain.cpp)
target_link_libraries(DataSetTest cppunit hepnos)
target_link_libraries(DataSetTest ${CPPUNIT_LIBRARIES} hepnos)
add_executable(RunSetTest RunSetTest.cpp HEPnOSTestMain.cpp)
target_link_libraries(RunSetTest cppunit hepnos)
target_link_libraries(RunSetTest ${CPPUNIT_LIBRARIES} hepnos)
add_executable(RunTest RunTest.cpp HEPnOSTestMain.cpp)
target_link_libraries(RunTest cppunit hepnos)
target_link_libraries(RunTest ${CPPUNIT_LIBRARIES} hepnos)
add_executable(SubRunTest SubRunTest.cpp HEPnOSTestMain.cpp)
target_link_libraries(SubRunTest cppunit hepnos)
target_link_libraries(SubRunTest ${CPPUNIT_LIBRARIES} hepnos)
add_executable(EventTest EventTest.cpp HEPnOSTestMain.cpp)
target_link_libraries(EventTest cppunit hepnos)
target_link_libraries(EventTest ${CPPUNIT_LIBRARIES} hepnos)
add_executable(LoadStoreTest LoadStoreTest.cpp HEPnOSTestMain.cpp)
target_link_libraries(LoadStoreTest cppunit hepnos boost_serialization)
target_link_libraries(LoadStoreTest ${CPPUNIT_LIBRARIES} hepnos ${BOOST_DEPS})
add_executable(PtrTest PtrTest.cpp HEPnOSTestMain.cpp)
target_link_libraries(PtrTest cppunit hepnos boost_serialization)
target_link_libraries(PtrTest ${CPPUNIT_LIBRARIES} hepnos ${BOOST_DEPS})
add_executable(WriteAndRestartTest WriteAndRestartTest.cpp HEPnOSTestMain.cpp)
target_link_libraries(WriteAndRestartTest cppunit hepnos boost_serialization)
target_link_libraries(WriteAndRestartTest ${CPPUNIT_LIBRARIES} hepnos ${BOOST_DEPS})
add_executable(RestartAndReadTest RestartAndReadTest.cpp HEPnOSTestMain.cpp)
target_link_libraries(RestartAndReadTest cppunit hepnos boost_serialization)
target_link_libraries(RestartAndReadTest ${CPPUNIT_LIBRARIES} hepnos ${BOOST_DEPS})
add_test(NAME DataStoreTest COMMAND run-test.sh ./DataStoreTest)
add_test(NAME DataSetTest COMMAND run-test.sh ./DataSetTest)
......
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