Make it possible to build an OS X framework

This commit is contained in:
Lukáš Lalinský
2011-05-08 15:46:19 +02:00
parent b2e3a477e9
commit c337694165
3 changed files with 17 additions and 4 deletions

View File

@ -21,14 +21,17 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/taglib_c.pc.cmake ${CMAKE_CURRENT_BIN
set(tag_c_HDRS tag_c.h)
if(ENABLE_STATIC)
add_library(tag_c STATIC tag_c.cpp)
add_library(tag_c STATIC tag_c.cpp ${tag_c_HDRS})
set_target_properties(tag_c PROPERTIES COMPILE_DEFINITIONS TAGLIB_STATIC)
else()
add_library(tag_c SHARED tag_c.cpp)
add_library(tag_c SHARED tag_c.cpp ${tag_c_HDRS})
endif()
target_link_libraries(tag_c tag)
set_target_properties(tag_c PROPERTIES PUBLIC_HEADER "${tag_c_HDRS}")
if(BUILD_FRAMEWORK)
set_target_properties(tag_c PROPERTIES FRAMEWORK TRUE)
endif()
# On Solaris we need to explicitly add the C++ standard and runtime
# libraries to the libs used by the C bindings, because those C bindings
@ -58,6 +61,7 @@ set_target_properties(tag_c PROPERTIES
INSTALL_NAME_DIR ${LIB_INSTALL_DIR}
)
install(TARGETS tag_c
FRAMEWORK DESTINATION ${FRAMEWORK_INSTALL_DIR}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
RUNTIME DESTINATION ${BIN_INSTALL_DIR}
ARCHIVE DESTINATION ${LIB_INSTALL_DIR}