Skip to content

Commit

Permalink
Merge branch 'release/0.9.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
mkeeter committed Jul 3, 2016
2 parents 5326b40 + e745909 commit e8480c7
Show file tree
Hide file tree
Showing 41 changed files with 639 additions and 569 deletions.
56 changes: 20 additions & 36 deletions BUILDING.md
@@ -1,11 +1,14 @@
Requirements
------------
- [Qt 5.4](http://www.qt.io/)
- [Qt 5.4 or later](http://www.qt.io/)
- [Python 3](https://www.python.org/)
- [Boost.Python](http://www.boost.org/doc/libs/1_57_0/libs/python/doc/index.html) (linked against Python 3)
- [`libpng`](http://www.libpng.org/pub/png/libpng.html)
- [Lemon](http://www.hwaci.com/sw/lemon/)
- [Flex](http://flex.sourceforge.net)
- [ninja](https://ninja-build.org/) (recommended)

--------------------------------------------------------------------------------

Mac OS X
--------
Expand All @@ -17,40 +20,30 @@ brew install --with-python3 boost-python
brew install qt5
brew install lemon
brew install flex
brew install ninja
brew install cmake
git clone https://github.com/mkeeter/antimony
cd antimony
mkdir build
cd build
/usr/local/Cellar/qt5/5.*/bin/qmake ../sb.pro
make -j8
open app/Antimony.app
```
### Troubleshooting
If you have installed Homebrew in a non-standard directory like `~/.homebrew`
(the default is `/usr/local`), you'll need to provide a path to your Homebrew
files:
```
export BREW_HOME=/Users/yourusername/.homebrew
cmake -DCMAKE_PREFIX_PATH=/usr/local/Cellar/qt5/5.6.1 -GNinja ..
ninja
$BREW_HOME/Cellar/qt5/5.*/bin/qmake ../qt/antimony.pro
make -j8
open app/Antimony.app
```

If you need to further adjust your library paths, Mac specific settings
can be found in `qt/libpng.pri` and `qt/python.pri`

Note: If `make -j8` exits with an "Error 2" just run `make -j8` again to succeed.
--------------------------------------------------------------------------------

Linux
-----
Tested on a clean Xubuntu 16.04 virtual machine:

```
# Install dependencies
sudo apt install git build-essential libpng-dev python3-dev libboost-all-dev libgl1-mesa-dev lemon flex qt5-default
sudo apt install git build-essential libpng-dev python3-dev libboost-all-dev libgl1-mesa-dev lemon flex qt5-default ninja-build cmake
# Clone the repo
git clone https://github.com/mkeeter/antimony
Expand All @@ -61,32 +54,23 @@ mkdir build
cd build
# Build and launch the application
qmake ../sb.pro
make -j8
./app/Antimony
```

You can use `make install`, or set up a symlink to run `antimony` from outside the build directory:
```
ln -s ~/antimony/build/app/antimony /usr/local/bin/antimony
cmake -GNinja ..
ninja
./app/antimony
```

### Caveats

The path to `qmake` may vary depending on how Qt 5 was installed; if the instructions don't work, try
```
~/Qt/5.4/gcc_64/bin/qmake ../sb.pro
```

--------------------------------------------------------------------------------
To put Antimony on your path, call `sudo ninja install`. This does two things:
- The `antimony` executable is copied to `/usr/local/bin`
- Antimony's Python libraries are copied to `/usr/local/share/antimony`

## Debugging
### `cannot find -lGL`
If running `make` gives the `/usr/bin/ld: cannot find -lGL`, create a symlink to the `libGL` file:
```
ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1.2.0 /usr/lib/libGL.so
```

--------------------------------------------------------------------------------

### Missing top menu
If the top menu bar is not appearing in Ubuntu with a non-Unity
desktop environment (e.g. `gnome-session-flashback`), run
```
Expand Down
32 changes: 32 additions & 0 deletions CMakeLists.txt
@@ -0,0 +1,32 @@
cmake_minimum_required(VERSION 2.6)
project(Antimony)
set(CMAKE_BUILD_TYPE RELEASE)

set(CMAKE_CXX_FLAGS "-Wall -Wextra -g -Werror=switch")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DRELEASE")
set(CMAKE_CXX_FLAGS_DEBUG "-O0")

################################################################################

find_package(PythonLibs 3.3 REQUIRED)

if (APPLE)
find_package(Boost REQUIRED COMPONENTS python3)
elseif (UNIX)
foreach (PYTHON_NAME python3 python-py35 python-py34)
find_package(Boost QUIET COMPONENTS ${PYTHON_NAME})
if (${Boost_FOUND})
break()
endif()
endforeach()
if (NOT ${Boost_FOUND})
message(FATAL_ERROR "Could not find boost::python3")
endif()
endif()

################################################################################

add_subdirectory(lib/graph)
add_subdirectory(lib/fab)

add_subdirectory(app)
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -11,15 +11,15 @@ For more details and screenshots, look at [this writeup](http://mattkeeter.com/p
*Antimony* is under active development. It's at a beta level of stability:
solid, but not recommended for mission-critical use.

If you're on a Mac, you can download a [pre-built application](https://github.com/mkeeter/antimony/releases)
and get started immediately.
To get started, there are two suggested options:
- Download a [pre-built application](https://github.com/mkeeter/antimony/releases) (Mac only)
- [Build from source](https://github.com/mkeeter/antimony/blob/develop/BUILDING.md) (Mac and Linux)

Antimony has also been [packaged for Fedora 22/23](https://admin.fedoraproject.org/pkgdb/package/antimony/):
There is also a community-supported package for [Fedora 22 or later](https://admin.fedoraproject.org/pkgdb/package/antimony/):
```
dnf install antimony --enablerepo=updates-testing
dnf install antimony
```

Otherwise, please refer to the [build instructions](https://github.com/mkeeter/antimony/blob/develop/BUILDING.md).
(or `dnf install antimony --enablerepo=updates-testing` to get testing builds)

## Support

Expand Down
186 changes: 186 additions & 0 deletions app/CMakeLists.txt
@@ -0,0 +1,186 @@
# Instruct CMake to run moc, uic, and rrc automatically when needed.
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

# Make the build directory an include target (for generated moc_ files)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

# Find the Qt libraries
find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5OpenGL REQUIRED)
find_package(Qt5Network REQUIRED)
find_package(Qt5Concurrent REQUIRED)

set(SRC_FILES
app/main.cpp
app/app.cpp
app/update.cpp
app/colors.cpp
canvas/scene.cpp
canvas/canvas_view.cpp
canvas/info.cpp
canvas/inspector/frame.cpp
canvas/inspector/export.cpp
canvas/inspector/title.cpp
canvas/inspector/buttons.cpp
canvas/inspector/util.cpp
canvas/datum_row.cpp
canvas/datum_editor.cpp
canvas/datum_port.cpp
canvas/subdatum/subdatum_frame.cpp
canvas/subdatum/subdatum_editor.cpp
canvas/subdatum/subdatum_row.cpp
canvas/connection/base.cpp
canvas/connection/connection.cpp
canvas/connection/dummy.cpp
window/base.cpp
window/canvas.cpp
window/viewport.cpp
window/quad.cpp
window/base_viewport_window.cpp
window/script_window.cpp
graph/constructor/populate.cpp
graph/proxy/graph.cpp
graph/proxy/node.cpp
graph/proxy/script.cpp
graph/proxy/datum.cpp
graph/proxy/subdatum.cpp
graph/proxy/base_datum.cpp
graph/hooks/hooks.cpp
graph/hooks/export.cpp
graph/hooks/ui.cpp
graph/hooks/title.cpp
graph/serialize/serializer.cpp
graph/serialize/deserializer.cpp
script/syntax.cpp
script/editor.cpp
script/frame.cpp
undo/undo_command.cpp
undo/undo_add_node.cpp
undo/undo_add_datum.cpp
undo/undo_delete_datum.cpp
undo/undo_delete_multi.cpp
undo/undo_delete_node.cpp
undo/undo_delete_link.cpp
undo/undo_move_node.cpp
undo/undo_move_datum.cpp
undo/undo_change_script.cpp
undo/undo_change_expr.cpp
undo/undo_stack.cpp
dialog/exporting.cpp
dialog/resolution.cpp
export/export_mesh.cpp
export/export_heightmap.cpp
export/export_worker.cpp
viewport/scene.cpp
viewport/gl.cpp
viewport/view.cpp
viewport/image.cpp
viewport/control/control.cpp
viewport/control/control_instance.cpp
viewport/control/point.cpp
viewport/control/wireframe.cpp
viewport/render/instance.cpp
viewport/render/task.cpp

gl/gl.qrc
)

set(PY_FAB_FILES
../py/fab/__init__.py
../py/fab/shapes.py
../py/fab/types.py
)

if (APPLE)
set(ANTIMONY_APP Antimony)
set(CMAKE_MACOSX_RPATH ON)

# Add the icon file and deploy it to Resources
set(SB_ICON ../deploy/mac/sb.icns)
set_source_files_properties(${SB_ICON}
PROPERTIES MACOSX_PACKAGE_LOCATION "Resources"
)

# Deploy fab module's files into Resources/fab
set_source_files_properties(${PY_FAB_FILES}
PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/fab"
)

add_executable(${ANTIMONY_APP} MACOSX_BUNDLE
${SRC_FILES}
${SB_ICON}
${PY_FAB_FILES}
)

# Set application Info.plist file
set_target_properties(${ANTIMONY_APP} PROPERTIES
MACOSX_BUNDLE_INFO_PLIST ../deploy/mac/Info.plist
)

# Copy node directory into application bundle
add_custom_command(TARGET ${ANTIMONY_APP} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/py/nodes
${CMAKE_CURRENT_BINARY_DIR}/${ANTIMONY_APP}.app/Contents/Resources/nodes)
else()
set(ANTIMONY_APP antimony)
add_executable(${ANTIMONY_APP} ${SRC_FILES})

# Copy node and fab directory into build directory
add_custom_command(TARGET ${ANTIMONY_APP} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/py/nodes
${CMAKE_CURRENT_BINARY_DIR}/sb/nodes)
add_custom_command(TARGET ${ANTIMONY_APP} POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
${CMAKE_SOURCE_DIR}/py/fab
${CMAKE_CURRENT_BINARY_DIR}/sb/fab)

install(TARGETS antimony
DESTINATION /usr/local/bin)
install(DIRECTORY ../py/nodes
DESTINATION /usr/local/share/antimony)
install(DIRECTORY ../py/fab
DESTINATION /usr/local/share/antimony)
endif()

target_link_libraries(${ANTIMONY_APP}
Qt5::Widgets
Qt5::Gui
Qt5::OpenGL
Qt5::Network
Qt5::Concurrent
SbGraph
SbFab)

################################################################################

execute_process(COMMAND git log --pretty=format:'%h' -n 1
OUTPUT_VARIABLE GITREV)
execute_process(COMMAND bash -c "git diff --quiet --exit-code || echo +"
OUTPUT_VARIABLE GITDIFF)
execute_process(COMMAND git describe --exact-match --tags
OUTPUT_VARIABLE GITTAG
ERROR_QUIET)
execute_process(COMMAND git rev-parse --abbrev-ref HEAD
OUTPUT_VARIABLE GITBRANCH)

add_definitions(-D'GITREV="${GITREV}${GITDIFF}"'
-D'GITTAG="${GITTAG}"'
-D'GITBRANCH="${GITBRANCH}"')

################################################################################

target_include_directories(${ANTIMONY_APP} SYSTEM PRIVATE
${PYTHON_INCLUDE_DIRS}
${Boost_INCLUDE_DIRS}
${AUTOGEN_TARGETS_FOLDER}
)

################################################################################

set_property(TARGET ${ANTIMONY_APP} PROPERTY CXX_STANDARD 11)

0 comments on commit e8480c7

Please sign in to comment.