| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
- # Set up the project
- project(guix
- VERSION 6.0.0
- LANGUAGES C ASM
- )
- if(NOT DEFINED THREADX_ARCH)
- message(FATAL_ERROR "Error: THREADX_ARCH not defined")
- endif()
- if(NOT DEFINED THREADX_TOOLCHAIN)
- message(FATAL_ERROR "Error: THREADX_TOOLCHAIN not defined")
- endif()
- # Define our target library and an alias for consumers
- add_library(${PROJECT_NAME})
- add_library("azrtos::${PROJECT_NAME}" ALIAS ${PROJECT_NAME})
- # Define any required dependencies between this library and others
- target_link_libraries(${PROJECT_NAME} PUBLIC
- "azrtos::threadx"
- )
- # A place for generated/copied include files (no need to change)
- set(CUSTOM_INC_DIR ${CMAKE_CURRENT_BINARY_DIR}/custom_inc)
- # Pick up the port specific stuff first
- add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/ports/${THREADX_ARCH}/${THREADX_TOOLCHAIN})
- # Then the common files
- add_subdirectory(${CMAKE_CURRENT_LIST_DIR}/common)
- # Include the user's override file if required
- if (NOT GX_USER_FILE)
- message(STATUS "Using default gx_user.h file")
- set(GX_USER_FILE ${CMAKE_CURRENT_LIST_DIR}/common/inc/gx_user_sample.h)
- else()
- message(STATUS "Using custom gx_user.h file from ${GX_USER_FILE}")
- endif()
- configure_file(${GX_USER_FILE} ${CUSTOM_INC_DIR}/gx_user.h COPYONLY)
- target_include_directories(${PROJECT_NAME}
- PUBLIC
- ${CUSTOM_INC_DIR}
- )
- target_compile_definitions(${PROJECT_NAME} PUBLIC "GX_INCLUDE_USER_DEFINE_FILE" )
- # Enable a build target that produces a ZIP file of all sources
- set(CPACK_SOURCE_GENERATOR "ZIP")
- set(CPACK_SOURCE_IGNORE_FILES
- \\.git/
- \\.github/
- _build/
- \\.git
- \\.gitattributes
- \\.gitignore
- ".*~$"
- )
- set(CPACK_VERBATIM_VARIABLES YES)
- include(CPack)
|