Skip to content

Commit 2c02053

Browse files
Jignesh-007SebastianSchildt
authored andcommitted
CMake files updated to support build for QNX
Signed-off-by: jth4kor <[email protected]>
1 parent 05b6d5f commit 2c02053

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

CMakeLists.txt

+5-3
Original file line numberDiff line numberDiff line change
@@ -69,11 +69,13 @@ if(CCACHE_BIN)
6969
endif()
7070

7171
add_subdirectory(src)
72-
add_custom_target(examples)
73-
add_subdirectory(examples)
72+
if (NOT CMAKE_SYSTEM_NAME STREQUAL "QNX")
73+
add_custom_target(examples)
74+
add_subdirectory(examples)
75+
endif()
7476

7577
# Build tests and install artefacts only for Linux systems
76-
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
78+
if (NOT (DEFINED ENV{ZEPHYR_BASE}))
7779
enable_testing()
7880
add_custom_target(unittests)
7981
add_subdirectory(unit EXCLUDE_FROM_ALL)

src/CMakeLists.txt

+3-3
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ set(LIB_NAME "open1722" )
3131

3232
file(GLOB LIB_SOURCES *.c)
3333

34-
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
34+
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "QNX")
3535
add_library(${LIB_NAME} SHARED ${LIB_SOURCES})
3636
elseif(DEFINED ENV{ZEPHYR_BASE})
3737
add_library(${LIB_NAME} STATIC ${LIB_SOURCES})
@@ -43,7 +43,7 @@ target_include_directories(${LIB_NAME} PRIVATE
4343
$<INSTALL_INTERFACE:include>)
4444
set_target_properties(${LIB_NAME} PROPERTIES VERSION ${PROJECT_VERSION})
4545

46-
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
46+
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "QNX")
4747
add_library(${LIB_NAME}custom SHARED ${LIB_SOURCES})
4848
elseif(DEFINED ENV{ZEPHYR_BASE})
4949
add_library(${LIB_NAME}custom STATIC ${LIB_SOURCES})
@@ -55,7 +55,7 @@ target_include_directories(${LIB_NAME}custom PRIVATE
5555
$<INSTALL_INTERFACE:include>)
5656
set_target_properties(${LIB_NAME}custom PROPERTIES VERSION ${PROJECT_VERSION})
5757

58-
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
58+
if (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" OR ${CMAKE_SYSTEM_NAME} STREQUAL "QNX")
5959
install(TARGETS ${LIB_NAME}
6060
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
6161
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})

0 commit comments

Comments
 (0)