Merge branch 'cmakeWin' into dev

This commit is contained in:
Mattia Montanari
2021-07-03 13:33:36 +02:00
4 changed files with 41 additions and 6 deletions

View File

@@ -42,12 +42,17 @@ set(SOURCE_FILES main.c )
# Create the executable
add_executable(demo ${SOURCE_FILES})
# Copy input files after build
# Copy input files for this example after build
add_custom_command(
TARGET demo POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/*.dat
${CMAKE_CURRENT_BINARY_DIR}/ )
${CMAKE_CURRENT_SOURCE_DIR}/userP.dat
${CMAKE_CURRENT_BINARY_DIR}/userP.dat )
add_custom_command(
TARGET demo POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_SOURCE_DIR}/userQ.dat
${CMAKE_CURRENT_BINARY_DIR}/userQ.dat )
# PLATFORM-SPECIFIC SETTING
if (UNIX)

View File

@@ -77,7 +77,7 @@ int readinput(const char *inputfile, double ***pts, int * out) {
}
/* Read number of input vertices. */
if (fscanf_s(fp, "%d", &npoints) != 1)
if (fscanf(fp, "%d", &npoints) != 1)
return 1;
/* Allocate memory. */
@@ -88,7 +88,7 @@ int readinput(const char *inputfile, double ***pts, int * out) {
/* Read and store vertices' coordinates. */
for (idx = 0; idx < npoints; idx++)
{
if (fscanf_s(fp, "%lf %lf %lf\n", &arr[idx][0], &arr[idx][1], &arr[idx][2]) != 3)
if (fscanf(fp, "%lf %lf %lf\n", &arr[idx][0], &arr[idx][1], &arr[idx][2]) != 3)
return 1;
}