<commit_before>project( kicad-library )

cmake_minimum_required( VERSION 2.6.1 FATAL_ERROR )

# Locations for install targets.
if( UNIX )
    if( APPLE )
        # Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
        set( CMAKE_INSTALL_PREFIX /
            CACHE PATH "" )
        # Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
        set( KICAD_DATA "Library/Application Support/kicad/"
            CACHE PATH "Location of KiCad data files." )
        set( KICAD_MODULES ${KICAD_DATA}/modules )
        set( KICAD_LIBRARY ${KICAD_DATA}/library )
        set( KICAD_TEMPLATE ${KICAD_DATA}/template )
    else()
        # Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
        set( CMAKE_INSTALL_PREFIX /usr/local
            CACHE PATH "")
        # Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
        set( KICAD_DATA share/kicad
            CACHE PATH "Location of KiCad data files." )
        set( KICAD_MODULES ${KICAD_DATA}/modules )
        set( KICAD_LIBRARY ${KICAD_DATA}/library )
        set( KICAD_TEMPLATE ${KICAD_DATA}/template )
    endif()
endif()

if(WIN32)
    # Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
    set( CMAKE_INSTALL_PREFIX c:/kicad
        CACHE PATH "" )
    # Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
    set( KICAD_MODULES modules )
    set( KICAD_LIBRARY library )
    set( KICAD_TEMPLATE template )
endif()

mark_as_advanced( KICAD_DATA KICAD_MODULES KICAD_LIBRARY )


if( UNIX )
    set( KICAD_USER_CONFIG_DIR "$ENV{HOME}/.config/kicad"
         CACHE PATH "Location of user specifig KiCad config files" )
elseif( MINGW )
    set( KICAD_USER_CONFIG_DIR "$ENV{%APPDATA%}/kicad"
         CACHE PATH "Location of user specifig KiCad config files" )
endif()

mark_as_advanced( KICAD_USER_CONFIG_DIR )


#================================================
# "make uninstall" rules
#================================================
configure_file(
    "${PROJECT_SOURCE_DIR}/CMakeModules/cmake_uninstall.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
    IMMEDIATE @ONLY )

add_custom_target( uninstall
    "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" )


# CMake will look in these dirs for nested 'CMakeLists.txt' files.<commit_msg>Another patch for config relocation<commit_after>project( kicad-library )

cmake_minimum_required( VERSION 2.6.1 FATAL_ERROR )

# Locations for install targets.
if( UNIX )
    if( APPLE )
        # Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
        set( CMAKE_INSTALL_PREFIX /
            CACHE PATH "" )
        # Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
        set( KICAD_DATA "Library/Application Support/kicad/"
            CACHE PATH "Location of KiCad data files." )
        set( KICAD_MODULES ${KICAD_DATA}/modules )
        set( KICAD_LIBRARY ${KICAD_DATA}/library )
        set( KICAD_TEMPLATE ${KICAD_DATA}/template )
    else()
        # Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
        set( CMAKE_INSTALL_PREFIX /usr/local
            CACHE PATH "")
        # Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
        set( KICAD_DATA share/kicad
            CACHE PATH "Location of KiCad data files." )
        set( KICAD_MODULES ${KICAD_DATA}/modules )
        set( KICAD_LIBRARY ${KICAD_DATA}/library )
        set( KICAD_TEMPLATE ${KICAD_DATA}/template )
    endif()
endif()

if(WIN32)
    # Like all variables, CMAKE_INSTALL_PREFIX can be over-ridden on the command line.
    set( CMAKE_INSTALL_PREFIX c:/kicad
        CACHE PATH "" )
    # Everything without leading / is relative to CMAKE_INSTALL_PREFIX.
    set( KICAD_MODULES modules )
    set( KICAD_LIBRARY library )
    set( KICAD_TEMPLATE template )
endif()

mark_as_advanced( KICAD_DATA KICAD_MODULES KICAD_LIBRARY )


if( UNIX )
    if( APPLE )
        set( KICAD_USER_CONFIG_DIR $ENV{HOME}/Library/Preferences/kicad
            CACHE PATH "Location of user specifig KiCad config files" )
    else()
        set( KICAD_USER_CONFIG_DIR $ENV{HOME}/.config/kicad
            CACHE PATH "Location of user specifig KiCad config files" )
    endif()
elseif( MINGW )
    set( KICAD_USER_CONFIG_DIR $ENV{%APPDATA%}/kicad
        CACHE PATH "Location of user specifig KiCad config files" )
endif()

mark_as_advanced( KICAD_USER_CONFIG_DIR )


#================================================
# "make uninstall" rules
#================================================
configure_file(
    "${PROJECT_SOURCE_DIR}/CMakeModules/cmake_uninstall.cmake.in"
    "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
    IMMEDIATE @ONLY )

add_custom_target( uninstall
    "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" )


# CMake will look in these dirs for nested 'CMakeLists.txt' files.
{'fraction_non_alphanumeric': 0.12130949989957823, 'fraction_numerical': 0.002008435428800964, 'mean_word_length': 3.3531468531468533, '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': '4762291', 'n_tokens_mistral': 1696, 'n_tokens_neox': 1601, 'n_words': 405}