##// END OF EJS Templates
Add Catalogue API dependency
perrinel -
r1058:bf5c5de37807
parent child
Show More
@@ -0,0 +1,29
1 # - Try to find CatalogueAPI Module
2 # Once done this will define
3 # CATALOGUEAPI_FOUND - System has CatalogueAPI
4 # CATALOGUEAPI_INCLUDE_DIRS - The CatalogueAPI include directories
5 # CATALOGUEAPI_LIBRARIES - The libraries needed to use CatalogueAPI
6 # CATALOGUEAPI_SHARED_LIBRARIES - The shared libraries for CatalogueAPI
7
8 set(CATALOGUEAPI_ROOT_DIR "${CATALOGUEAPI_EXTERN_FOLDER}"
9 CACHE PATHS
10 "Path to the installation of CatalogueAPI"
11 ${libRootDirForceValue})
12
13 find_path(CATALOGUEAPI_INCLUDE_DIR CatalogueDao.h
14 HINTS ${CATALOGUEAPI_ROOT_DIR} ${CATALOGUEAPI_EXTERN_FOLDER}
15 PATH_SUFFIXES src )
16
17 find_library(CATALOGUEAPI_LIBRARY NAMES CatalogueAPI
18 HINTS ${CATALOGUEAPI_ROOT_DIR} ${CATALOGUEAPI_EXTERN_FOLDER}
19 PATH_SUFFIXES lib)
20
21 set(CATALOGUEAPI_LIBRARIES ${CATALOGUEAPI_LIBRARY} )
22 set(CATALOGUEAPI_INCLUDE_DIRS ${CATALOGUEAPI_INCLUDE_DIR} )
23
24 include(FindPackageHandleStandardArgs)
25 # handle the QUIETLY and REQUIRED arguments and set CATALOGUEAPI_FOUND to TRUE
26 # if all listed variables are TRUE
27 find_package_handle_standard_args(CatalogueAPI FOUND_VAR CATALOGUEAPI_FOUND
28 REQUIRED_VARS CATALOGUEAPI_LIBRARY CATALOGUEAPI_INCLUDE_DIR)
29 mark_as_advanced(CATALOGUEAPI_INCLUDE_DIR CATALOGUEAPI_LIBRARY )
@@ -1,32 +1,39
1 #
1 #
2 # findslibs.cmake
2 # findslibs.cmake
3 #
3 #
4
4
5 #
5 #
6 # Qt
6 # Qt
7 #
7 #
8 # Find Qt here so that a message is displayed in the console when executing
8 # Find Qt here so that a message is displayed in the console when executing
9 # cmake, but each application must call SCIQLOP_FIND_QT() to load the Qt modules that
9 # cmake, but each application must call SCIQLOP_FIND_QT() to load the Qt modules that
10 # it needs.
10 # it needs.
11 FIND_PACKAGE(Qt5Core REQUIRED)
11 FIND_PACKAGE(Qt5Core REQUIRED)
12 FIND_PACKAGE(Qt5Test REQUIRED)
12 FIND_PACKAGE(Qt5Test REQUIRED)
13 FIND_PACKAGE(Qt5Gui REQUIRED)
13 FIND_PACKAGE(Qt5Gui REQUIRED)
14
14
15 #
15 #
16 # CatalogueAPI
17 #
18 LIST( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
19 FIND_PACKAGE(CatalogueAPI)
20
21
22 #
16 # doxygen tools
23 # doxygen tools
17 #
24 #
18 FIND_PACKAGE(Doxygen)
25 FIND_PACKAGE(Doxygen)
19
26
20 #
27 #
21 # Analyzer tools
28 # Analyzer tools
22 #
29 #
23 LIST( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/analyzer/cmake")
30 LIST( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/analyzer/cmake")
24 FIND_PACKAGE(cppcheck)
31 FIND_PACKAGE(cppcheck)
25 FIND_PACKAGE(ClangAnalyzer)
32 FIND_PACKAGE(ClangAnalyzer)
26
33
27 #
34 #
28 # Formatting tools
35 # Formatting tools
29 #
36 #
30 LIST( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/formatting/cmake")
37 LIST( APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/formatting/cmake")
31 FIND_PACKAGE(vera++)
38 FIND_PACKAGE(vera++)
32 FIND_PACKAGE(ClangFormat)
39 FIND_PACKAGE(ClangFormat)
@@ -1,159 +1,165
1
1
2 ## core - CMakeLists.txt
2 ## core - CMakeLists.txt
3 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
3 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
4 SET(SQPCORE_LIBRARY_NAME "${LIBRARY_PREFFIX}_core${DEBUG_SUFFIX}")
4 SET(SQPCORE_LIBRARY_NAME "${LIBRARY_PREFFIX}_core${DEBUG_SUFFIX}")
5 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/")
5 SET(SOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/")
6 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/")
6 SET(INCLUDES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/include/")
7 SET(TESTS_RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tests-resources")
7 SET(TESTS_RESOURCES_DIR "${CMAKE_CURRENT_SOURCE_DIR}/tests-resources")
8
8
9 # Include core directory
9 # Include core directory
10 include_directories("${INCLUDES_DIR}")
10 include_directories("${INCLUDES_DIR}")
11
11
12 # Set a variable to display a warning in the version files.
12 # Set a variable to display a warning in the version files.
13 SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.")
13 SET(SCIQLOP_CMAKE_GENERATION_WARNING "DON'T CHANGE THIS FILE. AUTOGENERATED BY CMAKE.")
14 # Generate the version file from the cmake version variables. The version
14 # Generate the version file from the cmake version variables. The version
15 # variables are defined in the cmake/sciqlop_version.cmake file.
15 # variables are defined in the cmake/sciqlop_version.cmake file.
16 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.h.in"
16 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.h.in"
17 "${INCLUDES_DIR}/Version.h")
17 "${INCLUDES_DIR}/Version.h")
18 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in"
18 CONFIGURE_FILE("${CMAKE_CURRENT_SOURCE_DIR}/resources/Version.cpp.in"
19 "${SOURCES_DIR}/Version.cpp")
19 "${SOURCES_DIR}/Version.cpp")
20
20
21 # Find dependent modules
21 # Find dependent modules
22 find_package(sciqlop-plugin)
22 find_package(sciqlop-plugin)
23 INCLUDE_DIRECTORIES(${SCIQLOP-PLUGIN_INCLUDE_DIR})
23 INCLUDE_DIRECTORIES(${SCIQLOP-PLUGIN_INCLUDE_DIR})
24
24
25 #
25 #
26 # Find Qt modules
26 # Find Qt modules
27 #
27 #
28 SCIQLOP_FIND_QT(Core Network)
28 SCIQLOP_FIND_QT(Core Network)
29
29
30 #
30 #
31 # Compile the library library
31 # Compile the library library
32 #
32 #
33
33
34 ADD_DEFINITIONS(-DCORE_LIB)
34 ADD_DEFINITIONS(-DCORE_LIB)
35
35
36 FILE (GLOB_RECURSE MODULE_SOURCES
36 FILE (GLOB_RECURSE MODULE_SOURCES
37 ${INCLUDES_DIR}/*.h
37 ${INCLUDES_DIR}/*.h
38 ${SOURCES_DIR}/*.c
38 ${SOURCES_DIR}/*.c
39 ${SOURCES_DIR}/*.cpp
39 ${SOURCES_DIR}/*.cpp
40 ${SOURCES_DIR}/*.h)
40 ${SOURCES_DIR}/*.h)
41
41
42 ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES})
42 ADD_LIBRARY(${SQPCORE_LIBRARY_NAME} ${MODULE_SOURCES})
43 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
43 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD 14)
44 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
44 set_property(TARGET ${SQPCORE_LIBRARY_NAME} PROPERTY CXX_STANDARD_REQUIRED ON)
45 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME})
45 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME})
46 qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core Network)
46 qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core Network)
47
47
48 # Find CATALOGUE_API
49 if(CATALOGUEAPI_FOUND)
50 include_directories("${CATALOGUEAPI_INCLUDE_DIRS}")
51 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME} ${CATALOGUEAPI_LIBRARIES})
52 endif()
53
48 INSTALL(TARGETS ${SQPCORE_LIBRARY_NAME}
54 INSTALL(TARGETS ${SQPCORE_LIBRARY_NAME}
49 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
55 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
50 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
56 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
51 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
57 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
52 )
58 )
53
59
54 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
60 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
55 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
61 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
56 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
62 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
57 IF(BUILD_SHARED_LIBS)
63 IF(BUILD_SHARED_LIBS)
58 SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
64 SET_TARGET_PROPERTIES(${SQPCORE_LIBRARY_NAME} PROPERTIES COMPILE_DEFINITIONS "SCIQLOP_EXPORT")
59 ELSE()
65 ELSE()
60 TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
66 TARGET_COMPILE_DEFINITIONS(${SQPCORE_LIBRARY_NAME} PUBLIC "SCIQLOP_STATIC_LIBRARIES")
61 ENDIF()
67 ENDIF()
62
68
63 # Set the variable to parent scope so that the other projects can copy the
69 # Set the variable to parent scope so that the other projects can copy the
64 # dependent shared libraries
70 # dependent shared libraries
65 SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
71 SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
66
72
67 # Copy extern shared libraries to the lib folder
73 # Copy extern shared libraries to the lib folder
68 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
74 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
69
75
70 # Add the files to the list of files to be analyzed
76 # Add the files to the list of files to be analyzed
71 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
77 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
72 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
78 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_INPUT_FILES)
73 # Vera++ exclusion files
79 # Vera++ exclusion files
74 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
80 LIST(APPEND CHECKSTYLE_EXCLUSION_FILES ${CMAKE_CURRENT_SOURCE_DIR}/vera-exclusions/exclusions.txt)
75 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
81 SCIQLOP_SET_TO_PARENT_SCOPE(CHECKSTYLE_EXCLUSION_FILES)
76
82
77 #
83 #
78 # Compile the tests
84 # Compile the tests
79 #
85 #
80 IF(BUILD_TESTS)
86 IF(BUILD_TESTS)
81 INCLUDE_DIRECTORIES(${SOURCES_DIR})
87 INCLUDE_DIRECTORIES(${SOURCES_DIR})
82 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
88 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
83 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
89 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
84 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
90 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
85
91
86 SET(TARGETS_COV)
92 SET(TARGETS_COV)
87 FOREACH( testFile ${TESTS_SOURCES} )
93 FOREACH( testFile ${TESTS_SOURCES} )
88 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
94 GET_FILENAME_COMPONENT( testDirectory ${testFile} DIRECTORY )
89 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
95 GET_FILENAME_COMPONENT( testName ${testFile} NAME_WE )
90
96
91 # Add to the list of sources files all the sources in the same
97 # Add to the list of sources files all the sources in the same
92 # directory that aren't another test
98 # directory that aren't another test
93 FILE (GLOB currentTestSources
99 FILE (GLOB currentTestSources
94 ${testDirectory}/*.c
100 ${testDirectory}/*.c
95 ${testDirectory}/*.cpp
101 ${testDirectory}/*.cpp
96 ${testDirectory}/*.h)
102 ${testDirectory}/*.h)
97 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
103 LIST (REMOVE_ITEM currentTestSources ${TESTS_SOURCES})
98 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
104 # LIST (REMOVE_ITEM currentTestSources ${TESTS_HEADERS})
99
105
100 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
106 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
101 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
107 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
102 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
108 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
103 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
109 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
104 qt5_use_modules(${testName} Test)
110 qt5_use_modules(${testName} Test)
105
111
106 ADD_TEST( NAME ${testName} COMMAND ${testName} )
112 ADD_TEST( NAME ${testName} COMMAND ${testName} )
107
113
108 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
114 SCIQLOP_COPY_TO_TARGET(RUNTIME ${testName} ${EXTERN_SHARED_LIBRARIES})
109 set(Coverage_NAME ${testName})
115 set(Coverage_NAME ${testName})
110 if(UNIX)
116 if(UNIX)
111 SETUP_TARGET_FOR_COVERAGE(TARGET ${testName}_coverage OUTPUT ${testFile}-path NAME ${testFile} EXECUTABLE ${testName})
117 SETUP_TARGET_FOR_COVERAGE(TARGET ${testName}_coverage OUTPUT ${testFile}-path NAME ${testFile} EXECUTABLE ${testName})
112 LIST( APPEND TARGETS_COV ${testName}_coverage)
118 LIST( APPEND TARGETS_COV ${testName}_coverage)
113 endif(UNIX)
119 endif(UNIX)
114
120
115 ENDFOREACH( testFile )
121 ENDFOREACH( testFile )
116
122
117 add_custom_target(coverage)
123 add_custom_target(coverage)
118
124
119 FOREACH( target_cov ${TARGETS_COV} )
125 FOREACH( target_cov ${TARGETS_COV} )
120 add_custom_command(TARGET coverage PRE_BUILD COMMAND make ${target_cov})
126 add_custom_command(TARGET coverage PRE_BUILD COMMAND make ${target_cov})
121 ENDFOREACH( target_cov )
127 ENDFOREACH( target_cov )
122
128
123 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
129 LIST(APPEND testFilesToFormat ${TESTS_SOURCES})
124 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
130 LIST(APPEND testFilesToFormat ${TESTS_HEADERS})
125 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
131 LIST(APPEND FORMATTING_INPUT_FILES ${testFilesToFormat})
126 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
132 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
127
133
128 ADD_DEFINITIONS(-DCORE_TESTS_RESOURCES_DIR="${TESTS_RESOURCES_DIR}")
134 ADD_DEFINITIONS(-DCORE_TESTS_RESOURCES_DIR="${TESTS_RESOURCES_DIR}")
129 ENDIF(BUILD_TESTS)
135 ENDIF(BUILD_TESTS)
130
136
131 #
137 #
132 # Set the files that must be formatted by clang-format.
138 # Set the files that must be formatted by clang-format.
133 #
139 #
134 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
140 LIST (APPEND FORMATTING_INPUT_FILES ${MODULE_SOURCES})
135 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
141 SCIQLOP_SET_TO_PARENT_SCOPE(FORMATTING_INPUT_FILES)
136
142
137 #
143 #
138 # Set the directories that doxygen must browse to generate the
144 # Set the directories that doxygen must browse to generate the
139 # documentation.
145 # documentation.
140 #
146 #
141 # Source directories:
147 # Source directories:
142 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
148 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/docs")
143 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
149 LIST (APPEND DOXYGEN_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
144 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
150 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_INPUT_DIRS)
145 # Source directories to exclude from the documentation generation
151 # Source directories to exclude from the documentation generation
146 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
152 #LIST (APPEND DOXYGEN_EXCLUDE_PATTERNS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir/*")
147 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
153 SCIQLOP_SET_TO_PARENT_SCOPE(DOXYGEN_EXCLUDE_PATTERNS)
148
154
149 #
155 #
150 # Set the directories with the sources to analyze and propagate the
156 # Set the directories with the sources to analyze and propagate the
151 # modification to the parent scope
157 # modification to the parent scope
152 #
158 #
153 # Source directories to analyze:
159 # Source directories to analyze:
154 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
160 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/src")
155 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
161 LIST (APPEND ANALYSIS_INPUT_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/tests")
156 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
162 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_INPUT_DIRS)
157 # Source directories to exclude from the analysis
163 # Source directories to exclude from the analysis
158 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
164 #LIST (APPEND ANALYSIS_EXCLUDE_DIRS "${CMAKE_CURRENT_SOURCE_DIR}/path/to/subdir")
159 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
165 SCIQLOP_SET_TO_PARENT_SCOPE(ANALYSIS_EXCLUDE_DIRS)
General Comments 0
You need to be logged in to leave comments. Login now