Fix CMake warnings (CMP0115)

This commit is contained in:
Roland Bock
2022-06-06 10:14:01 +02:00
parent f5be4095ae
commit 256429730a
5 changed files with 84 additions and 79 deletions

View File

@@ -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}
)

View File

@@ -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}
)

View File

@@ -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}
)

View File

@@ -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}
)

View File

@@ -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}
)