CMakeLists.txt 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # Copyright (c) 2023 HPMicro
  2. # SPDX-License-Identifier: BSD-3-Clause
  3. if(NOT DEFINED FX_INCLUDE_USER_DEFINE_FILE)
  4. sdk_compile_definitions(-DFX_INCLUDE_USER_DEFINE_FILE=1)
  5. endif()
  6. option(FX_STANDALONE_ENABLE "Enable Filex in standalone mode" OFF)
  7. if(NOT DEFINED THREADX_ARCH)
  8. message(FATAL_ERROR "Error: THREADX_ARCH not defined")
  9. endif()
  10. if(NOT DEFINED THREADX_TOOLCHAIN)
  11. message(FATAL_ERROR "Error: THREADX_TOOLCHAIN not defined")
  12. endif()
  13. add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/ports/${THREADX_ARCH}/${THREADX_TOOLCHAIN})
  14. # Then the common files
  15. add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/common)
  16. # Include the user's override file if required
  17. if (NOT FX_USER_FILE)
  18. message(STATUS "Using default fx_user.h file")
  19. set(FX_USER_FILE ${CMAKE_CURRENT_LIST_DIR}/common/inc/fx_user_sample.h)
  20. else()
  21. message(STATUS "Using custom fx_user.h file from ${FX_USER_FILE}")
  22. endif()
  23. # set include file path to place configure file
  24. set(generated_file_path "${__build_dir}/generated")
  25. set(CUSTOM_INC_DIR ${generated_file_path}/include)
  26. message(STATUS "copy fx_user.h to " ${CUSTOM_INC_DIR})
  27. configure_file(${FX_USER_FILE} ${CUSTOM_INC_DIR}/fx_user.h COPYONLY)
  28. sdk_inc(${CUSTOM_INC_DIR})