diff --git a/CMakeLists.txt b/CMakeLists.txt index 8e799ab10..72694c72a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -153,9 +153,7 @@ if(OC_CLOUD_ENABLED) set(CLOUD_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/api/cloud) endif() -if(UNIX) - file(GLOB PYTHON_SRC python/*.c) -endif() +file(GLOB PYTHON_SRC python/*.c) ######## Define link dependencies ######## set(PRIVATE_LINK_LIBS "") @@ -220,13 +218,11 @@ if(OC_CLOUD_ENABLED) endif() endif() -if(UNIX) - add_library(python-obj OBJECT ${PYTHON_SRC}) - target_compile_definitions(python-obj PRIVATE ${PRIVATE_COMPILE_DEFINITIONS} PUBLIC ${PUBLIC_COMPILE_DEFINITIONS} "OC_CLIENT") - target_include_directories(python-obj PRIVATE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/port ${PORT_INCLUDE_DIR}) - if(OC_SECURITY_ENABLED) - target_include_directories(python-obj PRIVATE ${MBEDTLS_INCLUDE_DIRS}) - endif() +add_library(python-obj OBJECT ${PYTHON_SRC}) +target_compile_definitions(python-obj PRIVATE ${PRIVATE_COMPILE_DEFINITIONS} PUBLIC ${PUBLIC_COMPILE_DEFINITIONS} "OC_CLIENT") +target_include_directories(python-obj PRIVATE ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/port ${PORT_INCLUDE_DIR}) +if(OC_SECURITY_ENABLED) + target_include_directories(python-obj PRIVATE ${MBEDTLS_INCLUDE_DIRS}) endif() ######## Compose static and shared libraries ######## @@ -431,41 +427,39 @@ set_target_properties(uuid-shared PROPERTIES ) # Python client -if(UNIX OR WIN32) - set(client-python-lib-obj - $ - $ - $ - $ - ) - if(OC_SECURITY_ENABLED) - list(APPEND client-python-lib-obj $) - endif() - add_library(client-python-shared SHARED ${client-python-lib-obj}) - target_link_libraries(client-python-shared PRIVATE ${PRIVATE_LINK_LIBS}) - target_compile_definitions(client-python-shared PUBLIC - $ - $ - ) - target_include_directories(client-python-shared PUBLIC - $ - $ - ) - if(OC_SECURITY_ENABLED) - target_include_directories(client-python-shared PUBLIC "$") - endif() - - set_property(TARGET client-python-shared PROPERTY C_VISIBILITY_PRESET hidden) - set_property(TARGET client-python-shared PROPERTY VISIBILITY_INLINES_HIDDEN ON) - target_compile_definitions(client-python-shared PUBLIC OC_SHARED_LIBRARY) - set_target_properties(client-python-shared PROPERTIES DEFINE_SYMBOL "OC_SHARED_LIBRARY_EXPORTS") - set_target_properties(client-python-shared PROPERTIES - OUTPUT_NAME "iotivity-lite-client-python" - VERSION ${PROJECT_VERSION} - SOVERSION ${PROJECT_VERSION_MAJOR} - ) +set(client-python-lib-obj + $ + $ + $ + $ +) +if(OC_SECURITY_ENABLED) + list(APPEND client-python-lib-obj $) +endif() +add_library(client-python-shared SHARED ${client-python-lib-obj}) +target_link_libraries(client-python-shared PRIVATE ${PRIVATE_LINK_LIBS}) +target_compile_definitions(client-python-shared PUBLIC + $ + $ +) +target_include_directories(client-python-shared PUBLIC + $ + $ +) +if(OC_SECURITY_ENABLED) + target_include_directories(client-python-shared PUBLIC "$") endif() +set_property(TARGET client-python-shared PROPERTY C_VISIBILITY_PRESET hidden) +set_property(TARGET client-python-shared PROPERTY VISIBILITY_INLINES_HIDDEN ON) +target_compile_definitions(client-python-shared PUBLIC OC_SHARED_LIBRARY) +set_target_properties(client-python-shared PROPERTIES DEFINE_SYMBOL "OC_SHARED_LIBRARY_EXPORTS") +set_target_properties(client-python-shared PROPERTIES + OUTPUT_NAME "iotivity-lite-client-python" + VERSION ${PROJECT_VERSION} + SOVERSION ${PROJECT_VERSION_MAJOR} +) + ######## Units tests (UNIX only) ######## include(CTest) if(BUILD_TESTING AND UNIX)