[CMake] Custom Module

2015-09-29 Thread Gerry Weaver
Hello All,


I'm trying to use a custom module, but I can't get cmake to see it. I am on 
FreeBSD 9.3 (amd64) using cmake-3.3.2. I have read and tried everything I can 
find on the topic. I have verified the module path via the "MESSAGE" command, 
but no joy. I have included all relevant information below. Any help would be 
much appreciated.


BTW: I also tried putting the .cmake files in the cmake Modules directory.


Thanks,

-S


set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} 
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/")

MESSAGE( STATUS "CMAKE_MODULE_PATH: " ${CMAKE_MODULE_PATH} )

find_package(NIM)


FindNIM.cmake
-

include(CMakeParseArguments)

find_program(NIM_EXECUTABLE nimrod PATHS ENV PATH)
mark_as_advanced(NIM_EXECUTABLE)

# Determine the valac version
if(NIM_EXECUTABLE)
execute_process(COMMAND ${NIM_EXECUTABLE} "--version"
OUTPUT_VARIABLE NIM_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" NIM_VERSION ${NIM_VERSION})
endif(NIM_EXECUTABLE)

# Handle the QUIETLY and REQUIRED arguments, which may be given to the find call
.
# set NIM_FOUND to TRUE if Nimrod has been found

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Nim
REQUIRED_VARS NIM_EXECUTABLE
VERSION_VAR NIM_VERSION)

set(NIM_USE_FILE "${CMAKE_CURRENT_LIST_DIR}/UseNim.cmake")


UseNim.cmake



include(CMakeParseArguments)

function(add_nim_executable )
cmake_parse_arguments(ARGS "" "TARGET" "SOURCES" ${ARGN})

# collect set of input source files
set(in_files "")
foreach(src ${ARGS_SOURCES} ${ARGS_UNPARSED_ARGUMENTS})
list(APPEND in_files "${CMAKE_CURRENT_SOURCE_DIR}/${src}")
endforeach(src ${ARGS_SOURCES} ${ARGS_UNPARSED_ARGUMENTS})

# set the target binary and nim cache directory
set(nim_target "${CMAKE_CURRENT_BINARY_DIR}/${ARGS_TARGET}")
set(DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/nimcache")

# add target to trigger the nimrod compiler
add_custom_target(
nim ALL
COMMAND
${NIM_EXECUTABLE} "c" "--nimcache:" ${DIRECTORY} "--out:" ${nim_
target} ${in_files}
DEPENDS
${in_files}
endfunction(add_nim_executable)







-- 

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] Custom Module

2015-09-29 Thread Nils Gladitz

On 09/29/2015 12:25 PM, Gerry Weaver wrote:

Hello All,


I'm trying to use a custom module, but I can't get cmake to see it. I am
on FreeBSD 9.3 (amd64) using cmake-3.3.2. I have read and tried
everything I can find on the topic. I have verified the module path via
the "MESSAGE" command, but no joy. I have included all relevant
information below. Any help would be much appreciated.


What exact output (diagnostics) do you get from cmake?

The module is found for me (Ubuntu) as expected but contains a syntax error.

FindNIM.cmake contains a line with nothing but a "." but that may be a 
copy&paste error?


Nils
--

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] Seemingly-unfixable warning about CMP0058 after upgrade to CMake 3.3

2015-09-29 Thread Michael Catanzaro
On Mon, 2015-09-28 at 11:51 -0400, Brad King wrote:
> CMake is warning that it now prefers to generate the Ninja build file
> for this case a different way than it did before but is doing it the
> old way for compatibility just in case the project needs that to
> build.
> In this case we know we are providing the file ourselves so it is
> safe
> to allow CMake to generate the build file without the extra phony
> rule.
> One can set the policy to NEW to get the new preferred behavior, but
> this has to be done in the project itself once it is known that the
> new
> behavior works for the project.

Thanks for the explanation, Brad!

Michael
-- 

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] Associating a single build step with multiple sub-projects in CDash

2015-09-29 Thread Attila Krasznahorkay
Dear All,

After the suggestion from Bill Hoffman, I played with CDash for a while now. I 
was able to create a ctest script that would build the packages/subdirectories 
of my project one by one, and then upload the build/test results to a CDash 
server. With the results being quite user friendly on the webpage.

However this is unfortunately terribly slow. The project that I'm trying to 
build as an exercise has ~120 packages/subdirectories. Each with 1-20 source 
files. As you can imagine there's a huge difference between calling "make" just 
once to let all targets build at the same time, or to call it 120 times for the 
separate packages. The CPU utilisation in the latter case is less than 50% 
overall. (With the "Unix Makefiles" generator it's around 30%, and with Ninja 
around 50%. On an machine with 8 threads.)

But I noticed that when I build the project with CTEST_USE_LAUNCHERS enabled, 
even in a fully parallel build the output generated by CTest/CMake associates 
the build warnings/errors with the labels that I gave to the targets in my 
build. (Which correspond to the names of the packages.)

Unfortunately however I'm unable to upload the results from this single build 
step to CDash such that the warnings/errors belonging to the different 
sub-projects would show up under those sub-projects. :-( I tried this with the 
following code:

# Execute the project build:
ctest_build( BUILD ${CTEST_BINARY_DIRECTORY} APPEND )

# The subprojects to build/test:
set( _subprojects @CTEST_PROJECT_SUBPROJECTS@ )
foreach( _subproject ${_subprojects} )

   # Upload the build results for this package:
   set_property( GLOBAL PROPERTY SubProject Package_${_subproject} )
   set_property( GLOBAL PROPERTY Label Package_${_subproject} )
   set( CTEST_BUILD_TARGET Package_${_subproject} )
   ctest_submit( PARTS Build )

   # Execute the test(s) of the subproject:
   ctest_test( BUILD ${CTEST_BINARY_DIRECTORY}
  INCLUDE_LABEL Package_${_subproject} APPEND )
   ctest_submit( PARTS Test )

endforeach()

But this doesn't do what I was hoping for. (No filtering is made from the one 
big XML to just pick out the warnings/errors belonging to the currently 
processed package.)

Now, the current situation is already a lot better than I was in a few days 
ago. As the XML files generated by ctest in this case seem like a very good 
starting point to process using our nightly build system to present the 
warnings/errors on our privately produced webpages. But I wonder if it could be 
possible to also teach CTest/CDash how to do this sort of thing out of the 
box...

Cheers,
Attila
-- 

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] Is there a variable containing the C flags that would be used to compile something in a directory

2015-09-29 Thread Matthew Keeler
There are various variables like CMAKE_C_FLAGS_ that can influence the 
final flags sent to the compiler. Is there a variable that exists or a function 
to call to get the final C flags.

What I am trying to do is invoke a custom command to run make on an external 
source tree. This makefile has CC, AR, RANLIB CFLAGS and LDFLAGS variables. The 
command I would like to do is

add_custom_command( COMMAND make CC=${CMAKE_C_COMPILER} AR=${CMAKE_AR} 
RANLIB=${CMAKE_RANLIB} CFLAGS= LDFLAGS= ……)

However it doesn’t seem like there is a variable that contains a set of all the 
flags that cmake would use. For example, when building on OS X the 
-mmacosx-version-min flag gets tacked on by cmake but I can’t find a variable 
that contains this flag.

Is there a way to do what I want or am I going to have to manage all the C 
flags manually?

--
Matt Keeler
-- 

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] Is the situation with CMake + Eclipse ever going to get any better?

2015-09-29 Thread Roland Schulz
Hi,

also Doug, the CDT co-lead, is working on an integration of cmake into cdt.
You can find information in the archive of cdt-...@eclipse.org. I think you
can expect well integration, similar to clion or qt-developer, with the
next major release next year.

Roland

On Mon, Sep 28, 2015 at 11:00 AM, Martin Weber 
wrote:

> Am Sonntag, 27. September 2015, 13:29:15 schrieb Talin:
> > I've been using CMake and Eclipse for a bunch of different projects over
> > the last several years. Although many aspects of both CMake and Eclipse
> > have improved over the years, using them together still has a lot of
> > problems.
> >
> > From what I understand, you have three choices when setting up a project:
> >
> > 1) Use in-source builds.
> > 2) Use out-of-source builds with a single generated project.
> > 3) Use out-of-source builds with both a build project and a source
> project.
>
> If you are building C/C++ sources, set up a CDT project.
> ADVERTISING:
> Then let  generate
> the
> makefiles. (I am the author of it).
>
> It is not perfect due to the quirks in CDT, but it avoids that extra manual
> invocation of 'cmake -G whatever'.
>
> Martin
>
> --
> Cd wrttn wtht vwls s mch trsr.
>
>
> --
>
> 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
>



-- 
ORNL/UT Center for Molecular Biophysics cmb.ornl.gov
865-241-1537, ORNL PO BOX 2008 MS6309
-- 

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 install behaviour with git

2015-09-29 Thread Jörg Kreuzberger
Hi!

the cmake install behaviour of files was ok for me, as long as we used svn.
Now we changed to git and i have a problem now with the install behaviour.

On git the timestamps of all files get the time of the clone. So files not build
(e.g. configuration files, xml files etc) from the repository have the same 
timestamp.

Now install behaves differnt, cause cmake checks only file time difference. 
Files previously overwritten are now
considered Up-to-date

I am forcing now overwrite with CMAKE_ALWAYS_INSTALL, but this takes then a 
long time, cause now all
binary files (with differnt timestamps) get installed (e.g. huge qt dlls, 
executables etc :-) )

Has anyone found a solution for this after a git migration?
Adapting the file timestamps after clone seems not the thing i want to do :-)
Or should i post a feature-request to check also the file size for Up-to-date 
checking?

Thanks for any hints,
Joerg

-- 

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