2025-08-19 10:54:42 +08:00
|
|
|
cmake_minimum_required(VERSION 3.10)
|
2019-12-29 16:11:05 +08:00
|
|
|
|
|
|
|
|
########################################################
|
2025-10-16 15:32:06 +08:00
|
|
|
project(irdecode)
|
2019-12-29 16:11:05 +08:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
|
|
|
|
|
|
|
|
|
|
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
|
|
|
|
|
MESSAGE("compile platform : Linux")
|
|
|
|
|
add_definitions(-DPLATFORM_LINUX)
|
|
|
|
|
ELSEIF (CMAKE_SYSTEM_NAME MATCHES "Windows")
|
|
|
|
|
MESSAGE("compile platform : win32")
|
|
|
|
|
add_definitions(-DPLATFORM_WIN32)
|
|
|
|
|
ELSE ()
|
|
|
|
|
MESSAGE("invalid compile platform")
|
|
|
|
|
add_definitions(-DPLATFORM_WIN32)
|
|
|
|
|
ENDIF ()
|
|
|
|
|
|
2026-01-05 12:25:53 +08:00
|
|
|
include_directories(
|
|
|
|
|
"src/include")
|
|
|
|
|
|
|
|
|
|
set(LIB_IRDECODE_SRC
|
2019-12-29 16:11:05 +08:00
|
|
|
src/ir_utils.c
|
|
|
|
|
src/ir_tv_control.c
|
|
|
|
|
src/ir_ac_apply.c
|
|
|
|
|
src/ir_ac_build_frame.c
|
|
|
|
|
src/ir_ac_parse_parameter.c
|
|
|
|
|
src/ir_ac_parse_forbidden_info.c
|
|
|
|
|
src/ir_ac_parse_frame_info.c
|
|
|
|
|
src/ir_ac_control.c
|
|
|
|
|
src/ir_ac_binary_parse.c
|
|
|
|
|
src/ir_decode.c
|
2025-01-17 07:14:43 +00:00
|
|
|
src/ir_decode_test.c)
|
2019-12-29 16:11:05 +08:00
|
|
|
|
2026-01-05 12:25:53 +08:00
|
|
|
set(BIN_TEST_SRC
|
2020-03-08 19:41:00 +08:00
|
|
|
src/ir_decode.c)
|
2019-12-29 16:11:05 +08:00
|
|
|
|
|
|
|
|
# SET(CMAKE_SYSTEM_NAME Linux)
|
2025-10-16 15:23:05 +08:00
|
|
|
## ARMv7hf cross compile
|
|
|
|
|
# SET(CMAKE_C_COMPILER "/usr/bin/arm-linux-gnueabihf-gcc")
|
|
|
|
|
# SET(CMAKE_CXX_COMPILER "/usr/bin/arm-linux-gnueabihf-g++")
|
2019-12-29 16:11:05 +08:00
|
|
|
# SET(CMAKE_FIND_ROOT_PATH "/usr/bin")
|
|
|
|
|
|
2025-10-16 15:23:05 +08:00
|
|
|
# SET(CMAKE_SYSTEM_NAME Linux)
|
|
|
|
|
## ARMv7el cross compile
|
2025-10-16 15:32:06 +08:00
|
|
|
# SET(CMAKE_C_COMPILER "/usr/bin/arm-linux-gnueabi-gcc")
|
|
|
|
|
# SET(CMAKE_CXX_COMPILER "/usr/bin/arm-linux-gnueabi-g++")
|
|
|
|
|
# SET(CMAKE_FIND_ROOT_PATH "/usr/bin")
|
2025-10-16 15:23:05 +08:00
|
|
|
|
2019-12-29 16:11:05 +08:00
|
|
|
## ARM64 cross compile
|
|
|
|
|
# SET(CMAKE_C_COMPILER "/usr/bin/aarch64-linux-gnu-gcc")
|
2020-04-15 12:40:28 +08:00
|
|
|
# SET(CMAKE_CXX_COMPILER "/usr/bin/aarch64-linux-gnu-g++")
|
2019-12-29 16:11:05 +08:00
|
|
|
# SET(CMAKE_FIND_ROOT_PATH "/usr/bin")
|
|
|
|
|
|
2026-01-05 12:25:53 +08:00
|
|
|
add_library(irdecode SHARED
|
|
|
|
|
${LIB_IRDECODE_SRC})
|
|
|
|
|
|
|
|
|
|
target_compile_options(irdecode PRIVATE
|
|
|
|
|
-DBOARD_PC)
|
|
|
|
|
|
|
|
|
|
add_library(irdecode_s STATIC
|
|
|
|
|
${LIB_IRDECODE_SRC})
|
|
|
|
|
|
|
|
|
|
target_compile_options(irdecode_s PRIVATE
|
|
|
|
|
-DBOARD_PC)
|
|
|
|
|
|
|
|
|
|
target_compile_options(irdecode_s PRIVATE
|
|
|
|
|
-fPIC)
|
|
|
|
|
|
|
|
|
|
add_executable(irdecode_test
|
|
|
|
|
${BIN_TEST_SRC})
|
|
|
|
|
|
|
|
|
|
target_link_libraries(irdecode_test PRIVATE
|
|
|
|
|
irdecode)
|
|
|
|
|
|
|
|
|
|
add_subdirectory("src/jni")
|