Commit 11ff6c69 authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[CHANGE] adapted scripting api to our general project organization.

parent 69eb18ad
......@@ -136,22 +136,31 @@ ADD_DEPENDENCIES( install_devdoc core_devdoc )
# build core
ADD_SUBDIRECTORY( core )
# -----------------------------------------------------------------------------------------------------------------------------------------------
# scripting library
# we need a name we can use for other GUI and libs if they want to link against the script lib
SET( OW_LIB_OPENWALNUTSCRIPT "openwalnut-scripting" )
# build scripting subsystem
ADD_SUBDIRECTORY( scripting )
# -----------------------------------------------------------------------------------------------------------------------------------------------
# QT4 GUI
OPTION( OW_GUI_QT4 "Enable this to build the QT4-based OpenWalnut GUI." ON )
IF( OW_GUI_QT4 )
SET( OWQt4GuiName "qt4gui" )
SET( OWBinaryName "openwalnut-qt4" )
# build
ADD_SUBDIRECTORY( qt4gui )
ENDIF()
OPTION( OW_GUI_SCRIPT "Enable this to build the script-based OpenWalnut NOGUI." ON )
# -----------------------------------------------------------------------------------------------------------------------------------------------
# Scripting GUI
OPTION( OW_GUI_SCRIPT "Enable this to build the script-based OpenWalnut interface for commandline-only use." ON )
IF( OW_GUI_SCRIPT )
# build
ADD_SUBDIRECTORY( scriptGui )
ADD_SUBDIRECTORY( scriptgui )
ENDIF()
# -----------------------------------------------------------------------------------------------------------------------------------------------
......
......@@ -39,25 +39,12 @@ ADD_DEFINITIONS( '-DW_LIB_SUFFIX="${CMAKE_SHARED_LIBRARY_SUFFIX}"' )
# Add sources as target
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# python
FIND_PACKAGE( PythonLibs REQUIRED )
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS} )
# lua
FIND_PACKAGE( Lua51 REQUIRED )
INCLUDE_DIRECTORIES( ${LUA_INCLUDE_DIR} )
FIND_PACKAGE( Luabind REQUIRED )
INCLUDE_DIRECTORIES( ${LUABIND_INCLUDE_DIR} )
# Collect the compile-files for this target
COLLECT_COMPILE_FILES( "${CMAKE_CURRENT_SOURCE_DIR}" TARGET_CPP_FILES TARGET_H_FILES TARGET_TEST_FILES )
# Setup the target
ADD_LIBRARY( ${LibName} SHARED ${TARGET_CPP_FILES} ${TARGET_H_FILES} ${OW_VERSION_HEADER} )
TARGET_LINK_LIBRARIES( ${LibName} ${Boost_LIBRARIES} ${CMAKE_DL_LIBS} ${OPENGL_gl_LIBRARY} ${OPENSCENEGRAPH_LIBRARIES}
${PYTHON_LIBRARIES} ${LUA_LIBRARIES} ${LUABIND_LIBRARIES}
)
TARGET_LINK_LIBRARIES( ${LibName} ${Boost_LIBRARIES} ${CMAKE_DL_LIBS} ${OPENGL_gl_LIBRARY} ${OPENSCENEGRAPH_LIBRARIES} )
# Tell CMake that someone creates this file for us. See doc of SETUP_VERSION_HEADER for details why this is needed.
# NOTE: this needs to be placed AFTER ADD_EXECUTABLE or ADD_LIBRARY
......
......@@ -26,8 +26,8 @@
# Some common setup
# ---------------------------------------------------------------------------------------------------------------------------------------------------
SET( LibName ${OWQt4GuiName} )
SET( BinName ${OWBinaryName} )
SET( LibName "qt4gui" )
SET( BinName "openwalnut-qt4" )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Setup QT4
......
......@@ -26,12 +26,14 @@
# Some common setup
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Setup QT4
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# NOTE: to ensure a uniqze script gui name, add gui to the script lib name. This is used as target name in cmake and is NOT the name of the
# binary.
SET( LibName "${OW_LIB_OPENWALNUTSCRIPT}-gui" )
# NOTE: ensure that this name is uniqe. It must not match the scripting lib's name
SET( BinaryName "openwalnut-script" )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# GUI compilation options
# Search additional dependencies
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------------------------------------
......@@ -45,37 +47,43 @@ COLLECT_COMPILE_FILES( "${CMAKE_CURRENT_SOURCE_DIR}" TARGET_CPP_FILES TARGET_H_F
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} )
# Setup the target
ADD_EXECUTABLE( openwalnut-script OpenWalnutScript.cpp ${OW_VERSION_HEADER} )
# Some linux distributions need to explicitily link against X11. We add this lib here.
IF( CMAKE_HOST_SYSTEM MATCHES "Linux" )
SET( ADDITIONAL_TARGET_LINK_LIBRARIES "X11" )
ENDIF()
TARGET_LINK_LIBRARIES( openwalnut-script ${OW_LIB_OPENWALNUT} ${QT_LIBS} ${Boost_LIBRARIES} ${ADDITIONAL_TARGET_LINK_LIBRARIES} )
ADD_EXECUTABLE( ${BinaryName} OpenWalnutScript.cpp ${OW_VERSION_HEADER} )
TARGET_LINK_LIBRARIES( ${BinaryName} ${OW_LIB_OPENWALNUT} ${OW_LIB_OPENWALNUTSCRIPT} ${Boost_LIBRARIES} )
# Tell CMake that someone creates this file for us. See doc of SETUP_VERSION_HEADER for details why this is needed.
# NOTE: this needs to be placed AFTER ADD_EXECUTABLE or ADD_LIBRARY
SETUP_USE_VERSION_HEADER( openwalnut-script )
SETUP_USE_VERSION_HEADER( ${BinaryName} )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Test Setup
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Setup tests of this target
SETUP_TESTS( "${TARGET_TEST_FILES}" "openwalnut-script" "" )
SETUP_TESTS( "${TARGET_TEST_FILES}" "${LibName}" "" )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Doxygen Release documentation
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# included in standard developer doc
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Copy local resources
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# where to put doc files?
SET( OW_DOC_DIR_RELATIVE "share/doc/openwalnut-script" )
# no local resources yet
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Copy Shaders
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# no shaders
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Style Checker
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# setup the stylechecker. Ignore the platform specific stuff.
SETUP_STYLECHECKER( "openwalnut-script"
SETUP_STYLECHECKER( "${LibName}"
"${TARGET_CPP_FILES};${TARGET_H_FILES};${TARGET_TEST_FILES};${TARGET_GLSL_FILES}" # add all these files to the stylechecker
"" ) # exlude some ugly files
#---------------------------------------------------------------------------
#
# Project: OpenWalnut ( http://www.openwalnut.org )
#
# Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
# For more information see http:#www.openwalnut.org/copying
#
# This file is part of OpenWalnut.
#
# OpenWalnut is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenWalnut is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with OpenWalnut. If not, see <http:#www.gnu.org/licenses/>.
#
#---------------------------------------------------------------------------
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Some common setup
# ---------------------------------------------------------------------------------------------------------------------------------------------------
SET( LibName ${OW_LIB_OPENWALNUTSCRIPT} )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Search additional dependencies
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Python
FIND_PACKAGE( PythonLibs REQUIRED )
INCLUDE_DIRECTORIES( ${Boost_INCLUDE_DIR} ${PYTHON_INCLUDE_DIRS} )
# Lua
FIND_PACKAGE( Lua51 REQUIRED )
INCLUDE_DIRECTORIES( ${LUA_INCLUDE_DIR} )
FIND_PACKAGE( Luabind REQUIRED )
INCLUDE_DIRECTORIES( ${LUABIND_INCLUDE_DIR} )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Add sources as target
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Collect the compile-files for this target
COLLECT_COMPILE_FILES( "${CMAKE_CURRENT_SOURCE_DIR}" TARGET_CPP_FILES TARGET_H_FILES TARGET_TEST_FILES )
# Setup the target
ADD_LIBRARY( ${LibName} SHARED ${TARGET_CPP_FILES} ${TARGET_H_FILES} ${OW_VERSION_HEADER} )
TARGET_LINK_LIBRARIES( ${LibName} ${OW_LIB_OPENWALNUTSCRIPT}
${Boost_LIBRARIES} ${PYTHON_LIBRARIES} ${LUA_LIBRARIES} ${LUABIND_LIBRARIES}
)
# Tell CMake that someone creates this file for us. See doc of SETUP_VERSION_HEADER for details why this is needed.
# NOTE: this needs to be placed AFTER ADD_EXECUTABLE or ADD_LIBRARY
SETUP_USE_VERSION_HEADER( ${LibName} )
# Set the version of the library.
SET_TARGET_PROPERTIES( ${LibName} PROPERTIES
VERSION ${OW_LIB_VERSION}
SOVERSION ${OW_SOVERSION}
)
# Do not forget the install targets
SETUP_LIB_INSTALL( ${LibName} ${OW_LIBRARY_DIR_RELATIVE} "SCRIPT" )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Test Setup
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Setup tests of this target
SETUP_TESTS( "${TARGET_TEST_FILES}" "${LibName}" "" )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Doxygen Release documentation
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# included in standard developer doc
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Copy local resources
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# no local resources yet
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Copy Shaders
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# no shaders
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Style Checker
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# setup the stylechecker. Ignore the platform specific stuff.
SETUP_STYLECHECKER( "${LibName}"
"${TARGET_CPP_FILES};${TARGET_H_FILES};${TARGET_TEST_FILES};${TARGET_GLSL_FILES}" # add all these files to the stylechecker
"" ) # exlude some ugly files
......@@ -24,9 +24,9 @@
#include <string>
#include "../../common/WLogger.h"
#include "core/common/WLogger.h"
#include "../../kernel/WKernel.h"
#include "core/kernel/WKernel.h"
#include "../wrappers/WLoggerWrapper.h"
#include "../wrappers/WModuleWrapper.h"
......
......@@ -24,7 +24,7 @@
#include <string>
#include "../../kernel/WKernel.h"
#include "core/kernel/WKernel.h"
#include "../wrappers/WLoggerWrapper.h"
#include "../wrappers/WModuleWrapper.h"
......
......@@ -27,7 +27,7 @@
#include <boost/shared_ptr.hpp>
#include "../../kernel/WModuleInputConnector.h"
#include "core/kernel/WModuleInputConnector.h"
#include "WOutputConnectorWrapper.h"
......
......@@ -26,9 +26,9 @@
#include <fstream>
#include <string>
#include "../../common/WAssert.h"
#include "../../common/WLogger.h"
#include "../../common/WLogStream.h"
#include "core/common/WAssert.h"
#include "core/common/WLogger.h"
#include "core/common/WLogStream.h"
#include "WLoggerWrapper.h"
......
......@@ -32,8 +32,8 @@
#include <boost/tuple/tuple.hpp>
#include "../../common/WLogger.h"
#include "../../common/WLogStream.h"
#include "core/common/WLogger.h"
#include "core/common/WLogStream.h"
/**
* \class WLoggerWrapper
......
......@@ -24,7 +24,7 @@
#include <string>
#include "../../kernel/WModuleFactory.h"
#include "core/kernel/WModuleFactory.h"
#include "WModuleContainerWrapper.h"
......
......@@ -29,7 +29,7 @@
#include <boost/shared_ptr.hpp>
#include "../../kernel/WModuleContainer.h"
#include "core/kernel/WModuleContainer.h"
#include "WModuleWrapper.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment