CMakeLists.txt
84 lines
| 3.8 KiB
| text/plain
|
TextLexer
r1331 | include_directories(include) | |||
FILE (GLOB_RECURSE amdaplugin_SRCS | ||||
include/*.h | ||||
src/*.cpp | ||||
resources/*.qrc | ||||
) | ||||
Alexandre Leroux
|
r349 | |||
r1333 | ||||
set(AMDA_server_type hybrid CACHE STRING "AMDA server type selected at CMake configure time") | ||||
set(AMDA_SERVER_TYPE "hybrid;amdatest;localhost" CACHE STRING | ||||
"List of possible for AMDA server type") | ||||
set_property(CACHE AMDA_server_type PROPERTY STRINGS ${AMDA_SERVER_TYPE}) | ||||
r1339 | add_definitions(-DSCIQLOP_AMDA_SERVER="${AMDA_server_type}") | |||
r1333 | ||||
r1331 | add_definitions(-DQT_PLUGIN) | |||
add_definitions(-DSCIQLOP_PLUGIN_JSON_FILE_PATH="${CMAKE_CURRENT_SOURCE_DIR}/resources/amda.json") | ||||
if(NOT BUILD_SHARED_LIBS) | ||||
add_definitions(-DQT_STATICPLUGIN) | ||||
endif() | ||||
Alexandre Leroux
|
r349 | |||
r1331 | add_library(amdaplugin ${amdaplugin_SRCS}) | |||
SET_TARGET_PROPERTIES(amdaplugin PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS TRUE) | ||||
Alexandre Leroux
|
r349 | |||
r1331 | target_link_libraries(amdaplugin PUBLIC sciqlopgui) | |||
Alexandre Leroux
|
r349 | |||
r1331 | install(TARGETS amdaplugin | |||
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}/SciQlop | ||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/SciQlop | ||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) | ||||
Alexandre Leroux
|
r349 | |||
r1331 | include(sciqlop_tests) | |||
Alexandre Leroux
|
r349 | |||
r1331 | add_definitions(-DAMDA_TESTS_RESOURCES_DIR="${CMAKE_CURRENT_LIST_DIR}/tests-resources") | |||
Alexandre Leroux
|
r349 | |||
r1331 | declare_test(TestAmdaParser TestAmdaParser tests/TestAmdaParser.cpp "amdaplugin;Qt5::Test") | |||
declare_test(TestAmdaResultParser TestAmdaResultParser tests/TestAmdaResultParser.cpp "amdaplugin;Qt5::Test") | ||||
declare_test(TestAmdaAcquisition TestAmdaAcquisition tests/TestAmdaAcquisition.cpp "amdaplugin;Qt5::Test") | ||||
r1333 | declare_test(TestAmdaFuzzing TestAmdaFuzzing "tests/TestAmdaFuzzing.cpp;tests/FuzzingValidators.cpp;tests/FuzzingUtils.cpp;tests/FuzzingOperations.cpp;tests/FuzzingDefs.cpp" "amdaplugin;Qt5::Test") | |||
r1339 | ||||
pybind11_add_module(pytestamda tests/PyTestAmdaWrapper.cpp) | ||||
target_link_libraries(pytestamda PUBLIC amdaplugin) | ||||
r1341 | target_link_libraries(pytestamda PUBLIC pysciqlop) | |||
r1339 | ||||
#pybind11_add_module(pytestamdalib SHARED tests/PyTestAmdaWrapper.cpp) | ||||
add_library(pytestamdalib tests/PyTestAmdaWrapper.cpp) | ||||
target_link_libraries(pytestamdalib PUBLIC pybind11::module) | ||||
target_link_libraries(pytestamdalib PUBLIC pybind11::embed) | ||||
target_link_libraries(pytestamdalib PUBLIC amdaplugin) | ||||
r1341 | target_link_libraries(pytestamdalib PUBLIC pysciqlop) | |||
GET_PROPERTY(CORE_PYTHON_PATH GLOBAL PROPERTY CORE_PYTHON_PATH) | ||||
r1339 | ||||
r1346 | declare_test(TestAmdaFileParserEmbed TestAmdaFileParserEmbed "tests/PyTestAmdaWrapperExe.cpp" "pytestamdalib") | |||
r1340 | target_compile_definitions(TestAmdaFileParserEmbed PRIVATE -DPYTESTAMDA_SCRIPT="${CMAKE_CURRENT_LIST_DIR}/tests/TestAmdaFileParser.py") | |||
r1341 | set_tests_properties(TestAmdaFileParserEmbed PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CORE_PYTHON_PATH}) | |||
r1340 | ||||
r1346 | declare_test(TestAmdaDownloadEmbed TestAmdaDownloadEmbed "tests/PyTestAmdaWrapperExe.cpp" "pytestamdalib") | |||
r1340 | target_compile_definitions(TestAmdaDownloadEmbed PRIVATE -DPYTESTAMDA_SCRIPT="${CMAKE_CURRENT_LIST_DIR}/tests/TestAmdaDownload.py") | |||
r1341 | set_tests_properties(TestAmdaDownloadEmbed PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CORE_PYTHON_PATH}) | |||
r1346 | declare_test(TestAmdaMiniFuzzEmbed TestAmdaMiniFuzzEmbed "tests/PyTestAmdaWrapperExe.cpp" "pytestamdalib") | |||
r1341 | target_compile_definitions(TestAmdaMiniFuzzEmbed PRIVATE -DPYTESTAMDA_SCRIPT="${CMAKE_CURRENT_LIST_DIR}/tests/TestAmdaMiniFuzz.py") | |||
set_tests_properties(TestAmdaMiniFuzzEmbed PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CORE_PYTHON_PATH}) | ||||
r1340 | ||||
r1339 | ||||
find_package(PythonInterp 3 REQUIRED) | ||||
r1340 | add_test(NAME TestAmdaFileParser | |||
COMMAND ${PYTHON_EXECUTABLE} | ||||
${CMAKE_CURRENT_LIST_DIR}/tests/TestAmdaFileParser.py | ||||
TestAmdaFileParser) | ||||
r1341 | set_tests_properties(TestAmdaFileParser PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CORE_PYTHON_PATH}) | |||
r1340 | ||||
add_test(NAME TestAmdaDownload | ||||
r1339 | COMMAND ${PYTHON_EXECUTABLE} | |||
r1340 | ${CMAKE_CURRENT_LIST_DIR}/tests/TestAmdaDownload.py | |||
TestAmdaDownload) | ||||
r1341 | set_tests_properties(TestAmdaDownload PROPERTIES ENVIRONMENT PYTHONPATH=${CMAKE_CURRENT_BINARY_DIR}:${CORE_PYTHON_PATH}) | |||