<commit_before>cmake_minimum_required(VERSION 3.0)

include_directories( ${CMAKE_CURRENT_SOURCE_DIR} )

project( QPOISSON_RECON_LIB )

#to remove very annoying "NO ARGUMENTS THAT DEPEND ON A TEMPLATE PARAMETER" errors with G++!
if( UNIX OR MINGW )
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive -w")
elseif( MSVC )
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /bigobj")
endif()

set( SAMPLE_PROJECT_VERSION_MAJOR 12 )
set( SAMPLE_PROJECT_VERSION_MINOR 0 )

file( GLOB header_list Src_CC_wrap/*.h )
file( GLOB source_list Src_CC_wrap/*.cpp )

add_library( ${PROJECT_NAME} STATIC ${header_list} ${source_list} )

target_include_directories( ${PROJECT_NAME} PRIVATE Src )

# Add preprocessor definitions
target_compile_definitions( ${PROJECT_NAME} PRIVATE _CRT_SECURE_NO_DEPRECATE _CRT_SECURE_NO_WARNINGS NOMINMAX )

option( POISSON_RECON_WITH_OPEN_MP "Check to compile PoissonRecon plugin with OpenMP support" OFF )
if ( POISSON_RECON_WITH_OPEN_MP )
	find_package(OpenMP)
	if (OPENMP_FOUND)
		set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
		set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
		target_compile_definitions( ${PROJECT_NAME} PRIVATE WITH_OPENMP )
	endif()
endif ()<commit_msg>{cmake} Update to use targets properly (#9)<commit_after>cmake_minimum_required( VERSION 3.10 )

project( QPOISSON_RECON_LIB )

add_library( ${PROJECT_NAME} STATIC )

# To remove very annoying "NO ARGUMENTS THAT DEPEND ON A TEMPLATE PARAMETER" errors with G++!
if( UNIX OR MINGW )
	target_compile_options( ${PROJECT_NAME} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-fpermissive -w> )
elseif( MSVC )
	target_compile_options( ${PROJECT_NAME} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:/bigobj> )
endif()

target_sources( ${PROJECT_NAME}
	PUBLIC
		${CMAKE_CURRENT_SOURCE_DIR}/Src_CC_wrap/PoissonReconLib.h
		${CMAKE_CURRENT_SOURCE_DIR}/Src_CC_wrap/PointData.h
	PRIVATE
		${CMAKE_CURRENT_SOURCE_DIR}/Src_CC_wrap/PoissonReconLib.cpp
		${CMAKE_CURRENT_SOURCE_DIR}/Src_CC_wrap/PointData.cpp
)

target_include_directories( ${PROJECT_NAME}
	PUBLIC
		${CMAKE_CURRENT_SOURCE_DIR}/Src_CC_wrap
	PRIVATE
		${CMAKE_CURRENT_SOURCE_DIR}/Src
)

target_compile_definitions( ${PROJECT_NAME}
	PRIVATE
		_CRT_SECURE_NO_DEPRECATE
		_CRT_SECURE_NO_WARNINGS
		NOMINMAX
)

option( POISSON_RECON_WITH_OPEN_MP "Compile PoissonRecon plugin with OpenMP support" OFF )
if( POISSON_RECON_WITH_OPEN_MP )
	find_package( OpenMP )
	
	if( OpenMP_CXX_FOUND ) 
		target_link_libraries( ${PROJECT_NAME} PUBLIC OpenMP::OpenMP_CXX )
		target_compile_definitions( ${PROJECT_NAME} PRIVATE WITH_OPENMP )
	endif()
endif ()
{'fraction_non_alphanumeric': 0.09662398137369034, 'fraction_numerical': 0.0034924330616996507, 'mean_word_length': 7.184126984126984, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1300250', 'n_tokens_mistral': 1061, 'n_tokens_neox': 990, 'n_words': 187}