Skip to content

Commit e1fba0f

Browse files
author
n.danilyuk
committed
Replace makefiles to cmake. Minor bug fix
1 parent 37ec79c commit e1fba0f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1356
-1356
lines changed

Bazaar/nginx/Makefile

-2
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ configuration += --with-ld-opt="-Wl,-rpath,/usr/lib/arm-linux-gnueabihf"
3737

3838
VERSION=$(VER)-$(BUILD_NUMBER)
3939

40-
.PHONY: $(NGINX)
41-
4240
all: $(NGINX)
4341

4442
$(NGINX): $(RP_MANAGER_LIB) $(WS_SERVER_LIB)

Bazaar/nginx/ngx_ext_modules/ws_server/rp_sdk/CustomParameters.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ class CDoubleParameter : public CCustomParameter<double>
313313
public:
314314
CDoubleParameter(std::string _name, CBaseParameter::AccessMode _access_mode, double _value, int _fpga_update, double _min, double _max)
315315
:CCustomParameter(_name, _access_mode, _value, _fpga_update, _min, _max){};
316-
316+
317317
CDoubleParameter(std::string _name, CBaseParameter::AccessMode _access_mode, double _value, int _fpga_update, double _min, double _max,int _tag)
318318
:CCustomParameter(_name, _access_mode, _value, _fpga_update, _min, _max,_tag){};
319319
};
@@ -362,10 +362,10 @@ class CIntSignal : public CCustomSignal<int>
362362
class CByteSignal : public CCustomSignal<uint8_t>
363363
{
364364
public:
365-
CByteSignal(std::string _name, uint8_t _size, uint8_t _def_value)
365+
CByteSignal(std::string _name, int _size, uint8_t _def_value)
366366
:CCustomSignal(_name, _size, _def_value){};
367367

368-
CByteSignal(std::string _name, CBaseParameter::AccessMode _access_mode, uint8_t _size, uint8_t _def_value)
368+
CByteSignal(std::string _name, CBaseParameter::AccessMode _access_mode, int _size, uint8_t _def_value)
369369
:CCustomSignal(_name, _access_mode, _size, _def_value){};
370370
};
371371

Makefile

+124-159
Large diffs are not rendered by default.

Makefile.x86

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ BUILD_NUMBER ?= 0
88
GIT_MODE ?= GITHUB
99
GITLAB_TOKEN ?= NONE
1010

11-
CPU_CORES=$($(shell grep '^processor' /proc/cpuinfo | sort -u | wc -l) + 1)
11+
CPU_CORES = $(shell ./get_cpu_ram.sh)
1212

1313
REVISION ?= $(shell git rev-parse --short HEAD)
1414
VERSION = $(VER)-$(BUILD_NUMBER)

Test/acquire/CMakeLists.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set(CMAKE_C_COMPILER "gcc")
44
set(CMAKE_CXX_COMPILER "g++")
55
set(CMAKE_CXX_STANDARD 11)
66
set(C_STANDARD 11)
7-
set(CMAKE_VERBOSE_MAKEFILE ON)
7+
set(CMAKE_VERBOSE_MAKEFILE OFF)
88

99
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/output)
1010

@@ -42,7 +42,6 @@ list(APPEND r_paths
4242
/opt/redpitaya/lib/web
4343
)
4444

45-
4645
set(CMAKE_INSTALL_RPATH ${r_paths})
4746

4847
include_directories(${INSTALL_DIR}/include)

Test/calib/CMakeLists.txt

+2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ list(APPEND r_paths
4040
/opt/redpitaya/lib/web
4141
)
4242

43+
set(CMAKE_INSTALL_RPATH ${r_paths})
44+
4345
include_directories(${INSTALL_DIR}/include)
4446

4547
file(GLOB SOURCES "src/*.c")

apps-tools/arb_manager/CMakeLists.txt

+97
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
3+
set(CMAKE_C_COMPILER "gcc")
4+
set(CMAKE_CXX_COMPILER "g++")
5+
set(CMAKE_CXX_STANDARD 17)
6+
set(CMAKE_VERBOSE_MAKEFILE OFF)
7+
8+
set(APP arb_manager)
9+
set(BUILD_PATH ${CMAKE_BINARY_DIR}/${APP})
10+
11+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BUILD_PATH})
12+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BUILD_PATH})
13+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BUILD_PATH})
14+
15+
project(controllerhf)
16+
17+
if(NOT DEFINED INSTALL_DIR)
18+
message(FATAL_ERROR,"Installation path not set.")
19+
endif()
20+
21+
if(NOT DEFINED VERSION)
22+
set(VERSION 0)
23+
endif()
24+
25+
if(NOT DEFINED REVISION)
26+
set(REVISION devbuild)
27+
endif()
28+
29+
30+
message(STATUS "Install path ${INSTALL_DIR}")
31+
message(STATUS "VERSION=${VERSION}")
32+
message(STATUS "REVISION=${REVISION}")
33+
34+
message(STATUS "Compiler C path: ${CMAKE_C_COMPILER}")
35+
message(STATUS "Compiler C ID: ${CMAKE_C_COMPILER_ID}")
36+
message(STATUS "Compiler C version: ${CMAKE_C_COMPILER_VERSION}")
37+
message(STATUS "Compiler C is part: ${CMAKE_COMPILER_IS_GNUC}")
38+
39+
message(STATUS "Compiler C++ path: ${CMAKE_CXX_COMPILER}")
40+
message(STATUS "Compiler C++ ID: ${CMAKE_CXX_COMPILER_ID}")
41+
message(STATUS "Compiler C++version: ${CMAKE_CXX_COMPILER_VERSION}")
42+
message(STATUS "Compiler C++ is part: ${CMAKE_COMPILER_IS_GNUCXX}")
43+
44+
set(ZIP_FILE ../../../${APP}-${VERSION}-${BUILD_NUMBER}-${REVISION}.zip)
45+
46+
list(APPEND r_paths
47+
/opt/redpitaya/lib
48+
/opt/redpitaya/lib/web
49+
)
50+
51+
list(APPEND include_paths
52+
${INSTALL_DIR}/include
53+
${INSTALL_DIR}/include/api2
54+
${INSTALL_DIR}/include/apiApp
55+
${INSTALL_DIR}/include/redpitaya
56+
${INSTALL_DIR}/rp_sdk
57+
${INSTALL_DIR}/rp_sdk/libjson
58+
)
59+
60+
list(APPEND libs_paths
61+
${INSTALL_DIR}/lib
62+
${INSTALL_DIR}/lib/web
63+
${INSTALL_DIR}/rp_sdk
64+
)
65+
66+
set(CMAKE_INSTALL_RPATH ${r_paths})
67+
include_directories(${include_paths})
68+
link_directories(${libs_paths})
69+
70+
file(GLOB SOURCES "src/*.cpp")
71+
72+
add_compile_options(-mcpu=cortex-a9 -mfpu=neon-fp16 -fPIC)
73+
add_compile_definitions(ARCH_ARM)
74+
add_compile_options(-Wall -Wno-reorder -Wno-cpp -Wextra $<$<CONFIG:Release>:-Wno-unused-parameter> $<$<CONFIG:Release>:-Wno-unused-variable>)
75+
add_compile_options(-DVERSION=${VERSION} -DREVISION=${REVISION} $<$<CONFIG:Debug>:-g3> $<$<CONFIG:Release>:-Os> -ffunction-sections -fdata-sections)
76+
77+
78+
add_library(${PROJECT_NAME} SHARED ${SOURCES})
79+
80+
target_link_libraries(${PROJECT_NAME} PRIVATE rp-system rp rp-hw-calib rp-hw-profiles rp-hw rp-i2c rp-spi rp-gpio i2c pthread)
81+
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
82+
83+
84+
install(DIRECTORY ${CMAKE_SOURCE_DIR}/css DESTINATION ${BUILD_PATH})
85+
install(DIRECTORY ${CMAKE_SOURCE_DIR}/img DESTINATION ${BUILD_PATH})
86+
install(DIRECTORY ${CMAKE_SOURCE_DIR}/info DESTINATION ${BUILD_PATH})
87+
install(DIRECTORY ${CMAKE_SOURCE_DIR}/js DESTINATION ${BUILD_PATH})
88+
89+
file(GLOB HTML "*.html")
90+
install(FILES ${HTML} DESTINATION ${BUILD_PATH})
91+
install(FILES nginx.conf fpga.conf fpga.sh DESTINATION ${BUILD_PATH})
92+
93+
install(CODE "execute_process(COMMAND sed -i ${BUILD_PATH}/info/info.json -e \"s/REVISION/${REVISION}/\")")
94+
install(CODE "execute_process(COMMAND sed -i ${BUILD_PATH}/info/info.json -e \"s/BUILD_NUMBER/${BUILD_NUMBER}/\")")
95+
96+
install(CODE "file(ARCHIVE_CREATE OUTPUT ${ZIP_FILE} FORMAT zip PATHS ${BUILD_PATH})")
97+
install(CODE "file(ARCHIVE_EXTRACT INPUT ${ZIP_FILE} DESTINATION ${INSTALL_DIR}/www/apps)")

apps-tools/arb_manager/Makefile

-51
This file was deleted.

apps-tools/arb_manager/b.sh

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
rm ./controllerhf.so
2-
#make clean
3-
make INSTALL_DIR=/boot -j 2
41
rw
5-
cp /root/redpitaya-public/apps-tools/arb_manager/controllerhf.so /opt/redpitaya/www/apps/arb_manager
2+
cmake -B./build -DINSTALL_DIR=/opt/redpitaya -DCMAKE_BUILD_TYPE=Debug
3+
make -C build install -j2

apps-tools/arb_manager/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--
22
*
3-
* Red Pitaya Stream service manager
3+
* Red Pitaya ARB Manager
44
*
55
* Author: Nikolay <n.danilyuk@integrasources.eu>
66
*

apps-tools/arb_manager/src/Makefile

-51
This file was deleted.

apps-tools/ba_pro/CMakeLists.txt

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
cmake_minimum_required(VERSION 3.14)
2+
3+
set(CMAKE_C_COMPILER "gcc")
4+
set(CMAKE_CXX_COMPILER "g++")
5+
set(CMAKE_CXX_STANDARD 17)
6+
set(CMAKE_VERBOSE_MAKEFILE OFF)
7+
8+
set(APP ba_pro)
9+
set(BUILD_PATH ${CMAKE_BINARY_DIR}/${APP})
10+
11+
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BUILD_PATH})
12+
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BUILD_PATH})
13+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BUILD_PATH})
14+
15+
project(controllerhf)
16+
17+
if(NOT DEFINED INSTALL_DIR)
18+
message(FATAL_ERROR,"Installation path not set.")
19+
endif()
20+
21+
if(NOT DEFINED VERSION)
22+
set(VERSION 0)
23+
endif()
24+
25+
if(NOT DEFINED REVISION)
26+
set(REVISION devbuild)
27+
endif()
28+
29+
30+
message(STATUS "Install path ${INSTALL_DIR}")
31+
message(STATUS "VERSION=${VERSION}")
32+
message(STATUS "REVISION=${REVISION}")
33+
34+
message(STATUS "Compiler C path: ${CMAKE_C_COMPILER}")
35+
message(STATUS "Compiler C ID: ${CMAKE_C_COMPILER_ID}")
36+
message(STATUS "Compiler C version: ${CMAKE_C_COMPILER_VERSION}")
37+
message(STATUS "Compiler C is part: ${CMAKE_COMPILER_IS_GNUC}")
38+
39+
message(STATUS "Compiler C++ path: ${CMAKE_CXX_COMPILER}")
40+
message(STATUS "Compiler C++ ID: ${CMAKE_CXX_COMPILER_ID}")
41+
message(STATUS "Compiler C++version: ${CMAKE_CXX_COMPILER_VERSION}")
42+
message(STATUS "Compiler C++ is part: ${CMAKE_COMPILER_IS_GNUCXX}")
43+
44+
set(ZIP_FILE ../../../${APP}-${VERSION}-${BUILD_NUMBER}-${REVISION}.zip)
45+
46+
list(APPEND r_paths
47+
/opt/redpitaya/lib
48+
/opt/redpitaya/lib/web
49+
)
50+
51+
list(APPEND include_paths
52+
${INSTALL_DIR}/include
53+
${INSTALL_DIR}/include/api2
54+
${INSTALL_DIR}/include/apiApp
55+
${INSTALL_DIR}/include/redpitaya
56+
${INSTALL_DIR}/rp_sdk
57+
${INSTALL_DIR}/rp_sdk/libjson
58+
)
59+
60+
list(APPEND libs_paths
61+
${INSTALL_DIR}/lib
62+
${INSTALL_DIR}/lib/web
63+
${INSTALL_DIR}/rp_sdk
64+
)
65+
66+
set(CMAKE_INSTALL_RPATH ${r_paths})
67+
include_directories(${include_paths})
68+
link_directories(${libs_paths})
69+
70+
file(GLOB SOURCES "src/*.cpp")
71+
72+
add_compile_options(-mcpu=cortex-a9 -mfpu=neon-fp16 -fPIC)
73+
add_compile_definitions(ARCH_ARM)
74+
add_compile_options(-Wall -Wno-reorder -Wno-cpp -Wextra $<$<CONFIG:Release>:-Wno-unused-parameter> $<$<CONFIG:Release>:-Wno-unused-variable>)
75+
add_compile_options(-DVERSION=${VERSION} -DREVISION=${REVISION} $<$<CONFIG:Debug>:-g3> $<$<CONFIG:Release>:-Os> -ffunction-sections -fdata-sections)
76+
77+
78+
add_library(${PROJECT_NAME} SHARED ${SOURCES})
79+
80+
target_link_libraries(${PROJECT_NAME} PRIVATE rp-system rp rp-hw-calib rp-hw-profiles rp-hw rp-i2c rp-spi rp-gpio i2c pthread)
81+
set_target_properties(${PROJECT_NAME} PROPERTIES PREFIX "")
82+
83+
84+
install(DIRECTORY ${CMAKE_SOURCE_DIR}/css DESTINATION ${BUILD_PATH})
85+
install(DIRECTORY ${CMAKE_SOURCE_DIR}/img DESTINATION ${BUILD_PATH})
86+
install(DIRECTORY ${CMAKE_SOURCE_DIR}/info DESTINATION ${BUILD_PATH})
87+
install(DIRECTORY ${CMAKE_SOURCE_DIR}/js DESTINATION ${BUILD_PATH})
88+
install(DIRECTORY ${CMAKE_SOURCE_DIR}/fonts DESTINATION ${BUILD_PATH})
89+
90+
file(GLOB HTML "*.html")
91+
install(FILES ${HTML} DESTINATION ${BUILD_PATH})
92+
install(FILES fpga.conf fpga.sh DESTINATION ${BUILD_PATH})
93+
94+
install(CODE "execute_process(COMMAND sed -i ${BUILD_PATH}/info/info.json -e \"s/REVISION/${REVISION}/\")")
95+
install(CODE "execute_process(COMMAND sed -i ${BUILD_PATH}/info/info.json -e \"s/BUILD_NUMBER/${BUILD_NUMBER}/\")")
96+
97+
install(CODE "file(ARCHIVE_CREATE OUTPUT ${ZIP_FILE} FORMAT zip PATHS ${BUILD_PATH})")
98+
install(CODE "file(ARCHIVE_EXTRACT INPUT ${ZIP_FILE} DESTINATION ${INSTALL_DIR}/www/apps)")

0 commit comments

Comments
 (0)