diff options
author | Allen Winter <allen.winter@kdab.com> | 2022-06-06 08:09:39 -0400 |
---|---|---|
committer | Allen Winter <allen.winter@kdab.com> | 2022-06-06 08:09:39 -0400 |
commit | 5de3e1500d33e3f14b289ee29ceb79cd9cc64fed (patch) | |
tree | 071fd080dfcbb6e9e78aee3abded1236a9060470 /cmake/Toolchain-QNX-common.cmake | |
parent | 8a02c81153db797703adf2e18be94efe0f0c7b8c (diff) | |
download | libical-git-5de3e1500d33e3f14b289ee29ceb79cd9cc64fed.tar.gz |
REUSE compliance
fixes: #489
Diffstat (limited to 'cmake/Toolchain-QNX-common.cmake')
-rw-r--r-- | cmake/Toolchain-QNX-common.cmake | 89 |
1 files changed, 89 insertions, 0 deletions
diff --git a/cmake/Toolchain-QNX-common.cmake b/cmake/Toolchain-QNX-common.cmake new file mode 100644 index 00000000..fa6899a3 --- /dev/null +++ b/cmake/Toolchain-QNX-common.cmake @@ -0,0 +1,89 @@ +# +# SPDX-FileCopyrightText: 2009 Johns Hopkins University (JHU), All Rights Reserved. +# SPDX-FileCopyrightText: 2012-2022 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com> +# SPDX-License-Identifier: LicenseRef-CISST + +# --- begin cisst license - do not edit --- +# +# This software is provided "as is" under an open source license, with no warranty. +# The complete license can be found in LICENSES/LicenseRef-CISST.txt. +# +# --- end cisst license --- + +SET(CMAKE_SYSTEM_NAME QNX) +SET(CMAKE_SYSTEM_VERSION ${QNX_VERSION}) +SET(CMAKE_SYSTEM_PROCESSOR ${QNX_PROCESSOR}) +SET(TOOLCHAIN QNX) + +#SET(CMAKE_IMPORT_LIBRARY_SUFFIX ".a") + +SET(CMAKE_SHARED_LIBRARY_PREFIX "lib") +SET(CMAKE_SHARED_LIBRARY_SUFFIX ".so") +SET(CMAKE_STATIC_LIBRARY_PREFIX "lib") +SET(CMAKE_STATIC_LIBRARY_SUFFIX ".a") + +IF(CMAKE_HOST_WIN32) + SET(HOST_EXECUTABLE_SUFFIX ".exe") +ENDIF(CMAKE_HOST_WIN32) + +FIND_PATH(QNX_HOST + NAME usr/bin/qcc${HOST_EXECUTABLE_SUFFIX} + PATHS $ENV{QNX_HOST} ${QNX_HOST_HINT} + NO_CMAKE_PATH + NO_CMAKE_ENVIRONMENT_PATH +) + +FIND_PATH(QNX_TARGET + NAME usr/include/qconfig.mk + PATHS $ENV{QNX_TARGET} ${QNX_TARGET_HINT} + NO_CMAKE_PATH + NO_CMAKE_ENVIRONMENT_PATH +) + +IF(CMAKE_HOST_WIN32) + FIND_PATH(QNX_CONFIGURATION + NAME bin/qnxactivate.exe + PATHS $ENV{QNX_CONFIGURATION} + "C:/Program Files/QNX Software Systems/qconfig" + NO_CMAKE_PATH + NO_CMAKE_ENVIRONMENT_PATH + ) +ENDIF(CMAKE_HOST_WIN32) + +SET(ENV{QNX_HOST} ${QNX_HOST}) +SET(ENV{QNX_TARGET} ${QNX_TARGET}) + +IF(CMAKE_HOST_WIN32) + SET(ENV{QNX_CONFIGURATION} ${QNX_CONFIGURATION}) + SET(ENV{PATH} "$ENV{PATH};${QNX_HOST}/usr/bin") +ENDIF(CMAKE_HOST_WIN32) + +if(CMAKE_GENERATOR MATCHES "Makefiles") + SET(CMAKE_MAKE_PROGRAM "${QNX_HOST}/usr/bin/make${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX Make Program") +endif() +SET(CMAKE_SH "${QNX_HOST}/usr/bin/sh${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX shell Program") +SET(CMAKE_AR "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-ar${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX ar Program") +SET(CMAKE_RANLIB "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-ranlib${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX ranlib Program") +SET(CMAKE_NM "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-nm${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX nm Program") +SET(CMAKE_OBJCOPY "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-objcopy${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX objcopy Program") +SET(CMAKE_OBJDUMP "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-objdump${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX objdump Program") +SET(CMAKE_LINKER "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-ld${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX Linker Program") +SET(CMAKE_STRIP "${QNX_HOST}/usr/bin/nto${CMAKE_SYSTEM_PROCESSOR}-strip${HOST_EXECUTABLE_SUFFIX}" CACHE PATH "QNX Strip Program") + +SET(CMAKE_C_COMPILER ${QNX_HOST}/usr/bin/qcc${HOST_EXECUTABLE_SUFFIX}) +SET(CMAKE_C_FLAGS_DEBUG "-g") +SET(CMAKE_C_FLAGS_MINSIZEREL "-Os -DNDEBUG") +SET(CMAKE_C_FLAGS_RELEASE "-O3 -DNDEBUG") +SET(CMAKE_C_FLAGS_RELWITHDEBINFO "-O2 -g") + +SET(CMAKE_CXX_COMPILER ${QNX_HOST}/usr/bin/qcc${HOST_EXECUTABLE_SUFFIX}) +SET(CMAKE_CXX_FLAGS_DEBUG "-g") +SET(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") +SET(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") +SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g") + +LIST(APPEND CMAKE_FIND_ROOT_PATH ${QNX_TARGET}) +SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |