Re: [Mingw-w64-public] cmake not creating directories on mingw64, works fine on linux.

2020-01-24 Thread David Mathog

On 2020-01-23 16:17, David Grayson wrote:

My CMake file-installation needs are simpler than yours and I haven't
figured out how to make it truly portable but I have something that 
works.
I tell MSYS2 users to build/install the software by running these 
commands:


mkdir build
cd build
MSYS2_ARG_CONV_EXCL=- cmake .. -G"MSYS Makefiles"
-DCMAKE_INSTALL_PREFIX=$MINGW_PREFIX
make install DESTDIR=/


No doubt it works, but strangely there is a warning NOT to do that here:

https://cmake.org/cmake/help/v3.16/envvar/DESTDIR.html

  WARNING: DESTDIR may not be used on Windows because installation 
prefix usually contains
  a drive letter like in C:/Program Files which cannot be prepended with 
some other prefix.


That warning strikes me as peculiar since one would never prepend 
anything to DESTDIR, rather things would be appended to it.


It turns out that currently neither MSYS2 nor MINGW64 automatically 
define an environmental variable along these lines:


set | grep MSYS2_ROOT
C:\progs\msys2

That is a really odd omission, and too bad, because otherwise one could 
use within the CMakeLists.txt


SET(MYROOT "$ENV{MSYS2_ROOT}")

to get the Windows formatted path.  (Conditionally, within a portable 
CMakeLists.txt.)


So while I keep trying to find a CMakeLists.txt which does not require 
at least one extra bash level command or command line parameter the best 
I could come up with was:


  export MSYS2_ROOT=`cygpath -w /`
  cmake -G "MSYS Makefiles" ..

which is really no improvement over your method, other than maybe making 
it explicit
that "/" is being converted to a Windows path format, which happens 
silently and automatically when your make command runs.


Thanks,

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


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


Re: [Mingw-w64-public] cmake not creating directories on mingw64, works fine on linux.

2020-01-23 Thread Vincent Torri
On Fri, Jan 24, 2020 at 7:31 AM Ruben Van Boxem  In my eyes, your CMakeLists.txt shouldn't contain a hardcoded Unix path
> such as /tmp. Instead it should e.g. check if it exists and accept a
> parameter from the command line to overwrite this using an option. In this
> case, it is much more conventional (and it will probably work better
> already) if you pass CMAKE_INSTALL_PREFIX from the command line.
>
> Additionally, directly calling unix commands within a CMakeLists.txt is
> also suboptimal. Instead you should call cmake -E (replace "cmake" with the
> variable CMake defines for itself) followed by the appropriate command you
> want to execute.
>
> Lastly, if the path issue is really getting in your way, you could try
> calling/building/using an MSYS2 version of CMake. I'm not sure there is a
> ready-made package for it, and in light of the above options, I don't think
> this will really be necessary.
>
> Ruben
>
> While the file creation actions went into C:/tmp, after doing this:
> >
> > >>
> > >> mkdir /tmp/testinstall
> > >> mkdir /tmp/testinstall/bin
> > >> mkdir /tmp/testinstall/man
> > >> cmake -G "MSYS Makefiles" ..
> > >> make

in addition, i prefer cross compile cmake-based projects instead, even
in MSYS2. you must open the MinGW 64 bits shell to cross compile for
64 bits :

- cross.txt -

set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_SYSTEM_PROCESSOR AMD64)
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres)

- end of cross.txt -

cmake -DCMAKE_TOOLCHAIN_FILE=cross.txt -G "Unix Makefiles" 

Vincent Torri

> > the binaries and man files were all correctly deposited into
> > /tmp/testinstall, not C:\tmp\testinstall.  If this was a bash script I
> > would know how to handle this, but within cmake I don't.  Skipping all
> > the compile stuff look at this subsection:
> >
> > 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)
> >
> > The MAKE_DIRECTORY for ${MAN_INSTALL_DIR} went to C:\tmp\testinstall\man
> > and the CMAKE_COMMAND -E copy went to /tmp/testinstall/man.  I think
> > what is happening
> > here is that when the CMAKE_COMMAND (or a compiler action) is done cmake
> > actually spins out
> > a bash session and runs the command line within that, so the usual
> > cygwin to windows path conversions are performeds.  But
> > FILE(MAKE_DIRECTORY...) is internal to cmake and it probably does a
> > mkdir() call directly, so the conversions are not made.
> >
> > Suggestions for making this portable
> >
> > Thanks,
> >
> > David Mathog
> > mat...@caltech.edu
> > Manager, Sequence Analysis Facility, Biology Division, Caltech
> >
> >
> > ___
> > Mingw-w64-public mailing list
> > Mingw-w64-public@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
> >
>
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public


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


Re: [Mingw-w64-public] cmake not creating directories on mingw64, works fine on linux.

2020-01-23 Thread Ruben Van Boxem
Op vr 24 jan. 2020 00:30 schreef David Mathog :

> On 2020-01-23 15:08, David Grayson wrote:
> > Since CMake in MSYS2 is a native Windows program, if you ask it to make
> > /tmp, I expect it will make C:/tmp.  Did that happen?
>
> Good call, that is exactly what happened!
>
> This is a problem (especially for a cross platform build environment)
> because the path usage within CMakeLists.txt seems to be inconsistent.
>

In my eyes, your CMakeLists.txt shouldn't contain a hardcoded Unix path
such as /tmp. Instead it should e.g. check if it exists and accept a
parameter from the command line to overwrite this using an option. In this
case, it is much more conventional (and it will probably work better
already) if you pass CMAKE_INSTALL_PREFIX from the command line.

Additionally, directly calling unix commands within a CMakeLists.txt is
also suboptimal. Instead you should call cmake -E (replace "cmake" with the
variable CMake defines for itself) followed by the appropriate command you
want to execute.

Lastly, if the path issue is really getting in your way, you could try
calling/building/using an MSYS2 version of CMake. I'm not sure there is a
ready-made package for it, and in light of the above options, I don't think
this will really be necessary.

Ruben

While the file creation actions went into C:/tmp, after doing this:
>
> >>
> >> mkdir /tmp/testinstall
> >> mkdir /tmp/testinstall/bin
> >> mkdir /tmp/testinstall/man
> >> cmake -G "MSYS Makefiles" ..
> >> make
>
> the binaries and man files were all correctly deposited into
> /tmp/testinstall, not C:\tmp\testinstall.  If this was a bash script I
> would know how to handle this, but within cmake I don't.  Skipping all
> the compile stuff look at this subsection:
>
> 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)
>
> The MAKE_DIRECTORY for ${MAN_INSTALL_DIR} went to C:\tmp\testinstall\man
> and the CMAKE_COMMAND -E copy went to /tmp/testinstall/man.  I think
> what is happening
> here is that when the CMAKE_COMMAND (or a compiler action) is done cmake
> actually spins out
> a bash session and runs the command line within that, so the usual
> cygwin to windows path conversions are performeds.  But
> FILE(MAKE_DIRECTORY...) is internal to cmake and it probably does a
> mkdir() call directly, so the conversions are not made.
>
> Suggestions for making this portable
>
> Thanks,
>
> David Mathog
> mat...@caltech.edu
> Manager, Sequence Analysis Facility, Biology Division, Caltech
>
>
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>

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


Re: [Mingw-w64-public] cmake not creating directories on mingw64, works fine on linux.

2020-01-23 Thread David Grayson
My CMake file-installation needs are simpler than yours and I haven't
figured out how to make it truly portable but I have something that works.
I tell MSYS2 users to build/install the software by running these commands:

mkdir build
cd build
MSYS2_ARG_CONV_EXCL=- cmake .. -G"MSYS Makefiles"
-DCMAKE_INSTALL_PREFIX=$MINGW_PREFIX
make install DESTDIR=/

Here's an example project that uses those commands:

https://github.com/pololu/libusbp

--David Grayson


On Thu, Jan 23, 2020 at 3:30 PM David Mathog  wrote:

> On 2020-01-23 15:08, David Grayson wrote:
> > Since CMake in MSYS2 is a native Windows program, if you ask it to make
> > /tmp, I expect it will make C:/tmp.  Did that happen?
>
> Good call, that is exactly what happened!
>
> This is a problem (especially for a cross platform build environment)
> because the path usage within CMakeLists.txt seems to be inconsistent.
> While the file creation actions went into C:/tmp, after doing this:
>
> >>
> >> mkdir /tmp/testinstall
> >> mkdir /tmp/testinstall/bin
> >> mkdir /tmp/testinstall/man
> >> cmake -G "MSYS Makefiles" ..
> >> make
>
> the binaries and man files were all correctly deposited into
> /tmp/testinstall, not C:\tmp\testinstall.  If this was a bash script I
> would know how to handle this, but within cmake I don't.  Skipping all
> the compile stuff look at this subsection:
>
> 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)
>
> The MAKE_DIRECTORY for ${MAN_INSTALL_DIR} went to C:\tmp\testinstall\man
> and the CMAKE_COMMAND -E copy went to /tmp/testinstall/man.  I think
> what is happening
> here is that when the CMAKE_COMMAND (or a compiler action) is done cmake
> actually spins out
> a bash session and runs the command line within that, so the usual
> cygwin to windows path conversions are performeds.  But
> FILE(MAKE_DIRECTORY...) is internal to cmake and it probably does a
> mkdir() call directly, so the conversions are not made.
>
> Suggestions for making this portable
>
> Thanks,
>
> David Mathog
> mat...@caltech.edu
> Manager, Sequence Analysis Facility, Biology Division, Caltech
>
>
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>

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


Re: [Mingw-w64-public] cmake not creating directories on mingw64, works fine on linux.

2020-01-23 Thread David Mathog

On 2020-01-23 15:08, David Grayson wrote:

Since CMake in MSYS2 is a native Windows program, if you ask it to make
/tmp, I expect it will make C:/tmp.  Did that happen?


Good call, that is exactly what happened!

This is a problem (especially for a cross platform build environment) 
because the path usage within CMakeLists.txt seems to be inconsistent.  
While the file creation actions went into C:/tmp, after doing this:




mkdir /tmp/testinstall
mkdir /tmp/testinstall/bin
mkdir /tmp/testinstall/man
cmake -G "MSYS Makefiles" ..
make


the binaries and man files were all correctly deposited into 
/tmp/testinstall, not C:\tmp\testinstall.  If this was a bash script I 
would know how to handle this, but within cmake I don't.  Skipping all 
the compile stuff look at this subsection:


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)

The MAKE_DIRECTORY for ${MAN_INSTALL_DIR} went to C:\tmp\testinstall\man 
and the CMAKE_COMMAND -E copy went to /tmp/testinstall/man.  I think 
what is happening
here is that when the CMAKE_COMMAND (or a compiler action) is done cmake 
actually spins out
a bash session and runs the command line within that, so the usual 
cygwin to windows path conversions are performeds.  But 
FILE(MAKE_DIRECTORY...) is internal to cmake and it probably does a 
mkdir() call directly, so the conversions are not made.


Suggestions for making this portable

Thanks,

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


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


Re: [Mingw-w64-public] cmake not creating directories on mingw64, works fine on linux.

2020-01-23 Thread David Grayson
Since CMake in MSYS2 is a native Windows program, if you ask it to make
/tmp, I expect it will make C:/tmp.  Did that happen?

--David

On Thu, Jan 23, 2020 at 2:55 PM David Mathog  wrote:

> On 2020-01-23 14:15, David Mathog wrote:
> > 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})
>
> Ran on both platforms with extra flags:
>
>   cmake --debug-output --trace-expand -S .. 2>&1 | tee /tmp/foo
>
> and there are no warnings or errors in the mingw64 one when it passes
> the relevant lines:
>
> C:/progs/msys64/home/david/drm_tools-1.1.32/CMakeLists.txt(46):
> FILE(MAKE_DIRECTORY /tmp/testinstall/bin )
> Called from:
> [1] C:/progs/msys64/home/david/drm_tools-1.1.32/CMakeLists.txt
> C:/progs/msys64/home/david/drm_tools-1.1.32/CMakeLists.txt(47):
> if(DO_MAN )
> Called from:
> [1] C:/progs/msys64/home/david/drm_tools-1.1.32/CMakeLists.txt
>
> it just silently fails to create those directories.  Nor were there any
> issues apparent above that, it was 1:1 but with different paths and
> versions on the two platforms.
>
> Do this:
>
> mkdir /tmp/testinstall
> mkdir /tmp/testinstall/bin
> mkdir /tmp/testinstall/man
> cmake -G "MSYS Makefiles" ..
> make
>
> and it runs without any warnings or errors.  The ONLY thing that fails
> are the
>FILE(MAKE_DIRECTORY...)
> lines in the CMakeLists.txt file.
>
> Is this just me or is that feature broken in this version of cmake???
>
> Thanks,
>
> David Mathog
> mat...@caltech.edu
> Manager, Sequence Analysis Facility, Biology Division, Caltech
>
>
> ___
> Mingw-w64-public mailing list
> Mingw-w64-public@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>

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


Re: [Mingw-w64-public] cmake not creating directories on mingw64, works fine on linux.

2020-01-23 Thread David Mathog

On 2020-01-23 14:15, David Mathog wrote:
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})


Ran on both platforms with extra flags:

 cmake --debug-output --trace-expand -S .. 2>&1 | tee /tmp/foo

and there are no warnings or errors in the mingw64 one when it passes 
the relevant lines:


C:/progs/msys64/home/david/drm_tools-1.1.32/CMakeLists.txt(46):  
FILE(MAKE_DIRECTORY /tmp/testinstall/bin )
   Called from: 
[1]	C:/progs/msys64/home/david/drm_tools-1.1.32/CMakeLists.txt
C:/progs/msys64/home/david/drm_tools-1.1.32/CMakeLists.txt(47):  
if(DO_MAN )
   Called from: 
[1]	C:/progs/msys64/home/david/drm_tools-1.1.32/CMakeLists.txt


it just silently fails to create those directories.  Nor were there any 
issues apparent above that, it was 1:1 but with different paths and 
versions on the two platforms.


Do this:

mkdir /tmp/testinstall
mkdir /tmp/testinstall/bin
mkdir /tmp/testinstall/man
cmake -G "MSYS Makefiles" ..
make

and it runs without any warnings or errors.  The ONLY thing that fails 
are the

  FILE(MAKE_DIRECTORY...)
lines in the CMakeLists.txt file.

Is this just me or is that feature broken in this version of cmake???

Thanks,

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


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


[Mingw-w64-public] cmake not creating directories on mingw64, works fine on linux.

2020-01-23 Thread David Mathog
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(binreplacebinreplace.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.cmath_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(binreplacePRIVATE ${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 ${