[CMake] Platform information override file is ignored for ASM language

2014-08-25 Thread Никонов Михаил Николаевич
Hello,

In a bare-metal embedded project, I need to initialize compiler flags
to custom values while toolchains are initialized; for that, I'm using
override files to set _INIT variables. From what I've encountered, it
appears that CMAKE_USER_MAKE_RULES_OVERRIDE file (and
language-specific *_ASM one) are not loaded during initialization of
assembly compiler. Here's a test to reproduce it, made of two files:

CMakeLists.txt:
  set(CMAKE_USER_MAKE_RULES_OVERRIDE override.cmake)
  project(Test C CXX ASM)

override.cmake:
  set(CMAKE_C_FLAGS_INIT "-Wall")
  set(CMAKE_CXX_FLAGS_INIT "-Wall")
  set(CMAKE_ASM_FLAGS_INIT "-Wall")

After running cmake, CMAKE_C_FLAGS and CMAKE_CXX_FLAGS in
CMakeCache.txt contain flag -Wall, while CMAKE_ASM_FLAGS doesn't
(tested with CMake 2.8.12.2 and 3.0.1 and gcc 4.8.2 on latest Ubuntu).

Is there any mistake I made? And if not, is there any elegant
workaround for that? I'm aware that I can just force flags' values
into cache in toolchain file itself, before project() call, but from
what I understood, it's a discouraged practice.

Regards,
Mikhail.
-- 

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] add_custom_command and CONFIG-dependent output

2014-08-25 Thread David Cole via CMake
> Ah, thanks... Though, I think there may be a general disconnect here:
> that is, it seems likely that one would want to construct output with
> a pattern composed from generator expressions.
> ...
> While I gather from your comment that something like this might be
> possible in the future, is there some other general approach that can
> be taken with current CMake?


The "disconnect" is that generator expressions were bolted on top of
existing CMake functionality, and are not fully supported in all
contexts. The documentation for add_custom_command [1] explicitly says
"Arguments to COMMAND may use “generator expressions”" -- but it says
nothing about OUTPUT using them at all.

I don't know if there's a strong reason behind not supporting them in
the OUTPUT clause... but I suspect if it was easy, it would have been
done already.

For now, any OUTPUT you need to specify will have to be done without
the use of generator expressions. In some cases, that means you need to
know what the behavior of CMake is (like the library file name in your
example), and duplicate it if you need it in the OUTPUT clause. So, no:
no general approach that I know of, but you can use CMAKE_CFG_INTDIR as
needed to separate the output of different config builds...

(If I'm wrong here, I do hope somebody else more intimately involved
with generator expressions will chime in and correct me.)


HTH,
David C.


[1] http://www.cmake.org/cmake/help/v3.0/command/add_custom_command.html



-- 

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] add_custom_command and CONFIG-dependent output

2014-08-25 Thread Petr Kmoch
On Mon, Aug 25, 2014 at 1:07 PM, David Cole via CMake 
wrote:

> > Ah, thanks... Though, I think there may be a general disconnect here:
> > that is, it seems likely that one would want to construct output with
> > a pattern composed from generator expressions.
> > ...
> > While I gather from your comment that something like this might be
> > possible in the future, is there some other general approach that can
> > be taken with current CMake?
>
>
> The "disconnect" is that generator expressions were bolted on top of
> existing CMake functionality, and are not fully supported in all
> contexts. The documentation for add_custom_command [1] explicitly says
> "Arguments to COMMAND may use “generator expressions”" -- but it says
> nothing about OUTPUT using them at all.
>
> I don't know if there's a strong reason behind not supporting them in
> the OUTPUT clause... but I suspect if it was easy, it would have been
> done already.
>

Brad suggests it's far from easy in this bug comment:
http://public.kitware.com/Bug/view.php?id=12877#c28315


>
> For now, any OUTPUT you need to specify will have to be done without
> the use of generator expressions. In some cases, that means you need to
> know what the behavior of CMake is (like the library file name in your
> example), and duplicate it if you need it in the OUTPUT clause. So, no:
> no general approach that I know of, but you can use CMAKE_CFG_INTDIR as
> needed to separate the output of different config builds...
>
> (If I'm wrong here, I do hope somebody else more intimately involved
> with generator expressions will chime in and correct me.)
>
>
> HTH,
> David C.
>
>
> [1] http://www.cmake.org/cmake/help/v3.0/command/add_custom_command.html
>

Petr
-- 

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] File concatenation in cmake add_custom_command()

2014-08-25 Thread David Cole via CMake
First: thanks for your questions to the CMake list. However, when you 
send an email to the list, please just ask the question -- that is, 
please do *not* ask me by name. I know I've answered a few questions 
for you in the last few weeks, but I am not the only one here, and 
asking me by name may discourage somebody else from answering earlier 
if they are able to. The list is a community resource, and all should 
feel welcome to chime in on any discussion where they can add something 
useful.


I think using "file(WRITE..." followed by "file(APPEND..." is the 
simplest way of performing file concatenation using the CMake language.


However, I would never write a custom command rule that writes files 
into the source tree of a project. For one thing, it precludes having 
two separate build trees for a single source tree that do not clobber 
each other - the build trees should be independent of each other... but 
when you push output to the source tree, multiple builds can never be 
independent of each other.


It might be simpler or more elegant to use a different language 
(python, perl, ?) for this task, but if you must do it in CMake, what 
you have is just fine.


I'm certain you could make the code easier to understand by naming 
variables more descriptively (FILE1, FILE2, FILE3, ... are not very 
descriptive) and by adding some comments. Also, there's no reason to 
file(WRITE the script itself in your example: the script could simply 
be written, and be a part of your source code, and then just called 
from the custom command. That would remove a leap of indirection that a 
developer reading the code has to make mentally to understand what 
you've got. If the script file is just a script file, and they can look 
at it as such, then the add_custom_command becomes easier to read, 
because it doesn't have the crazy file(WRITE with backslashes in it to 
interpret.


HTH,
David C.

--

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] File concatenation in cmake add_custom_command()

2014-08-25 Thread Ravi Raman
Thanks for the reply.

Thanks & Regards

Ravi Raman 
Xoriant Solutions Pvt. Ltd
4th Floor, Winchester, Hiranandani Business Park, Powai, Mumbai 400076, INDIA. 
Tel: +91 22 30511000,9930100026 Extn: 2144 Voip No. 4088344495/96/97/98 Voip 
Extn:1178| Fax: +91 22 3051 
ravi.ra...@xoriant.com| http://www.xoriant.com

-Original Message-
From: David Cole [mailto:dlrd...@aol.com] 
Sent: Monday, August 25, 2014 4:59 PM
To: Ravi Raman
Cc: cmake@cmake.org
Subject: Re: File concatenation in cmake add_custom_command()

First: thanks for your questions to the CMake list. However, when you 
send an email to the list, please just ask the question -- that is, 
please do *not* ask me by name. I know I've answered a few questions 
for you in the last few weeks, but I am not the only one here, and 
asking me by name may discourage somebody else from answering earlier 
if they are able to. The list is a community resource, and all should 
feel welcome to chime in on any discussion where they can add something 
useful.

I think using "file(WRITE..." followed by "file(APPEND..." is the 
simplest way of performing file concatenation using the CMake language.

However, I would never write a custom command rule that writes files 
into the source tree of a project. For one thing, it precludes having 
two separate build trees for a single source tree that do not clobber 
each other - the build trees should be independent of each other... but 
when you push output to the source tree, multiple builds can never be 
independent of each other.

It might be simpler or more elegant to use a different language 
(python, perl, ?) for this task, but if you must do it in CMake, what 
you have is just fine.

I'm certain you could make the code easier to understand by naming 
variables more descriptively (FILE1, FILE2, FILE3, ... are not very 
descriptive) and by adding some comments. Also, there's no reason to 
file(WRITE the script itself in your example: the script could simply 
be written, and be a part of your source code, and then just called 
 from the custom command. That would remove a leap of indirection that a 
developer reading the code has to make mentally to understand what 
you've got. If the script file is just a script file, and they can look 
at it as such, then the add_custom_command becomes easier to read, 
because it doesn't have the crazy file(WRITE with backslashes in it to 
interpret.

HTH,
David C.

-- 

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] Find SDL

2014-08-25 Thread Benjamin Eikel

Hello Christer,

Zitat von Christer Solskogen :


Hi!

I have a cross compiler, installed into /opt/cross, which is  
compiled by me. This cross compiler (gcc) is sysroot aware, which  
means that every header and library is installed into  
/opt/cross/.


In order to get cmake to find SDL (both SDL1 and SDL2) I need to  
specify SDLDIR. The project I'm using (called hatari, a Atari ST(e)  
emulator) is also using other libraries like readline and png, which  
cmake have no problem finding.


Is this a bug in cmake? Right now the cmake version I'm using is  
2.8.12.2, but this problem have been there since I can remember.


in order to help you, I need more information. If I understand you  
correctly, you do not want to set the environment variable SDLDIR.  
Instead, you expect the FindSDL module to find SDL without that  
information. Is that correct?
Please give some more information about your installation. In which  
path exactly is SDL located (where is "SDL.h", where is "libSDL.a" or  
"libSDL.so")?


Kind regards
Benjamin
--

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] Setting additional Plist values for OS X Bundle

2014-08-25 Thread Michael Jackson
Are there are newer facilities in CMake 3.x that would allow me to add 
additional Plist values to the standard Mac OS X bundle plist that gets created?

I use the following code currently:

 set_target_properties(${TARGET_NAME} PROPERTIES
 MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}${DBG_EXTENSION} Version 
${VERSION_STRING}, Copyright 2014 BlueQuartz Software."
 MACOSX_BUNDLE_ICON_FILE ${ICON_FILE_NAME}
 MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_NAME}${DBG_EXTENSION}"
 MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME}${DBG_EXTENSION} Version 
${VERSION_STRING}"
 MACOSX_BUNDLE_BUNDLE_NAME ${PROJECT_NAME}${DBG_EXTENSION}
 MACOSX_BUNDLE_SHORT_VERSION_STRING ${VERSION_STRING}
 MACOSX_BUNDLE_BUNDLE_VERSION ${VERSION_STRING}
 MACOSX_BUNDLE_COPYRIGHT "Copyright 2014, BlueQuartz Software. All Rights 
Reserved."
 )


But I need to add the following to my plist:

NSHighResolutionCapable
True


Thanks for any help
--
Mike Jackson www.bluequartz.net

-- 

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] Setting additional Plist values for OS X Bundle

2014-08-25 Thread Clinton Stimpson
On Monday, August 25, 2014 01:10:27 PM Michael Jackson wrote:
> Are there are newer facilities in CMake 3.x that would allow me to add
> additional Plist values to the standard Mac OS X bundle plist that gets
> created?
> 
> I use the following code currently:
> 
>  set_target_properties(${TARGET_NAME} PROPERTIES
>  MACOSX_BUNDLE_INFO_STRING "${PROJECT_NAME}${DBG_EXTENSION} Version
> ${VERSION_STRING}, Copyright 2014 BlueQuartz Software."
> MACOSX_BUNDLE_ICON_FILE ${ICON_FILE_NAME}
>  MACOSX_BUNDLE_GUI_IDENTIFIER "${PROJECT_NAME}${DBG_EXTENSION}"
>  MACOSX_BUNDLE_LONG_VERSION_STRING "${PROJECT_NAME}${DBG_EXTENSION}
> Version ${VERSION_STRING}" MACOSX_BUNDLE_BUNDLE_NAME
> ${PROJECT_NAME}${DBG_EXTENSION}
>  MACOSX_BUNDLE_SHORT_VERSION_STRING ${VERSION_STRING}
>  MACOSX_BUNDLE_BUNDLE_VERSION ${VERSION_STRING}
>  MACOSX_BUNDLE_COPYRIGHT "Copyright 2014, BlueQuartz Software. All
> Rights Reserved." )
> 
> 
> But I need to add the following to my plist:
> 
> NSHighResolutionCapable
> True
> 
> 
> Thanks for any help
> --
> Mike Jackson www.bluequartz.net

Even with CMake 2.x, you can make your own .plist.in copied from  
CMake/Modules/MacOSXBundleInfo.plist.in, then add your part in there.
 NSHighResolutionCapable
 True

Then add one more line to your set of target properties:

MACOSX_BUNDLE_INFO_PLIST 
"${CMAKE_CURRENT_SOURCE_DIR}/MacOSXBundleInfo.plist.in"

- Clint
-- 

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] Can't run cmd.exe directly in ctest?

2014-08-25 Thread Dan Kegel
Hi!  The simple CMakeLists.txt

cmake_minimum_required(VERSION 2.8)
project(foo)
enable_testing()
add_test(NAME bar COMMAND cmd /c echo hello)

fails for me when run on Windows 7 64 bit (only platform I've tried)
with ctest 2.8.12 or 2.8.11.
"ctest -V -C Debug" outputs

...
test 1
Start 1: bar

1: Test command: C:\Windows\System32\cmd.exe "/c" "echo" "hello"
1: Test timeout computed to be: 9.99988e+006
1: The syntax of the command is incorrect.
1/1 Test #1: bar ..***Failed0.07 sec

Watching with ProcessMonitor, the only funky business I can see is
that ctest uses forward slashes in the path it passes to
CreateProcess.

Trying this with a little C program shows that, yes, cmd.exe outputs
"The syntax of the command is incorrect" if run with
CreateProcess( NULL, "c:/windows/system32/cmd.exe /c echo hi", ...)
but executes properly if run with
CreateProcess( NULL, "c:\\windows\\system32\\cmd.exe /c echo hi", ...)

The obvious workaround is... just use a bat file without mentioning cmd at all:

cmake_minimum_required(VERSION 2.8)
project(foo)
enable_testing()
add_test(NAME bar COMMAND foobar.bat)

If you forget to do chmod +x foobar.bat first, it'll fail with "***Not Run".

The only reason I'm posting this is because I forgot to do the chmod
+x, and tried using
cmd directly without a batch file as a minimal test case.  Bit of a detour :-)
- Dan
-- 

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] Platform information override file is ignored for ASM language

2014-08-25 Thread Alexander Neundorf
On Monday, August 25, 2014 14:36:21 Никонов Михаил Николаевич wrote:
> Hello,
> 
> In a bare-metal embedded project, I need to initialize compiler flags
> to custom values while toolchains are initialized; for that, I'm using
> override files to set _INIT variables. From what I've encountered, it
> appears that CMAKE_USER_MAKE_RULES_OVERRIDE file (and
> language-specific *_ASM one) are not loaded during initialization of
> assembly compiler. Here's a test to reproduce it, made of two files:
> 
> CMakeLists.txt:
>   set(CMAKE_USER_MAKE_RULES_OVERRIDE override.cmake)
>   project(Test C CXX ASM)
> 
> override.cmake:
>   set(CMAKE_C_FLAGS_INIT "-Wall")
>   set(CMAKE_CXX_FLAGS_INIT "-Wall")
>   set(CMAKE_ASM_FLAGS_INIT "-Wall")
> 
> After running cmake, CMAKE_C_FLAGS and CMAKE_CXX_FLAGS in
> CMakeCache.txt contain flag -Wall, while CMAKE_ASM_FLAGS doesn't
> (tested with CMake 2.8.12.2 and 3.0.1 and gcc 4.8.2 on latest Ubuntu).
> 
> Is there any mistake I made? And if not, is there any elegant
> workaround for that? I'm aware that I can just force flags' values
> into cache in toolchain file itself, before project() call, but from
> what I understood, it's a discouraged practice.

please enter a bug report at http://public.kitware.com/Bug

Thanks
Alex

-- 

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] Collecting libraries for NSIS installer

2014-08-25 Thread Richard Shaw
Ok, apparently I'm the only person that can't figure out how generator
expressions work but I worked around it using "find_program" to find the
resultant executable in the source directory, which I think is a really bad
way to do it, but it works.

Then I use find_library to get the full path of the library because
get_filename_component isn't working for me.

Thanks,
Richard
-- 

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] Unhelpful cmListFileCache error

2014-08-25 Thread david

I am at a complete loss on what to look for here. This error started when I 
tried adding "list(append )" instead of copying the language files to the 
CMake installation directory. If anyone has any idea where to look, I'm all 
ears. I think 95% of my users will be on Windows, so I can't launch until I get 
past this bug.
 
Cheers,
David

-Original Message-
From: "David Zemon" 
Sent: Sunday, August 24, 2014 1:56pm
To: cmake@cmake.org
Subject: [CMake] Unhelpful cmListFileCache error


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 
/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 ]( 
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

Re: [CMake] Collecting libraries for NSIS installer

2014-08-25 Thread Jean-Christophe Fillion-Robin
Hi Richard,

Generator expression won't work in install rules. Instead, I suggest you
simply use "install(TARGET ...") for regular targets.

Hth
Jc


On Mon, Aug 25, 2014 at 5:02 PM, Richard Shaw  wrote:

> Ok, apparently I'm the only person that can't figure out how generator
> expressions work but I worked around it using "find_program" to find the
> resultant executable in the source directory, which I think is a really bad
> way to do it, but it works.
>
> Then I use find_library to get the full path of the library because
> get_filename_component isn't working for me.
>
> Thanks,
> Richard
>
> --
>
> 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
>



-- 
+1 919 869 8849
-- 

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] Collecting libraries for NSIS installer

2014-08-25 Thread Richard Shaw
On Mon, Aug 25, 2014 at 4:10 PM, Jean-Christophe Fillion-Robin <
jchris.filli...@kitware.com> wrote:

> Hi Richard,
>
> Generator expression won't work in install rules. Instead, I suggest you
> simply use "install(TARGET ...") for regular targets.
>

That explains that problem. I'm not sure if you followed the whole thread
but what I'm trying to do is collect all the dependent DLL's for packaging
into the NSIS installer. I don't think install(TARGET... will work here.

I'm using the GetPrerequisites module which needs the absolute path to the
binary/library to scan. I tried to use get_target_property but it
complained that generator expressions should be used instead, which as you
mention don't work for install rules.

I use find_program to get the full location to the generated binary which I
then pass to get_prerequisites(...) to get the required dll's.

Then I used find_library to get the location to the library for
installation purposes (win32 only).

Thanks,
Richard
-- 

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] Dependency weirdness

2014-08-25 Thread Phil Smith
A colleague figured it out. We had:
${CMAKE_CURRENT_SOURCE_DIR}/src/zprotect

But the actual directory name is zProtect, capital P.  Windows "doesn't care", 
sorta kinda, but apparently CMake or Cygwin or Windows does somehow. If the 
directory has a period in the name, it works; if it doesn't, it fails. After 
40+ years of software I should know better than to be surprised by anything, 
but I still am...

...phsiii

From: Phil Smith
Sent: Saturday, August 23, 2014 1:18 PM
To: cmake@cmake.org
Cc: zTeam
Subject: Dependency weirdness

A while ago, folks on this list kindly helped me through adding dependency 
checking for assembler macros with the cross-compiler we use (summary: if 
module foo.asm uses macro bar.mac, we wanted foo.asm picked up by CMake if 
bar.mac changed).

I recently realized this was no longer working. I had the old version's source 
path, and verified that it still worked there, and then that the CMakeLists had 
not changed in any substantive way.

Some more tinkering led me to try a "This can't possible matter/work" scenario:
The old, working path was named C:\SVN\zFPE4.3.0
The new, broken path was named C:\SVN\zFPE510

I did various renames (4.3.0==>430 and 510==>5.1.0), clean builds,.mac changes, 
and CMAKEs. The results:

-  If the periods are in the filename, the dependency checking works

-  If no period, it doesn't work

But the dependency code in CMakeLists is:
foreach(entry ${ZPROTECT_ASM_DEPENDENCIES})
   # Convert each entry into a new list
   string(REPLACE "," ";" entry ${entry})
   # Get the source filename from the list
   list(GET entry 0 file)
   # And remove it so we can now traverse the list
   list(REMOVE_AT entry 0)
   # Now traverse the list and set each dependency
   foreach(temp ${entry})
  # Note hard-coded path; MUST be full path, cannot be relative (CMake 
restriction)
  set_property(SOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/zprotect/asm/${file} 
APPEND PROPERTY OBJECT_DEPENDS 
${CMAKE_CURRENT_SOURCE_DIR}/src/zprotect/asm/${temp})
   endforeach(temp ${entry})
endforeach(entry ${ZPROTECT_ASM_DEPENDENCIES}

I see no periods here...I see commas, but no periods. And I'd've expected it to 
be more likely that the presence of periods would upset it than their absence!

I added a diagnostic MESSAGE in the code and reran it.

Good:
-- set_property(SOURCE C:/SVN/zFPE5.1.0/src/zprotect/asm/VSHVOLT.asm APPEND 
PROPERTY OBJECT_DEPENDS C:/SVN/zFPE5.1.0/src/zprotect/asm/VSHVOLTX.mac)
Bad:
-- set_property(SOURCE C:/SVN/zFPE510/src/zprotect/asm/VSHVOLT.asm APPEND 
PROPERTY OBJECT_DEPENDS C:/SVN/zFPE510/src/zprotect/asm/VSHVOLTX.mac)

Those are identical other than the periods in the directory name, as expected! 
Any ideas?

cmake --version says:
cmake version 2.8.1

I know this is old but there are reasons. In any case, seems like an odd bug. 
Is the period perhaps some regex confusion kicking in?
-- 

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] Need to know the ASM flag that needs to be modified in cmake

2014-08-25 Thread Ravi Raman
Hi,

In our cmake project, there is an assembler file (.asm extension) that needs to 
be compiled to create object file (.obj) using microsoft macro assembler 
(ml.exe for 32-bit and ml64.exe for 64-bit)
This is happening successfully.
But there is a preprocessor directive (_WIN64) as follows within the .asm code, 
which is not getting set.
IFDEF _WIN64
We would like to know which is the ASM related cmake flag variable that needs 
to be manipulated in order to set _WIN64

Details as follows:

1.   In CMakeLists.txt, we do the following to enable microsoft macro 
assembler to compile .asm files

enable_language(ASM_MASM)

2.   We include the .asm file Testx64.asm in the source list

3.   Because of the above enable_language step, the MASM step gets 
correctly triggered as follows with the following ml64.exe options to compile 
the .asm to create corresponding .obj

_MASM:

  Assembling ..\..\..\testx64\Testx64.asm...

  cmd.exe /C 
"C:\Users\raman_r\AppData\Local\Temp\tmp8a9b40c55523496e9edce668c1f812a2.cmd"

  ml64.exe /c /nologo /Zi /Fo"testx64.dir\Release\Testx64.obj" /W3 
/errorReport:prompt  /Ta..\..\..\testx64\Testx64.asm



Note that in the above step 3, ml64.exe execution creates the output object 
file Testx64.obj, but in this there is no pre-processor switch /D _WIN64

Is there a way in cmake to manipulate any ASM related cmake flag, so that the 
above ml64.exe execution has /D _WIN64 option set ?

Thanks & Regards

Ravi Raman
Xoriant Solutions Pvt. Ltd
4th Floor, Winchester, Hiranandani Business Park, Powai, Mumbai 400076, INDIA.
Tel: +91 22 30511000,9930100026 Extn: 2144 Voip No. 4088344495/96/97/98 Voip 
Extn:1178| Fax: +91 22 3051
ravi.ra...@xoriant.com| 
http://www.xoriant.com

-- 

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