######################################################################
# Automatically generated by cppiniter {{{date_time}}}
######################################################################

{{#is_exe}}
add_executable({{{project_name}}})
{{/is_exe}}
{{^is_exe}}
add_library({{{project_name}}})

if(BUILD_SHARED_LIBS)
    target_compile_definitions({{{project_name}}} PRIVATE {{{project_name_uppercase}}}_DLL {{{project_name_uppercase}}}_EXPORTS)
endif()
{{/is_exe}}

target_include_directories({{{project_name}}} PUBLIC ${CMAKE_CURRENT_LIST_DIR} ${CMAKE_BINARY_DIR})

{{#is_exe}}
configure_file(${CMAKE_CURRENT_LIST_DIR}/version.h.in ${CMAKE_BINARY_DIR}/version.h)
{{/is_exe}}
{{^is_exe}}
configure_file(${CMAKE_CURRENT_LIST_DIR}/{{{project_name}}}/version.h.in ${CMAKE_BINARY_DIR}/version.h)
{{/is_exe}}
list(APPEND SRC ${CMAKE_CURRENT_LIST_DIR}/{{{project_name}}}/version.cpp)

file(GLOB SRC "*/*.h"
              "*/*.cpp"
              "*.hpp"
              "*.cpp")
target_sources({{{project_name}}} PRIVATE ${SRC})

find_package(fmt REQUIRED CONFIG)

target_link_libraries({{{project_name}}} fmt::fmt)

INSTALL(TARGETS {{{project_name}}}
        RUNTIME DESTINATION bin
        LIBRARY DESTINATION lib
        ARCHIVE DESTINATION lib)

if(MSVC AND BUILD_SHARED_LIBS)
    install(FILES $<TARGET_PDB_FILE:{{{project_name}}}> DESTINATION lib)
endif()
