From f413e52dddaddd7ca64591ed2fe61a389791832b Mon Sep 17 00:00:00 2001 From: Marko Viitanen Date: Thu, 28 Apr 2022 21:12:39 +0300 Subject: [PATCH] [build] Use relative paths in CMakeLists GLOB and fix gitlab-ci --- .gitlab-ci.yml | 8 +++----- CMakeLists.txt | 8 ++++---- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index a8940f20..b79a532e 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -7,14 +7,12 @@ test-kvazaar: &test-template script: - bash .travis-install.bash - export PATH="${HOME}/bin:${PATH}" - - cmake . - - ./configure --enable-werror || (cat config.log && false) - - make --jobs=8 + - cmake -DUSE_SHARED_LIB=OFF -DCMAKE_INSTALL_PREFIX=../ .. || (cat config.log && false) + - make install --jobs=8 - make check --jobs=8 VERBOSE=1 artifacts: paths: - - src/uvg266 - - src/.libs + - bin/uvg266 expire_in: 1 week test-asan: diff --git a/CMakeLists.txt b/CMakeLists.txt index 43ed8a31..7b4efe2b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,13 +33,13 @@ if(NOT EXISTS "${PROJECT_SOURCE_DIR}/greatest/greatest.h") endif() # Add all sources in src/ base -file(GLOB LIB_SOURCES "src/*.h" "src/*.c") +file(GLOB LIB_SOURCES RELATIVE ${PROJECT_SOURCE_DIR} "src/*.h" "src/*.c") # We don't want CLI main in the library list(REMOVE_ITEM LIB_SOURCES "${CMAKE_CURRENT_SOURCE_DIR}/src/encmain.c" "${CMAKE_CURRENT_SOURCE_DIR}/src/cli.c" "${CMAKE_CURRENT_SOURCE_DIR}/src/yuv_io.c") # Add also all the strategies -file(GLOB_RECURSE LIB_SOURCES_STRATEGIES "src/strategies/*.c") +file(GLOB_RECURSE LIB_SOURCES_STRATEGIES RELATIVE ${PROJECT_SOURCE_DIR} "src/strategies/*.c") # ToDo: do something with encode_coding_tree-avx2, currently not converted to VVC list(REMOVE_ITEM LIB_SOURCES_STRATEGIES "${CMAKE_CURRENT_SOURCE_DIR}/src/strategies/avx2/encode_coding_tree-avx2.c") @@ -72,7 +72,7 @@ target_include_directories(uvg266 PUBLIC src) target_include_directories(uvg266 PUBLIC src/extras) target_include_directories(uvg266 PUBLIC src/strategies) -file(GLOB LIB_SOURCES_STRATEGIES_AVX2 "src/strategies/avx2/*.c") +file(GLOB LIB_SOURCES_STRATEGIES_AVX2 RELATIVE ${PROJECT_SOURCE_DIR} "src/strategies/avx2/*.c") set(CLI_SOURCES "src/encmain.c" "src/cli.c" "src/yuv_io.c") @@ -123,7 +123,7 @@ install(FILES ${PROJECT_SOURCE_DIR}/doc/uvg266.1 DESTINATION ${CMAKE_INSTALL_PRE # DIST -file(GLOB_RECURSE DIST_SOURCES "*.c" "*.h" "*.sh" "*.py" "*.md" "*.yml" "*.in" "placeholder.txt" "CMakeLists.txt" "doc/*" "greatest/*") +file(GLOB_RECURSE DIST_SOURCES RELATIVE ${PROJECT_SOURCE_DIR} "*.c" "*.h" "*.sh" "*.py" "*.md" "*.yml" "*.in" "placeholder.txt" "CMakeLists.txt" "doc/*" "greatest/*") list(APPEND DIST_SOURCES ".clang-format" ".gitignore" ".gitmodules" "tests/tsan_suppressions.txt" ".travis-install.bash" "CREDITS" "Dockerfile" "docs.doxy" "LICENSE" "LICENSE.EXT.greatest") add_custom_target(dist