CMake-files updated for installation of Telldus Center on Linux
This commit is contained in:
parent
ac04adc3a4
commit
e90cf53c6f
5 changed files with 34 additions and 13 deletions
|
@ -25,6 +25,9 @@ SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
IF (WIN32)
|
IF (WIN32)
|
||||||
SET(TELLDUSCORE_INCLUDE_DIR "" CACHE PATH "Path to the directory which contains telldus-core.h")
|
SET(TELLDUSCORE_INCLUDE_DIR "" CACHE PATH "Path to the directory which contains telldus-core.h")
|
||||||
|
ELSEIF(UNIX)
|
||||||
|
SET(PLUGIN_LIB_PATH "lib" CACHE STRING "Relative path to the directory to install TelldusCenter plugin libraries into")
|
||||||
|
SET(PLUGIN_LIB_FULL_PATH "${PLUGIN_LIB_PATH}/telldus/tellduscenter/plugins")
|
||||||
ENDIF (WIN32)
|
ENDIF (WIN32)
|
||||||
|
|
||||||
if(BUILD_LIBTELLDUS-GUI)
|
if(BUILD_LIBTELLDUS-GUI)
|
||||||
|
|
|
@ -35,14 +35,14 @@ SET(translation_sources ${Plugin_SRCS})
|
||||||
|
|
||||||
IF(Plugin_PATH)
|
IF(Plugin_PATH)
|
||||||
STRING(REPLACE "." "/"
|
STRING(REPLACE "." "/"
|
||||||
path ${Plugin_PATH}
|
Plugin_PATH_relative ${Plugin_PATH}
|
||||||
)
|
)
|
||||||
IF (APPLE)
|
IF (APPLE)
|
||||||
SET(Plugin_PATH "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/TelldusCenter.app/Contents/Plugins/script/${path}")
|
SET(Plugin_PATH "${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/TelldusCenter.app/Contents/Plugins/script/${Plugin_PATH_relative}")
|
||||||
ELSEIF (WIN32)
|
ELSEIF (WIN32)
|
||||||
SET(Plugin_PATH "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/Plugins/script/${path}")
|
SET(Plugin_PATH "${LIBRARY_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/Plugins/script/${Plugin_PATH_relative}")
|
||||||
ELSE (APPLE)
|
ELSE (APPLE)
|
||||||
SET(Plugin_PATH "${CMAKE_BINARY_DIR}/TelldusCenter/Plugins/script/${path}")
|
SET(Plugin_PATH "${CMAKE_BINARY_DIR}/TelldusCenter/Plugins/script/${Plugin_PATH_relative}")
|
||||||
ENDIF (APPLE)
|
ENDIF (APPLE)
|
||||||
|
|
||||||
LIST(APPEND translation_sources
|
LIST(APPEND translation_sources
|
||||||
|
@ -89,6 +89,9 @@ IF(Plugin_SRCS)
|
||||||
SET_TARGET_PROPERTIES(${Plugin_NAME} PROPERTIES
|
SET_TARGET_PROPERTIES(${Plugin_NAME} PROPERTIES
|
||||||
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/TelldusCenter/Plugins/script
|
LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/TelldusCenter/Plugins/script
|
||||||
)
|
)
|
||||||
|
INSTALL(TARGETS ${Plugin_NAME}
|
||||||
|
LIBRARY DESTINATION "${PLUGIN_LIB_FULL_PATH}/script"
|
||||||
|
)
|
||||||
ENDIF (APPLE)
|
ENDIF (APPLE)
|
||||||
ELSE(Plugin_SRCS)
|
ELSE(Plugin_SRCS)
|
||||||
ADD_CUSTOM_TARGET(${Plugin_NAME} ALL
|
ADD_CUSTOM_TARGET(${Plugin_NAME} ALL
|
||||||
|
@ -109,6 +112,8 @@ IF(Plugin_PATH)
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy ${_FILE} ${Plugin_PATH}
|
COMMAND ${CMAKE_COMMAND} -E copy ${_FILE} ${Plugin_PATH}
|
||||||
COMMENT "Copy ${_FILENAME} for plugin ${Plugin_NAME}"
|
COMMENT "Copy ${_FILENAME} for plugin ${Plugin_NAME}"
|
||||||
)
|
)
|
||||||
|
INSTALL(FILES ${_FILE} DESTINATION "${PLUGIN_LIB_FULL_PATH}/script/${Plugin_PATH_relative}")
|
||||||
ENDFOREACH(_FILE)
|
ENDFOREACH(_FILE)
|
||||||
ENDIF(Plugin_PATH)
|
ENDIF(Plugin_PATH)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -6,6 +6,7 @@ INCLUDE( ${QT_USE_FILE} )
|
||||||
|
|
||||||
if(COMMAND cmake_policy)
|
if(COMMAND cmake_policy)
|
||||||
cmake_policy(SET CMP0003 NEW)
|
cmake_policy(SET CMP0003 NEW)
|
||||||
|
cmake_policy(SET CMP0005 NEW)
|
||||||
endif(COMMAND cmake_policy)
|
endif(COMMAND cmake_policy)
|
||||||
|
|
||||||
######## Non configurable options ########
|
######## Non configurable options ########
|
||||||
|
@ -99,7 +100,7 @@ ELSEIF (WIN32) #### Windows ####
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/TelldusCenter.rc
|
${CMAKE_CURRENT_BINARY_DIR}/TelldusCenter.rc
|
||||||
)
|
)
|
||||||
ELSE (APPLE) #### Linux ####
|
ELSE (APPLE) #### Linux ####
|
||||||
|
ADD_DEFINITIONS( -DPLUGIN_LIB_PATH=${CMAKE_INSTALL_PREFIX}/${PLUGIN_LIB_FULL_PATH} )
|
||||||
ENDIF (APPLE)
|
ENDIF (APPLE)
|
||||||
|
|
||||||
######## QtSingleApplication ########
|
######## QtSingleApplication ########
|
||||||
|
@ -158,3 +159,7 @@ IF (APPLE)
|
||||||
)
|
)
|
||||||
ENDIF (APPLE)
|
ENDIF (APPLE)
|
||||||
|
|
||||||
|
INSTALL(TARGETS ${telldus-center_TARGET}
|
||||||
|
RUNTIME DESTINATION bin
|
||||||
|
)
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,9 @@
|
||||||
#include "plugintree.h"
|
#include "plugintree.h"
|
||||||
#include "scriptenvironment.h"
|
#include "scriptenvironment.h"
|
||||||
|
|
||||||
|
#define DEFINE_STRING_HELPER(X) #X
|
||||||
|
#define DEFINE_STRING(X) DEFINE_STRING_HELPER(X)
|
||||||
|
|
||||||
class TelldusCenterPlugin;
|
class TelldusCenterPlugin;
|
||||||
|
|
||||||
typedef QList<TelldusCenterPlugin *> PluginList;
|
typedef QList<TelldusCenterPlugin *> PluginList;
|
||||||
|
@ -95,12 +98,17 @@ void TelldusCenterApplication::loadPlugins() {
|
||||||
pluginsDir.cdUp();
|
pluginsDir.cdUp();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (!pluginsDir.cd("Plugins")) {
|
|
||||||
return;
|
if (pluginsDir.cd("Plugins")) {
|
||||||
|
this->setLibraryPaths( QStringList(pluginsDir.absolutePath()) );
|
||||||
}
|
}
|
||||||
|
|
||||||
this->setLibraryPaths( QStringList(pluginsDir.absolutePath()) );
|
|
||||||
|
|
||||||
|
#if defined(Q_OS_UNIX)
|
||||||
|
QStringList paths = QStringList() << DEFINE_STRING(PLUGIN_LIB_PATH);
|
||||||
|
this->setLibraryPaths( paths );
|
||||||
|
#endif
|
||||||
|
|
||||||
QScriptValue mainWindowObject = d->scriptEnvironment->engine()->newQObject(d->mainWindow);
|
QScriptValue mainWindowObject = d->scriptEnvironment->engine()->newQObject(d->mainWindow);
|
||||||
d->scriptEnvironment->engine()->globalObject().property("application").setProperty("mainwindow", mainWindowObject);
|
d->scriptEnvironment->engine()->globalObject().property("application").setProperty("mainwindow", mainWindowObject);
|
||||||
|
|
||||||
|
|
|
@ -142,9 +142,9 @@ TARGET_LINK_LIBRARIES( ${telldus-gui_TARGET} ${telldus-gui_LIBRARIES} )
|
||||||
SET_PROPERTY(TARGET ${telldus-gui_TARGET}
|
SET_PROPERTY(TARGET ${telldus-gui_TARGET}
|
||||||
PROPERTY FRAMEWORK TRUE
|
PROPERTY FRAMEWORK TRUE
|
||||||
)
|
)
|
||||||
SET_PROPERTY(TARGET ${telldus-gui_TARGET}
|
#SET_PROPERTY(TARGET ${telldus-gui_TARGET}
|
||||||
PROPERTY PUBLIC_HEADER ${telldus-gui_HDRS}
|
# PROPERTY PUBLIC_HEADER ${telldus-gui_HDRS}
|
||||||
)
|
#)
|
||||||
|
|
||||||
SET_PROPERTY(TARGET ${telldus-gui_TARGET}
|
SET_PROPERTY(TARGET ${telldus-gui_TARGET}
|
||||||
PROPERTY VERSION ${PACKAGE_VERSION}
|
PROPERTY VERSION ${PACKAGE_VERSION}
|
||||||
|
@ -154,6 +154,6 @@ SET_PROPERTY(TARGET ${telldus-gui_TARGET}
|
||||||
)
|
)
|
||||||
|
|
||||||
INSTALL(TARGETS ${telldus-gui_TARGET}
|
INSTALL(TARGETS ${telldus-gui_TARGET}
|
||||||
DESTINATION lib
|
LIBRARY DESTINATION lib
|
||||||
# PUBLIC_HEADER DESTINATION ${HEADER_DIR}
|
# PUBLIC_HEADER DESTINATION ${HEADER_DIR}
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue