Skip to content

Commit

Permalink
Fix build with multi-config generators
Browse files Browse the repository at this point in the history
Reported by @jwrober.
  • Loading branch information
lmoureaux committed Dec 29, 2023
1 parent 58d5d06 commit 7cc07a3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions data/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ endif()
# Create the test file. This is ugly because we need to replace variables
# and use generator expressions.
configure_file(rulesets.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/rulesets.cpp.in)
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/rulesets.cpp
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/rulesets.cpp
INPUT ${CMAKE_CURRENT_BINARY_DIR}/rulesets.cpp.in)

add_executable(test_rulesets ${CMAKE_CURRENT_BINARY_DIR}/rulesets.cpp)
add_executable(test_rulesets ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/rulesets.cpp)
target_link_libraries(test_rulesets PRIVATE Qt5::Test)
add_test(NAME test_rulesets
COMMAND test_rulesets
COMMAND "${CMAKE_BINARY_DIR}/$<CONFIG>/test_rulesets"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")
6 changes: 3 additions & 3 deletions server/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ set(CMAKE_AUTOMOC ON)
# Create the test file. This is ugly because we need to replace variables
# and use generator expressions.
configure_file(cli.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/cli.cpp.in)
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/cli.cpp
file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/cli.cpp
INPUT ${CMAKE_CURRENT_BINARY_DIR}/cli.cpp.in)

add_executable(test_server_cli ${CMAKE_CURRENT_BINARY_DIR}/cli.cpp)
add_executable(test_server_cli ${CMAKE_CURRENT_BINARY_DIR}/$<CONFIG>/cli.cpp)
target_link_libraries(test_server_cli PRIVATE Qt5::Test)
add_test(NAME test_server_cli
COMMAND test_server_cli
COMMAND "${CMAKE_BINARY_DIR}/$<CONFIG>/test_server_cli"
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}")

0 comments on commit 7cc07a3

Please sign in to comment.