Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MERGE AFTER #165 ONLY] Patch travis use cmake #170

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,5 @@ before_install:
fi

script:
- make
- if [ `uname` = "Darwin" ]; then
make tests;
fi
- if [ `uname` = "Darwin" ]; then
make examples;
fi
- if [ `uname` = "Darwin" ]; then
make build_documentation;
fi
- mkdir build_dir && cd build_dir && cmake ..
- make -j6
48 changes: 48 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
cmake_minimum_required(VERSION 3.9)

set(LIBNAME "allegro_flare")
set(LIBVERSION 0.9.0)

project(${LIBNAME} VERSION ${LIBVERSION} DESCRIPTION "allegro but for C++")

include(GNUInstallDirs)

file(GLOB SRC_FILES
${PROJECT_SOURCE_DIR}/src/allegro_flare/*.cpp
${PROJECT_SOURCE_DIR}/src/allegro_flare/platform/*.cpp
${PROJECT_SOURCE_DIR}/src/AllegroFlare/*.cpp
${PROJECT_SOURCE_DIR}/src/NcursesArt/*.cpp
${PROJECT_SOURCE_DIR}/include/allegro_flare/*.h
${PROJECT_SOURCE_DIR}/include/AllegroFlare/*.h
${PROJECT_SOURCE_DIR}/include/NcursesArt/*.h)

IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
file(GLOB LINUX_SRC_FILES
${PROJECT_SOURCE_DIR}/src/allegro_flare/platform/linux/*.cpp)
list (APPEND SRC_FILES ${LINUX_SRC_FILES})
ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Linux")

IF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
file(GLOB MACOS_SRC_FILES
${PROJECT_SOURCE_DIR}/src/allegro_flare/platform/mac_os/*.cpp)
list (APPEND SRC_FILES ${MACOS_SRC_FILES})
ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Darwin")

IF(CMAKE_SYSTEM_NAME STREQUAL "Windows")
file(GLOB WIN_SRC_FILES
${PROJECT_SOURCE_DIR}/src/allegro_flare/platform/win/*.cpp)
list (APPEND SRC_FILES ${WIN_SRC_FILES})
ENDIF(CMAKE_SYSTEM_NAME STREQUAL "Windows")

add_library(${LIBNAME} SHARED ${SRC_FILES})

set_target_properties(${LIBNAME} PROPERTIES
VERSION ${LIBVERSION}
SOVERSION 1
PUBLIC_HEADER include/allegro_flare.h)

target_include_directories(${LIBNAME} PRIVATE include src)

install(TARGETS ${LIBNAME}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
3 changes: 3 additions & 0 deletions src/allegro_flare/drawing_interface_html_canvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ namespace allegro_flare
DrawingInterfaceHTMLCanvas::DrawingInterfaceHTMLCanvas()
: DrawingInterface("html5 canvas")
{}

// Has to be defined even if pure virtual, see https://stackoverflow.com/a/15113814
DrawingInterfaceHTMLCanvas::~DrawingInterfaceHTMLCanvas() {};



Expand Down
3 changes: 2 additions & 1 deletion src/allegro_flare/drawing_interface_svg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ namespace allegro_flare
{}



// Has to be defined even if pure virtual, see https://stackoverflow.com/a/15113814
DrawingInterfaceSVG::~DrawingInterfaceSVG() {};

/*
std::string DrawingInterfaceSVG::get_xml_encoded_ustr(ALLEGRO_USTR *ustr)
Expand Down