Commit c068cfc7 authored by Ghislain MARY's avatar Ghislain MARY
Browse files

Link with appropriate frameworks when building with CMake for Mac OS X or iOS.

parent 41ffa88e
...@@ -123,6 +123,9 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") ...@@ -123,6 +123,9 @@ if ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")
elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") elseif ("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU")
add_definitions(-Wno-error=pragmas) add_definitions(-Wno-error=pragmas)
endif() endif()
if("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
set(LINK_FLAGS "${LINK_FLAGS} -framework CoreFoundation -framework CFNetwork")
endif("${CMAKE_SYSTEM_NAME}" MATCHES "Darwin")
add_subdirectory(include) add_subdirectory(include)
add_subdirectory(src) add_subdirectory(src)
......
...@@ -145,6 +145,7 @@ else(${ENABLE_STATIC}) ...@@ -145,6 +145,7 @@ else(${ENABLE_STATIC})
endif() endif()
endif(MSVC) endif(MSVC)
endif(${ENABLE_STATIC}) endif(${ENABLE_STATIC})
set_target_properties(bellesip PROPERTIES LINK_FLAGS ${LINK_FLAGS})
target_include_directories(bellesip PUBLIC ${INCLUDES}) target_include_directories(bellesip PUBLIC ${INCLUDES})
target_link_libraries(bellesip ${LIBS}) target_link_libraries(bellesip ${LIBS})
......
...@@ -40,6 +40,7 @@ set(TESTER_SOURCES ...@@ -40,6 +40,7 @@ set(TESTER_SOURCES
) )
add_executable(belle_sip_tester ${TESTER_SOURCES}) add_executable(belle_sip_tester ${TESTER_SOURCES})
set_target_properties(belle_sip_tester PROPERTIES LINK_FLAGS ${LINK_FLAGS})
target_include_directories(belle_sip_tester PUBLIC ${CUNIT_INCLUDE_DIR}) target_include_directories(belle_sip_tester PUBLIC ${CUNIT_INCLUDE_DIR})
target_link_libraries(belle_sip_tester ${CUNIT_LIBRARIES} bellesip) target_link_libraries(belle_sip_tester ${CUNIT_LIBRARIES} bellesip)
add_test(NAME belle_sip_tester COMMAND belle_sip_tester --verbose) add_test(NAME belle_sip_tester COMMAND belle_sip_tester --verbose)
...@@ -48,10 +49,13 @@ add_test(NAME belle_sip_tester COMMAND belle_sip_tester --verbose) ...@@ -48,10 +49,13 @@ add_test(NAME belle_sip_tester COMMAND belle_sip_tester --verbose)
set(OBJECT_DESCRIBE_SOURCES describe.c) set(OBJECT_DESCRIBE_SOURCES describe.c)
add_executable(belle_sip_object_describe ${OBJECT_DESCRIBE_SOURCES}) add_executable(belle_sip_object_describe ${OBJECT_DESCRIBE_SOURCES})
set_target_properties(belle_sip_object_describe PROPERTIES LINK_FLAGS ${LINK_FLAGS})
target_link_libraries(belle_sip_object_describe bellesip) target_link_libraries(belle_sip_object_describe bellesip)
set(PARSE_SOURCES parse.c) set(PARSE_SOURCES parse.c)
add_executable(belle_sip_parse ${PARSE_SOURCES}) add_executable(belle_sip_parse ${PARSE_SOURCES})
set_target_properties(belle_sip_parse PROPERTIES LINK_FLAGS ${LINK_FLAGS})
target_link_libraries(belle_sip_parse bellesip) target_link_libraries(belle_sip_parse bellesip)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment