Skip to content

Commit

Permalink
cmake: use CMake 3.1 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizux committed Aug 26, 2022
1 parent 155dd33 commit 97eb1a3
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions cmake/dotnet.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ add_custom_command(

add_custom_command(
OUTPUT ${DOTNET_NATIVE_PROJECT_DIR}/timestamp
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME -- ${DOTNET_EXECUTABLE} build -c Release /p:Platform=${DOTNET_PLATFORM} ${DOTNET_NATIVE_PROJECT}.csproj
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME -- ${DOTNET_EXECUTABLE} pack -c Release ${DOTNET_NATIVE_PROJECT}.csproj
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME ${DOTNET_EXECUTABLE} build -c Release /p:Platform=${DOTNET_PLATFORM} ${DOTNET_NATIVE_PROJECT}.csproj
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME ${DOTNET_EXECUTABLE} pack -c Release ${DOTNET_NATIVE_PROJECT}.csproj
COMMAND ${CMAKE_COMMAND} -E touch ${DOTNET_NATIVE_PROJECT_DIR}/timestamp
DEPENDS
${PROJECT_BINARY_DIR}/dotnet/Directory.Build.props
Expand Down Expand Up @@ -160,8 +160,8 @@ add_custom_command(

add_custom_command(
OUTPUT ${DOTNET_PROJECT_DIR}/timestamp
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME -- ${DOTNET_EXECUTABLE} build -c Release /p:Platform=${DOTNET_PLATFORM} ${DOTNET_PROJECT}.csproj
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME -- ${DOTNET_EXECUTABLE} pack -c Release ${DOTNET_PROJECT}.csproj
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME ${DOTNET_EXECUTABLE} build -c Release /p:Platform=${DOTNET_PLATFORM} ${DOTNET_PROJECT}.csproj
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME ${DOTNET_EXECUTABLE} pack -c Release ${DOTNET_PROJECT}.csproj
COMMAND ${CMAKE_COMMAND} -E touch ${DOTNET_PROJECT_DIR}/timestamp
DEPENDS
${DOTNET_PROJECT_DIR}/${DOTNET_PROJECT}.csproj
Expand Down Expand Up @@ -213,7 +213,7 @@ function(add_dotnet_test FILE_NAME)

add_custom_command(
OUTPUT ${DOTNET_TEST_DIR}/timestamp
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME -- ${DOTNET_EXECUTABLE} build -c Release ${TEST_NAME}.csproj
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME ${DOTNET_EXECUTABLE} build -c Release ${TEST_NAME}.csproj
COMMAND ${CMAKE_COMMAND} -E touch ${DOTNET_TEST_DIR}/timestamp
DEPENDS
${DOTNET_TEST_DIR}/${TEST_NAME}.csproj
Expand All @@ -234,7 +234,7 @@ function(add_dotnet_test FILE_NAME)
if(BUILD_TESTING)
add_test(
NAME dotnet_${COMPONENT_NAME}_${TEST_NAME}
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME -- ${DOTNET_EXECUTABLE} test --no-build -c Release ${TEST_NAME}.csproj
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME ${DOTNET_EXECUTABLE} test --no-build -c Release ${TEST_NAME}.csproj
WORKING_DIRECTORY ${DOTNET_TEST_DIR})
endif()
message(STATUS "Configuring test ${FILE_NAME} done")
Expand Down Expand Up @@ -275,8 +275,8 @@ function(add_dotnet_example FILE_NAME)

add_custom_command(
OUTPUT ${DOTNET_EXAMPLE_DIR}/timestamp
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME -- ${DOTNET_EXECUTABLE} build -c Release ${EXAMPLE_NAME}.csproj
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME -- ${DOTNET_EXECUTABLE} pack -c Release ${EXAMPLE_NAME}.csproj
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME ${DOTNET_EXECUTABLE} build -c Release ${EXAMPLE_NAME}.csproj
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME ${DOTNET_EXECUTABLE} pack -c Release ${EXAMPLE_NAME}.csproj
COMMAND ${CMAKE_COMMAND} -E touch ${DOTNET_EXAMPLE_DIR}/timestamp
DEPENDS
${DOTNET_EXAMPLE_DIR}/${EXAMPLE_NAME}.csproj
Expand All @@ -298,13 +298,13 @@ function(add_dotnet_example FILE_NAME)
if(USE_DOTNET_CORE_31)
add_test(
NAME dotnet_${COMPONENT_NAME}_${EXAMPLE_NAME}_netcoreapp31
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME -- ${DOTNET_EXECUTABLE} run --no-build --framework netcoreapp3.1 -c Release ${EXAMPLE_NAME}.csproj
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME ${DOTNET_EXECUTABLE} run --no-build --framework netcoreapp3.1 -c Release ${EXAMPLE_NAME}.csproj
WORKING_DIRECTORY ${DOTNET_EXAMPLE_DIR})
endif()
if(USE_DOTNET_6)
add_test(
NAME dotnet_${COMPONENT_NAME}_${EXAMPLE_NAME}_net60
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME -- ${DOTNET_EXECUTABLE} run --no-build --framework net6.0 -c Release ${EXAMPLE_NAME}.csproj
COMMAND ${CMAKE_COMMAND} -E env --unset=TARGETNAME ${DOTNET_EXECUTABLE} run --no-build --framework net6.0 -c Release ${EXAMPLE_NAME}.csproj
WORKING_DIRECTORY ${DOTNET_EXAMPLE_DIR})
endif()
endif()
Expand Down

0 comments on commit 97eb1a3

Please # to comment.