From 256429730acbf32cc8e51afdc4a5079bbfba9833 Mon Sep 17 00:00:00 2001 From: Roland Bock Date: Mon, 6 Jun 2022 10:14:01 +0200 Subject: [PATCH] Fix CMake warnings (CMP0115) --- tests/core/serialize/CMakeLists.txt | 33 ++++++++++++----------- tests/core/usage/CMakeLists.txt | 39 ++++++++++++++------------- tests/mysql/usage/CMakeLists.txt | 31 ++++++++++----------- tests/postgresql/usage/CMakeLists.txt | 29 ++++++++++---------- tests/sqlite3/usage/CMakeLists.txt | 31 ++++++++++----------- 5 files changed, 84 insertions(+), 79 deletions(-) diff --git a/tests/core/serialize/CMakeLists.txt b/tests/core/serialize/CMakeLists.txt index 2d6b6d14..0be5281b 100644 --- a/tests/core/serialize/CMakeLists.txt +++ b/tests/core/serialize/CMakeLists.txt @@ -22,23 +22,23 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -set(test_names - As - Blob - CustomQuery - DynamicWhere - ForUpdate - From - In - Insert - Operator - Over - TableAlias - Where - ParameterizedVerbatim +set(test_files + As.cpp + Blob.cpp + CustomQuery.cpp + DynamicWhere.cpp + ForUpdate.cpp + From.cpp + In.cpp + Insert.cpp + Operator.cpp + Over.cpp + TableAlias.cpp + Where.cpp + ParameterizedVerbatim.cpp ) -create_test_sourcelist(test_sources test_serializer_main.cpp ${test_names}) +create_test_sourcelist(test_sources test_serializer_main.cpp ${test_files}) add_executable(sqlpp11_core_serialize ${test_sources}) target_link_libraries(sqlpp11_core_serialize PRIVATE sqlpp11::sqlpp11 sqlpp11_testing) @@ -49,7 +49,8 @@ if (SQLPP11_TESTS_CXX_STD) set_property(TARGET sqlpp11_test_serializer PROPERTY CXX_EXTENSIONS no) endif() -foreach(test IN LISTS test_names) +foreach(test_file IN LISTS test_files) + get_filename_component(test ${test_file} NAME_WLE) add_test(NAME sqlpp11.core.serialize.${test} COMMAND sqlpp11_core_serialize ${test} ) diff --git a/tests/core/usage/CMakeLists.txt b/tests/core/usage/CMakeLists.txt index 8bdb062f..7bb0b4cf 100644 --- a/tests/core/usage/CMakeLists.txt +++ b/tests/core/usage/CMakeLists.txt @@ -29,32 +29,32 @@ if (NOT MSVC) target_compile_options(sqlpp11_testing INTERFACE -Wall -Wextra -pedantic) endif () -set(test_names - BooleanExpression - CustomQuery - DateTime - Interpret - Insert - Remove - Update - Select - SelectType - Function - Prepared - Minimalistic - Result - Union - With +set(test_files + BooleanExpression.cpp + CustomQuery.cpp + DateTime.cpp + Interpret.cpp + Insert.cpp + Remove.cpp + Update.cpp + Select.cpp + SelectType.cpp + Function.cpp + Prepared.cpp + Minimalistic.cpp + Result.cpp + Union.cpp + With.cpp ) find_package(Boost 1.50) if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) - list(APPEND test_names Ppgen) + list(APPEND test_files Ppgen.cpp) endif() -create_test_sourcelist(test_sources test_main.cpp ${test_names}) +create_test_sourcelist(test_sources test_main.cpp ${test_files}) add_executable(sqlpp11_core_tests ${test_sources}) target_link_libraries(sqlpp11_core_tests PRIVATE sqlpp11::sqlpp11 sqlpp11_testing) # conditionally bump to a higher C++ standard to test compatibility @@ -64,7 +64,8 @@ if (SQLPP11_TESTS_CXX_STD) set_property(TARGET sqlpp11_core_tests PROPERTY CXX_EXTENSIONS no) endif() -foreach(test IN LISTS test_names) +foreach(test_file IN LISTS test_files) + get_filename_component(test ${test_file} NAME_WLE) add_test(NAME sqlpp11.core.usage.${test} COMMAND sqlpp11_core_tests ${test} ) diff --git a/tests/mysql/usage/CMakeLists.txt b/tests/mysql/usage/CMakeLists.txt index 3f374e34..1a9e3b4d 100644 --- a/tests/mysql/usage/CMakeLists.txt +++ b/tests/mysql/usage/CMakeLists.txt @@ -27,22 +27,22 @@ find_package(Threads REQUIRED) add_library(sqlpp11_mysql_testing INTERFACE) target_include_directories(sqlpp11_mysql_testing INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -set(test_names - Json - CustomQuery - DateTime - Sample - Select - Union - DynamicSelect - MoveConstructor - Prepared - Truncated - Update - Remove +set(test_files + Json.cpp + CustomQuery.cpp + DateTime.cpp + Sample.cpp + Select.cpp + Union.cpp + DynamicSelect.cpp + MoveConstructor.cpp + Prepared.cpp + Truncated.cpp + Update.cpp + Remove.cpp ) -create_test_sourcelist(test_sources test_main.cpp ${test_names}) +create_test_sourcelist(test_sources test_main.cpp ${test_files}) add_executable(sqlpp11_mysql_tests ${test_sources}) target_link_libraries(sqlpp11_mysql_tests PRIVATE sqlpp11::mysql sqlpp11_testing sqlpp11_mysql_testing) target_link_libraries(sqlpp11_mysql_tests PRIVATE Threads::Threads) @@ -57,7 +57,8 @@ if (SQLPP11_TESTS_CXX_STD) set_property(TARGET sqlpp11_mysql_tests PROPERTY CXX_EXTENSIONS no) endif() -foreach(test IN LISTS test_names) +foreach(test_file IN LISTS test_files) + get_filename_component(test ${test_file} NAME_WLE) add_test(NAME sqlpp11.mysql.usage.${test} COMMAND sqlpp11_mysql_tests ${test} ) diff --git a/tests/postgresql/usage/CMakeLists.txt b/tests/postgresql/usage/CMakeLists.txt index a41f40f2..9d825a59 100644 --- a/tests/postgresql/usage/CMakeLists.txt +++ b/tests/postgresql/usage/CMakeLists.txt @@ -26,21 +26,21 @@ add_library(sqlpp11_postgresql_testing INTERFACE) target_include_directories(sqlpp11_postgresql_testing INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -set(test_names - Basic - Blob - Constructor - Date - DateTime - Exceptions - InsertOnConflict - Returning - Select - Transaction - Type +set(test_files + Basic.cpp + Blob.cpp + Constructor.cpp + Date.cpp + DateTime.cpp + Exceptions.cpp + InsertOnConflict.cpp + Returning.cpp + Select.cpp + Transaction.cpp + Type.cpp ) -create_test_sourcelist(test_sources test_main.cpp ${test_names}) +create_test_sourcelist(test_sources test_main.cpp ${test_files}) add_executable(sqlpp11_postgresql_tests ${test_sources}) target_link_libraries(sqlpp11_postgresql_tests PRIVATE sqlpp11::postgresql sqlpp11_testing sqlpp11_postgresql_testing) if(NOT MSVC) @@ -54,7 +54,8 @@ if (SQLPP11_TESTS_CXX_STD) set_property(TARGET sqlpp11_postgresql_tests PROPERTY CXX_EXTENSIONS no) endif() -foreach(test IN LISTS test_names) +foreach(test_file IN LISTS test_files) + get_filename_component(test ${test_file} NAME_WLE) add_test(NAME sqlpp11.postgresql.usage.${test} COMMAND sqlpp11_postgresql_tests ${test} ) diff --git a/tests/sqlite3/usage/CMakeLists.txt b/tests/sqlite3/usage/CMakeLists.txt index bf494299..21eea602 100644 --- a/tests/sqlite3/usage/CMakeLists.txt +++ b/tests/sqlite3/usage/CMakeLists.txt @@ -25,22 +25,22 @@ add_library(sqlpp11_sqlite3_testing INTERFACE) target_include_directories(sqlpp11_sqlite3_testing INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) -set(test_names - DateTime - Sample - Select - Union - With - Attach - DynamicSelect - AutoIncrement - Transaction - FloatingPoint - Integral - Blob +set(test_files + DateTime.cpp + Sample.cpp + Select.cpp + Union.cpp + With.cpp + Attach.cpp + DynamicSelect.cpp + AutoIncrement.cpp + Transaction.cpp + FloatingPoint.cpp + Integral.cpp + Blob.cpp ) -create_test_sourcelist(test_sources test_main.cpp ${test_names}) +create_test_sourcelist(test_sources test_main.cpp ${test_files}) add_executable(sqlpp11_sqlite3_tests ${test_sources}) target_link_libraries(sqlpp11_sqlite3_tests PRIVATE sqlpp11_testing sqlpp11_sqlite3_testing) @@ -60,7 +60,8 @@ if (SQLPP11_TESTS_CXX_STD) set_property(TARGET sqlpp11_sqlite3_tests PROPERTY CXX_EXTENSIONS OFF) endif() -foreach(test IN LISTS test_names) +foreach(test_file IN LISTS test_files) + get_filename_component(test ${test_file} NAME_WLE) add_test(NAME sqlpp11.sqlite3.usage.${test} COMMAND sqlpp11_sqlite3_tests ${test} )