+ADD_SUBDIRECTORY( py )
+
+SET(MAIN_SOURCES
+ qui/mussagl.cpp)
+
+ADD_EXECUTABLE(mussagl WIN32 MACOSX_BUNDLE ${MAIN_SOURCES} )
+
+# For windows you need to go from library with the most dependencies
+# to the library with the least dependencies -diane
+TARGET_LINK_LIBRARIES(mussagl
+ mussa_qui
+ mussa_core
+ ${QT_LIBRARIES}
+ # Including QT_LIBS twice is for dealing with linking dependancies
+ # related to Qt Assistant Client on windows
+ ${QT_LIBRARIES}
+ ${Boost_FILESYSTEM_LIBRARY}
+ ${Boost_SERIALIZATION_LIBRARY}
+ ${Boost_SYSTEM_LIBRARY}
+ ${Boost_PROGRAM_OPTIONS_LIBRARY}
+ ${OPENGL_gl_LIBRARY}
+ )
+
+IF(USE_PYTHON)
+ SET(PYTHON_CFLAGS "-DUSE_PYTHON")
+ TARGET_LINK_LIBRARIES(mussagl
+ mussa_py
+ ${QT_LIBRARIES}
+#mussaqui_py
+ ${Boost_PYTHON_LIBRARY}
+ ${PYTHON_LIBRARIES}
+ ${PYTHON_LINK_LIBRARIES})
+ENDIF(USE_PYTHON)
+
+GET_MUSSA_COMPILE_FLAGS(MAIN_CFLAGS)
+GET_MUSSA_LINK_FLAGS(MAIN_LDFLAGS)
+
+SET_SOURCE_FILES_PROPERTIES(
+ ${MAIN_SOURCES}
+ PROPERTIES
+ COMPILE_FLAGS "${MAIN_CFLAGS} ${PYTHON_CFLAGS}"
+)
+SET_TARGET_PROPERTIES(
+ mussagl PROPERTIES
+ COMPILE_FLAGS "${MAIN_CFLAGS}"
+ LINK_FLAGS "${MAIN_LDFLAGS}"
+)
+
+# we need Cocoa in order to find where our base directory is (AKA bundle)
+IF(APPLE)
+ SET(COCOA_LIBRARY "-framework Cocoa")
+ TARGET_LINK_LIBRARIES(mussagl ${COCOA_LIBRARY})
+ SET(MACOSX_BUNDLE_BUNDLE_NAME "Mussa")
+ SET(MACOSX_BUNDLE_LONG_VERSION_STRING "Mussa Copyright 2004-2006 California Institute of Technology")
+ SET(MACOSX_BUNDLE_COPYRIGHT "Copyright 2004-2006 California Institute of Technology")
+ SET(MACOSX_BUNDLE_ICON_FILE "mussa.icns")
+
+ SET(APP_DIR ${CMAKE_BINARY_DIR}/mussagl.app/Contents)
+ SET(RESOURCE_DIR ${APP_DIR}/Resources})
+
+ ADD_CUSTOM_TARGET(mussa.icns ALL
+ cmake -E copy_directory ${CMAKE_SOURCE_DIR}/icons/osx
+ ${APP_DIR}
+ )
+ENDIF(APPLE)
+