<commit_before>############################################################################
# CMakeLists.txt
# Copyright (C) 2014  Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
############################################################################

set(LIBS ${CMAKE_THREAD_LIBS_INIT})
if(HAVE_RT)
	list(APPEND LIBS rt)
endif()

set(ORTP_SOURCE_FILES
	${ORTP_HEADER_FILES}
	avprofile.c
	b64.c
	event.c
	extremum.c
	jitterctl.c
	logging.c
	netsim.c
	ortp.c
	payloadtype.c
	port.c
	posixtimer.c
	rtcp.c
	rtcp_fb.c
	rtcp_xr.c
	rtcpparse.c
	rtpparse.c
	rtpprofile.c
	rtpsession.c
	rtpsession_inet.c
	rtpsignaltable.c
	rtptimer.c
	scheduler.c
	sessionset.c
	str_utils.c
	telephonyevents.c
	utils.c
)

if(WIN32)
	list(APPEND ORTP_SOURCE_FILES dll_entry.c)
	if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone")
		list(APPEND ORTP_SOURCE_FILES winrttimer.cpp winrttimer.h)
		set_source_files_properties(winrttimer.cpp PROPERTIES COMPILE_FLAGS "/ZW /AI\$(WindowsSDK_MetadataPath)")
	endif()
endif()

add_definitions(
	-DORTP_EXPORTS
)

if(WIN32)
	add_definitions(-DWINDOWS_NATIVE)
	list(APPEND LIBS ws2_32)
	if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone")
		list(APPEND LIBS delayimp Winmm Qwave)
	endif()
endif()

if(ENABLE_STATIC)
	add_library(ortp STATIC ${ORTP_SOURCE_FILES})
	target_link_libraries(ortp ${LIBS})
else()
	add_library(ortp SHARED ${ORTP_SOURCE_FILES})
	set_target_properties(ortp PROPERTIES VERSION ${ORTP_SO_VERSION})
	target_link_libraries(ortp ${LIBS})
	if(MSVC)
		if(CMAKE_BUILD_TYPE STREQUAL "Debug")
			install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/ortp.pdb
				DESTINATION bin
				PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
			)
		endif()
	endif()
endif()

install(TARGETS ortp EXPORT ${EXPORT_TARGETS_NAME}Targets
	RUNTIME DESTINATION bin<commit_msg>Improve header files handling in CMake.<commit_after>############################################################################
# CMakeLists.txt
# Copyright (C) 2014  Belledonne Communications, Grenoble France
#
############################################################################
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
#
############################################################################

set(LIBS ${CMAKE_THREAD_LIBS_INIT})
if(HAVE_RT)
	list(APPEND LIBS rt)
endif()

set(ORTP_SOURCE_FILES
	avprofile.c
	b64.c
	event.c
	extremum.c
	jitterctl.c
	logging.c
	netsim.c
	ortp.c
	payloadtype.c
	port.c
	posixtimer.c
	rtcp.c
	rtcp_fb.c
	rtcp_xr.c
	rtcpparse.c
	rtpparse.c
	rtpprofile.c
	rtpsession.c
	rtpsession_inet.c
	rtpsignaltable.c
	rtptimer.c
	scheduler.c
	sessionset.c
	str_utils.c
	telephonyevents.c
	utils.c
)

if(WIN32)
	list(APPEND ORTP_SOURCE_FILES dll_entry.c)
	if("${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone")
		list(APPEND ORTP_SOURCE_FILES winrttimer.cpp winrttimer.h)
		set_source_files_properties(winrttimer.cpp PROPERTIES COMPILE_FLAGS "/ZW /AI\$(WindowsSDK_MetadataPath)")
	endif()
endif()

add_definitions(
	-DORTP_EXPORTS
)

if(WIN32)
	add_definitions(-DWINDOWS_NATIVE)
	list(APPEND LIBS ws2_32)
	if(NOT "${CMAKE_SYSTEM_NAME}" STREQUAL "WindowsPhone")
		list(APPEND LIBS delayimp Winmm Qwave)
	endif()
endif()

if(ENABLE_STATIC)
	add_library(ortp STATIC ${ORTP_HEADER_FILES} ${ORTP_SOURCE_FILES})
	target_link_libraries(ortp ${LIBS})
else()
	add_library(ortp SHARED ${ORTP_HEADER_FILES} ${ORTP_SOURCE_FILES})
	set_target_properties(ortp PROPERTIES VERSION ${ORTP_SO_VERSION})
	target_link_libraries(ortp ${LIBS})
	if(MSVC)
		if(CMAKE_BUILD_TYPE STREQUAL "Debug")
			install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Debug/ortp.pdb
				DESTINATION bin
				PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
			)
		endif()
	endif()
endif()

install(TARGETS ortp EXPORT ${EXPORT_TARGETS_NAME}Targets
	RUNTIME DESTINATION bin
{'fraction_non_alphanumeric': 0.1628171147292692, 'fraction_numerical': 0.010602044680045438, 'mean_word_length': 5.834411384217335, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2085153', 'n_tokens_mistral': 1954, 'n_tokens_neox': 1797, 'n_words': 475}