diff options
author | Ryo Nakamura <upa@haeena.net> | 2022-11-20 02:01:44 +0900 |
---|---|---|
committer | Ryo Nakamura <upa@haeena.net> | 2022-11-20 02:02:43 +0900 |
commit | 8e266517dac1541be4b836e57971484f18996845 (patch) | |
tree | aaac6d126da69a6e2d15db23fd07157be6459f1e /CMakeLists.txt | |
parent | 8395c05d672d7f6117c2854218435ff71cf23294 (diff) |
use list(LENGTH) to iterate DIST_ lists
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 88d5109..55878a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,9 +53,7 @@ target_link_libraries(mscp PRIVATE ${MSCP_LINK_LIBS}) target_compile_options(mscp PRIVATE ${MSCP_COMPILE_OPTS}) target_compile_definitions(mscp PUBLIC _VERSION="${PROJECT_VERSION}") -install(TARGETS mscp - RUNTIME DESTINATION bin -) +install(TARGETS mscp RUNTIME DESTINATION bin) @@ -106,12 +104,15 @@ include(CPack) # Custom targets to build and test mscp in docker containers. # foreach(IN ZIP_LISTS) (cmake >= 3.17) can shorten the following lists. -# However, ubuntu 20.04 has cmake 3.16.3. +# However, ubuntu 20.04 has cmake 3.16.3. So this is a roundabout trick. list(APPEND DIST_NAMES ubuntu ubuntu centos rocky) list(APPEND DIST_VERS 20.04 22.04 8 8.6) list(APPEND DIST_PKGS deb deb rpm rpm) -foreach(x RANGE 3) +list(LENGTH DIST_NAMES _DIST_LISTLEN) +math(EXPR DIST_LISTLEN "${_DIST_LISTLEN} - 1") + +foreach(x RANGE ${DIST_LISTLEN}) list(GET DIST_NAMES ${x} DIST_NAME) list(GET DIST_VERS ${x} DIST_VER) list(GET DIST_PKGS ${x} DIST_PKG) |