diff --git a/CMakeLists.txt b/CMakeLists.txt index 58c60257..41146658 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,11 @@ include(CheckFunctionExists) include(CheckSymbolExists) include(CheckCXXCompilerFlag) +# ---------------------------------------------------------------------------- +# set property to classify library kinds +# ---------------------------------------------------------------------------- +set_property(GLOBAL PROPERTY USE_FOLDERS ON) +set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER "CMakeTargets") # ---------------------------------------------------------------------------- # enable test in this project # ---------------------------------------------------------------------------- diff --git a/mpp/CMakeLists.txt b/mpp/CMakeLists.txt index d6eb9180..75eb6e7f 100644 --- a/mpp/CMakeLists.txt +++ b/mpp/CMakeLists.txt @@ -30,7 +30,7 @@ add_library(mpp STATIC mpi_impl.cpp mpi.cpp ) - +set_target_properties(mpp PROPERTIES FOLDER "mpp") add_subdirectory(legacy) add_subdirectory(test) diff --git a/mpp/codec/CMakeLists.txt b/mpp/codec/CMakeLists.txt index 74ba62d0..b75970a7 100644 --- a/mpp/codec/CMakeLists.txt +++ b/mpp/codec/CMakeLists.txt @@ -7,8 +7,9 @@ add_library(mpp_codec STATIC mpp_buf_slot.cpp mpp_enc.cpp mpp_dec.cpp + ) - +set_target_properties(mpp_codec PROPERTIES FOLDER "mpp/codec") add_subdirectory(dec) add_subdirectory(enc) diff --git a/mpp/codec/dec/h264/CMakeLists.txt b/mpp/codec/dec/h264/CMakeLists.txt index b66fe4ac..c115eff8 100644 --- a/mpp/codec/dec/h264/CMakeLists.txt +++ b/mpp/codec/dec/h264/CMakeLists.txt @@ -1 +1,28 @@ # vim: syntax=cmake + +# h264 decoder api +set(H264D_API + ../../inc/h264d_api.h + + ) + + +# h264 decoder header +set(H264D_HDR + + ) + +# h264 decoder sourse +set(H264D_SRC + h264d_api.c + ) + + +add_library(codec_h264d STATIC + ${H264D_API} + ${H264D_HDR} + ${H264D_SRC} + ) + +set_target_properties(codec_h264d PROPERTIES FOLDER "mpp/codec") + diff --git a/mpp/hal/CMakeLists.txt b/mpp/hal/CMakeLists.txt index 9ec0bd91..ed3daac2 100644 --- a/mpp/hal/CMakeLists.txt +++ b/mpp/hal/CMakeLists.txt @@ -5,7 +5,7 @@ add_library(mpp_hal STATIC mpp_hal.cpp ) - +set_target_properties(mpp_hal PROPERTIES FOLDER "mpp/hal") add_subdirectory(rkdec/h264d) add_subdirectory(rkdec/h265d) diff --git a/mpp/hal/rkdec/h264d/CMakeLists.txt b/mpp/hal/rkdec/h264d/CMakeLists.txt index b66fe4ac..55c2d957 100644 --- a/mpp/hal/rkdec/h264d/CMakeLists.txt +++ b/mpp/hal/rkdec/h264d/CMakeLists.txt @@ -1 +1,27 @@ # vim: syntax=cmake + +# hal h264 decoder api +set(HAL_H264D_API + ../../inc/hal_h264d_api.h + + ) + + +# hal h264 header +set(HAL_H264D_HDR + + ) + +# hal h264 decoder sourse +set(HAL_H264D_SRC + hal_h264d_api.c + + ) + +add_library(hal_h264d STATIC + ${HAL_H264D_API} + ${HAL_H264D_HDR} + ${HAL_H264D_SRC} + ) + +set_target_properties(hal_h264d PROPERTIES FOLDER "mpp/hal") diff --git a/mpp/legacy/CMakeLists.txt b/mpp/legacy/CMakeLists.txt index 22705ad6..406105f3 100644 --- a/mpp/legacy/CMakeLists.txt +++ b/mpp/legacy/CMakeLists.txt @@ -8,5 +8,5 @@ add_library(mpp_legacy STATIC vpu_api.cpp vpu_api_legacy.cpp ) - +set_target_properties(mpp_legacy PROPERTIES FOLDER "mpp/legacy") target_link_libraries(mpp_legacy osal) diff --git a/mpp/test/CMakeLists.txt b/mpp/test/CMakeLists.txt index f0e8e4b0..caad0909 100644 --- a/mpp/test/CMakeLists.txt +++ b/mpp/test/CMakeLists.txt @@ -14,6 +14,7 @@ macro(add_mpp_test module) if(${test_tag}) add_executable(${test_name} ${test_name}.c) target_link_libraries(${test_name} mpp) + set_target_properties(${test_name} PROPERTIES FOLDER "mpp/test") install(TARGETS ${test_name} RUNTIME DESTINATION ${TEST_INSTALL_DIR}) endif() endmacro() diff --git a/osal/CMakeLists.txt b/osal/CMakeLists.txt index 9f78b7d2..5570588f 100644 --- a/osal/CMakeLists.txt +++ b/osal/CMakeLists.txt @@ -33,4 +33,5 @@ else() target_link_libraries(osal pthread) endif() +set_target_properties(osal PROPERTIES FOLDER "osal") add_subdirectory(test) diff --git a/osal/test/CMakeLists.txt b/osal/test/CMakeLists.txt index 6cb36752..47a97309 100644 --- a/osal/test/CMakeLists.txt +++ b/osal/test/CMakeLists.txt @@ -14,6 +14,7 @@ macro(add_mpp_osal_test module) if(${test_tag}) add_executable(${test_name} ${test_name}.c) target_link_libraries(${test_name} osal) + set_target_properties(${test_name} PROPERTIES FOLDER "osal/test") install(TARGETS ${test_name} RUNTIME DESTINATION ${TEST_INSTALL_DIR}) add_test(NAME ${test_name} COMMAND ${test_name}) endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index f4a30dde..560638ed 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -14,6 +14,7 @@ macro(add_mpp_test module) if(${test_tag}) add_executable(${test_name} ${test_name}.c) target_link_libraries(${test_name} mpp) + set_target_properties(${test_name} PROPERTIES FOLDER "test") install(TARGETS ${test_name} RUNTIME DESTINATION ${TEST_INSTALL_DIR}) add_test(NAME ${test_name} COMMAND ${test_name}) endif() diff --git a/test/mpi_test.c b/test/mpi_test.c index f11007d2..22d563d0 100644 --- a/test/mpi_test.c +++ b/test/mpi_test.c @@ -55,7 +55,7 @@ int main() mpp_env_set_u32("mpi_debug", 0x1); - buf = malloc(size); + buf = (char *)malloc(size); if (NULL == buf) { mpp_err("mpi_test malloc failed\n"); goto MPP_TEST_FAILED;