diff options
-rw-r--r-- | libccnx-common/CMakeLists.txt | 49 | ||||
-rw-r--r-- | libccnx-common/ccnx/common/CMakeLists.txt | 37 | ||||
-rw-r--r-- | libccnx-portal/.gitignore | 1 | ||||
-rw-r--r-- | libccnx-portal/CMakeLists.txt | 61 | ||||
-rw-r--r-- | libccnx-portal/ccnx/api/ccnx_Portal/CMakeLists.txt | 36 | ||||
-rw-r--r-- | libccnx-transport-rta/CMakeLists.txt | 59 | ||||
-rw-r--r-- | libccnx-transport-rta/ccnx/api/control/CMakeLists.txt | 39 | ||||
-rw-r--r-- | libccnx-transport-rta/ccnx/api/notify/CMakeLists.txt | 42 | ||||
-rw-r--r-- | libccnx-transport-rta/ccnx/transport/CMakeLists.txt | 32 |
9 files changed, 239 insertions, 117 deletions
diff --git a/libccnx-common/CMakeLists.txt b/libccnx-common/CMakeLists.txt index ea15ce2a..940dad9a 100644 --- a/libccnx-common/CMakeLists.txt +++ b/libccnx-common/CMakeLists.txt @@ -6,6 +6,11 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) +if (NOT CMAKE_BUILD_TYPE) + message(STATUS "No build type selected, default to Release") + set(CMAKE_BUILD_TYPE "Release") +endif () + if( UNIX ) link_libraries(m) endif( UNIX ) @@ -20,9 +25,14 @@ if(ANDROID_API) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ANDROID_C_FLAGS} -Wall") else() # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -DNDEBUG -DLibccnx_DISABLE_VALIDATION") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") endif() +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} -DLibccnx_DISABLE_VALIDATION") +set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${CMAKE_C_FLAGS}") +set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${CMAKE_C_FLAGS}") + #set(CMAKE_C_FLAGS_NOPANTS "${CMAKE_C_FLAGS_NOPANTS} -O3 -DNDEBUG -DLibccnx_DISABLE_VALIDATION") include_directories(${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}/ccnx/common) @@ -30,20 +40,35 @@ include_directories(${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}/ccnx/common) include_directories($ENV{CCNX_DEPENDENCIES}/include) set(OPENSSL_ROOT_DIR $ENV{CCNX_DEPENDENCIES}) -find_package( LongBow REQUIRED ) -include_directories(${LONGBOW_INCLUDE_DIRS}) +if(COMPILE_FOR_IOS) + find_host_package( LongBow REQUIRED ) + include_directories(${LONGBOW_INCLUDE_DIRS}) + + find_host_package( LibEvent REQUIRED ) + include_directories(${LIBEVENT_INCLUDE_DIRS}) + + find_host_package( Libparc REQUIRED ) + include_directories(${LIBPARC_INCLUDE_DIRS}) + + find_host_package ( OpenSSL REQUIRED ) -find_package( LibEvent REQUIRED ) -include_directories(${LIBEVENT_INCLUDE_DIRS}) + find_host_package( Doxygen ) +else() + find_package( LongBow REQUIRED ) + include_directories(${LONGBOW_INCLUDE_DIRS}) + + find_package( LibEvent REQUIRED ) + include_directories(${LIBEVENT_INCLUDE_DIRS}) -find_package( Libparc REQUIRED ) -include_directories(${LIBPARC_INCLUDE_DIRS}) + find_package( Libparc REQUIRED ) + include_directories(${LIBPARC_INCLUDE_DIRS}) -find_package ( Threads REQUIRED ) + find_package ( Threads REQUIRED ) -find_package ( OpenSSL REQUIRED ) + find_package ( OpenSSL REQUIRED ) -find_package( Doxygen ) + find_package( Doxygen ) +endif() add_custom_target(${PROJECT_NAME}_cleanup_profiling_data "find" "." "-name" "*.gcda" "-delete" @@ -54,6 +79,10 @@ if (ANDROID_API) macro(AddTest testFile) message("Android build: Skipping test ${ARGV0}") endmacro(AddTest) +elseif(COMPILE_FOR_IOS) + macro(AddTest testFile) + message("iOS build: Skipping test ${ARGV0}") + endmacro(AddTest) else() macro(AddTest testFile) add_executable(${ARGV0} ${ARGV0}.c) diff --git a/libccnx-common/ccnx/common/CMakeLists.txt b/libccnx-common/ccnx/common/CMakeLists.txt index 81a7054e..f333a4ea 100644 --- a/libccnx-common/ccnx/common/CMakeLists.txt +++ b/libccnx-common/ccnx/common/CMakeLists.txt @@ -232,25 +232,32 @@ set(PUBLIC_HDRS configure_file("config.h.in" "config.h" @ONLY) -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR COMPILE_FOR_IOS) set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -undefined dynamic_lookup") message( "-- Set \"-undefined dynamic_lookup\" for shared libraries") endif() -add_library(ccnx_common STATIC ${ALL_SRCS} ${ALL_HDRS}) -add_library(ccnx_common.shared SHARED ${ALL_SRCS}) - -target_link_libraries(ccnx_common.shared ${LIBPARC_LIBRARIES}) -set_target_properties(ccnx_common.shared PROPERTIES - C_STANDARD 99 - SOVERSION 1 - VERSION 1.0 - OUTPUT_NAME ccnx_common ) - -set(libccnx_commonLibraries - ccnx_common - ccnx_common.shared - ) +if(COMPILE_FOR_IOS OR ANDROID_API) + add_library(ccnx_common STATIC ${ALL_SRCS} ${ALL_HDRS}) + set(libccnx_commonLibraries + ccnx_common + ) +else() + add_library(ccnx_common STATIC ${ALL_SRCS} ${ALL_HDRS}) + add_library(ccnx_common.shared SHARED ${ALL_SRCS}) + + target_link_libraries(ccnx_common.shared ${LIBPARC_LIBRARIES}) + set_target_properties(ccnx_common.shared PROPERTIES + C_STANDARD 99 + SOVERSION 1 + VERSION 1.0 + OUTPUT_NAME ccnx_common ) + + set(libccnx_commonLibraries + ccnx_common + ccnx_common.shared + ) +endif() foreach(lib ${libccnx_commonLibraries}) install(TARGETS ${lib} COMPONENT library LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) diff --git a/libccnx-portal/.gitignore b/libccnx-portal/.gitignore index 140cd67b..2cacf631 100644 --- a/libccnx-portal/.gitignore +++ b/libccnx-portal/.gitignore @@ -27,6 +27,7 @@ config.status .dirstamp Makefile stamp-h1 +.DS_Store transport/common/test/test_keyvalue transport/transport_rta/test/test_multi_connections diff --git a/libccnx-portal/CMakeLists.txt b/libccnx-portal/CMakeLists.txt index b11249ef..c911a716 100644 --- a/libccnx-portal/CMakeLists.txt +++ b/libccnx-portal/CMakeLists.txt @@ -7,6 +7,11 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON) set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) +if (NOT CMAKE_BUILD_TYPE) + message(STATUS "No build type selected, default to Release") + set(CMAKE_BUILD_TYPE "Release") +endif () + set(CMAKE_POSITION_INDEPENDENT_CODE ON) if( UNIX ) @@ -23,35 +28,57 @@ if(ANDROID_API) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ANDROID_C_FLAGS} -Wall") else() #set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -DNDEBUG -DLibccnx_Portal_DISABLE_VALIDATION") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") find_package( Doxygen ) endif() -#set(CMAKE_C_FLAGS_NOPANTS "${CMAKE_C_FLAGS_NOPANTS} -O3 -DNDEBUG -DLibccnx_Portal_DISABLE_VALIDATION") + +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} -DLibccnx_Portal_DISABLE_VALIDATION") +set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${CMAKE_C_FLAGS}") +set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${CMAKE_C_FLAGS}") include_directories(${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR}/ccnx/api/ccnx_Portal) include_directories($ENV{CCNX_DEPENDENCIES}/include) set(OPENSSL_ROOT_DIR $ENV{CCNX_DEPENDENCIES}) +if(COMPILE_FOR_IOS) + find_host_package( LongBow REQUIRED ) + include_directories(${LONGBOW_INCLUDE_DIRS}) + + find_host_package( LibEvent REQUIRED ) + include_directories(${LIBEVENT_INCLUDE_DIRS}) + + find_host_package( Libparc REQUIRED ) + include_directories(${LIBPARC_INCLUDE_DIRS}) + + find_host_package( CCNX_Common REQUIRED ) + include_directories(${CCNX_COMMON_INCLUDE_DIRS}) -find_package( LongBow REQUIRED ) -include_directories(${LONGBOW_INCLUDE_DIRS}) + find_host_package( CCNX_Transport_Rta REQUIRED ) + include_directories(${CCNX_TRANSPORT_RTA_INCLUDE_DIRS}) -find_package( LibEvent REQUIRED ) -include_directories(${LIBEVENT_INCLUDE_DIRS}) + find_host_package ( OpenSSL REQUIRED ) +else() + find_package( LongBow REQUIRED ) + include_directories(${LONGBOW_INCLUDE_DIRS}) + + find_package( LibEvent REQUIRED ) + include_directories(${LIBEVENT_INCLUDE_DIRS}) -find_package( Libparc REQUIRED ) -include_directories(${LIBPARC_INCLUDE_DIRS}) + find_package( Libparc REQUIRED ) + include_directories(${LIBPARC_INCLUDE_DIRS}) -find_package( CCNX_Common REQUIRED ) -include_directories(${CCNX_COMMON_INCLUDE_DIRS}) + find_package( CCNX_Common REQUIRED ) + include_directories(${CCNX_COMMON_INCLUDE_DIRS}) -find_package( CCNX_Transport_Rta REQUIRED ) -include_directories(${CCNX_TRANSPORT_RTA_INCLUDE_DIRS}) + find_package( CCNX_Transport_Rta REQUIRED ) + include_directories(${CCNX_TRANSPORT_RTA_INCLUDE_DIRS}) -find_package ( Threads REQUIRED ) + find_package ( Threads REQUIRED ) -find_package ( OpenSSL REQUIRED ) + find_package ( OpenSSL REQUIRED ) +endif() set(CCNX_LINK_LIBRARIES @@ -71,6 +98,10 @@ if (ANDROID_API) macro(AddTest testFile) message("Android build: Skipping test ${ARGV0}") endmacro(AddTest) +elseif(COMPILE_FOR_IOS) + macro(AddTest testFile) + message("iOS build: Skipping test ${ARGV0}") + endmacro(AddTest) else() macro(AddTest testFile) add_executable(${ARGV0} ${ARGV0}.c) @@ -80,7 +111,7 @@ else() endmacro(AddTest) endif() -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR COMPILE_FOR_IOS) set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -undefined dynamic_lookup") message( "-- Set \"-undefined dynamic_lookup\" for shared libraries") endif() diff --git a/libccnx-portal/ccnx/api/ccnx_Portal/CMakeLists.txt b/libccnx-portal/ccnx/api/ccnx_Portal/CMakeLists.txt index a7d9e8dd..e54cfe56 100644 --- a/libccnx-portal/ccnx/api/ccnx_Portal/CMakeLists.txt +++ b/libccnx-portal/ccnx/api/ccnx_Portal/CMakeLists.txt @@ -28,18 +28,24 @@ set(CCNX_API_PORTAL_SOURCE_FILES source_group(Sources FILES ${CCNX_API_PORTAL_SOURCE_FILES}) source_group(Sources FILES ${CCNX_API_PORTAL_HEADERS}) -add_library(ccnx_api_portal STATIC ${CCNX_API_PORTAL_SOURCE_FILES} ${CCNX_API_PORTAL_HEADER_FILES}) -add_library(ccnx_api_portal.shared SHARED ${CCNX_API_PORTAL_SOURCE_FILES}) -set_target_properties(ccnx_api_portal.shared PROPERTIES - C_STANDARD 99 - SOVERSION 1 - VERSION 1.0 - OUTPUT_NAME ccnx_api_portal ) - -set(libccnx_api_portal_libraries - ccnx_api_portal - ccnx_api_portal.shared - ) +if(COMPILE_FOR_IOS OR ANDROID_API) + add_library(ccnx_api_portal STATIC ${CCNX_API_PORTAL_SOURCE_FILES} ${CCNX_API_PORTAL_HEADER_FILES}) + set(libccnx_api_portal_libraries + ccnx_api_portal + ) +else() + add_library(ccnx_api_portal STATIC ${CCNX_API_PORTAL_SOURCE_FILES} ${CCNX_API_PORTAL_HEADER_FILES}) + add_library(ccnx_api_portal.shared SHARED ${CCNX_API_PORTAL_SOURCE_FILES}) + set_target_properties(ccnx_api_portal.shared PROPERTIES + C_STANDARD 99 + SOVERSION 1 + VERSION 1.0 + OUTPUT_NAME ccnx_api_portal ) + set(libccnx_api_portal_libraries + ccnx_api_portal + ccnx_api_portal.shared + ) +endif() foreach(lib ${libccnx_api_portal_libraries}) install(TARGETS ${lib} COMPONENT library LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) @@ -48,5 +54,7 @@ endforeach() install(FILES ${CCNX_API_PORTAL_HEADERS} DESTINATION include/ccnx/api/ccnx_Portal COMPONENT headers) -add_subdirectory(test) -add_subdirectory(command-line) +if (NOT COMPILE_FOR_IOS AND NOT ANDROID_API) + add_subdirectory(test) + add_subdirectory(command-line) +endif() diff --git a/libccnx-transport-rta/CMakeLists.txt b/libccnx-transport-rta/CMakeLists.txt index 6061ee7e..998e0c27 100644 --- a/libccnx-transport-rta/CMakeLists.txt +++ b/libccnx-transport-rta/CMakeLists.txt @@ -5,6 +5,11 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") set(CMAKE_C_STANDARD 99) set(CMAKE_C_STANDARD_REQUIRED ON) +if (NOT CMAKE_BUILD_TYPE) + message(STATUS "No build type selected, default to Release") + set(CMAKE_BUILD_TYPE "Release") +endif () + set_property(GLOBAL PROPERTY USE_FOLDERS ON) if( UNIX ) @@ -21,38 +26,64 @@ if(ANDROID_API) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ANDROID_C_FLAGS} -Wall") else() # set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall") - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -DNDEBUG -DCCNxTransport_DISABLE_VALIDATION -DLIBRTA_DISABLE_VALIDATION -DTransportLibrary_DISABLE_VALIDATION") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS}") endif() -#set(CMAKE_C_FLAGS_NOPANTS "${CMAKE_C_FLAGS_NOPANTS} -O3 -DNDEBUG -DCCNxTransport_DISABLE_VALIDATION -DLIBRTA_DISABLE_VALIDATION -DTransportLibrary_DISABLE_VALIDATION") +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${CMAKE_C_FLAGS}") +set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${CMAKE_C_FLAGS} -DCCNxTransport_DISABLE_VALIDATION -DLIBRTA_DISABLE_VALIDATION -DTransportLibrary_DISABLE_VALIDATION") +set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} ${CMAKE_C_FLAGS}") +set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS_MINSIZEREL} ${CMAKE_C_FLAGS}") include_directories(${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/ccnx/transport/transport_rta ${PROJECT_BINARY_DIR}/ccnx) include_directories($ENV{CCNX_DEPENDENCIES}/include) set(OPENSSL_ROOT_DIR $ENV{CCNX_DEPENDENCIES}) -find_package( LongBow REQUIRED ) -include_directories(${LONGBOW_INCLUDE_DIRS}) +if(COMPILE_FOR_IOS) + find_host_package( LongBow REQUIRED ) + include_directories(${LONGBOW_INCLUDE_DIRS}) + + find_host_package( LibEvent REQUIRED ) + include_directories(${LIBEVENT_INCLUDE_DIRS}) + + find_host_package( Libparc REQUIRED ) + include_directories(${LIBPARC_INCLUDE_DIRS}) + + find_host_package( CCNX_Common REQUIRED ) + include_directories(${CCNX_COMMON_INCLUDE_DIRS}) + + find_host_package ( OpenSSL REQUIRED ) -find_package( LibEvent REQUIRED ) -include_directories(${LIBEVENT_INCLUDE_DIRS}) + find_host_package( Doxygen ) +else() + find_package( LongBow REQUIRED ) + include_directories(${LONGBOW_INCLUDE_DIRS}) + + find_package( LibEvent REQUIRED ) + include_directories(${LIBEVENT_INCLUDE_DIRS}) -find_package( Libparc REQUIRED ) -include_directories(${LIBPARC_INCLUDE_DIRS}) + find_package( Libparc REQUIRED ) + include_directories(${LIBPARC_INCLUDE_DIRS}) -find_package( CCNX_Common REQUIRED ) -include_directories(${CCNX_COMMON_INCLUDE_DIRS}) + find_package( CCNX_Common REQUIRED ) + include_directories(${CCNX_COMMON_INCLUDE_DIRS}) -find_package ( Threads REQUIRED ) + find_package ( Threads REQUIRED ) -find_package ( OpenSSL REQUIRED ) + find_package ( OpenSSL REQUIRED ) -find_package( Doxygen ) + find_package( Doxygen ) + +endif() if (ANDROID_API) macro(AddTest testFile) message("Android build: Skipping test ${ARGV0}") endmacro(AddTest) +elseif(COMPILE_FOR_IOS) + macro(AddTest testFile) + message("iOS build: Skipping test ${ARGV0}") + endmacro(AddTest) else() macro(AddTest testFile) add_executable(${ARGV0} ${ARGV0}.c) @@ -70,7 +101,7 @@ else() endmacro(AddTest) endif() -if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang") +if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "AppleClang" OR COMPILE_FOR_IOS) set(CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_C_FLAGS} -undefined dynamic_lookup") message( "-- Set \"-undefined dynamic_lookup\" for shared libraries") endif() diff --git a/libccnx-transport-rta/ccnx/api/control/CMakeLists.txt b/libccnx-transport-rta/ccnx/api/control/CMakeLists.txt index 741bec7d..28928e15 100644 --- a/libccnx-transport-rta/ccnx/api/control/CMakeLists.txt +++ b/libccnx-transport-rta/ccnx/api/control/CMakeLists.txt @@ -63,23 +63,28 @@ set(CCNX_API_CONTROL_SOURCE_FILES controlPlaneInterface.c ) - -add_library(ccnx_api_control STATIC ${CCNX_API_CONTROL_SOURCE_FILES} ${CCNX_API_CONTROL_HEADERS}) -add_library(ccnx_api_control.shared SHARED ${CCNX_API_CONTROL_SOURCE_FILES}) - -source_group(Sources FILES ${CCNX_API_CONTROL_SOURCE_FILES}) -source_group(Sources FILES ${CCNX_API_CONTROL_HEADERS}) - -set_target_properties(ccnx_api_control.shared PROPERTIES - C_STANDARD 99 - SOVERSION 1 - VERSION 1.0 - OUTPUT_NAME ccnx_api_control ) - -set(libccnx_api_control_libraries - ccnx_api_control - ccnx_api_control.shared - ) +if(COMPILE_FOR_IOS OR ANDROID_API) + add_library(ccnx_api_control STATIC ${CCNX_API_CONTROL_SOURCE_FILES} ${CCNX_API_CONTROL_HEADERS}) + source_group(Sources FILES ${CCNX_API_CONTROL_SOURCE_FILES}) + source_group(Sources FILES ${CCNX_API_CONTROL_HEADERS}) + set(libccnx_api_control_libraries + ccnx_api_control + ) +else() + add_library(ccnx_api_control STATIC ${CCNX_API_CONTROL_SOURCE_FILES} ${CCNX_API_CONTROL_HEADERS}) + add_library(ccnx_api_control.shared SHARED ${CCNX_API_CONTROL_SOURCE_FILES}) + source_group(Sources FILES ${CCNX_API_CONTROL_SOURCE_FILES}) + source_group(Sources FILES ${CCNX_API_CONTROL_HEADERS}) + set_target_properties(ccnx_api_control.shared PROPERTIES + C_STANDARD 99 + SOVERSION 1 + VERSION 1.0 + OUTPUT_NAME ccnx_api_control ) + set(libccnx_api_control_libraries + ccnx_api_control + ccnx_api_control.shared + ) +endif() foreach(lib ${libccnx_api_control_libraries}) install(TARGETS ${lib} COMPONENT library LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) diff --git a/libccnx-transport-rta/ccnx/api/notify/CMakeLists.txt b/libccnx-transport-rta/ccnx/api/notify/CMakeLists.txt index 10d4065d..c0fff823 100644 --- a/libccnx-transport-rta/ccnx/api/notify/CMakeLists.txt +++ b/libccnx-transport-rta/ccnx/api/notify/CMakeLists.txt @@ -11,24 +11,30 @@ set(CCNX_API_NOTIFY_SOURCE_FILES notify_Status.c ) - -add_library(ccnx_api_notify STATIC ${CCNX_API_NOTIFY_SOURCE_FILES} ${CCNX_API_NOTIFY_HEADERS}) -add_library(ccnx_api_notify.shared SHARED ${CCNX_API_NOTIFY_SOURCE_FILES}) - -source_group(Sources FILES ${CCNX_API_NOTIFY_SOURCE_FILES}) -source_group(Sources FILES ${CCNX_API_NOTIFY_HEADERS}) - -set_target_properties(ccnx_api_notify.shared PROPERTIES - C_STANDARD 99 - SOVERSION 1 - VERSION 1.0 - OUTPUT_NAME ccnx_api_notify ) - -set(libccnx_api_notify_libraries - ccnx_api_notify - ccnx_api_notify.shared - ) - +if(COMPILE_FOR_IOS OR ANDROID_API) + add_library(ccnx_api_notify STATIC ${CCNX_API_NOTIFY_SOURCE_FILES} ${CCNX_API_NOTIFY_HEADERS}) + source_group(Sources FILES ${CCNX_API_NOTIFY_SOURCE_FILES}) + source_group(Sources FILES ${CCNX_API_NOTIFY_HEADERS}) + + set(libccnx_api_notify_libraries + ccnx_api_notify + ) +else() + add_library(ccnx_api_notify STATIC ${CCNX_API_NOTIFY_SOURCE_FILES} ${CCNX_API_NOTIFY_HEADERS}) + add_library(ccnx_api_notify.shared SHARED ${CCNX_API_NOTIFY_SOURCE_FILES}) + source_group(Sources FILES ${CCNX_API_NOTIFY_SOURCE_FILES}) + source_group(Sources FILES ${CCNX_API_NOTIFY_HEADERS}) + + set_target_properties(ccnx_api_notify.shared PROPERTIES + C_STANDARD 99 + SOVERSION 1 + VERSION 1.0 + OUTPUT_NAME ccnx_api_notify ) + set(libccnx_api_notify_libraries + ccnx_api_notify + ccnx_api_notify.shared + ) +endif() foreach(lib ${libccnx_api_notify_libraries}) install(TARGETS ${lib} COMPONENT library LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) set_property(TARGET ${lib} PROPERTY C_STANDARD 99) diff --git a/libccnx-transport-rta/ccnx/transport/CMakeLists.txt b/libccnx-transport-rta/ccnx/transport/CMakeLists.txt index 119826cb..a1416ea1 100644 --- a/libccnx-transport-rta/ccnx/transport/CMakeLists.txt +++ b/libccnx-transport-rta/ccnx/transport/CMakeLists.txt @@ -181,20 +181,24 @@ set(TRANSPORT_RTA_SOURCE_FILES ${RTA_COMMANDS_SRCS} ) -add_library(ccnx_transport_rta STATIC ${TRANSPORT_RTA_SOURCE_FILES}) -add_library(ccnx_transport_rta.shared SHARED ${TRANSPORT_RTA_SOURCE_FILES}) - -set_target_properties(ccnx_transport_rta.shared PROPERTIES - C_STANDARD 99 - SOVERSION 1 - VERSION 1.0 - OUTPUT_NAME ccnx_transport_rta ) - -set(libccnx_transport_rta_libraries - ccnx_transport_rta - ccnx_transport_rta.shared - ) - +if(COMPILE_FOR_IOS OR ANDROID_API) + add_library(ccnx_transport_rta STATIC ${TRANSPORT_RTA_SOURCE_FILES}) + set(libccnx_transport_rta_libraries + ccnx_transport_rta + ) +else() + add_library(ccnx_transport_rta STATIC ${TRANSPORT_RTA_SOURCE_FILES}) + add_library(ccnx_transport_rta.shared SHARED ${TRANSPORT_RTA_SOURCE_FILES}) + set_target_properties(ccnx_transport_rta.shared PROPERTIES + C_STANDARD 99 + SOVERSION 1 + VERSION 1.0 + OUTPUT_NAME ccnx_transport_rta ) + set(libccnx_transport_rta_libraries + ccnx_transport_rta + ccnx_transport_rta.shared + ) +endif() foreach(lib ${libccnx_transport_rta_libraries}) install(TARGETS ${lib} COMPONENT library LIBRARY DESTINATION lib ARCHIVE DESTINATION lib) set_property(TARGET ${lib} PROPERTY C_STANDARD 99) |