Browse Source

Merge pull request #43 from mcharleb/cmake-mc

cmake: fixed posix configs
sbg
James Goppert 10 years ago
parent
commit
97cb25254d
  1. 25
      CMakeLists.txt
  2. 0
      cmake/configs/nuttx_px4fmu-v2_default.cmake
  3. 0
      cmake/configs/nuttx_px4fmu-v2_simple.cmake
  4. 0
      cmake/configs/nuttx_sim_simple.cmake
  5. 7
      cmake/configs/posix_eagle_default.cmake
  6. 7
      cmake/configs/posix_eagle_hil.cmake
  7. 7
      cmake/configs/posix_eagle_muorb.cmake
  8. 6
      cmake/configs/posix_eagle_release.cmake
  9. 1
      cmake/configs/posix_sitl_simple.cmake
  10. 0
      cmake/configs/qurt_eagle_hello.cmake
  11. 0
      cmake/configs/qurt_eagle_hil.cmake
  12. 0
      cmake/configs/qurt_eagle_muorb.cmake
  13. 67
      cmake/toolchains/Toolchain-arm-linux-gnueabihf.cmake

25
CMakeLists.txt

@ -112,16 +112,16 @@ set(package-contact "px4users@googlegroups.com") @@ -112,16 +112,16 @@ set(package-contact "px4users@googlegroups.com")
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
#=============================================================================
# cmake modules
# Validate build configuration and build
#
if (NOT NESTED_CMAKE_CALL)
message(STATUS "IN TOP")
if (EXISTS ${CMAKE_SOURCE_DIR}/cmake/configs/config_${CONFIG}.cmake)
if (EXISTS ${CMAKE_SOURCE_DIR}/cmake/configs/${CONFIG}.cmake)
# Get the toolchain information
include(configs/config_${CONFIG})
include(configs/${CONFIG})
else()
message(FATAL_ERROR "build config not found: config_${CONFIG}.cmake")
message(FATAL_ERROR "build config not found: ${CONFIG}.cmake")
endif()
if (NOT "${USE_TOOLCHAIN}" STREQUAL "")
set(TOOLCHAIN -DCMAKE_TOOLCHAIN_FILE=${CMAKE_SOURCE_DIR}/cmake/toolchains/${USE_TOOLCHAIN}.cmake)
@ -130,15 +130,6 @@ if (NOT NESTED_CMAKE_CALL) @@ -130,15 +130,6 @@ if (NOT NESTED_CMAKE_CALL)
list(GET TARGET_PARAMS 0 OS)
list(GET TARGET_PARAMS 1 BOARD)
list(GET TARGET_PARAMS 2 LABEL)
message(STATUS "CONFIG ${OS} ${BOARD} ${LABEL}")
if ("${LABEL}" STREQUAL "upload")
set(LABEL "simple")
set(DOUPLOAD "1")
endif()
if ("${LABEL}" STREQUAL "test")
set(LABEL "simple")
set(DOTEST "1")
endif()
execute_process( COMMAND ${CMAKE_COMMAND} -E make_directory ${CONFIG} )
set(NESTED_CMAKE_CALL 1)
message(STATUS "Before")
@ -149,14 +140,6 @@ if (NOT NESTED_CMAKE_CALL) @@ -149,14 +140,6 @@ if (NOT NESTED_CMAKE_CALL)
COMMAND make -s
)
message(STATUS "${CMAKE_COMMAND} VERBOSE=1 ${CMAKE_SOURCE_DIR} ${TOOLCHAIN} -DOS=${OS} -DBOARD=${BOARD} -DLABEL=${LABEL}")
if ("${DOUPLOAD}" STREQUAL "1")
execute_process( WORKING_DIRECTORY ${CONFIG}
COMMAND make upload)
endif()
if ("${DOTEST}" STREQUAL "1")
execute_process( WORKING_DIRECTORY ${CONFIG}
COMMAND make test)
endif()
return()
endif(NOT NESTED_CMAKE_CALL)

0
cmake/configs/config_nuttx_px4fmu-v2_default.cmake → cmake/configs/nuttx_px4fmu-v2_default.cmake

0
cmake/configs/config_nuttx_px4fmu-v2_simple.cmake → cmake/configs/nuttx_px4fmu-v2_simple.cmake

0
cmake/configs/config_nuttx_sim_simple.cmake → cmake/configs/nuttx_sim_simple.cmake

7
cmake/configs/config_posix_eagle_default.cmake → cmake/configs/posix_eagle_default.cmake

@ -1,10 +1,13 @@ @@ -1,10 +1,13 @@
include(posix/px4_impl_posix-arm)
set(USE_TOOLCHAIN Toolchain-arm-linux-gnueabihf)
function(px4_get_config)
px4_parse_function_args(
NAME px4_set_config_modules
ONE_VALUE OUT_MODULES OUT_FW_OPTS OUT_EXTRA_CMDS
ONE_VALUE OUT_MODULES
REQUIRED OUT_MODULES
ARGN ${ARGN})
set(config_module_list
@ -47,7 +50,7 @@ function(px4_get_config) @@ -47,7 +50,7 @@ function(px4_get_config)
platforms/posix/work_queue
)
set(${out_module_list} ${config_module_list} PARENT_SCOPE)
set(${OUT_MODULES} ${config_module_list} PARENT_SCOPE)
endfunction()

7
cmake/configs/config_posix_eagle_hil.cmake → cmake/configs/posix_eagle_hil.cmake

@ -1,10 +1,13 @@ @@ -1,10 +1,13 @@
include(posix/px4_impl_posix-arm)
set(USE_TOOLCHAIN Toolchain-arm-linux-gnueabihf)
function(px4_get_config)
px4_parse_function_args(
NAME px4_set_config_modules
ONE_VALUE OUT_MODULES OUT_FW_OPTS OUT_EXTRA_CMDS
ONE_VALUE OUT_MODULES
REQUIRED OUT_MODULES
ARGN ${ARGN})
set(config_module_list
@ -36,7 +39,7 @@ function(px4_get_config) @@ -36,7 +39,7 @@ function(px4_get_config)
modules/muorb/krait
)
set(${out_module_list} ${config_module_list} PARENT_SCOPE)
set(${OUT_MODULES} ${config_module_list} PARENT_SCOPE)
endfunction()

7
cmake/configs/config_posix_eagle_muorb.cmake → cmake/configs/posix_eagle_muorb.cmake

@ -1,10 +1,13 @@ @@ -1,10 +1,13 @@
include(posix/px4_impl_posix-arm)
set(USE_TOOLCHAIN Toolchain-arm-linux-gnueabihf)
function(px4_get_config)
px4_parse_function_args(
NAME px4_set_config_modules
ONE_VALUE OUT_MODULES OUT_FW_OPTS OUT_EXTRA_CMDS
ONE_VALUE OUT_MODULES
REQUIRED OUT_MODULES
ARGN ${ARGN})
set(config_module_list
@ -18,7 +21,7 @@ function(px4_get_config) @@ -18,7 +21,7 @@ function(px4_get_config)
modules/muorb/krait
)
set(${out_module_list} ${config_module_list} PARENT_SCOPE)
set(${OUT_MODULES} ${config_module_list} PARENT_SCOPE)
endfunction()

6
cmake/configs/config_posix_eagle_release.cmake → cmake/configs/posix_eagle_release.cmake

@ -1,10 +1,12 @@ @@ -1,10 +1,12 @@
include(posix/px4_impl_posix-arm)
set(USE_TOOLCHAIN Toolchain-arm-linux-gnueabihf)
function(px4_get_config)
px4_parse_function_args(
NAME px4_set_config_modules
ONE_VALUE OUT_MODULES OUT_FW_OPTS OUT_EXTRA_CMDS
ONE_VALUE OUT_MODULES
ARGN ${ARGN})
set(config_module_list
@ -31,7 +33,7 @@ function(px4_get_config) @@ -31,7 +33,7 @@ function(px4_get_config)
modules/muorb/krait
)
set(${out_module_list} ${config_module_list} PARENT_SCOPE)
set(${OUT_MODULES} ${config_module_list} PARENT_SCOPE)
endfunction()

1
cmake/configs/config_posix_sitl_simple.cmake → cmake/configs/posix_sitl_simple.cmake

@ -1,4 +1,5 @@ @@ -1,4 +1,5 @@
include(posix/px4_impl_posix)
set(USE_TOOLCHAIN Toolchain-native)
function(px4_get_config)

0
cmake/configs/config_qurt_eagle_hello.cmake → cmake/configs/qurt_eagle_hello.cmake

0
cmake/configs/config_qurt_eagle_hil.cmake → cmake/configs/qurt_eagle_hil.cmake

0
cmake/configs/config_qurt_eagle_muorb.cmake → cmake/configs/qurt_eagle_muorb.cmake

67
cmake/toolchains/Toolchain-arm-linux-gnueabihf.cmake

@ -0,0 +1,67 @@ @@ -0,0 +1,67 @@
# defines:
#
# NM
# OBJCOPY
# LD
# CXX_COMPILER
# C_COMPILER
# CMAKE_SYSTEM_NAME
# CMAKE_SYSTEM_VERSION
# GENROMFS
# LINKER_FLAGS
# CMAKE_EXE_LINKER_FLAGS
# CMAKE_FIND_ROOT_PATH
# CMAKE_FIND_ROOT_PATH_MODE_PROGRAM
# CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
# CMAKE_FIND_ROOT_PATH_MODE_INCLUDE
include(CMakeForceCompiler)
# this one is important
set(CMAKE_SYSTEM_NAME Generic)
#this one not so much
set(CMAKE_SYSTEM_VERSION 1)
# specify the cross compiler
find_program(C_COMPILER arm-linux-gnueabihf-gcc)
if(NOT C_COMPILER)
message(FATAL_ERROR "could not find arm-none-eabi-gcc compiler")
endif()
cmake_force_c_compiler(${C_COMPILER} GNU)
find_program(CXX_COMPILER arm-linux-gnueabihf-g++)
if(NOT CXX_COMPILER)
message(FATAL_ERROR "could not find arm-none-eabi-g++ compiler")
endif()
cmake_force_cxx_compiler(${CXX_COMPILER} GNU)
# compiler tools
foreach(tool objcopy nm ld)
string(TOUPPER ${tool} TOOL)
find_program(${TOOL} arm-linux-gnueabihf-${tool})
if(NOT ${TOOL})
message(FATAL_ERROR "could not find ${tool}")
endif()
endforeach()
# os tools
foreach(tool echo patch grep rm mkdir nm genromfs awk cp touch make unzip)
string(TOUPPER ${tool} TOOL)
find_program(${TOOL} ${tool})
if(NOT ${TOOL})
message(FATAL_ERROR "could not find ${TOOL}")
endif()
endforeach()
set(LINKER_FLAGS "-Wl,-gc-sections")
set(CMAKE_EXE_LINKER_FLAGS ${LINKER_FLAGS})
# where is the target environment
set(CMAKE_FIND_ROOT_PATH get_file_component(${C_COMPILER} PATH))
# search for programs in the build host directories
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
# for libraries and headers in the target directories
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
Loading…
Cancel
Save