summaryrefslogtreecommitdiff
path: root/stacks/crdop/CMakeLists.txt
blob: 27ab1748e2df941a810f3dfe37bee16a89bc6cdc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
cmake_minimum_required(VERSION 3.16)
# Product label CRDOP-CUR999 (pre-release until v0.5). CMake project() requires a
# numeric VERSION; 0.0.999 is the build-time fallback. Human-facing strings live
# in VERSION (CUR999) and include/crdop/version.h (CRDOP-CUR999 / CUR999).
project(crdop VERSION 0.0.999 LANGUAGES C)

set(CMAKE_C_STANDARD 17)
set(CMAKE_C_STANDARD_REQUIRED ON)

include(GNUInstallDirs)

if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
    set(CMAKE_BUILD_TYPE Release CACHE STRING "Build type" FORCE)
endif()

option(CRDOP_VENDOR_ARDOPCF
       "Dev-only: build legacy ARDOP (ardopcf) vendor — OFF by default; never installed in MAX25 releases"
       OFF)

set(CRDOP_ROOT "${CMAKE_CURRENT_SOURCE_DIR}")
set(VENDOR_DIR "${CRDOP_ROOT}/vendor/ardopcf")

function(crdop_install_scaffold)
    install(FILES
        "${CRDOP_ROOT}/share/crdop.ini.example"
        "${CRDOP_ROOT}/share/crdop-dual.ini.example"
        "${CRDOP_ROOT}/share/crdop-amateur.ini.example"
        "${CRDOP_ROOT}/share/crdop.freebsd.ini.example"
        DESTINATION ${CMAKE_INSTALL_DATADIR}/crdop
    )
    install(FILES "${CRDOP_ROOT}/VERSION" DESTINATION ${CMAKE_INSTALL_DATADIR}/crdop)
    install(PROGRAMS "${CRDOP_ROOT}/scripts/crdopc"
            DESTINATION ${CMAKE_INSTALL_BINDIR} RENAME crdop)
    install(PROGRAMS
        "${CRDOP_ROOT}/tools/max25-signal-sniffer"
        "${CRDOP_ROOT}/tools/audio-dummyd"
        DESTINATION ${CMAKE_INSTALL_BINDIR}
    )
    install(DIRECTORY "${CRDOP_ROOT}/lib/"
            DESTINATION ${CMAKE_INSTALL_DATADIR}/crdop/lib
            FILES_MATCHING PATTERN "*.py")
endfunction()

if(CRDOP_VENDOR_ARDOPCF AND EXISTS "${VENDOR_DIR}/Makefile")
    include("${CRDOP_ROOT}/cmake/CRDOPVendorArdopcf.cmake")
    crdop_install_scaffold()
    message(STATUS "CRDOP ${PROJECT_VERSION} → crdopc (legacy vendor/ardopcf)")
elseif(CRDOP_VENDOR_ARDOPCF)
    message(WARNING "CRDOP: CRDOP_VENDOR_ARDOPCF=ON but vendor/ardopcf missing — scaffold only")
    crdop_install_scaffold()
    message(STATUS "CRDOP: scaffold only (native modem in development)")
else()
    crdop_install_scaffold()
    message(STATUS "CRDOP: scaffold only (native Eigenentwicklung; -DCRDOP_VENDOR_ARDOPCF=ON for legacy vendor build)")
endif()
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com