<commit_before>cmake_minimum_required(VERSION 2.8)
project(sampgdk)

set(VERSION_MAJOR 0)
set(VERSION_MINOR 9)
set(VERSION_PATCH 9)
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})

include(CheckIncludeFile)

include_directories("include")

function(check_include_and_define include_file define)
	check_include_file(${include_file} HAVE_${include_file})
	if(HAVE_${include_file})
		add_definitions(-D${define})
	endif()
endfunction()

check_include_and_define(alloca.h HAVE_ALLOCA_H)
check_include_and_define(inttypes.h HAVE_ALLOCA_H)
check_include_and_define(malloc.h HAVE_ALLOCA_H)
check_include_and_define(stdint.h HAVE_ALLOCA_H)

if(UNIX)
	add_definitions(-DUNIX)
	if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
		add_definitions(-DLINUX)
	endif()
	if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
		add_definitions(-DFREEBSD)
	endif()
elseif(WIN32)
	add_definitions(-DWIN32 -D_WIN32)
endif()

set(SOURCES
	src/amxapihooks.cpp
	src/amxplugin.cpp
	src/callbacks.cpp
	src/eventhandler.cpp
	src/fakeamx.cpp
	src/funcidx.cpp
	src/gamemode.cpp
	src/gpci.cpp
	src/hooknative.cpp
	src/jump.cpp
	src/objects.cpp
	src/players.cpp
	src/samp.cpp
	src/vehicles.cpp
	src/wrapper.cpp
	src/wrapperimpl.cpp
)

add_library(sampgdk-shared SHARED ${SOURCES})
set_target_properties(sampgdk-shared PROPERTIES 
	OUTPUT_NAME "sampgdk"
	COMPILE_DEFINITIONS "IN_SAMPGDK"
	VERSION ${VERSION}
	SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR}
)
if(WIN32)
	set(DEF_FILE "${CMAKE_CURRENT_SOURCE_DIR}/src/sampgdk.def")
	if(MINGW)
		set_property(TARGET sampgdk-shared APPEND PROPERTY LINK_FLAGS "-Wl,--kill-at --def=${DEF_FILE}")
	else()
		set_property(TARGET sampgdk-shared APPEND PROPERTY LINK_FLAGS "/DEF:${DEF_FILE}")
	endif()
endif()

add_library(sampgdk-static STATIC ${SOURCES})
set_target_properties(sampgdk-static  PROPERTIES 
	COMPILE_DEFINITIONS "IN_SAMPGDK; SAMPGDK_STATIC")
if(WIN32 AND NOT MINGW)
	set_target_properties(sampgdk-static PROPERTIES OUTPUT_NAME "sampgdk_static")
else()
	set_target_properties(sampgdk-static PROPERTIES OUTPUT_NAME "sampgdk")
endif()

if(UNIX OR MINGW)
	set(CMAKE_CXX_FLAGS "-m32 -Wno-attributes")
endif()

install(TARGETS sampgdk-shared sampgdk-static
	RUNTIME DESTINATION "bin" COMPONENT runtime
	LIBRARY DESTINATION "lib" COMPONENT libraries
	ARCHIVE DESTINATION "lib" COMPONENT libraries
)

install(DIRECTORY "include" DESTINATION "." COMPONENT headers)

set(CPACK_PACKAGE_NAME sampgdk) 
set(CPACK_PACKAGE_VENDOR "Zeex")
set(CPACK_PACKAGE_CONTACT "<EMAIL>")
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "SA:MP Gamemode Development Kit for C++")
set(CPACK_RESOURCE_FILE_LICENSE ${CMAKE_CURRENT_SOURCE_DIR}/LICENSE)
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})
set(CPACK_PACKAGE_VERSION_PATCH ${VERSION_PATCH})
set(CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})
set(CPACK_NSIS_MODIFY_PATH ON)

set(CPACK_COMPONENT_RUNTIME_DISPLAY_NAME "Runtime")
set(CPACK_COMPONENT_RUNTIME_DESCRIPTION "Runtime library")
set(CPACK_COMPONENT_RUNTIME_INSTALL_TYPES "Full" "Runtime Only")
set(CPACK_COMPONENT_LIBRARIES_DISPLAY_NAME "Libraries")
set(CPACK_COMPONENT_LIBRARIES_DESCRIPTION "Static and import libraries")
set(CPACK_COMPONENT_LIBRARIES_GROUP "Development")
set(CPACK_COMPONENT_LIBRARIES_INSTALL_TYPES "Full")
set(CPACK_COMPONENT_HEADERS_DISPLAY_NAME "C++ headers")
set(CPACK_COMPONENT_HEADERS_DESCRIPTION "C++ header files for developers")
set(CPACK_COMPONENT_HEADERS_GROUP "Development")
set(CPACK_COMPONENT_HEADERS_INSTALL_TYPES "Full")
set(CPACK_COMPONENT_HEADERS_DEPENDS libraries)
set(CPACK_COMPONENT_SOURCES_DISPLAY_NAME "Source")
set(CPACK_COMPONENT_SOURCES_DESCRIPTION "Source code")
set(CPACK_COMPONENT_SOURCES_INSTALL_TYPES "Full")
<commit_msg>Delete CPack stuff<commit_after>cmake_minimum_required(VERSION 2.8)
project(sampgdk)

set(VERSION_MAJOR 0)
set(VERSION_MINOR 9)
set(VERSION_PATCH 9)
set(VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})

include(CheckIncludeFile)

include_directories("include")

function(check_include_and_define include_file define)
	check_include_file(${include_file} HAVE_${include_file})
	if(HAVE_${include_file})
		add_definitions(-D${define})
	endif()
endfunction()

check_include_and_define(alloca.h HAVE_ALLOCA_H)
check_include_and_define(inttypes.h HAVE_ALLOCA_H)
check_include_and_define(malloc.h HAVE_ALLOCA_H)
check_include_and_define(stdint.h HAVE_ALLOCA_H)

if(UNIX)
	add_definitions(-DUNIX)
	if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
		add_definitions(-DLINUX)
	endif()
	if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
		add_definitions(-DFREEBSD)
	endif()
elseif(WIN32)
	add_definitions(-DWIN32 -D_WIN32)
endif()

set(SOURCES
	src/amxapihooks.cpp
	src/amxplugin.cpp
	src/callbacks.cpp
	src/eventhandler.cpp
	src/fakeamx.cpp
	src/funcidx.cpp
	src/gamemode.cpp
	src/gpci.cpp
	src/hooknative.cpp
	src/jump.cpp
	src/objects.cpp
	src/players.cpp
	src/samp.cpp
	src/vehicles.cpp
	src/wrapper.cpp
	src/wrapperimpl.cpp
)

add_library(sampgdk-shared SHARED ${SOURCES})
set_target_properties(sampgdk-shared PROPERTIES 
	OUTPUT_NAME "sampgdk"
	COMPILE_DEFINITIONS "IN_SAMPGDK"
	VERSION ${VERSION}
	SOVERSION ${VERSION_MAJOR}.${VERSION_MINOR}
)
if(WIN32)
	set(DEF_FILE "${CMAKE_CURRENT_SOURCE_DIR}/src/sampgdk.def")
	if(MINGW)
		set_property(TARGET sampgdk-shared APPEND PROPERTY LINK_FLAGS "-Wl,--kill-at --def=${DEF_FILE}")
	else()
		set_property(TARGET sampgdk-shared APPEND PROPERTY LINK_FLAGS "/DEF:${DEF_FILE}")
	endif()
endif()

add_library(sampgdk-static STATIC ${SOURCES})
set_target_properties(sampgdk-static  PROPERTIES 
	COMPILE_DEFINITIONS "IN_SAMPGDK; SAMPGDK_STATIC")
if(WIN32 AND NOT MINGW)
	set_target_properties(sampgdk-static PROPERTIES OUTPUT_NAME "sampgdk_static")
else()
	set_target_properties(sampgdk-static PROPERTIES OUTPUT_NAME "sampgdk")
endif()

if(UNIX OR MINGW)
	set(CMAKE_CXX_FLAGS "-m32 -Wno-attributes")
endif()

install(TARGETS sampgdk-shared sampgdk-static
	RUNTIME DESTINATION "bin" COMPONENT runtime
	LIBRARY DESTINATION "lib" COMPONENT libraries
	ARCHIVE DESTINATION "lib" COMPONENT libraries
)

install(DIRECTORY "include" DESTINATION "." COMPONENT headers)

{'fraction_non_alphanumeric': 0.1052717747216765, 'fraction_numerical': 0.005566470203012442, 'mean_word_length': 8.427469135802468, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3044794', 'n_tokens_mistral': 2511, 'n_tokens_neox': 2408, 'n_words': 365}