The CMakeLists.txt file after my signature works correctly in linux with:

mkdir build
cd build
cmake ..
make

but in mingw64 this:

mkdir build
cd build
cmake -G "MSYS Makefiles" ..
make

fails when it tries to link the first executable (which happens to be pockmark.exe for some reason) because it has failed to create the directories /tmp/testinstall and /tmp/testinstall/bin. That should happen at this line:

FILE(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})

The cmake versions are nearly identical:
mingw64 3.15.5
linux   3.15.3

The path for /tmp has no spaces in it: "C:\progs\msys64\tmp".

Anybody see what the problem is???

Thanks,

David Mathog
mat...@caltech.edu
Manager, Sequence Analysis Facility, Biology Division, Caltech

#####################################################
#problem CMakeLists.txt file
#####################################################
# revised because older versions broke when working with cmake 3
# 2010-01-23
########################
cmake_minimum_required (VERSION 3.5) #for multiple file copy
project(drm_tools)

#Default is to install man but not html.  Change this if it is needed
SET(DO_MAN 1)
SET(DO_HTML)

if (UNIX)
SET(FS9 -Wall -std=c99 -pedantic -O3)
SET(FS10)
SET(FS11)
SET(FS12 mt19937ar_drm.c)
endif (UNIX)

if (WIN32)
# Despite the -std=c99 switch that standard is not achieved by the compiler
# unless __USE_MINGW_ANSI_STDIO is also specified.
# Leave it off and strtof() does not return errno and "inf" is "1.#INF00".
#
### works OK now without -DMSCRTL (was for c89 library) and -Wno-format (all OK now) ###SET(FS9 -Wall -std=c99 -pedantic -DMSCRTL -D__USE_MINGW_ANSI_STDIO -Wno-format)
SET(FS9 -Wall -std=c99 -pedantic -D__USE_MINGW_ANSI_STDIO -O3)
SET(FS10 -DUSE_WINDOWS)
SET(FS11 windows-mmap.c)
SET(FS12 mt19937ar_drm.c)
endif (WIN32)

###################################################################
#for dmath use first form if test_dmath.sh will be run, else second
#USETOK tests a mode used in extract too, and it is more convenient to
#debug it in test_math.  However, it should NOT be compiled in when
#dmath is used otherwise.
###################################################################
#SET(FS13 -DPROG_TEST_MATH -DUSETOK)
SET(FS13 -DPROG_TEST_MATH)
SET(FS14 -D_POSIX_C_SOURCE=200112L)

#SET(CMAKE_INSTALL_PREFIX "/usr/local")
SET(CMAKE_INSTALL_PREFIX "/tmp/testinstall")
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_INSTALL_PREFIX}/bin)
SET(MAN_INSTALL_DIR  ${CMAKE_INSTALL_PREFIX}/man/man1)

FILE(MAKE_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
if (DO_MAN)
        FILE(GLOB MAN_FILES  "${CMAKE_CURRENT_SOURCE_DIR}/*.1")
        FILE(MAKE_DIRECTORY ${MAN_INSTALL_DIR})
        #install man pages
        ADD_CUSTOM_TARGET(man ALL
${CMAKE_COMMAND} -E copy ${MAN_FILES} ${MAN_INSTALL_DIR}
                COMMENT "Copying all man pages")
endif (DO_MAN)

if (DO_HTML)
        SET(HTML_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/html)
        FILE(GLOB HTML_FILES "${CMAKE_CURRENT_SOURCE_DIR}/*.html")
        FILE(MAKE_DIRECTORY ${HTML_INSTALL_DIR})
        #install html pages
        ADD_CUSTOM_TARGET(html ALL
${CMAKE_COMMAND} -E copy ${HTML_FILES} ${HTML_INSTALL_DIR}
               COMMENT "Copying all html pages")
endif (DO_HTML)

add_executable(accudate      accudate.c    )
if (UNIX)
add_executable(binformat     binformat.c   )
endif (UNIX)
if (WIN32)
add_executable(binformat     binformat.c  )
endif (WIN32)
add_executable(binload       binload.c     )
add_executable(binorder      binorder.c  ${FS11} ${FS12}  )
add_executable(binreplace    binreplace.c  )
add_executable(binsplit      binsplit.c    )
add_executable(chardiff      chardiff.c    )
add_executable(columnadd     columnadd.c   )
add_executable(datasniffer   datasniffer.c )
add_executable(dmath         test_math.c  math_funcs.c )
add_executable(execinput     execinput.c   )
add_executable(extract       extract.c    math_funcs.c )
add_executable(indexed_text  indexed_text.c  ${FS11} )
add_executable(mbin          mbin.c        )
add_executable(mbout         mbout.c       )
add_executable(mdump         mdump.c       )
if (UNIX)
add_executable(msgqueue      msgqueue.c    )
endif (UNIX)
add_executable(pockmark      pockmark.c  ${FS12}   )
add_executable(tarsieve      tarsieve.c    )
#
target_compile_options(accudate      PRIVATE ${FS9})
target_compile_options(binformat     PRIVATE ${FS9} ${FS14})
target_compile_options(binload       PRIVATE ${FS9})
target_compile_options(binorder      PRIVATE ${FS9} ${FS10} ${FS14})
target_compile_options(binreplace    PRIVATE ${FS9})
target_compile_options(binsplit      PRIVATE ${FS9} ${FS10} )
target_compile_options(chardiff      PRIVATE ${FS9})
target_compile_options(columnadd     PRIVATE ${FS9})
target_compile_options(datasniffer   PRIVATE ${FS9})
target_compile_options(dmath         PRIVATE ${FS9} ${FS13} )
target_compile_options(execinput PRIVATE ${FS9} -D_GNU_SOURCE ${FS10})
target_compile_options(extract       PRIVATE ${FS9} -DMAXINFILE=40)
target_compile_options(indexed_text  PRIVATE ${FS9} ${FS10} ${FS14})
target_compile_options(mbin          PRIVATE ${FS9})
target_compile_options(mbout         PRIVATE ${FS9} -D_POSIX_SOURCE)
target_compile_options(mdump         PRIVATE ${FS9})
if (UNIX)
target_compile_options(msgqueue PRIVATE ${FSA} -DHAS__MSG_CBYTES -D_XOPEN_SOURCE)
endif (UNIX)
target_compile_options(pockmark      PRIVATE ${FS9})
target_compile_options(tarsieve      PRIVATE ${FS9})
#
target_link_libraries(datasniffer PRIVATE -lm)
target_link_libraries(dmath       PRIVATE -lm)
target_link_libraries(extract     PRIVATE -lm -lpcre)
target_link_libraries(tarsieve    PRIVATE -lpcre)
#
#####################################################
#



_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to