<commit_before>cmake_minimum_required(VERSION 2.6)
project(netlicensing)

option (BUILD_TESTS "Build unit tests." TRUE)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

#find_package(JsonCpp REQUIRED)
find_package(CURL REQUIRED)

if (BUILD_TESTS)
	set(Boost_USE_STATIC_LIBS ON)
    find_package(Boost 1.40 REQUIRED unit_test_framework)    
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CURL_INCLUDE_DIRS})
include_directories(${JSONCPP_INCLUDE_DIRS})

set(LIBS ${LIBS} ${CURL_LIBRARIES} ${JSONCPP_LIBRARIES})

set(BUILD_SHARED_LIBS OFF)

add_definitions(-DCURL_STATICLIB)
if(UNIX)
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++0x")
endif()

# enumerate header and source files for library
file(GLOB headers include/netlicensing/*.h)
source_group(include FILES ${headers})
file(GLOB sources src/*.cc)

add_library(netlicensing ${headers} ${sources})
target_link_libraries(netlicensing ${LIBS})

# demo client 
file(GLOB client_demo_headers client_demo/${db2lp_component}/*h)
file(GLOB client_demo_sources client_demo/${db2lp_component}/*cc)
add_executable(netlicensing-client-demo ${client_demo_headers} ${client_demo_sources} )
target_link_libraries(netlicensing-client-demo netlicensing ${LIBS})

if (BUILD_TESTS)
    include_directories(${Boost_INCLUDE_DIR} )
    link_directories(${Boost_LIBRARY_DIRS})
    set(test_dir "${PROJECT_SOURCE_DIR}/tests")
    file(GLOB_RECURSE test_headers ${test_dir}/*h)
    file(GLOB_RECURSE test_sources ${test_dir}/*cc)
    add_executable(run_tests ${headers} ${test_headers} ${test_sources})
    set_target_properties(run_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY  ${test_dir})
    target_link_libraries(run_tests netlicensing ${LIBS})
    TARGET_LINK_LIBRARIES(run_tests ${Boost_LIBRARIES})
endif()

<commit_msg>Do not build unit tests by default<commit_after>cmake_minimum_required(VERSION 2.6)
project(netlicensing)

option (BUILD_TESTS "Build unit tests." FALSE)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")

#find_package(JsonCpp REQUIRED)
find_package(CURL REQUIRED)

if (BUILD_TESTS)
	set(Boost_USE_STATIC_LIBS ON)
    find_package(Boost 1.40 REQUIRED unit_test_framework)    
endif()

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(${CURL_INCLUDE_DIRS})
include_directories(${JSONCPP_INCLUDE_DIRS})

set(LIBS ${LIBS} ${CURL_LIBRARIES} ${JSONCPP_LIBRARIES})

set(BUILD_SHARED_LIBS OFF)

add_definitions(-DCURL_STATICLIB)
if(UNIX)
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=gnu++0x")
endif()

# enumerate header and source files for library
file(GLOB headers include/netlicensing/*.h)
source_group(include FILES ${headers})
file(GLOB sources src/*.cc)

add_library(netlicensing ${headers} ${sources})
target_link_libraries(netlicensing ${LIBS})

# demo client 
file(GLOB client_demo_headers client_demo/${db2lp_component}/*h)
file(GLOB client_demo_sources client_demo/${db2lp_component}/*cc)
add_executable(netlicensing-client-demo ${client_demo_headers} ${client_demo_sources} )
target_link_libraries(netlicensing-client-demo netlicensing ${LIBS})

if (BUILD_TESTS)
    include_directories(${Boost_INCLUDE_DIR} )
    link_directories(${Boost_LIBRARY_DIRS})
    set(test_dir "${PROJECT_SOURCE_DIR}/tests")
    file(GLOB_RECURSE test_headers ${test_dir}/*h)
    file(GLOB_RECURSE test_sources ${test_dir}/*cc)
    add_executable(run_tests ${headers} ${test_headers} ${test_sources})
    set_target_properties(run_tests PROPERTIES RUNTIME_OUTPUT_DIRECTORY  ${test_dir})
    target_link_libraries(run_tests netlicensing ${LIBS})
    TARGET_LINK_LIBRARIES(run_tests ${Boost_LIBRARIES})
endif()


{'fraction_non_alphanumeric': 0.11550976138828634, 'fraction_numerical': 0.004338394793926247, 'mean_word_length': 8.292191435768261, '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': '3252091', 'n_tokens_mistral': 1385, 'n_tokens_neox': 1315, 'n_words': 210}