##// END OF EJS Templates
Configuration update to permit make install on linux
perrinel -
r257:40b3607afb8e
parent child
Show More
@@ -67,6 +67,11 set_property(TARGET ${EXECUTABLE_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
67 67 target_link_libraries(${EXECUTABLE_NAME}
68 68 ${LIBRARIES})
69 69
70 INSTALL(TARGETS ${EXECUTABLE_NAME}
71 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
72 LIBRARY DESTINATION ${INSTALL_BINARY_DIR}
73 ARCHIVE DESTINATION ${INSTALL_BINARY_DIR}
74 )
70 75 # Link with Qt5 modules
71 76 qt5_use_modules(${EXECUTABLE_NAME} Core Widgets)
72 77
@@ -31,8 +31,19
31 31 namespace {
32 32
33 33 /// Name of the directory containing the plugins
34
35 #if _WIN32 || _WIN64
34 36 const auto PLUGIN_DIRECTORY_NAME = QStringLiteral("plugins");
37 #endif
38
35 39
40 #if __GNUC__
41 #if __x86_64__ || __ppc64__
42 #define ENVIRONMENT64
43 #else
44 #define ENVIRONMENT32
45 #endif
46 #endif
36 47 } // namespace
37 48
38 49 int main(int argc, char *argv[])
@@ -46,9 +57,19 int main(int argc, char *argv[])
46 57
47 58 // Loads plugins
48 59 auto pluginDir = QDir{sqpApp->applicationDirPath()};
60 #if _WIN32 || _WIN64
49 61 pluginDir.mkdir(PLUGIN_DIRECTORY_NAME);
50 62 pluginDir.cd(PLUGIN_DIRECTORY_NAME);
63 #endif
64
51 65
66 #if __GNUC__
67 #if __x86_64__ || __ppc64__
68 pluginDir.cd("../lib64/SciQlop");
69 #else
70 pluginDir.cd("../lib/SciQlop");
71 #endif
72 #endif
52 73 qCDebug(LOG_PluginManager())
53 74 << QObject::tr("Plugin directory: %1").arg(pluginDir.absolutePath());
54 75
@@ -1,17 +1,3
1 #
2 # Sciqlop_modules.cmake
3 #
4 # Set ouptut directories
5 #
6 SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
7 SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
8 IF (UNIX)
9 SET (CONFIG_OUTPUT_PATH $ENV{HOME}/.config/QtProject)
10 ELSEIF(WIN32)
11 SET (CONFIG_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/app/QtProject)
12 ELSE()
13 SET (CONFIG_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
14 ENDIF()
15 1
16 2 if(BUILD_TESTS)
17 3 INCLUDE ("cmake/sciqlop_code_coverage.cmake")
@@ -44,6 +44,30 else()
44 44 set(libRootDirForceValue)
45 45 endif()
46 46
47 #
48 # Sciqlop_modules.cmake
49 #
50 # Set ouptut directories
51 #
52 IF (UNIX)
53 # 32 or 64 bits compiler
54 IF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
55 SET(defaultLib "lib64/sciqlop")
56 ELSE()
57 SET(defaultLib "lib/sciqlop")
58 ENDIF()
59 SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/bin)
60 SET (CONFIG_OUTPUT_PATH $ENV{HOME}/.config/QtProject)
61 SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/${defaultLib})
62 ELSEIF(WIN32)
63 SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
64 SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
65 SET (CONFIG_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist/app/QtProject)
66 ELSE()
67 SET (EXECUTABLE_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
68 SET (CONFIG_OUTPUT_PATH $ENV{HOME}/.config/QtProject)
69 SET (LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/dist)
70 ENDIF()
47 71
48 72
49 73 #
@@ -54,33 +78,51 OPTION (BUILD_SHARED_LIBS "Build the shared libraries" ON)
54 78 # Generate position independant code (-fPIC)
55 79 SET(CMAKE_POSITION_INDEPENDENT_CODE TRUE)
56 80
57 #
58 # Configure installation directories
59 #
81
82
83 # Configuration for make install
84
85 set(PROJECT_PLUGIN_PREFIX "SciQlop")
86
60 87 IF (UNIX)
88 SET(CMAKE_INSTALL_PREFIX "/usr/local/${PROJECT_PLUGIN_PREFIX}")
61 89 SET(defaultBin "bin")
62 90 SET(defaultInc "include/sciqlop")
63 91
64 92 # 32 or 64 bits compiler
65 93 IF( CMAKE_SIZEOF_VOID_P EQUAL 8 )
66 SET(defaultLib "lib64/sciqlop")
94 SET(defaultLib "lib64")
95 SET(defaultPluginsLib "lib64/${PROJECT_PLUGIN_PREFIX}")
67 96 ELSE()
68 SET(defaultLib "lib/sciqlop")
97 SET(defaultLib "lib/")
98 SET(defaultPluginsLib "lib/${PROJECT_PLUGIN_PREFIX}")
69 99 ENDIF()
70 100
71 SET(defaultDoc "share/docs/sciqlop")
101 SET(defaultDoc "share/docs/${PROJECT_PLUGIN_PREFIX}")
72 102 ELSE()
73 103 SET(defaultBin "bin")
74 SET(defaultInc "include/sciqlop")
75 SET(defaultLib "lib/sciqlop")
76 SET(defaultDoc "docs/sciqlop")
104 SET(defaultInc "include/${PROJECT_PLUGIN_PREFIX}")
105 SET(defaultLib "lib")
106 SET(defaultPluginsLib "lib/${PROJECT_PLUGIN_PREFIX}")
107 SET(defaultDoc "docs/${PROJECT_PLUGIN_PREFIX}")
77 108 ENDIF()
78 109
79 110 SET(INSTALL_BINARY_DIR "${defaultBin}" CACHE STRING
80 111 "Installation directory for binaries")
81 112 SET(INSTALL_LIBRARY_DIR "${defaultLib}" CACHE STRING
82 113 "Installation directory for libraries")
114 SET(INSTALL_PLUGINS_LIBRARY_DIR "${defaultPluginsLib}" CACHE STRING
115 "Installation directory for libraries")
83 116 SET(INSTALL_INCLUDE_DIR "${defaultInc}" CACHE STRING
84 117 "Installation directory for headers")
85 118 SET(INSTALL_DOCUMENTATION_DIR "${defaultDoc}" CACHE STRING
86 119 "Installation directory for documentations")
120
121
122 # Set the rpath when installing
123 SET(CMAKE_SKIP_BUILD_RPATH FALSE)
124 SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
125 SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBRARY_DIR}")
126 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
127
128 message("Install RPATH: ${CMAKE_INSTALL_PREFIX}/${INSTALL_LIBRARY_DIR}")
@@ -41,6 +41,12 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
41 41 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME})
42 42 qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core)
43 43
44 INSTALL(TARGETS ${SQPCORE_LIBRARY_NAME}
45 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
46 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
47 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
48 )
49
44 50 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
45 51 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
46 52 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
@@ -1,5 +1,7
1 1 #include <DataSource/DataSourceItemAction.h>
2 2
3 #include <functional>
4
3 5 Q_LOGGING_CATEGORY(LOG_DataSourceItemAction, "DataSourceItemAction")
4 6
5 7 struct DataSourceItemAction::DataSourceItemActionPrivate {
@@ -67,6 +67,12 set_property(TARGET ${SQPGUI_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
67 67 TARGET_LINK_LIBRARIES(${SQPGUI_LIBRARY_NAME} ${LIBRARIES})
68 68 qt5_use_modules(${SQPGUI_LIBRARY_NAME} Core Widgets PrintSupport)
69 69
70
71 INSTALL(TARGETS ${SQPGUI_LIBRARY_NAME}
72 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
73 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
74 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
75 )
70 76 add_dependencies(${SQPGUI_LIBRARY_NAME} ${SQPCORE_LIBRARY_NAME})
71 77
72 78
@@ -19,6 +19,12 FILE (GLOB_RECURSE MODULE_SOURCES
19 19
20 20 ADD_LIBRARY(${SQPPLUGIN_LIBRARY_NAME} ${MODULE_SOURCES})
21 21
22 INSTALL(TARGETS ${SQPPLUGIN_LIBRARY_NAME}
23 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
24 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
25 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
26 )
27
22 28
23 29 # Add the files to the list of files to be analyzed
24 30 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
@@ -49,6 +49,13 ADD_LIBRARY(${SQPMOCKPLUGIN_LIBRARY_NAME} ${MODULE_SOURCES})
49 49 set_property(TARGET ${SQPMOCKPLUGIN_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
50 50 set_property(TARGET ${SQPMOCKPLUGIN_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
51 51
52 INSTALL(TARGETS ${SQPMOCKPLUGIN_LIBRARY_NAME}
53 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
54 LIBRARY DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR}
55 ARCHIVE DESTINATION ${INSTALL_PLUGINS_LIBRARY_DIR}
56 )
57
58
52 59 TARGET_LINK_LIBRARIES(${SQPMOCKPLUGIN_LIBRARY_NAME} ${LIBRARIES})
53 60 qt5_use_modules(${SQPMOCKPLUGIN_LIBRARY_NAME} Core Widgets)
54 61
General Comments 0
You need to be logged in to leave comments. Login now