##// END OF EJS Templates
Add config for windows compatibility of CatalogueAPI
perrinel -
r1060:e7c327b9c583
parent child
Show More
@@ -1,36 +1,36
1 1 STRING(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TO_LOWER)
2 SET(WINDEPLOYQT_ARGS --${CMAKE_BUILD_TYPE_TO_LOWER} --list mapping --no-system-d3d-compiler --compiler-runtime --dry-run)
2 SET(WINDEPLOYQT_ARGS --${CMAKE_BUILD_TYPE_TO_LOWER} --list mapping -network -sql --no-system-d3d-compiler --compiler-runtime --dry-run)
3 3
4 4 #FOREACH(qtModule @_qt5_modules@)
5 5 # STRING(TOLOWER ${qtModule} qtLowerModule)
6 6 # SET(WINDEPLOYQT_ARGS ${WINDEPLOYQT_ARGS} -${qtLowerModule})
7 7 #ENDFOREACH()
8 8
9 9 EXECUTE_PROCESS(
10 10 COMMAND windeployqt ${WINDEPLOYQT_ARGS} -printsupport ${SCIQLOP_EXE_LOCATION}
11 11 OUTPUT_VARIABLE QT_FILES
12 12 )
13 13
14 14 IF( QT_FILES )
15 15
16 16 STRING(REPLACE "\n" ";" QT_FILES ${QT_FILES})
17 17 LIST(APPEND QT_FILES_LIST ${QT_FILES})
18 18 FOREACH(QtFile ${QT_FILES_LIST})
19 19 STRING(REPLACE "\"" "" QtFile ${QtFile})
20 20 STRING(REPLACE "\\" "/" QtFile ${QtFile})
21 21 STRING(REGEX MATCH "^(.*) " QtFileSource ${QtFile})
22 22 STRING(REGEX MATCH " (.*)$" QtFileTarget ${QtFile})
23 23
24 24 STRING(STRIP ${QtFileSource} QtFileSource)
25 25 STRING(STRIP ${QtFileTarget} QtFileTarget)
26 26 GET_FILENAME_COMPONENT(QtFileTargetDir ${QtFileTarget} DIRECTORY)
27 27
28 28 IF(NOT EXISTS "${CMAKE_INSTALL_PREFIX}/${EXECUTABLE_OUTPUT_PATH}/${QtFileTarget}")
29 29 GET_FILENAME_COMPONENT(QtFileTargetDir ${QtFileTarget} DIRECTORY)
30 30 FILE(INSTALL DESTINATION "${EXECUTABLE_OUTPUT_PATH}/${QtFileTargetDir}" FILES "${QtFileSource}")
31 31 ENDIF()
32 32 ENDFOREACH()
33 33
34 34 ENDIF()
35 35
36 36 MESSAGE( "Exec windeployqt done" )
@@ -1,165 +1,168
1 1
2 2 ## core - CMakeLists.txt
3 3 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
4 4 SET(SQPCORE_LIBRARY_NAME "${LIBRARY_PREFFIX}_core${DEBUG_SUFFIX}")
5 5 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/")
6 6 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/")
7 7 SET(TESTS_RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tests-resources")
8 8
9 9 # Include core directory
10 10 include_directories("${INCLUDES_DIR}")
11 11
12 12 # Set a variable to display a warning in the version files.
13 13 SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.")
14 14 # Generate the version file from the cmake version variables. The version
15 15 # variables are defined in the cmake/sciqlop_version.cmake file.
16 16 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.h.in"
17 17 "${INCLUDES_DIR}/Version.h")
18 18 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in"
19 19 "${SOURCES_DIR}/Version.cpp")
20 20
21 21 # Find dependent modules
22 22 find_package(sciqlop-plugin)
23 23 INCLUDE_DIRECTORIES(${SCIQLOP-PLUGIN_INCLUDE_DIR})
24 24
25 25 #
26 26 # Find Qt modules
27 27 #
28 28 SCIQLOP_FIND_QT(Core Network)
29 29
30 30 #
31 31 # Compile the library library
32 32 #
33 33
34 34 ADD_DEFINITIONS(-DCORE_LIB)
35 35
36 36 FILE (GLOB_RECURSE MODULE_SOURCES
37 37 ${INCLUDES_DIR}/*.h
38 38 ${SOURCES_DIR}/*.c
39 39 ${SOURCES_DIR}/*.cpp
40 40 ${SOURCES_DIR}/*.h)
41 41
42 42 ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES})
43 43 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
44 44 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
45 45 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME})
46 46 qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core Network)
47 47
48 48 # Find CATALOGUE_API
49 49 if(CATALOGUEAPI_FOUND)
50 50 include_directories("${CATALOGUEAPI_INCLUDE_DIRS}")
51 51 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME} ${CATALOGUEAPI_LIBRARIES})
52 52 endif()
53 53
54 54 INSTALL(TARGETS ${SQPCORE_LIBRARY_NAME}
55 55 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
56 56 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
57 57 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
58 58 )
59 59
60 60 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
61 61 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
62 62 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
63 63 IF(BUILD_SHARED_LIBS)
64 64 SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
65 65 ELSE()
66 66 TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
67 67 ENDIF()
68 68
69 69 # Set the variable to parent scope so that the other projects can copy the
70 70 # dependent shared libraries
71 71 SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
72 72
73 73 # Copy extern shared libraries to the lib folder
74 LIST (APPEND ${EXTERN_SHARED_LIBRARIES} ${CATALOGUEAPI_LIBRARIES})
75
76 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${CATALOGUEAPI_LIBRARIES})
74 77 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
75
78
76 79 # Add the files to the list of files to be analyzed
77 80 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
78 81 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
79 82 # Vera++ exclusion files
80 83 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
81 84 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
82 85
83 86 #
84 87 # Compile the tests
85 88 #
86 89 IF(BUILD_TESTS)
87 90 INCLUDE_DIRECTORIES(${SOURCES_DIR})
88 91 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
89 92 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
90 93 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
91 94
92 95 SET(TARGETS_COV)
93 96 FOREACH( testFile ${TESTS_SOURCES} )
94 97 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
95 98 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
96 99
97 100 # Add to the list of sources files all the sources in the same
98 101 # directory that aren't another test
99 102 FILE (GLOB currentTestSources
100 103 ${testDirectory}/*.c
101 104 ${testDirectory}/*.cpp
102 105 ${testDirectory}/*.h)
103 106 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
104 107 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
105 108
106 109 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
107 110 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
108 111 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
109 112 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
110 113 qt5_use_modules(${testName} Test)
111 114
112 115 ADD_TEST( NAME ${testName} COMMAND ${testName} )
113 116
114 117 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
115 118 set(Coverage_NAME ${testName})
116 119 if(UNIX)
117 120 SETUP_TARGET_FOR_COVERAGE(TARGET ${testName}_coverage OUTPUT ${testFile}-path NAME ${testFile} EXECUTABLE ${testName})
118 121 LIST( APPEND TARGETS_COV ${testName}_coverage)
119 122 endif(UNIX)
120 123
121 124 ENDFOREACH( testFile )
122 125
123 126 add_custom_target(coverage)
124 127
125 128 FOREACH( target_cov ${TARGETS_COV} )
126 129 add_custom_command(TARGET coverage PRE_BUILD COMMAND make ${target_cov})
127 130 ENDFOREACH( target_cov )
128 131
129 132 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
130 133 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
131 134 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
132 135 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
133 136
134 137 ADD_DEFINITIONS(-DCORE_TESTS_RESOURCES_DIR="${TESTS_RESOURCES_DIR}")
135 138 ENDIF(BUILD_TESTS)
136 139
137 140 #
138 141 # Set the files that must be formatted by clang-format.
139 142 #
140 143 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
141 144 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
142 145
143 146 #
144 147 # Set the directories that doxygen must browse to generate the
145 148 # documentation.
146 149 #
147 150 # Source directories:
148 151 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
149 152 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
150 153 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
151 154 # Source directories to exclude from the documentation generation
152 155 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
153 156 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
154 157
155 158 #
156 159 # Set the directories with the sources to analyze and propagate the
157 160 # modification to the parent scope
158 161 #
159 162 # Source directories to analyze:
160 163 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
161 164 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
162 165 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
163 166 # Source directories to exclude from the analysis
164 167 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
165 168 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
General Comments 0
You need to be logged in to leave comments. Login now