<commit_before>project(libMCNP2CAD)

cmake_minimum_required(VERSION 3.0)

set(MCNP2CAD_MAJOR_VERSION 1)
set(MCNP2CAD_MINOR_VERSION 0)
set(MCNP2CAD_PATCH_VERSION 5)

# Build options
option(STANDALONE_MCNP2CAD  "Build mcnp2cad as a standalone program" ON)
option(BUILD_MCNP2CAD_TESTS "Build mcnp2cad tests"                   ON)

# Default to a release build
if (NOT CMAKE_BUILD_TYPE)
  message(STATUS "CMAKE_BUILD_TYPE not specified, defaulting to Release")
  set(CMAKE_BUILD_TYPE Release)
endif ()
  
# Use C++11
set(CMAKE_CXX_STANDARD 11)

# iGeom assumed to have cone functionality
add_definitions(-DHAVE_IGEOM_CONE=ON)

# Adjust compiler setting for Linux using gcc version 5.0 and higher
if (CMAKE_SYSTEM_NAME MATCHES Linux AND CMAKE_COMPILER_IS_GNUCXX)
  if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.0")
    if (NOT CMAKE_CXX_FLAGS MATCHES _GLIBCXX_USE_CXX11_ABI)
      set(CMAKE_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=0 ${CMAKE_CXX_FLAGS}")
    endif ()
  endif ()
endif ()

# Find Eigen3
find_package(Eigen3 3.3 REQUIRED)
message(STATUS "EIGEN3_INCLUDE_DIR: ${EIGEN3_INCLUDE_DIR}")
include_directories(${EIGEN3_INCLUDE_DIR})

# Find iGeom. If mcnp2cad is being built as a standalone library, then
# -DIGEOM_DIR must be specified. If it is not being built as a standalone
# library, then it is assumed that the location of the iGeom library is known
# and that the iGeom headers have already been included.
if (STANDALONE_MCNP2CAD)
  if (NOT IGEOM_DIR)
    message(FATAL_ERROR "-DIGEOM_DIR must be specified when building mcnp2cad"
                        " as a standalone library")
  else ()
    message(STATUS "Building standalone mcnp2cad")
  endif ()

  # Find location of iGeom headers
  find_path(IGEOM_INCLUDE_DIR NAMES iGeom.h HINTS ${IGEOM_DIR}/include)
  message(STATUS "IGEOM_INCLUDE_DIR: ${IGEOM_INCLUDE_DIR}")

  # Find location of iGeom library
  find_library(IGEOM_LIB NAMES iGeom HINTS ${IGEOM_DIR}/lib)
  get_filename_component(IGEOM_LIB_DIR ${IGEOM_LIB} DIRECTORY)
  message(STATUS "IGEOM_LIB_DIR: ${IGEOM_LIB_DIR}")
  message(STATUS "IGEOM_LIB: ${IGEOM_LIB}")

  # Create an imported target for iGeom
  add_library(iGeom SHARED IMPORTED)
  set_target_properties(iGeom PROPERTIES IMPORTED_LOCATION "${IGEOM_LIB}"
                        INTERFACE_INCLUDE_DIRECTORIES "${IGEOM_INCLUDE_DIR}"
                        INTERFACE_LINK_DIRECTORIES "${IGEOM_LIB_DIR}")
else ()
  message(STATUS "Building mcnp2cad as a component of another package."
                 " The iGeom target should already exist.")
endif ()

# RPATH handling
if (STANDALONE_MCNP2CAD)
  # Add all directories that have been linked via the link_directories() command
  # to the RPATH
  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
  # Add the location of libraries installed by this project to the
  # INSTALL_RPATH_DIRS variable
  if (CMAKE_INSTALL_RPATH)
    set(INSTALL_RPATH_DIRS "${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_PREFIX}/lib")
  else ()
    set(INSTALL_RPATH_DIRS "${CMAKE_INSTALL_PREFIX}/lib")
  endif ()
endif ()


SET(MCNP2CAD_SRC_FILES geometry.cpp
                       GQ_Characterize.cpp
                       mcnp2cad.cpp
                       MCNPInput.cpp
                       volumes.cpp)

set(MCNP2CAD_PUB_HEADERS dataref.hpp
                         geometry.hpp
                         GQ_Characterize.hpp
                         mcnp2cad.hpp
                         MCNPInput.hpp
                         options.hpp)
                         
configure_file(version.hpp.in version.hpp)
list(APPEND MCNP2CAD_PUB_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/version.hpp)
<commit_msg>updating cmakefile<commit_after>project(libMCNP2CAD)

cmake_minimum_required(VERSION 3.0)

set(MCNP2CAD_MAJOR_VERSION 1)
set(MCNP2CAD_MINOR_VERSION 0)
set(MCNP2CAD_PATCH_VERSION 5)

# Build options
option(STANDALONE_MCNP2CAD  "Build mcnp2cad as a standalone program" ON)
option(BUILD_MCNP2CAD_TESTS "Build mcnp2cad tests"                   ON)

# Default to a release build
if (NOT CMAKE_BUILD_TYPE)
  message(STATUS "CMAKE_BUILD_TYPE not specified, defaulting to Release")
  set(CMAKE_BUILD_TYPE Release)
endif ()
  
# Use C++11
set(CMAKE_CXX_STANDARD 11)

# iGeom assumed to have cone functionality
add_definitions(-DHAVE_IGEOM_CONE=ON)

# Adjust compiler setting for Linux using gcc version 5.0 and higher
if (CMAKE_SYSTEM_NAME MATCHES Linux AND CMAKE_COMPILER_IS_GNUCXX)
  if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER "5.0")
    if (NOT CMAKE_CXX_FLAGS MATCHES _GLIBCXX_USE_CXX11_ABI)
      set(CMAKE_CXX_FLAGS "-D_GLIBCXX_USE_CXX11_ABI=0 ${CMAKE_CXX_FLAGS}")
    endif ()
  endif ()
endif ()

# Find Eigen3
find_package(Eigen3 3.3 REQUIRED)
message(STATUS "EIGEN3_INCLUDE_DIR: ${EIGEN3_INCLUDE_DIR}")
include_directories(${EIGEN3_INCLUDE_DIR})

# Find iGeom. If mcnp2cad is being built as a standalone library, then
# -DIGEOM_DIR must be specified. If it is not being built as a standalone
# library, then it is assumed that the location of the iGeom library is known
# and that the iGeom headers have already been included.
if (STANDALONE_MCNP2CAD)
  if (NOT IGEOM_DIR)
    message(FATAL_ERROR "-DIGEOM_DIR must be specified when building mcnp2cad"
                        " as a standalone library")
  else ()
    message(STATUS "Building standalone mcnp2cad")
  endif ()

  # Find location of iGeom headers
  find_path(IGEOM_INCLUDE_DIR NAMES iGeom.h HINTS ${IGEOM_DIR}/include)
  message(STATUS "IGEOM_INCLUDE_DIR: ${IGEOM_INCLUDE_DIR}")

  # Find location of iGeom library
  find_library(IGEOM_LIB NAMES iGeom HINTS ${IGEOM_DIR}/lib)
  get_filename_component(IGEOM_LIB_DIR ${IGEOM_LIB} DIRECTORY)
  message(STATUS "IGEOM_LIB_DIR: ${IGEOM_LIB_DIR}")
  message(STATUS "IGEOM_LIB: ${IGEOM_LIB}")

  # Create an imported target for iGeom
  add_library(iGeom SHARED IMPORTED)
  set_target_properties(iGeom PROPERTIES IMPORTED_LOCATION "${IGEOM_LIB}"
                        INTERFACE_INCLUDE_DIRECTORIES "${IGEOM_INCLUDE_DIR}"
                        INTERFACE_LINK_DIRECTORIES "${IGEOM_LIB_DIR}")
else ()
  message(STATUS "Building mcnp2cad as a component of another package."
                 " The iGeom target should already exist.")
endif ()

# RPATH handling
if (STANDALONE_MCNP2CAD)
  # Add all directories that have been linked via the link_directories() command
  # to the RPATH
  set(CMAKE_INSTALL_RPATH_USE_LINK_PATH ON)
  # Add the location of libraries installed by this project to the
  # INSTALL_RPATH_DIRS variable
  if (CMAKE_INSTALL_RPATH)
    set(INSTALL_RPATH_DIRS "${CMAKE_INSTALL_RPATH}:${CMAKE_INSTALL_PREFIX}/lib")
  else ()
    set(INSTALL_RPATH_DIRS "${CMAKE_INSTALL_PREFIX}/lib")
  endif ()
endif ()


SET(MCNP2CAD_SRC_FILES geometry.cpp
                       GQ_Characterize.cpp
                       mcnp2cad.cpp
                       MCNPInput.cpp
                       volumes.cpp)

set(MCNP2CAD_PUB_HEADERS dataref.hpp
                         geometry.hpp
                         GQ_Characterize.hpp
                         mcnp2cad.hpp
                         MCNPInput.hpp
                         options.hpp)
                         
configure_file(version.hpp.in version.hpp @MCNP2CAD_MAJOR_VERSION @MCNP2CAD_MINOR_VERSION @MCNP2CAD_PATCH_VERSION @STANDALONE_MCNP2CAD)
list(APPEND MCNP2CAD_PUB_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/version.hpp)

{'fraction_non_alphanumeric': 0.07156567041403894, 'fraction_numerical': 0.012613106663010694, 'mean_word_length': 3.4919950738916254, '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': '293505', 'n_tokens_mistral': 2718, 'n_tokens_neox': 2454, 'n_words': 587}