<commit_before>#-------------------------------------------------------------------------------
# exampleApp executables setup

project(RadiumExampleApps)

# short convenience target from cmake/cleanCpppExtensions.cpp
add_custom_target(test-run)
add_custom_target(${PROJECT_NAME})

# Expectations:
# Sources are in ${CMAKE_CURRENT_SOURCE_DIR}/${APP}
macro( configureExampleApp APP )
    message("[RadiumExampleApps]Configuring ${APP}")

    set(APP_NAME "Radium${APP}")
    set(APP_IDEN "com.radium.${APP}")
    target_include_directories(${APP} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${APP})

    if(APPLE)
        set_target_properties(${APP} PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME ${APP_NAME})
        set_target_properties(${APP} PROPERTIES MACOSX_BUNDLE_BUNDLE_GUI_IDENTIFIER "${APP_IDEN}")
        set_target_properties(${APP} PROPERTIES MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
        set_target_properties(${APP} PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
    endif()

    install(TARGETS ${APP}
        BUNDLE DESTINATION "."
        RUNTIME DESTINATION bin)

    if(APPLE)
        install(CODE "
            include(BundleUtilities)
            fixup_bundle(${CMAKE_INSTALL_PREFIX}/${APP}.app \"\" \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\")
        " COMPONENT Runtime)
    endif()

    # Using macro from cmake/cleanCpppExtensions.cpp included on the top
    # Provides ${APP}-run and ${APP}-dbg
    addRunAndDebugTargets(${APP})

    # short convenience target from cmake/cleanCpppExtensions.cpp
    add_dependencies(test-run "${APP}-run")
    add_dependencies(${PROJECT_NAME} "${APP}")

    # Basic runable tests (will not crash)
    add_test(NAME "${APP}Is_Runable "
        COMMAND $<TARGET_FILE:${APP}>)
endmacro()


add_executable(CoreExampleApp MACOSX_BUNDLE
    CoreExampleApp/CoreExampleApp.cpp)
target_link_libraries (CoreExampleApp PUBLIC Radium::Core)
configureExampleApp( "CoreExampleApp" )

#if( RADIUM_GENERATE_LIB_ENGINE )
#    find_package(Qt5 COMPONENTS Core Widgets OpenGL Xml REQUIRED)
#    find_package(OpenGL REQUIRED)
#    set(CMAKE_AUTOMOC ON)
#    add_executable(EngineExampleApp MACOSX_BUNDLE
#        EngineExampleApp/main.cpp
#        EngineExampleApp/minimalapp.cpp
#        EngineExampleApp/minimalapp.hpp
#        EngineExampleApp/minimalradium.cpp
#        EngineExampleApp/minimalradium.hpp)
#    target_link_libraries (EngineExampleApp PUBLIC
#                           Radium::Core Radium::Engine Radium::GuiBase
#                           Qt5::Core Qt5::Widgets Qt5::OpenGL Qt5::Xml
#                           OpenGL::GL)
#    configureExampleApp( "EngineExampleApp" )
#endif()
<commit_msg>After fixing up the bundle, copy the resources into the bundle. EngineExampleApp is now fully relocatable.<commit_after>#-------------------------------------------------------------------------------
# exampleApp executables setup

project(RadiumExampleApps)

# short convenience target from cmake/cleanCpppExtensions.cpp
add_custom_target(test-run)
add_custom_target(${PROJECT_NAME})

# Expectations:
# Sources are in ${CMAKE_CURRENT_SOURCE_DIR}/${APP}
macro( configureExampleApp APP )
    message("[RadiumExampleApps] Configuring ${APP}")

    set(APP_NAME "Radium${APP}")
    set(APP_IDEN "com.radium.${APP}")
    target_include_directories(${APP} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${APP})

    if(APPLE)
        set_target_properties(${APP} PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME ${APP_NAME})
        set_target_properties(${APP} PROPERTIES MACOSX_BUNDLE_BUNDLE_GUI_IDENTIFIER "${APP_IDEN}")
        set_target_properties(${APP} PROPERTIES MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}")
        set_target_properties(${APP} PROPERTIES MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}")
    endif()

    install(TARGETS ${APP}
        BUNDLE DESTINATION "."
        RUNTIME DESTINATION bin)

    if(APPLE)
        install(CODE "
            include(BundleUtilities)
            fixup_bundle(${CMAKE_INSTALL_PREFIX}/${APP}.app \"\" \"${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}\")
            file(COPY ${CMAKE_INSTALL_PREFIX}/Resources DESTINATION ${CMAKE_INSTALL_PREFIX}/${APP}.app/Contents)
        " COMPONENT Runtime)
    endif()

    # Using macro from cmake/cleanCpppExtensions.cpp included on the top
    # Provides ${APP}-run and ${APP}-dbg
    addRunAndDebugTargets(${APP})

    # short convenience target from cmake/cleanCpppExtensions.cpp
    add_dependencies(test-run "${APP}-run")
    add_dependencies(${PROJECT_NAME} "${APP}")

    # Basic runable tests (will not crash)
    add_test(NAME "${APP}Is_Runable "
        COMMAND $<TARGET_FILE:${APP}>)
endmacro()


add_executable(CoreExampleApp MACOSX_BUNDLE
    CoreExampleApp/CoreExampleApp.cpp)
target_link_libraries (CoreExampleApp PUBLIC Radium::Core)
configureExampleApp( "CoreExampleApp" )

if (RADIUM_GENERATE_LIB_ENGINE)
    find_package(Qt5 COMPONENTS Core Widgets OpenGL Xml REQUIRED)
    find_package(OpenGL REQUIRED)
    set(CMAKE_AUTOMOC ON)
    add_executable(EngineExampleApp MACOSX_BUNDLE
            EngineExampleApp/main.cpp
            EngineExampleApp/minimalapp.cpp
            EngineExampleApp/minimalapp.hpp
            EngineExampleApp/minimalradium.cpp
            EngineExampleApp/minimalradium.hpp)

    target_link_libraries(EngineExampleApp PUBLIC
            Radium::Core Radium::Engine Radium::GuiBase
            Qt5::Core Qt5::Widgets Qt5::OpenGL Qt5::Xml
            OpenGL::GL)
    configureExampleApp("EngineExampleApp")
endif ()

{'fraction_non_alphanumeric': 0.13099824868651488, 'fraction_numerical': 0.0017513134851138354, 'mean_word_length': 3.7276490066225167, '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': '950960', 'n_tokens_mistral': 1858, 'n_tokens_neox': 1805, 'n_words': 294}