Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ jobs:
cd build
make -j2

- name: Run tests
run: |
cd build
make test
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can do make -C build and drop the cd.
Alternatively: ctest --test-dir build --output-on-failure

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's used to make it similar with other steps.


release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/v')
Expand Down
14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
cmake_minimum_required(VERSION 3.0.2)
if(CMAKE_MAJOR_VERSION LESS 3)
cmake_minimum_required(VERSION 2.6)
else()
cmake_minimum_required(VERSION 2.8.12)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason to support a cmake version from 10 years ago? 👀

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's still used on one of the systems on which I'm testing roc (some old raspberry pi). While there's no big maintaining burden, I prefer to keep compatibility with older systems, because often people are too lazy to update them, like me :)

endif()

##project
project(openfec C)
Expand Down Expand Up @@ -39,13 +43,17 @@ message(STATUS "Optimization level ${OPTIMIZE}")

endif (DEBUG STREQUAL "ON")

set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE})
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}
CACHE STRING "output path for libraries")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}
CACHE STRING "output path for executables")
MARK_AS_ADVANCED(
LIBRARY_OUTPUT_PATH
EXECUTABLE_OUTPUT_PATH
)

option(INSTALL_DEVTOOLS "install developer tools to the system" OFF)

link_directories(${LIBRARY_OUTPUT_PATH})

add_subdirectory(pc)
Expand Down
8 changes: 6 additions & 2 deletions applis/eperftool/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
file (GLOB eperftool_sources ./*)

set(EPERFTOOL_BIN ${PROJECT_BINARY_DIR}/applis/eperftool/eperftool CACHE STRING "eperftool dir")
set(EPERFTOOL_BIN ${EXECUTABLE_OUTPUT_PATH}/eperftool CACHE STRING "eperftool exe")
add_executable( eperftool ${eperftool_sources})


target_link_libraries( eperftool openfec m)

install(TARGETS eperftool)
if(INSTALL_DEVTOOLS)
install(TARGETS eperftool
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
COMPONENT devtools)
endif()
10 changes: 7 additions & 3 deletions applis/howto_examples/simple_client_server/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
file (GLOB simple_server_sources ./simple_server.c)

set(SIMPLE_SERVER_BIN ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}/simple_server CACHE STRING "simple_server dir")
set(SIMPLE_SERVER_BIN ${EXECUTABLE_OUTPUT_PATH}/simple_server CACHE STRING "simple_server exe")
add_executable(simple_server ${simple_server_sources})

target_link_libraries(simple_server openfec m)


file (GLOB simple_client_sources ./simple_client.c)

set(SIMPLE_SERVER_BIN ${PROJECT_SOURCE_DIR}/bin/${CMAKE_BUILD_TYPE}/simple_client CACHE STRING "simple_client dir")
set(SIMPLE_SERVER_BIN ${EXECUTABLE_OUTPUT_PATH}/simple_client CACHE STRING "simple_client exe")
add_executable(simple_client ${simple_client_sources})

target_link_libraries(simple_client openfec m)

install(TARGETS simple_server simple_client)
if(INSTALL_DEVTOOLS)
install(TARGETS simple_server simple_client
RUNTIME DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}
COMPONENT applis)
endif()
6 changes: 5 additions & 1 deletion pc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SET(PKG_CONFIG_LIBS
"-L\${libdir} -l${PROJECT_NAME}"
)
SET(PKG_CONFIG_CFLAGS
"-I\${includedir}/lib_common -I\${includedir}/lib_stable"
"-I\${includedir}/lib_common -I\${includedir}/lib_stable -I\${includedir}/lib_advanced"
)

message(STATUS "Configuring \"${CMAKE_SOURCE_BINARY_DIR}/${PROJECT_NAME}.pc\"")
Expand All @@ -15,3 +15,7 @@ CONFIGURE_FILE(
"${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc"
@ONLY
)

install(
FILES "${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}.pc"
DESTINATION ${CMAKE_INSTALL_FULL_DATAROOTDIR}/pkgconfig)
5 changes: 5 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ target_link_libraries(openfec m)

install(TARGETS openfec DESTINATION ${CMAKE_INSTALL_FULL_LIBDIR})

install(
DIRECTORY ${PROJECT_SOURCE_DIR}/src/
DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/openfec
FILES_MATCHING PATTERN "*.h*")

include(TestBigEndian)
test_big_endian(BIG_ENDIAN)
if(BIG_ENDIAN)
Expand Down
6 changes: 3 additions & 3 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# list of dedicated binary tests
add_executable(test_create_instance create_instance_test.c)
target_link_libraries(test_create_instance openfec m)
add_test("create_instance" ${PROJECT_BINARY_DIR}/tests/test_create_instance)
add_test("create_instance" ${EXECUTABLE_OUTPUT_PATH}/test_create_instance)
set_tests_properties ("create_instance"
PROPERTIES FAIL_REGULAR_EXPRESSION "ERROR;FAILURE")

add_executable(test_encoder_instance encoder_instance_test.c)
target_link_libraries(test_encoder_instance openfec m)
add_test("encoder_instance" ${PROJECT_BINARY_DIR}/tests/test_encoder_instance)
add_test("encoder_instance" ${EXECUTABLE_OUTPUT_PATH}/test_encoder_instance)
set_tests_properties ("encoder_instance"
PROPERTIES FAIL_REGULAR_EXPRESSION "ERROR;FAILURE")

add_executable(test_code_params code_params_test.c)
target_link_libraries(test_code_params openfec m)
add_test("code_params" ${PROJECT_BINARY_DIR}/tests/test_code_params)
add_test("code_params" ${EXECUTABLE_OUTPUT_PATH}/test_code_params)
set_tests_properties ("code_params"
PROPERTIES FAIL_REGULAR_EXPRESSION "ERROR;FAILURE")

Expand Down
2 changes: 0 additions & 2 deletions tools/descr_stats_v1.2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@ set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/perf_eval)
add_executable(descr_stats ${descr_stat_sources})

target_link_libraries( descr_stats m)

install(TARGETS descr_stats)