##// END OF EJS Templates
Add CatalogueAPI external project with SciQLop cmake configuration
perrinel -
r1062:53bdb3e416f0
parent child
Show More
@@ -0,0 +1,50
1 # - Clone and build CatalogueAPI Module
2 include(ExternalProject)
3
4 find_package(Git REQUIRED)
5
6 SET(CATALOGUEAPI_SOURCES_PATH ${CMAKE_SOURCE_DIR}/3rdparty/CatalogueAPI)
7 SET(CATALOGUEAPI_BUILD_PATH ${CATALOGUEAPI_SOURCES_PATH}/build)
8 SET(CATALOGUEAPI_QXORM_LIB_PATH ${CATALOGUEAPI_BUILD_PATH}/subprojects/QxOrm)
9 SET(CatalogueAPI_build_type plain)
10
11 string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_TOLOWER)
12
13 ExternalProject_Add(
14 CatalogueAPI
15
16 GIT_REPOSITORY https://perrinel@hephaistos.lpp.polytechnique.fr/rhodecode/GIT_REPOSITORIES/LPP/Users/mperrinel/CatalogueAPI
17 GIT_TAG develop
18
19 UPDATE_COMMAND git pull
20 PATCH_COMMAND ""
21
22 SOURCE_DIR "${CATALOGUEAPI_SOURCES_PATH}"
23 CONFIGURE_COMMAND meson --prefix=${CATALOGUEAPI_SOURCES_PATH} --buildtype=${CMAKE_BUILD_TYPE_TOLOWER} "${CATALOGUEAPI_SOURCES_PATH}" "${CATALOGUEAPI_BUILD_PATH}"
24
25 BUILD_COMMAND ninja -C "${CATALOGUEAPI_BUILD_PATH}"
26 INSTALL_COMMAND ninja -C "${CATALOGUEAPI_BUILD_PATH}" install
27 TEST_COMMAND ninja -C "${CATALOGUEAPI_BUILD_PATH}" test
28 LOG_DOWNLOAD 1
29 LOG_UPDATE 1
30 )
31
32 ExternalProject_Add_Step(
33 CatalogueAPI CopyToBin
34 COMMAND ${CMAKE_COMMAND} -E copy_directory ${CATALOGUEAPI_SOURCES_PATH}/lib64 ${CATALOGUEAPI_SOURCES_PATH}/lib
35 COMMAND ${CMAKE_COMMAND} -E copy_directory ${CATALOGUEAPI_QXORM_LIB_PATH} ${CATALOGUEAPI_SOURCES_PATH}/lib
36 DEPENDEES install
37 )
38
39
40 set(CATALOGUEAPI_INCLUDE ${CATALOGUEAPI_SOURCES_PATH}/src)
41 set(CATALOGUEAPI_LIBRARIES ${CATALOGUEAPI_SOURCES_PATH}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}CatalogueAPI${CMAKE_SHARED_LIBRARY_SUFFIX})
42 list(APPEND CATALOGUEAPI_LIBRARIES ${CATALOGUEAPI_SOURCES_PATH}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}QxOrm${CMAKE_SHARED_LIBRARY_SUFFIX})
43
44 #message("CMAKE_SHARED_LIBRARY_PREFIX: ${CMAKE_SHARED_LIBRARY_PREFIX}")
45 #message("CMAKE_SHARED_LIBRARY_SUFFIX: ${CMAKE_SHARED_LIBRARY_SUFFIX}")
46 #message("CATALOGUEAPI_INCLUDE: ${CATALOGUEAPI_INCLUDE}")
47 #message("CATALOGUEAPI_LIBRARIES: ${CATALOGUEAPI_LIBRARIES}")
48
49 mark_as_advanced(CATALOGUEAPI_INCLUDE)
50 mark_as_advanced(CATALOGUEAPI_LIBRARIES)
@@ -6,7 +6,13 cmake_policy(VERSION 3.6)
6
6
7 PROJECT(SCIQLOP)
7 PROJECT(SCIQLOP)
8
8
9
10 #
11 # build the CatalogueAPI dependencu
12 #
13 INCLUDE("extern/CatalogueAPI.cmake")
14
9 #
15 #
10 # build the project
16 # build the project
11 #
17 #
12 INCLUDE("cmake/sciqlop.cmake") No newline at end of file
18 INCLUDE("cmake/sciqlop.cmake")
@@ -13,13 +13,6 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 #
23 # doxygen tools
16 # doxygen tools
24 #
17 #
25 FIND_PACKAGE(Doxygen)
18 FIND_PACKAGE(Doxygen)
@@ -1,4 +1,3
1
2 ## core - CMakeLists.txt
1 ## core - CMakeLists.txt
3 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
2 STRING(TOLOWER ${CMAKE_PROJECT_NAME} LIBRARY_PREFFIX)
4 SET(SQPCORE_LIBRARY_NAME "${LIBRARY_PREFFIX}_core${DEBUG_SUFFIX}")
3 SET(SQPCORE_LIBRARY_NAME "${LIBRARY_PREFFIX}_core${DEBUG_SUFFIX}")
@@ -46,17 +45,16 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME})
46 qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core Network)
45 qt5_use_modules(${SQPCORE_LIBRARY_NAME} Core Network)
47
46
48 # Find CATALOGUE_API
47 # Find CATALOGUE_API
49 if(CATALOGUEAPI_FOUND)
48 include_directories("${CATALOGUEAPI_INCLUDE}")
50 include_directories("${CATALOGUEAPI_INCLUDE_DIRS}")
49 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME} ${CATALOGUEAPI_LIBRARIES})
51 TARGET_LINK_LIBRARIES(${SQPCORE_LIBRARY_NAME} ${CATALOGUEAPI_LIBRARIES})
52 endif()
53
54 INSTALL(TARGETS ${SQPCORE_LIBRARY_NAME}
50 INSTALL(TARGETS ${SQPCORE_LIBRARY_NAME}
55 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
51 RUNTIME DESTINATION ${INSTALL_BINARY_DIR}
56 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
52 LIBRARY DESTINATION ${INSTALL_LIBRARY_DIR}
57 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
53 ARCHIVE DESTINATION ${INSTALL_LIBRARY_DIR}
58 )
54 )
59
55
56 add_dependencies(${SQPCORE_LIBRARY_NAME} CatalogueAPI)
57
60 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
58 # From cmake documentation: http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html
61 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
59 # Entries in the COMPILE_DEFINITIONS are prefixed with -D or /D and added to the compile line in an unspecified order.
62 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
60 # The DEFINE_SYMBOL target property is also added as a compile definition as a special convenience case for SHARED and MODULE library targets
@@ -70,14 +68,14 ENDIF()
70 # dependent shared libraries
68 # dependent shared libraries
71 SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
69 SCIQLOP_SET_TO_PARENT_SCOPE(SQPCORE_LIBRARY_NAME)
72
70
73 # Copy extern shared libraries to the lib folder
71 ## Copy extern shared libraries to the lib folder
74 LIST (APPEND ${EXTERN_SHARED_LIBRARIES} ${CATALOGUEAPI_LIBRARIES})
72 #LIST (APPEND ${EXTERN_SHARED_LIBRARIES} ${CATALOGUEAPI_LIBRARIES})
75
73
76 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${CATALOGUEAPI_LIBRARIES})
74 #SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${CATALOGUEAPI_LIBRARIES})
77 if(APPLE)
75 #if(APPLE)
78 SCIQLOP_COPY_TO_TARGET(RUNTIME ${SQPCORE_LIBRARY_NAME} ${CATALOGUEAPI_LIBRARIES})
76 #SCIQLOP_COPY_TO_TARGET(RUNTIME ${SQPCORE_LIBRARY_NAME} ${CATALOGUEAPI_LIBRARIES})
79 endif()
77 #endif()
80 SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
78 #SCIQLOP_COPY_TO_TARGET(LIBRARY ${SQPCORE_LIBRARY_NAME} ${EXTERN_SHARED_LIBRARIES})
81
79
82 # Add the files to the list of files to be analyzed
80 # Add the files to the list of files to be analyzed
83 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
81 LIST(APPEND CHECKSTYLE_INPUT_FILES ${MODULE_SOURCES})
@@ -94,6 +92,7 IF(BUILD_TESTS)
94 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
92 FILE (GLOB_RECURSE TESTS_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/Test*.cpp)
95 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
93 FILE (GLOB_RECURSE TESTS_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Test*.h)
96 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
94 SET( TEST_LIBRARIES ${SQPCORE_LIBRARY_NAME})
95 list(APPEND TEST_LIBRARIES ${CATALOGUEAPI_LIBRARIES})
97
96
98 SET(TARGETS_COV)
97 SET(TARGETS_COV)
99 FOREACH( testFile ${TESTS_SOURCES} )
98 FOREACH( testFile ${TESTS_SOURCES} )
@@ -112,7 +111,7 IF(BUILD_TESTS)
112 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
111 ADD_EXECUTABLE(${testName} ${testFile} ${currentTestSources})
113 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
112 set_property(TARGET ${testName} PROPERTY CXX_STANDARD 14)
114 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
113 set_property(TARGET ${testName} PROPERTY CXX_STANDARD_REQUIRED ON)
115 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES} )
114 TARGET_LINK_LIBRARIES( ${testName} ${TEST_LIBRARIES})
116 qt5_use_modules(${testName} Test)
115 qt5_use_modules(${testName} Test)
117
116
118 ADD_TEST( NAME ${testName} COMMAND ${testName} )
117 ADD_TEST( NAME ${testName} COMMAND ${testName} )
General Comments 0
You need to be logged in to leave comments. Login now