Merge pull request #3286 from Dimon4eg/use_folders_in_cmake

use folders in CMake
This commit is contained in:
Matthieu Gallien 2021-05-18 12:17:37 +02:00 committed by GitHub
commit 701e106aa3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View file

@ -25,3 +25,5 @@ set(GENERIC_LIB_SOVERSION "0")
# set -Werror
set(CMAKE_ENABLE_WERROR ON)
# enables folders for targets to be visible in an IDE
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

View file

@ -13,6 +13,7 @@ add_library(testutils
target_link_libraries(testutils PUBLIC ${APPLICATION_EXECUTABLE}sync Qt5::Test)
target_include_directories(testutils PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set_target_properties(testutils PROPERTIES FOLDER Tests)
nextcloud_add_test(NextcloudPropagator)

View file

@ -29,11 +29,12 @@ macro(nextcloud_add_test test_class)
COMMAND ${OWNCLOUD_TEST_CLASS}Test
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
target_include_directories(${OWNCLOUD_TEST_CLASS}Test
target_include_directories(${OWNCLOUD_TEST_CLASS}Test
PRIVATE
"${CMAKE_SOURCE_DIR}/test/"
${CMAKE_SOURCE_DIR}/src/3rdparty/qtokenizer
)
set_target_properties(${OWNCLOUD_TEST_CLASS}Test PROPERTIES FOLDER Tests)
endmacro()
macro(nextcloud_add_benchmark test_class)
@ -63,4 +64,5 @@ macro(nextcloud_add_benchmark test_class)
add_definitions(-DOWNCLOUD_TEST)
add_definitions(-DOWNCLOUD_BIN_PATH="${CMAKE_BINARY_DIR}/bin")
set_target_properties(${OWNCLOUD_TEST_CLASS}Bench PROPERTIES FOLDER Tests/Benchmarks)
endmacro()