Commit 8e192159 authored by Ghislain MARY's avatar Ghislain MARY

CMake fixes for static library build.

parent 15996291
......@@ -129,9 +129,9 @@ include(CMakePackageConfigHelpers)
export(EXPORT ${EXPORT_TARGETS_NAME}Targets
FILE "${CMAKE_CURRENT_BINARY_DIR}/BelrTargets.cmake"
)
configure_file(cmake/BelrConfig.cmake
"${CMAKE_CURRENT_BINARY_DIR}/BelrConfig.cmake"
COPYONLY
configure_file(cmake/BelrConfig.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/BelrConfig.cmake"
@ONLY
)
set(ConfigPackageLocation share/Belr/cmake)
install(EXPORT ${EXPORT_TARGETS_NAME}Targets
......@@ -139,6 +139,6 @@ install(EXPORT ${EXPORT_TARGETS_NAME}Targets
DESTINATION ${ConfigPackageLocation}
)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/BelrConfig.cmake"
DESTINATION ${ConfigPackageLocation}
"${CMAKE_CURRENT_BINARY_DIR}/BelrConfig.cmake"
DESTINATION ${ConfigPackageLocation}
)
......@@ -37,5 +37,11 @@ if(LINPHONE_BUILDER_GROUP_EXTERNAL_SOURCE_PATH_BUILDERS)
else()
set(BELR_INCLUDE_DIRS "${BELR_CMAKE_DIR}/../../../include")
endif()
set(BELR_LIBRARIES belr)
if(@ENABLE_SHARED@)
set(BELR_LIBRARIES belr)
else()
set(BELR_LIBRARIES belr-static)
endif()
set(BELR_FOUND 1)
......@@ -20,12 +20,18 @@
#
############################################################################
if(ENABLE_SHARED)
set(BELR_LIBRARIES_FOR_TOOLS belr)
else()
set(BELR_LIBRARIES_FOR_TOOLS belr-static)
endif()
foreach(EXECTUABLE belr-parse belr-demo)
set(SOURCE_FILES_CXX ${EXECTUABLE}.cc)
apply_compile_flags(SOURCE_FILES_CXX "CPP" "CXX")
add_executable(${EXECTUABLE} ${SOURCE_FILES_CXX})
set_target_properties(${EXECTUABLE} PROPERTIES LINKER_LANGUAGE CXX)
target_link_libraries(${EXECTUABLE} belr)
target_link_libraries(${EXECTUABLE} ${BELR_LIBRARIES_FOR_TOOLS})
if(APPLE)
set_target_properties(${EXECTUABLE} PROPERTIES LINK_FLAGS "-stdlib=libc++")
endif()
......
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