Cmake build: do not change CMAKE_RUNTIME_OUTPUT_DIRECTORY if building with catkin

This commit is contained in:
TSC21 2018-12-12 18:30:07 +00:00 committed by Nuno Marques
parent c7eb21be86
commit a6121e1655
2 changed files with 12 additions and 1 deletions

View File

@ -260,7 +260,12 @@ set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# For the catkin build process, unset build of dynamically-linked binaries
if (CATKIN_DEVEL_PREFIX)
# and do not change CMAKE_RUNTIME_OUTPUT_DIRECTORY
if (NOT CATKIN_DEVEL_PREFIX)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PX4_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${PX4_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${PX4_BINARY_DIR})
else()
SET(BUILD_SHARED_LIBS OFF)
endif()

View File

@ -5,6 +5,12 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
get_property(module_libraries GLOBAL PROPERTY PX4_MODULE_LIBRARIES)
# When building with catkin, do not change CMAKE_RUNTIME_OUTPUT_DIR from
# CMAKE_CURRENT_BINARY_DIR ''./platforms/posix' to './bin'
if (NOT CATKIN_DEVEL_PREFIX)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
endif()
set(PX4_SHELL_COMMAND_PREFIX "px4-")
add_definitions("-DPX4_SHELL_COMMAND_PREFIX=\"${PX4_SHELL_COMMAND_PREFIX}\"")