<commit_before>cmake_minimum_required(VERSION 2.8)

Project(simanneal_cpp)

INCLUDE_DIRECTORIES(
    ${simanneal_cpp_SOURCE_DIR}
)

SET(simanneal_library_sources
  barray.cxx
  cputime.cxx
  errorstream.cxx
  r250.cxx
  randgen.cxx
  random.cxx
  registrar.cxx
  rndlcg.cxx
  simann.cxx
)
SET(simanneal_library_headers
  barray.hpp
  cputime.hpp
  errorstream.hpp
  r250.hpp
  randgen.hpp
  random.hpp
  registrar.hpp
  rndlcg.hpp
  scalar.hpp
  simann.hpp
)

SET(test1_src
  satest1.cxx
)

SET(test2_src
  satest2.cxx
)

ADD_LIBRARY(simann ${simanneal_library_headers} ${simanneal_library_sources})

ADD_EXECUTABLE(satest1 ${test1_src})
TARGET_LINK_LIBRARIES( satest1
  simann
)

ADD_EXECUTABLE(satest2 ${test2_src})
TARGET_LINK_LIBRARIES( satest2
  simann
)

INSTALL( FILES ${simanneal_library_headers} DESTINATION include/simann)
INSTALL( TARGETS simann DESTINATION lib)<commit_msg>Added CMake option to build shared library<commit_after>cmake_minimum_required(VERSION 2.8)

Project(simanneal_cpp)

INCLUDE_DIRECTORIES(
    ${simanneal_cpp_SOURCE_DIR}
)

SET(simanneal_library_sources
  barray.cxx
  cputime.cxx
  errorstream.cxx
  r250.cxx
  randgen.cxx
  random.cxx
  registrar.cxx
  rndlcg.cxx
  simann.cxx
)
SET(simanneal_library_headers
  barray.hpp
  cputime.hpp
  errorstream.hpp
  r250.hpp
  randgen.hpp
  random.hpp
  registrar.hpp
  rndlcg.hpp
  scalar.hpp
  simann.hpp
)

SET(test1_src
  satest1.cxx
)

SET(test2_src
  satest2.cxx
)

OPTION(SIMANNEAL_BUILD_SHARED OFF)

IF(${SIMANNEAL_BUILD_SHARED})
ADD_LIBRARY(simann SHARED ${simanneal_library_headers} ${simanneal_library_sources})
ELSE()
ADD_LIBRARY(simann ${simanneal_library_headers} ${simanneal_library_sources})
ENDIF(${SIMANNEAL_BUILD_SHARED})

ADD_EXECUTABLE(satest1 ${test1_src})
TARGET_LINK_LIBRARIES( satest1
  simann
)

ADD_EXECUTABLE(satest2 ${test2_src})
TARGET_LINK_LIBRARIES( satest2
  simann
)

INSTALL( FILES ${simanneal_library_headers} DESTINATION include/simann)
INSTALL( TARGETS simann DESTINATION lib)
{'fraction_non_alphanumeric': 0.08341708542713568, 'fraction_numerical': 0.018090452261306532, 'mean_word_length': 5.65886287625418, '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': '6385450', 'n_tokens_mistral': 866, 'n_tokens_neox': 841, 'n_words': 120}