<commit_before>######################################################################
## CMakeLists.txt ---
## This file is part of the G+Smo library. 
##
## Author: <NAME> 
## Copyright (C) 2012 - 2015 RICAM-Linz.
######################################################################

######################################################################
# Macros for adding executables linked to G+Smo
######################################################################

# add an executable
macro(add_gismo_executable FILE)
    if( GISMO_BUILD_LIB )
        add_gismo_shared_executable(${FILE})
    #elseif ( GISMO_BUILD_STATIC_LIB )
    #    add_gismo_static_executable(${FILE})
    else ( GISMO_BUILD_LIB )
    	add_gismo_pure_executable(${FILE})
    endif( GISMO_BUILD_LIB )
endmacro(add_gismo_executable)

# add an executable compiled with pure template headers
macro(add_gismo_pure_executable FILE)
    get_filename_component(FNAME ${FILE} NAME_WE) # name without extension
    add_test(${FNAME} ${CMAKE_BINARY_DIR}/bin/${FNAME} )
    #message(STATUS "exec (pure template): ${FNAME}")
    add_executable(${FNAME} ${FILE} ${gismo_SOURCES} ${gismo_EXTENSIONS})
    target_link_libraries(${FNAME} gismo_static)
    # Allow CMake to follow dependencies on hpp files
    set_property(TARGET ${FNAME} PROPERTY 
    IMPLICIT_DEPENDS_INCLUDE_TRANSFORM "GISMO_HPP_HEADER(%)=\"%\"")
    SET_TARGET_PROPERTIES(${FNAME} PROPERTIES COMPILE_FLAGS -UGISMO_BUILD_LIB)
endmacro(add_gismo_pure_executable)

# add an executable compiled with the shared library
macro(add_gismo_shared_executable FILE)
    get_filename_component(FNAME ${FILE} NAME_WE) # name without extension
    add_test(${FNAME} ${CMAKE_BINARY_DIR}/bin/${FNAME} )
    #message(STATUS "exec (dynamically linked): ${FNAME}") 	
    add_executable(${FNAME} ${FILE})
    target_link_libraries(${FNAME} gismo)
    if (GISMO_BUILD_COVERAGE)
      target_link_libraries(${FNAME} gcov)
    endif(GISMO_BUILD_COVERAGE)
	#set_property(TARGET ${FNAME} PROPERTY FOLDER "tests-gismo")
endmacro(add_gismo_shared_executable)

# add an executable compiled statically with the library
macro(add_gismo_static_executable FILE)
    get_filename_component(FNAME ${FILE} NAME_WE) # name without extension
    add_test(${FNAME} ${CMAKE_BINARY_DIR}/bin/${FNAME} )
    #message(STATUS "exec (statically linked): ${FNAME}")
    add_executable(${FNAME} ${FILE})
    target_link_libraries(${FNAME} gismo_static)
endmacro(add_gismo_static_executable)

macro(mark_gismo_optional FILE)
    get_filename_component(FNAME ${FILE} NAME_WE) # name without extension
    set(gismo_optionals ${gismo_optionals} ${FNAME}
     CACHE INTERNAL "${PROJECT_NAME} list of optionals")
endmacro(mark_gismo_optional)

######################################################################
# File collection utilities
######################################################################

# list all subdirectories of the current directory
MACRO(SUBDIRLIST result curdir)
  FILE(GLOB children RELATIVE ${curdir} ${curdir}/gs*)
  SET(dirlist "")
  FOREACH(child ${children})
    IF(IS_DIRECTORY ${curdir}/${child})
        LIST(APPEND dirlist ${child})
    ENDIF()
  ENDFOREACH()
  SET(${result} ${dirlist})<commit_msg>Force linking with libdl (required for JIT compiler) under linux.<commit_after>######################################################################
## CMakeLists.txt ---
## This file is part of the G+Smo library. 
##
## Author: <NAME> 
## Copyright (C) 2012 - 2015 RICAM-Linz.
######################################################################

######################################################################
# Macros for adding executables linked to G+Smo
######################################################################

# add an executable
macro(add_gismo_executable FILE)
    if( GISMO_BUILD_LIB )
        add_gismo_shared_executable(${FILE})
    #elseif ( GISMO_BUILD_STATIC_LIB )
    #    add_gismo_static_executable(${FILE})
    else ( GISMO_BUILD_LIB )
    	add_gismo_pure_executable(${FILE})
    endif( GISMO_BUILD_LIB )
endmacro(add_gismo_executable)

# add an executable compiled with pure template headers
macro(add_gismo_pure_executable FILE)
    get_filename_component(FNAME ${FILE} NAME_WE) # name without extension
    add_test(${FNAME} ${CMAKE_BINARY_DIR}/bin/${FNAME} )
    #message(STATUS "exec (pure template): ${FNAME}")
    add_executable(${FNAME} ${FILE} ${gismo_SOURCES} ${gismo_EXTENSIONS})
    target_link_libraries(${FNAME} gismo_static)
    if(UNIX AND NOT APPLE)
    	target_link_libraries(${FNAME} dl)
    endif(UNIX AND NOT APPLE)
    # Allow CMake to follow dependencies on hpp files
    set_property(TARGET ${FNAME} PROPERTY 
    IMPLICIT_DEPENDS_INCLUDE_TRANSFORM "GISMO_HPP_HEADER(%)=\"%\"")
    SET_TARGET_PROPERTIES(${FNAME} PROPERTIES COMPILE_FLAGS -UGISMO_BUILD_LIB)
endmacro(add_gismo_pure_executable)

# add an executable compiled with the shared library
macro(add_gismo_shared_executable FILE)
    get_filename_component(FNAME ${FILE} NAME_WE) # name without extension
    add_test(${FNAME} ${CMAKE_BINARY_DIR}/bin/${FNAME} )
    #message(STATUS "exec (dynamically linked): ${FNAME}") 	
    add_executable(${FNAME} ${FILE})
    target_link_libraries(${FNAME} gismo)
    if (GISMO_BUILD_COVERAGE)
      target_link_libraries(${FNAME} gcov)
    endif(GISMO_BUILD_COVERAGE)
    if(UNIX AND NOT APPLE)
    	target_link_libraries(${FNAME} dl)
    endif(UNIX AND NOT APPLE)
	#set_property(TARGET ${FNAME} PROPERTY FOLDER "tests-gismo")
endmacro(add_gismo_shared_executable)

# add an executable compiled statically with the library
macro(add_gismo_static_executable FILE)
    get_filename_component(FNAME ${FILE} NAME_WE) # name without extension
    add_test(${FNAME} ${CMAKE_BINARY_DIR}/bin/${FNAME} )
    #message(STATUS "exec (statically linked): ${FNAME}")
    add_executable(${FNAME} ${FILE})
    target_link_libraries(${FNAME} gismo_static)
    if(UNIX AND NOT APPLE)
    	target_link_libraries(${FNAME} dl)
    endif(UNIX AND NOT APPLE)
endmacro(add_gismo_static_executable)

macro(mark_gismo_optional FILE)
    get_filename_component(FNAME ${FILE} NAME_WE) # name without extension
    set(gismo_optionals ${gismo_optionals} ${FNAME}
     CACHE INTERNAL "${PROJECT_NAME} list of optionals")
endmacro(mark_gismo_optional)

######################################################################
# File collection utilities
######################################################################

# list all subdirectories of the current directory
MACRO(SUBDIRLIST result curdir)
  FILE(GLOB children RELATIVE ${curdir} ${curdir}/gs*)
  SET(dirlist "")
  FOREACH(child ${children})
    IF(IS_DIRECTORY ${curdir}/${child})
        LIST(APPEND dirlist ${child})
    ENDIF()
  ENDFOREACH()
  SET(${result} ${dirlist})
{'fraction_non_alphanumeric': 0.2224834680382072, 'fraction_numerical': 0.002351212343864805, 'mean_word_length': 6.16421052631579, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4512388', 'n_tokens_mistral': 2249, 'n_tokens_neox': 2117, 'n_words': 442}