Easy compile on Win with mingw32
parent
6ef178f508
commit
f8d043ed59
|
@ -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)
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue