Skip to content
Snippets Groups Projects
Commit 8f12901c authored by Joscha Schmiedt's avatar Joscha Schmiedt
Browse files

Rename subfolder CMakeLists.txt files

parent 7c355117
Branches
Tags
2 merge requests!61Release 0.3.0,!55Rename caosdb-cpplib to linkahead-cpplib
......@@ -23,7 +23,7 @@ find_package(Doxygen)
if (DOXYGEN_FOUND)
string(REPLACE ";" " " DOXYGEN_INPUT
"${libcaosdb_INCL} ${PROJECT_INCLUDE_DIR}/ccaosdb.h")
"${liblinkahead_INCL} ${PROJECT_INCLUDE_DIR}/clinkahead.h")
configure_file(Doxyfile.in Doxyfile)
......@@ -43,10 +43,10 @@ if (DOXYGEN_FOUND)
configure_file(cppapi/index.rst.in cppapi/index.rst)
# create rst pages for every header file
list(LENGTH libcaosdb_INCL len_header_files)
list(LENGTH liblinkahead_INCL len_header_files)
math(EXPR len_header_files "${len_header_files} - 1")
foreach (i RANGE "${len_header_files}")
list(GET libcaosdb_INCL ${i} HEADER_FILE)
list(GET liblinkahead_INCL ${i} HEADER_FILE)
string(REPLACE
"${PROJECT_INCLUDE_DIR}/"
""
......@@ -58,7 +58,7 @@ if (DOXYGEN_FOUND)
HEADER_FILE_NAME
${HEADER_FILE_NAME})
string(REPLACE
"caosdb/"
"linkahead/"
""
DOC_FILE_NAME
${HEADER_FILE_NAME})
......@@ -69,11 +69,11 @@ if (DOXYGEN_FOUND)
# create (plain) C docs
configure_file(capi/index.rst.in capi/index.rst)
set(HEADER_FILE_NAME ccaosdb.h)
set(HEADER_FILE ccaosdb.h)
set(HEADER_FILE_NAME clinkahead.h)
set(HEADER_FILE clinkahead.h)
configure_file(
header_file.rst.in
capi/_ccaosdb.rst)
capi/_clinkahead.rst)
add_custom_target(doc-sphinx
COMMAND ${SPHINX_CMD}
......
......@@ -19,47 +19,47 @@
#
# add all header files to this list
set(libcaosdb_INCL
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/authentication.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/certificate_provider.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/configuration.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/connection.h
${CMAKE_CURRENT_BINARY_DIR}/caosdb/constants.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/data_type.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/entity.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/exceptions.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/file_descriptor.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/handler_interface.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/info.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/log_level.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/logging.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/message_code.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/protobuf_helper.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/result_table.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/result_set.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/status_code.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/transaction.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/transaction_handler.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/transaction_status.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/unary_rpc_handler.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/utility.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/value.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/file_transmission/register_file_upload_handler.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/file_transmission/upload_request_handler.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/file_transmission/download_request_handler.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/file_transmission/file_writer.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/file_transmission/file_reader.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/file_transmission/file_error.h
set(liblinkahead_INCL
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/authentication.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/certificate_provider.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/configuration.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/connection.h
${CMAKE_CURRENT_BINARY_DIR}/linkahead/constants.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/data_type.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/entity.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/exceptions.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/file_descriptor.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/handler_interface.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/info.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/log_level.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/logging.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/message_code.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/protobuf_helper.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/result_table.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/result_set.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/status_code.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/transaction.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/transaction_handler.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/transaction_status.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/unary_rpc_handler.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/utility.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/value.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/file_transmission/register_file_upload_handler.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/file_transmission/upload_request_handler.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/file_transmission/download_request_handler.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/file_transmission/file_writer.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/file_transmission/file_reader.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/file_transmission/file_error.h
)
IF(BUILD_ACM)
list(APPEND libcaosdb_INCL
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/acm/user.h
list(APPEND liblinkahead_INCL
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/acm/user.h
)
ENDIF()
# pass variable to parent scope
set(libcaosdb_INCL ${libcaosdb_INCL} PARENT_SCOPE)
set(liblinkahead_INCL ${liblinkahead_INCL} PARENT_SCOPE)
# initialize constants
configure_file(caosdb/constants.h.in caosdb/constants.h)
configure_file(linkahead/constants.h.in linkahead/constants.h)
......@@ -20,33 +20,33 @@
# add all source files to this list
set(libcaosdb_SRC
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/authentication.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/entity.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/logging.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/connection.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/configuration.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/protobuf_helper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/result_set.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/result_table.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/result_table_impl.h
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/transaction.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/transaction_handler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/utility.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/unary_rpc_handler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/file_transmission/register_file_upload_handler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/file_transmission/upload_request_handler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/file_transmission/download_request_handler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/file_transmission/file_writer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/file_transmission/file_reader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/status_code_description.cpp
set(liblinkahead_SRC
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/authentication.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/entity.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/logging.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/connection.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/configuration.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/protobuf_helper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/result_set.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/result_table.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/result_table_impl.h
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/transaction.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/transaction_handler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/utility.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/unary_rpc_handler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/file_transmission/register_file_upload_handler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/file_transmission/upload_request_handler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/file_transmission/download_request_handler.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/file_transmission/file_writer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/file_transmission/file_reader.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/status_code_description.cpp
)
IF(BUILD_ACM)
list(APPEND libcaosdb_SRC
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/acm/user.cpp
${CMAKE_CURRENT_SOURCE_DIR}/caosdb/acm/user_impl.h
list(APPEND liblinkahead_SRC
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/acm/user.cpp
${CMAKE_CURRENT_SOURCE_DIR}/linkahead/acm/user_impl.h
)
ENDIF()
# pass variable to parent scope
set(libcaosdb_SRC ${libcaosdb_SRC} PARENT_SCOPE)
set(liblinkahead_SRC ${liblinkahead_SRC} PARENT_SCOPE)
......@@ -62,10 +62,10 @@ math(EXPR len_test_cases "${len_test_cases} - 1")
foreach (i RANGE "${len_test_cases}")
list(GET test_cases ${i} test_case_name)
add_executable(${test_case_name} ${test_case_name}.cpp)
set(libcaosdb_TEST_SRC "${CMAKE_CURRENT_SOURCE_DIR}/${test_case_name}.cpp
${libcaosdb_TEST_SRC}")
set(liblinkahead_TEST_SRC "${CMAKE_CURRENT_SOURCE_DIR}/${test_case_name}.cpp
${liblinkahead_TEST_SRC}")
target_link_libraries(${test_case_name}
PRIVATE GTest::gtest_main caosdb ccaosdb gtest::gtest)
PRIVATE GTest::gtest_main linkahead clinkahead gtest::gtest)
target_include_directories(${test_case_name}
PUBLIC ${CMAKE_CURRENT_BINARY_DIR})
if(_LINTING)
......@@ -78,14 +78,14 @@ foreach (i RANGE "${len_test_cases}")
gtest_discover_tests(${test_case_name}
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
PROPERTIES
LABELS "caosdb-cpplib-unit-tests"
LABELS "linkahead-cpplib-unit-tests"
)
endforeach ()
# copy test data to build dir
set(TEST_DATA_DIR "${CMAKE_CURRENT_SOURCE_DIR}/test_data")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/caosdb_test_utility.h.in
${CMAKE_CURRENT_BINARY_DIR}/caosdb_test_utility.h)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/linkahead_test_utility.h.in
${CMAKE_CURRENT_BINARY_DIR}/linkahead_test_utility.h)
......@@ -98,30 +98,30 @@ include(CodeCoverage)
if (LCOV_PATH)
message(STATUS "Found LCOV: ${LCOV_PATH}")
target_link_libraries(caosdb gcov)
target_link_libraries(ccaosdb gcov)
target_link_libraries(linkahead gcov)
target_link_libraries(clinkahead gcov)
setup_target_for_coverage_lcov(
NAME unit_test_coverage
EXECUTABLE ctest -L caosdb-cpplib-unit-tests
EXECUTABLE ctest -L linkahead-cpplib-unit-tests
EXCLUDE "${CMAKE_BINARY_DIR}/*"
DEPENDENCIES caosdb ccaosdb ${test_cases}
DEPENDENCIES linkahead clinkahead ${test_cases}
LCOV_ARGS --rc lcov_branch_coverage=1 --no-external
GENHTML_ARGS --rc lcov_branch_coverage=1
)
message(STATUS "Adding COMPILE_FLAGS for coverage: ${COVERAGE_COMPILER_FLAGS}")
set(TARGET_CAOSDB_COMPILE_FLAGS "${TARGET_CAOSDB_COMPILE_FLAGS} ${COVERAGE_COMPILER_FLAGS}")
set(TARGET_CCAOSDB_COMPILE_FLAGS "${TARGET_CCAOSDB_COMPILE_FLAGS} ${COVERAGE_COMPILER_FLAGS}")
set(TARGET_CAOSDB_COMPILE_FLAGS ${TARGET_CAOSDB_COMPILE_FLAGS} PARENT_SCOPE)
set(TARGET_CCAOSDB_COMPILE_FLAGS ${TARGET_CCAOSDB_COMPILE_FLAGS} PARENT_SCOPE)
set_target_properties(caosdb PROPERTIES
COMPILE_FLAGS "${TARGET_CAOSDB_COMPILE_FLAGS}")
set_target_properties(ccaosdb PROPERTIES
COMPILE_FLAGS "${TARGET_CCAOSDB_COMPILE_FLAGS}")
set(TARGET_LINKAHEAD_COMPILE_FLAGS "${TARGET_LINKAHEAD_COMPILE_FLAGS} ${COVERAGE_COMPILER_FLAGS}")
set(TARGET_CLINKAHEAD_COMPILE_FLAGS "${TARGET_CLINKAHEAD_COMPILE_FLAGS} ${COVERAGE_COMPILER_FLAGS}")
set(TARGET_LINKAHEAD_COMPILE_FLAGS ${TARGET_LINKAHEAD_COMPILE_FLAGS} PARENT_SCOPE)
set(TARGET_CLINKAHEAD_COMPILE_FLAGS ${TARGET_CLINKAHEAD_COMPILE_FLAGS} PARENT_SCOPE)
set_target_properties(linkahead PROPERTIES
COMPILE_FLAGS "${TARGET_LINKAHEAD_COMPILE_FLAGS}")
set_target_properties(clinkahead PROPERTIES
COMPILE_FLAGS "${TARGET_CLINKAHEAD_COMPILE_FLAGS}")
else ()
if (NOT SKIP_CODE_COVERAGE)
message(WARNING "Could not generate code coverage report. Please install lcov.")
add_custom_target(unit_test_coverage ctest -L caosdb-cpplib-unit-tests
DEPENDS caosdb ccaosdb ${test_cases}
add_custom_target(unit_test_coverage ctest -L linkahead-cpplib-unit-tests
DEPENDS linkahead clinkahead ${test_cases}
)
endif()
endif ()
File moved
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment