Commit a4d6be6a authored by Sebastian Eichelbaum's avatar Sebastian Eichelbaum
Browse files

[ADD] - install targets for the libs/binaries added. Also fixed some structure...

[ADD] - install targets for the libs/binaries added. Also fixed some structure for documentation in target dir
parent 178cffbe
......@@ -86,6 +86,8 @@ SET( OW_CONFIG_DIR_RELATIVE "etc/OpenWalnut" )
SET( OW_CONFIG_DIR ${PROJECT_BINARY_DIR}/${OW_CONFIG_DIR_RELATIVE} )
SET( OW_SHARE_DIR_RELATIVE "share/OpenWalnut" )
SET( OW_SHARE_DIR ${PROJECT_BINARY_DIR}/${OW_SHARE_DIR_RELATIVE} )
SET( OW_DOC_DIR_RELATIVE "share/doc/OpenWalnut" )
SET( OW_DOC_DIR ${PROJECT_BINARY_DIR}/${OW_DOC_DIR_RELATIVE} )
SET( OW_RUNTIME_DIR_RELATIVE "bin" )
SET( OW_RUNTIME_DIR ${PROJECT_BINARY_DIR}/${OW_RUNTIME_DIR_RELATIVE} )
SET( OW_LIBRARY_DIR_RELATIVE "lib" )
......@@ -265,6 +267,7 @@ IF( NOT EXISTS ${OW_CONFIG_DIR}/walnut.cfg )
CONFIGURE_FILE( ${PROJECT_SOURCE_DIR}/../resources/etc/OpenWalnut/walnut.cfg.official ${OW_CONFIG_DIR}/walnut.cfg COPYONLY )
MESSAGE( STATUS "Copied walnut.cfg.official to ${OW_CONFIG_DIR}/walnut.cfg" )
ENDIF()
INSTALL( FILES ${PROJECT_SOURCE_DIR}/../resources/etc/OpenWalnut/walnut.cfg.official DESTINATION ${OW_CONFIG_DIR_RELATIVE} RENAME walnut.cfg )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
......@@ -401,10 +404,3 @@ ADD_SUBDIRECTORY( qt4gui )
# build modules
ADD_SUBDIRECTORY( modules )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
#
# Installation Targets
#
# ---------------------------------------------------------------------------------------------------------------------------------------------------
......@@ -52,6 +52,15 @@ TARGET_LINK_LIBRARIES( ${LibName} ${OWExtBioSigName} ${OWExtEEPName} ${OWExtNift
${Boost_LIBRARIES} ${CMAKE_DL_LIBS} ${OPENGL_gl_LIBRARY} ${OPENSCENEGRAPH_LIBRARIES}
)
# Do not forget the install targets
INSTALL( TARGETS ${LibName}
LIBRARY
DESTINATION ${OW_LIBRARY_DIR_RELATIVE}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Test Setup
# ---------------------------------------------------------------------------------------------------------------------------------------------------
......
......@@ -59,6 +59,7 @@ void WPathHelper::setAppPath( boost::filesystem::path appPath )
{
m_appPath = appPath;
m_sharePath = m_appPath / "../share/OpenWalnut";
m_docPath = m_appPath / "../share/doc/OpenWalnut";
m_configPath = m_appPath / "../etc/OpenWalnut";
m_libPath = m_appPath / "../lib";
m_modulePath = m_libPath / "OpenWalnut";
......@@ -125,6 +126,11 @@ boost::filesystem::path WPathHelper::getSharePath()
return getPathHelper()->m_sharePath;
}
boost::filesystem::path WPathHelper::getDocPath()
{
return getPathHelper()->m_docPath;
}
boost::filesystem::path WPathHelper::getConfigPath()
{
return getPathHelper()->m_configPath;
......
......@@ -154,6 +154,13 @@ public:
*/
static boost::filesystem::path getSharePath();
/**
* The path where the doc files reside in.
*
* \return the doc file path.
*/
static boost::filesystem::path getDocPath();
/**
* The path where the config files reside in.
*
......@@ -180,6 +187,11 @@ private:
*/
boost::filesystem::path m_sharePath;
/**
* The path where all the documentation files reside in.
*/
boost::filesystem::path m_docPath;
/**
* The path where all the config files reside in.
*/
......
......@@ -83,6 +83,15 @@ INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR} )
ADD_EXECUTABLE( ${BinName} ${TARGET_CPP_FILES} ${TARGET_H_FILES} "version.h" )
TARGET_LINK_LIBRARIES( ${BinName} ${OWCoreName} ${QT_LIBS} ${Boost_LIBRARIES} )
# Do not forget the install targets
INSTALL( TARGETS ${BinName}
RUNTIME
DESTINATION ${OW_RUNTIME_DIR_RELATIVE}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
# TODO(all): comment this stuff. I do not know what the purpose is
IF( MSVC_IDE )
SET_TARGET_PROPERTIES( ${BinName} PROPERTIES DEBUG_POSTFIX "d")
......@@ -103,16 +112,13 @@ SETUP_TESTS( "${TARGET_TEST_FILES}" "${BinName}" "" )
# Copy the help documents. This is not in the resource directory since it is qt4gui specific, so we need to copy it.
ADD_CUSTOM_TARGET( help
ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/../doc/user/help/ ${OW_SHARE_DIR}/${LibName}/
COMMENT "Copy the GUI help"
)
# Copy the icons of the GUI. They might be needed in the help system
ADD_CUSTOM_TARGET( icons
ALL
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/icons/ ${OW_SHARE_DIR}/${LibName}/icons
COMMENT "Copy the GUI icons"
COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/../doc/user/help/ ${OW_DOC_DIR}/${LibName}/
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/icons/ ${OW_DOC_DIR}/${LibName}/icons
COMMENT "Copy the GUI Documentation"
)
# Also create an install target for this
INSTALL( DIRECTORY ${PROJECT_SOURCE_DIR}/../doc/user/help/ DESTINATION ${OW_DOC_DIR_RELATIVE}/${LibName} )
INSTALL( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/icons DESTINATION ${OW_DOC_DIR_RELATIVE}/${LibName} )
# ---------------------------------------------------------------------------------------------------------------------------------------------------
# Style Checker
......
......@@ -752,14 +752,14 @@ void WMainWindow::openAboutQtDialog()
void WMainWindow::openAboutDialog()
{
std::string filename( WPathHelper::getSharePath().file_string() + "/OpenWalnutAbout.html" );
std::string filename( WPathHelper::getDocPath().file_string() + "/OpenWalnutAbout.html" );
std::string content = readFileIntoString( filename );
QMessageBox::about( this, "About OpenWalnut", content.c_str() );
}
void WMainWindow::openOpenWalnutHelpDialog()
{
std::string filename( WPathHelper::getSharePath().file_string() + "/qt4gui/OpenWalnutHelp.html" );
std::string filename( WPathHelper::getDocPath().file_string() + "/qt4gui/OpenWalnutHelp.html" );
std::string content = readFileIntoString( filename );
QWidget* window = new QWidget( this, Qt::Window );
......@@ -772,7 +772,7 @@ void WMainWindow::openOpenWalnutHelpDialog()
window->show();
QWebView *view = new QWebView( this );
QString location( QString( "file://" ) + WPathHelper::getSharePath().file_string().c_str() + "/qt4gui/" );
QString location( QString( "file://" ) + WPathHelper::getDocPath().file_string().c_str() + "/qt4gui/" );
view->setHtml( content.c_str(), QUrl( location ) );
view->show();
layout->addWidget( view );
......
......@@ -84,6 +84,16 @@ FUNCTION( SETUP_MODULE _MODULE_NAME _MODULE_SOURCE_DIR _MODULE_DEPENDENCIES _MOD
ADD_LIBRARY( ${MODULE_NAME} SHARED ${TARGET_CPP_FILES} ${TARGET_H_FILES} )
TARGET_LINK_LIBRARIES( ${MODULE_NAME} ${OWCoreName} ${Boost_LIBRARIES} ${OPENGL_gl_LIBRARY} ${OPENSCENEGRAPH_LIBRARIES} ${_MODULE_DEPENDENCIES} )
# Do not forget the install targets
# NOTE: do we really need to set all permissions explicitely?
INSTALL( TARGETS ${MODULE_NAME}
LIBRARY
DESTINATION ${MODULE_TARGET_DIR_RELATIVE}
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
# TODO(all): someone needs to explain this
IF(MSVC_IDE)
SET_TARGET_PROPERTIES( ${MODULE_NAME} PROPERTIES PREFIX "../")
......
......@@ -240,6 +240,12 @@ FUNCTION( SETUP_RESOURCES )
)
# Also specify install target
INSTALL( DIRECTORY ${ResourcesPath} DESTINATION "." )
INSTALL( DIRECTORY ${ResourcesPath}
DESTINATION "."
PATTERN "bin/*" # binaries need to be executable
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
GROUP_READ GROUP_EXECUTE
WORLD_READ WORLD_EXECUTE
)
ENDFUNCTION( SETUP_RESOURCES )
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