[CMake] Determine Verbosity in Custom Language Scripts

2016-01-11 Thread David Zemon
I've defined a custom language for my project which is simply a wrapper
around GCC. The "compiler" for this language is a CMake script which
invokes g++ followed by objcopy. I would like to use CMake's standard
verbosity system - either VERBOSE=1 for Unix Makefiles or -v or Ninja
(maybe there are others too?) but I don't know how. I was previously doing
something like

```
if (ENV{VERBOSE})
  message("g++ ${SOURCE}")
endif ()
execute_process(COMMAND g++ ${SOURCE})
```

but Ninja doesn't set an environment variable. Is it possible do this?

Thank you,
David Zemon
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[cmake-developers] Build OS X packages with CPack from Ubuntu

2015-07-19 Thread David Zemon

Hello,

I'd like to build OS X packages for my project. Is that possible with 
CPack? My project doesn't actually have any native binaries - it's for 
embedded systems - so I don't need to cross-compile or anything. The 
installation is very simple and, on Linux, looks like this:


 * /usr/PropWare/
 o include/
   Contains headers for embedded target
 o lib/
   Contains static libraries for embedded target
 o version.txt
   Version file
 * /usr/pwcmake/
 o CMake binary distribution downloaded from cmake.org - I just add
   a few extra config files specific to my embedded target to make
   configuration a bit easier
 * /usr/bin/
 o cmake - /usr/pwcmake/bin/cmake
 o cpack - /usr/pwcmake/bin/cpack
 o  (sym links to each of the executables in CMake)

That's it! Really simple. But when I run cpack --help, the list of 
generators at the bottom doesn't include anything for Mac.


   Generators
  7Z  = 7-Zip file format
  DEB = Debian packages
  IFW = Qt Installer Framework
  NSIS= Null Soft Installer
  NSIS64  = Null Soft Installer (64-bit)
  RPM = RPM packages
  STGZ= Self extracting Tar GZip compression
  TBZ2= Tar BZip2 compression
  TGZ = Tar GZip compression
  TXZ = Tar XZ compression
  TZ  = Tar Compress compression
  ZIP = ZIP file format

Am I dreaming? Can I package my software for Mac from Linux or am I just 
SOL?


Thanks,
David

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

[CMake] Unhelpful cmListFileCache error

2014-08-24 Thread David Zemon

Hello all,

This problem does not exist in Linux - I have perfect compilation there. 
Windows, however, is throwing the following error:


   CMake Error: cmListFileCache: error can not open file
   C:/Users/David/Documents/GitHub/PropWare
   CMake Error: Could not find cmake module file:

The can not open file points to the root directory of my project. The 
error is somehow connected to enabling new languages. I get the above 
two lines once for each new language that I try to add. The line 
enabling the project is as follows:


   project(PropWare C CXX ASM COGC COGCXX ECOGC ECOGCXX)

My language files are in project root/CMakeModules and I tell CMake to 
find there with the following:


   list(APPEND CMAKE_MODULE_PATH ${PROPWARE_PATH}/CMakeModules)

Like I said - this all works great in Linux. Not so much in Windows 
though :(


Full source code at 
https://github.com/SwimDude0614/PropWare/tree/release-2.0-nightly.


Easiest way to test this for yourself is to run INSTALL.py from the util 
directory - it will install necessary dependencies (the compiler and 
CMake 3 if not in the PATH already).


Thanks,
David
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] CMake Error With No Description

2014-08-22 Thread David Zemon

Hello all,

I have a working (in Linux) CMake project and am now trying to make it 
cross-platform. I'm nearly there! CMake generates the Makefiles without 
error but upon trying to run Make, things die. Here's the output from 
make VERBOSE=1


C:\Users\David\Documents\GitHub\PropWaremake VERBOSE=1
C:/Users/David/cmake-3.0.1-win32-x86/bin/cmake.exe 
-HC:/Users/David/Documents/GitHub/PropWare 
-BC:/Users/David/Documents/GitHub/PropWare --check-build-system 
CMakeFiles/Makefile.cmake 0
C:/Users/David/cmake-3.0.1-win32-x86/bin/cmake.exe -E 
cmake_progress_start C:/Users/David/Documents/GitHub/PropWare/CMakeFiles 
C:/Users/David/Documents/GitHub/PropWare/CMakeFiles/progress.marks

make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `C:/Users/David/Documents/GitHub/PropWare'
make -f simple/cog/CMakeFiles/Simple_cog.dir/build.make 
simple/cog/CMakeFiles/Simple_cog.dir/depend

make[2]: Entering directory `C:/Users/David/Documents/GitHub/PropWare'
C:/Users/David/cmake-3.0.1-win32-x86/bin/cmake.exe -E cmake_depends 
Unix Makefiles C:/Users/David/Documents/GitHub/PropWare 
C:/Users/David/Documents/GitHub/PropWare/simple/cog 
C:/Users/David/Documents/GitHub/PropWare 
C:/Users/David/Documents/GitHub/PropWare/simpl
e/cog 
C:/Users/David/Documents/GitHub/PropWare/simple/cog/CMakeFiles/Simple_cog.dir/DependInfo.cmake 
--color=

make[2]: *** [simple/cog/CMakeFiles/Simple_cog.dir/depend] Error 1
make[2]: Leaving directory `C:/Users/David/Documents/GitHub/PropWare'
make[1]: *** [simple/cog/CMakeFiles/Simple_cog.dir/all] Error 2
make[1]: Leaving directory `C:/Users/David/Documents/GitHub/PropWare'
make: *** [all] Error 2

C:\Users\David\Documents\GitHub\PropWare

A note: yes, it is set to Unix Makefiles. Yes, that is on purpose - a 
copy of GNU Make is included in the compiler package for this project.


Anyone have ideas on what to look for? I'm completely lost.

Thanks,

David

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] No Such File or Directory

2014-08-18 Thread David Zemon
The first reply was perfect. All I needed was libc6:i386. So bizarre, but I'm 
glad you guys could help.

David

On Aug 18, 2014 2:13 AM, Jakub Zakrzewski jzakrzew...@e2e.ch wrote:


 -Original Message- 
 From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Alan W. Irwin 
 Sent: Sonntag, 17. August 2014 01:51 
 To: David Zemon 
 Cc: cmake@cmake.org 
 Subject: Re: [CMake] No Such File or Directory 

 On 2014-08-16 15:02-0500 David Zemon wrote: 

  Hello, 
  
  After downloading the 3.0.1 binary Linux distribution of CMake, I am 
  running into the following bash error: 
  
    *david@fresh-ubuntu:~/**PropWare/util$* cmake 
     ^ == that is a prompt followed 
 by a blank so it looks like there is no actual path in front of your cmake 
 invocation. 

    bash: /home/david/cmake-3.0.1-Linux-i386/bin/cmake: No such file or 
    directory 

 I am pretty sure this issue is due to a very long-standing Linux security 
 feature where you have to specify executables using a path in front of the 
 name, i.e., from that directory invoke cmake with 

 ./cmake 

 or from anywhere invoke it with the full pathname, e.g., 

 /home/david/cmake-3.0.1-Linux-i386/bin/cmake 

 Hope this guess is right. 

 Alan 

 __ 
 Alan W. Irwin 

 Astronomical research affiliation with Department of Physics and Astronomy, 
 University of Victoria (astrowww.phys.uvic.ca). 

 Programming affiliations with the FreeEOS equation-of-state implementation 
 for stellar interiors (freeeos.sf.net); the Time Ephemerides project 
 (timeephem.sf.net); PLplot scientific plotting software package 
 (plplot.sf.net); the libLASi project (unifont.org/lasi); the Loads of Linux 
 Links project (loll.sf.net); and the Linux Brochure Project 
 (lbproject.sf.net). 
 __ 

 Linux-powered Science 
 __ 
 -- 

 Powered by www.kitware.com 

 Please keep messages on-topic and check the CMake FAQ at: 
 http://www.cmake.org/Wiki/CMake_FAQ 

 Kitware offers various services to support the CMake community. For more 
 information on each offering, please visit: 

 CMake Support: http://cmake.org/cmake/help/support.html 
 CMake Consulting: http://cmake.org/cmake/help/consulting.html 
 CMake Training Courses: http://cmake.org/cmake/help/training.html 

 Visit other Kitware open-source projects at 
 http://www.kitware.com/opensource/opensource.html 

 Follow this link to subscribe/unsubscribe: 
 http://public.kitware.com/mailman/listinfo/cmake 



 Hi, 

 I think you didn't read careful enough. David tries once withou and second 
 time with full path. Furthermore, the `which` command can find cmake, what 
 means it's somewhere in the PATH, so there's no need to specify full path by 
 invokation (do you specify full path when invoking `grep` for example? - I 
 don't think so.) 

 So apparently system cannot find some file, but it's not the CMake executable 
 itself. Marcel Loose's answer makes a lot of sense to me. 

 -- 
 Gruesse, 
 Jakub 



-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] No Such File or Directory

2014-08-16 Thread David Zemon

Hello,

After downloading the 3.0.1 binary Linux distribution of CMake, I am 
running into the following bash error:


   *david@fresh-ubuntu:~/**PropWare/util$* cmake
   bash: /home/david/cmake-3.0.1-Linux-i386/bin/cmake: No such file or
   directory
   *david@fresh-ubuntu:~/**PropWare/util$* which cmake
   /home/david/cmake-3.0.1-Linux-i386/bin/cmake
   *david@fresh-ubuntu:~/**PropWare/util$*
   /home/david/cmake-3.0.1-Linux-i386/bin/cmake
   bash: /home/david/cmake-3.0.1-Linux-i386/bin/cmake: No such file or
   directory
   *david@fresh-ubuntu:~/PropWare/util$*

Does anyone have any idea why? This problem seems to have existed for 
quite a long time as I am seeing evidence of it 
http://www.cfd-online.com/Forums/openfoam/64045-cmake-no-such-file-directory.html 
as far back as 2009.


The system in question is a fresh installation of Ubuntu 14.04 64-bit 
running in VirtualBox. CMake has never been installed on the machine 
before. The only non-default packages installed are git, vim, make and 
VirtualBox Guest Additions.


Thanks,
David
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Settings different flags in sub projects

2014-08-04 Thread David Zemon

Glenn, thanks for the tip. Those two options are new to me.

It's not very clear to me how the add_compile_options function works. 
Complexity might be added when I mention that I've also defined 4 new 
custom languages (all essentially identical to C). When 
add_compile_options is executed, will it add the flags to all languages 
(that would be desirable in my case)? What about assembly (that would be 
undesirable but I don't think detrimental)?


If I use the header guard concept, could I just tack that 
add_compile_options line onto my ToolChain file? That would save trouble 
for users of my library so that they don't have to define all the basics 
in every one of their projects.


Can I assume that set_property(DIRECTORY ... PROPERTY COMPILE_OPTIONS 
...) affects the same variables as add_compile_options?


Thank you,
David

On 08/04/2014 05:09 PM, Glenn Coombs wrote:

Something like this should work:

add_compile_options(-std=c99)

set_property(DIRECTORY /root/p1 PROPERTY COMPILE_OPTIONS -Os)
set_property(DIRECTORY /root/p2 PROPERTY COMPILE_OPTIONS -O1)


or you just use the add_compile_options command in all 3 CMakeLists.txt files.  
The CMakeLists.txt files in root/p1 and root/p2 will inherit the compile 
options set in the parent root/CMakeLists.txt file.


--
Glenn


On 3 August 2014 23:46, David Zemon da...@zemon.name 
mailto:da...@zemon.name wrote:


Hello,

For the simple case of three directories and two projects - /root,
/root/p1, and /root/p2 - I would like to set some common flags for
both projects and then other flags should be independent. For
instance, p1 should be compiled with -std=c99 -Os and p2 should
be compiled with -std=c99 -O1. The first flag, -std=c99, is
common to all projects and the second, -Os, might be changed from
project to project. How do I do this?

I thought I could create MyRulesOverride.cmake with the content:

set(CMAKE_C_FLAGS_INIT -std=c99)

And that would be the end of it, but apparently not. The
CMakeLists.txt files in each project have a line such as 
set(CMAKE_C_FLAGS -Os) which is apparently overwriting the
cached value from CMakeCInformation.cmake. I can't write a line
like set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Os) because then the
result is -std=c99 -std=c99 -Os for the second project.

Any help would be greatly appreciated.

David

--

Powered by www.kitware.com http://www.kitware.com

Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community.
For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake




-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Re: [CMake] Settings different flags in sub projects

2014-08-04 Thread David Zemon

Poking around some more I think I may have found a better solution.

   # Toolchain file
   include(FileWithInitFlags.cmake)
   set(CMAKE_C_COMPILE_OBJECT
   CMAKE_C_COMPILER DEFINES FLAGS ${CMAKE_C_FLAGS_INIT} -o
   OBJECT -c SOURCE)

And for the custom languages I can add that to 
CMakeLangInformation.cmake. I'm not sure why I didn't think of this 
earlier - I think just sparking off Glenn or getting some sleep helped :P


Cheers,
David

On 08/04/2014 05:09 PM, Glenn Coombs wrote:

Something like this should work:

add_compile_options(-std=c99)

set_property(DIRECTORY /root/p1 PROPERTY COMPILE_OPTIONS -Os)
set_property(DIRECTORY /root/p2 PROPERTY COMPILE_OPTIONS -O1)


or you just use the add_compile_options command in all 3 CMakeLists.txt files.  
The CMakeLists.txt files in root/p1 and root/p2 will inherit the compile 
options set in the parent root/CMakeLists.txt file.


--
Glenn


On 3 August 2014 23:46, David Zemon da...@zemon.name 
mailto:da...@zemon.name wrote:


Hello,

For the simple case of three directories and two projects - /root,
/root/p1, and /root/p2 - I would like to set some common flags for
both projects and then other flags should be independent. For
instance, p1 should be compiled with -std=c99 -Os and p2 should
be compiled with -std=c99 -O1. The first flag, -std=c99, is
common to all projects and the second, -Os, might be changed from
project to project. How do I do this?

I thought I could create MyRulesOverride.cmake with the content:

set(CMAKE_C_FLAGS_INIT -std=c99)

And that would be the end of it, but apparently not. The
CMakeLists.txt files in each project have a line such as 
set(CMAKE_C_FLAGS -Os) which is apparently overwriting the
cached value from CMakeCInformation.cmake. I can't write a line
like set(CMAKE_C_FLAGS ${CMAKE_C_FLAGS} -Os) because then the
result is -std=c99 -std=c99 -Os for the second project.

Any help would be greatly appreciated.

David

--

Powered by www.kitware.com http://www.kitware.com

Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community.
For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake




-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] Settings different flags in sub projects

2014-08-03 Thread David Zemon

Hello,

For the simple case of three directories and two projects - /root, 
/root/p1, and /root/p2 - I would like to set some common flags for both 
projects and then other flags should be independent. For instance, p1 
should be compiled with -std=c99 -Os and p2 should be compiled with 
-std=c99 -O1. The first flag, -std=c99, is common to all projects and 
the second, -Os, might be changed from project to project. How do I do this?


I thought I could create MyRulesOverride.cmake with the content:

   set(CMAKE_C_FLAGS_INIT -std=c99)

And that would be the end of it, but apparently not. The CMakeLists.txt 
files in each project have a line such as  set(CMAKE_C_FLAGS -Os) 
which is apparently overwriting the cached value from 
CMakeCInformation.cmake. I can't write a line like set(CMAKE_C_FLAGS 
${CMAKE_C_FLAGS} -Os) because then the result is -std=c99 -std=c99 
-Os for the second project.


Any help would be greatly appreciated.

David
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

[CMake] How to set Look for CMakeDetermineLang.cmake here

2014-07-21 Thread David Zemon
I am attempting to build an easy-to-use build system for an embedded 
system. This chip uses .dat, .spin, .cogc, and .ecogc files along with 
.S, .c, and .cpp. I've added the necessary language files to my project 
path which will enable cogc (I'll get to the other file types 
eventually) and they work great, but it requires manually linking or 
copying the files out of the project directory and into CMake's 
installation path. Is there some way to tell CMake that it should look 
for these files in a custom path?


Thanks,
David
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake