<commit_before>#
# $Id$
#
# Created 2013/05/19
# Author: <NAME>
#
# Copyright 2013 Quantcast Corp.
#
# This file is part of Kosmos File System (KFS).
#
# Licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing
# permissions and limitations under the License.
#
#

set (sources
KrbService.cc
KrbClient.cc
)

#
# Build a static and a dynamically linked libraries.  Both libraries
# should have the same root name, but installed in different places
#
add_library (qfskrb STATIC ${sources})
add_library (qfskrb-shared SHARED ${sources})
set_target_properties (qfskrb-shared PROPERTIES OUTPUT_NAME "qfskrb")
set_target_properties (qfskrb PROPERTIES OUTPUT_NAME "qfskrb")

#
# Since the objects have to be built twice, set this up so they don't
# clobber each other.

set_target_properties (qfskrb PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set_target_properties (qfskrb-shared PROPERTIES CLEAN_DIRECT_OUTPUT 1)
target_link_libraries (qfskrb ${Boost_LIBRARIES} krb5)

add_executable (qfskrbtest krbtest_main.cc)

set (exe_files qfskrbtest)

foreach (exe_file ${exe_files})
        if (USE_STATIC_LIB_LINKAGE)
           target_link_libraries (${exe_file} qfskrb krb5 qcdio)
           add_dependencies (${exe_file} qfskrb qcdio)
        else (USE_STATIC_LIB_LINKAGE)
           target_link_libraries (${exe_file} qfskrb)
           add_dependencies (${exe_file} qfskrb krb5 qcdio)
        endif (USE_STATIC_LIB_LINKAGE)
endforeach (exe_file)

if (NOT Boost_USE_STATIC_LIBS)
    target_link_libraries (qfskrb-shared ${Boost_LIBRARIES} krb5)
endif (NOT Boost_USE_STATIC_LIBS)

install (TARGETS qfskrb qfskrb-shared
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib/static)
<commit_msg>Qfs kerberos lib: use kerberos lib at /opt/local/lib location if available on mac os.<commit_after>#
# $Id$
#
# Created 2013/05/19
# Author: <NAME>
#
# Copyright 2013 Quantcast Corp.
#
# This file is part of Kosmos File System (KFS).
#
# Licensed under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
# implied. See the License for the specific language governing
# permissions and limitations under the License.
#
#

set (sources
KrbService.cc
KrbClient.cc
)

#
# Build a static and a dynamically linked libraries.  Both libraries
# should have the same root name, but installed in different places
#
add_library (qfskrb STATIC ${sources})
add_library (qfskrb-shared SHARED ${sources})
set_target_properties (qfskrb-shared PROPERTIES OUTPUT_NAME "qfskrb")
set_target_properties (qfskrb PROPERTIES OUTPUT_NAME "qfskrb")

#
# Since the objects have to be built twice, set this up so they don't
# clobber each other.

set_target_properties (qfskrb PROPERTIES CLEAN_DIRECT_OUTPUT 1)
set_target_properties (qfskrb-shared PROPERTIES CLEAN_DIRECT_OUTPUT 1)
target_link_libraries (qfskrb ${Boost_LIBRARIES} krb5)

add_executable (qfskrbtest krbtest_main.cc)

set (exe_files qfskrbtest)

foreach (exe_file ${exe_files})
        if (USE_STATIC_LIB_LINKAGE)
           target_link_libraries (${exe_file} qfskrb qcdio krb5)
           add_dependencies (${exe_file} qfskrb qcdio)
        else (USE_STATIC_LIB_LINKAGE)
           target_link_libraries (${exe_file} qfskrb-shared qcdio-shared krb5)
           add_dependencies (${exe_file} qfskrb-shared qcdio-shared)
        endif (USE_STATIC_LIB_LINKAGE)
endforeach (exe_file)

if (EXISTS "/opt/local/lib/libkrb5.dylib")
    set (KRB5_SHARED_LINK_LIB /opt/local/lib/libkrb5.dylib)
else (EXISTS "/opt/local/lib/libkrb5.dylib")
    set (KRB5_SHARED_LINK_LIB krb5)
endif (EXISTS "/opt/local/lib/libkrb5.dylib")

if (NOT Boost_USE_STATIC_LIBS)
    target_link_libraries (qfskrb-shared ${Boost_LIBRARIES} ${KRB5_SHARED_LINK_LIB})
endif (NOT Boost_USE_STATIC_LIBS)

install (TARGETS qfskrb qfskrb-shared
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib/static)

{'fraction_non_alphanumeric': 0.07980811164413432, 'fraction_numerical': 0.011120802442215439, 'mean_word_length': 4.546553808948005, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '7117952', 'n_tokens_mistral': 1628, 'n_tokens_neox': 1546, 'n_words': 479}