NewCreature / Allegro-Legacy

Make Your Allegro 4 Programs Run On Modern Systems Using Allegro 5
19 stars 3 forks source link

Enabling build from a parent project #36

Closed humbertodias closed 11 months ago

humbertodias commented 11 months ago

Feature

Including allegro 4 statically into a project without any external dependency Such as was made on https://github.com/connorjclark/allegro-project for allegro 5

Environment

Tested on mac OS 14.0

How to test

# Allegro 4
include(FetchContent)
FetchContent_Declare(
        allegro4
        GIT_REPOSITORY https://github.com/humbertodias/Allegro-Legacy
        GIT_BRANCH        master
)
FetchContent_GetProperties(allegro4)
if(NOT allegro4_POPULATED)
    FetchContent_Populate(allegro4)
    if (MSVC)
        set(SHARED ON)
    else()
        set(SHARED OFF)
    endif()
    add_subdirectory(${allegro4_SOURCE_DIR} ${allegro4_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
[ 98%] Building C object CMakeFiles/allegro.dir/src/a5/midia5/midia5.c.o
[ 99%] Building C object CMakeFiles/allegro.dir/src/a5/midia5/macos/coremidi.m.o
[100%] Linking C static library lib/liballeg.dylib
[100%] Built target allegro
NewCreature commented 11 months ago

Looks good. Thanks!