Re: [CMake] Patch on Windows?

2015-09-01 Thread CHEVRIER, Marc
FYI, the latest version (2.5.1) of git for Windows (available 
https://github.com/git-for-windows/git/releases and http://git-scm.com/) 
includes again the patch tool.

Marc

From: CMake on behalf of "Macumber, Daniel"
Date: Tuesday 1 September 2015 17:51
To: "cmake@cmake.org"
Subject: [CMake] Patch on Windows?

There was a thread back in January of 2014 about “It would be great if CMake 
implemented a "cmake -E patch".”.  This feature would really help us out, 
especially since the patch tool was removed from the Git for Windows 
distribution (I have no idea why).  Did anything ever happen with this request?

Thanks a lot,
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] Subclass of external library: unresolved external symbol

2015-09-01 Thread Jakob van Bethlehem
Hej,

Seems to me at first sight you didn’t implement the New() function

Greetsz, Jakob

> On 01 Sep 2015, at 22:02, Marcos  wrote:
> 
> Hi,
> 
> I can use and include VTK libraries in my project, but I did a 
> vtkInteractorStyleImage subclass, just overriding a method:
> 
> 
> #ifndef dcmInteractorStyleImage_h
> #define dcmInteractorStyleImage_h
> 
> #include "vtkInteractionStyleModule.h" // For export macro
> #include "vtkInteractorStyleImage.h"
> 
> class VTKINTERACTIONSTYLE_EXPORT dcmInteractorStyle : public 
> vtkInteractorStyleImage
> {
> public:
>   static dcmInteractorStyle *New();
>   vtkTypeMacro(dcmInteractorStyle, vtkInteractorStyleImage);
> 
>   virtual void OnLeftButtonDown();
> 
>   void PrintSelf(ostream& os, vtkIndent indent);
> };
> 
> 
> #endif
> 
> 
> The thing is I use it in a Qt class. So I include this in my CMakeLists.txt:
> 
> set(GENERIC_VIEW_CPP
>  View/UI/dcminteractorstyle.cpp
> )
> 
> SET(GENERIC_VIEW_H
>  View/UI/dcminteractorstyle.h
> )
> 
> add_library(generic ${GENERIC_VIEW_CPP} ${GENERIC_VIEW_H})
> ...
> add_library(ui_qt ${UI_QT_CXX}
>  ${UI_FORM_HEADERS} ${UI_RESOURCES_RCC}
>  ${MODEL_WRAPPED_HEADERS}
>  ${GENERIC_VIEW_CPP} ${GENERIC_VIEW_H} #necesary here?
> )
> qt5_use_modules(ui_qt Core Gui Widgets)
> ...
> set_source_files_properties(${UI_RESOURCES_RCC} PROPERTIES GENERATED ON)
> add_executable(UtilidadDICOM WIN32 main.cpp ${UI_RESOURCES_RCC})
> target_link_libraries(UtilidadDICOM
> model
> ui_qt
> generic
> ${Glue}
> ${VTK_LIBRARIES}
> ${ITK_LIBRARIES}
> )
> --
> The error trying to compile:
> ui_qt.lib(viewerwidget.cpp.obj):-1: error: LNK2019: unresolved external 
> symbol "public: static class dcmInteractorStyle * __cdecl 
> dcmInteractorStyle::New(void)" (?New@dcmInteractorStyle@@SAPAV1@XZ) 
> referenced in function "public: static class vtkSmartPointer dcmInteractorStyle> __cdecl vtkSmartPointer dcmInteractorStyle>::New(void)" 
> (?New@?$vtkSmartPointer@VdcmInteractorStyleSA?AV1@XZ)
> 
> ui_qt is a library declared in CMake, as you can see above.
> 
> Any ideas? Thank you.
> -- 
> 
> 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

-- 

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] Subclass of external library: unresolved external symbol

2015-09-01 Thread Marcos
Hi,

I can use and include VTK libraries in my project, but I did a
vtkInteractorStyleImage subclass, just overriding a method:



#ifndef dcmInteractorStyleImage_h

#define dcmInteractorStyleImage_h


#include "vtkInteractionStyleModule.h" // For export macro

#include "vtkInteractorStyleImage.h"


class VTKINTERACTIONSTYLE_EXPORT dcmInteractorStyle : public
vtkInteractorStyleImage

{

public:

  static dcmInteractorStyle *New();

  vtkTypeMacro(dcmInteractorStyle, vtkInteractorStyleImage);


  virtual void OnLeftButtonDown();


  void PrintSelf(ostream& os, vtkIndent indent);

};



#endif




The thing is I use it in a Qt class. So I include this in my CMakeLists.txt:


set(GENERIC_VIEW_CPP

 View/UI/dcminteractorstyle.cpp

)


SET(GENERIC_VIEW_H

 View/UI/dcminteractorstyle.h

)


add_library(generic ${GENERIC_VIEW_CPP} ${GENERIC_VIEW_H})

...

add_library(ui_qt ${UI_QT_CXX}

 ${UI_FORM_HEADERS} ${UI_RESOURCES_RCC}

 ${MODEL_WRAPPED_HEADERS}

 ${GENERIC_VIEW_CPP} ${GENERIC_VIEW_H} #necesary here?

)

qt5_use_modules(ui_qt Core Gui Widgets)

...

set_source_files_properties(${UI_RESOURCES_RCC} PROPERTIES GENERATED ON)
add_executable(UtilidadDICOM WIN32 main.cpp ${UI_RESOURCES_RCC})
target_link_libraries(UtilidadDICOM
model
ui_qt
generic
${Glue}
${VTK_LIBRARIES}
${ITK_LIBRARIES}
)

--

The error trying to compile:

ui_qt.lib(viewerwidget.cpp.obj):-1: error: LNK2019: unresolved
external symbol "public: static class dcmInteractorStyle * __cdecl
dcmInteractorStyle::New(void)" (?New@dcmInteractorStyle@@SAPAV1@XZ)
referenced in function "public: static class vtkSmartPointer __cdecl vtkSmartPointer::New(void)"
(?New@?$vtkSmartPointer@VdcmInteractorStyleSA?AV1@XZ)


ui_qt is a library declared in CMake, as you can see above.


Any ideas? Thank you.
-- 

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] Patch on Windows?

2015-09-01 Thread Bill Hoffman

On 9/1/2015 11:51 AM, Macumber, Daniel wrote:

There was a thread back in January of 2014 about “It would be great if
CMake implemented a "cmake -E patch".”.  This feature would really help
us out, especially since the patch tool was removed from the Git for
Windows distribution (I have no idea why).  Did anything ever happen
with this request?


Would be a great contribution but I don't think there is a compatible 
license patch library that is around.  I have looked in the past.  This 
one requires Qt:


https://github.com/arrbee/google-diff-match-patch/blob/master/cpp/diff_match_patch.h

-Bill

--

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] Patch on Windows?

2015-09-01 Thread Macumber, Daniel
There was a thread back in January of 2014 about "It would be great if CMake 
implemented a "cmake -E patch".".  This feature would really help us out, 
especially since the patch tool was removed from the Git for Windows 
distribution (I have no idea why).  Did anything ever happen with this request?

Thanks a lot,
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] Per build configuration variables

2015-09-01 Thread Sergiu Dotenco
On 8/31/2015 1:11 AM, Sergiu Dotenco wrote:
> I would like to pass different library directories to fixup_bundle,
> depending what configuration is currently active. Right now, I define a
> cache variable consisting of DLL directories:
> 
> set (RUNTIME_LIBRARY_DIRS "C:/Foo/Release/bin;..." CACHE STRING "")
> 
> This is problematic, since for a different build configuration (for
> instance RelWithDebInfo or even Debug) this set of directories would
> probably be different as well. For Makefile generators I can use
> CMAKE_BUILD_TYPE to decide which variables to select. However, this does
> not work in an environment that supports multiconfiguration, such as
> Visual Studio or Xcode, because the selection must be done at build time.
> 
> Any ideas how can one achieve this?
> 

Got it. One can use CMAKE_INSTALL_CONFIG_NAME in install (CODE "...").
-- 

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] Adding Compile Features/Flags for Intel and other Compilers

2015-09-01 Thread Ben Morgan
Hi,

I've been using the new compile features functionality for working with
C++11 and beyond (very useful!!). However, I've run into issues (probably
misunderstandings) trying to extend it to compilers for which CMake doesn't
currently provide a -CXX-FeatureTests.cmake file. Of course
long term, these will be added (and I'm happy to contribute here), but on
shorter timescales and to potentially support older CMake 3 series I wanted
to see if I could provide files/settings in my own project to do this.

Initially I thought about providing the file as a module in my project
(e.g. for Intel)
and then prepending the directory holding it to CMAKE_MODULE_PATH. However,
all the files using the feature testing system appear to use absolute paths
(via CMAKE_ROOT) to load the relevant file, so this appears to be a no-go.

I then looked at setting the CMAKE_CXX11_COMPILE_FEATURES and
CMAKE_CXX11_{STANDARD,EXTENSION}_COMPILE_OPTION variables directly after
the initial project call. This appears to work for compile features, but
not for compile options. Here's my simple test case (NB no version checking
of Intel yet...)

cmake_minimum_required(VERSION 3.1)

project(IntelCompileFeatures CXX)


if(CMAKE_CXX_COMPILER_ID MATCHES "Intel")

  message(STATUS "CMAKE_COMPILER_ID matches 'Intel'")

  set(CMAKE_CXX11_COMPILE_FEATURES cxx_auto_type cxx_range_for)

  set(CMAKE_CXX_COMPILE_FEATURES ${CMAKE_CXX11_COMPILE_FEATURES})

  set(CMAKE_CXX11_STANDARD_COMPILE_OPTION "-std=c++11")

  set(CMAKE_CXX11_EXTENSION_COMPILE_OPTION "-std=c++11")

endif()


file(WRITE "testIntel.cpp" "

#include 


int main() {

std::string foo(\"helloworld\");

for (auto& i : foo) {

std::cout << i << std::endl;

}

}

")


add_executable(testIntel testIntel.cpp)

target_compile_features(testIntel PRIVATE

  cxx_auto_type

  cxx_range_for

  )

This will pass the configure/generate stage fine, as CMake configures and
generates recognising the features set on `testIntel`, but the compile
option  -std=c++11 isn't added to the compile flags. I've cross-checked on
the usage of CMAKE_CXX11_{STANDARD,EXTENSION}_COMPILE_OPTION and here I've
been able to modify it after project has been called and see the modified
version
appear in the build time flags.

I'm therefore not sure if I've misunderstood how
CMAKE_CXX11_{STANDARD,EXTENSION}_COMPILE_OPTION is supposed to work, or if
there's some other setting I'm missing. Any help or suggestions gratefully
received!!

Thanks,

Ben Morgan
-- 

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] packageConfig mishap

2015-09-01 Thread Nagy-Egri Máté Ferenc via CMake
Hi!
I'm trying to use the package config file of clFFT (big congrats on providing 
one), but it seems I'm doing something wrong. Without using FindclFFT.cmake, 
CMake fails to find the config files, both on Windows and Ubuntu. On Windows I 
have a registry entry such as:
PS C:\Users\Matty> Get-ItemProperty -Path HKCU:\SOFTWARE\Kitware\CMake\Packages\


clFFT_2.6.1  : C:\Kellekek\AMD\clFFT\2.6.1\CMake
PSPath   : 
Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\SOFTWARE\Kitware\CMake\Packages\
PSParentPath : 
Microsoft.PowerShell.Core\Registry::HKEY_CURRENT_USER\SOFTWARE\Kitware\CMake
PSChildName  : Packages
PSDrive  : HKCU
PSProvider   : Microsoft.PowerShell.Core\Registry

and also on Linux:

mnagy@opteron:~/Build/clFFT_Test/opteron$ cat 
~/.cmake/packages/clFFT_2.6.1.package
/opt/AMD/clFFT/2.6.1/lib64/cmake/clFFT

but every time I configure a project, I get the following error:

mnagy@opteron:~/Build/clFFT_Test/opteron$ cmake -D CMAKE_BUILD_TYPE=Release 
~/Develop/clFFT_Test/
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Warning at CMakeLists.txt:39 (find_package):
  By not providing "FindclFFT.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "clFFT", but
  CMake did not find one.

  Could not find a package configuration file provided by "clFFT" with any of
  the following names:

clFFTConfig.cmake
clfft-config.cmake

  Add the installation prefix of "clFFT" to CMAKE_PREFIX_PATH or set
  "clFFT_DIR" to a directory containing one of the above files.  If "clFFT"
  provides a separate development package or SDK, be sure it has been
  installed.


CMake Warning at CMakeLists.txt:40 (find_package):
  By not providing "FindOpenCL.cmake" in CMAKE_MODULE_PATH this project has
  asked CMake to find a package configuration file provided by "OpenCL", but
  CMake did not find one.

  Could not find a package configuration file provided by "OpenCL" with any
  of the following names:

OpenCLConfig.cmake
opencl-config.cmake

  Add the installation prefix of "OpenCL" to CMAKE_PREFIX_PATH or set
  "OpenCL_DIR" to a directory containing one of the above files.  If "OpenCL"
  provides a separate development package or SDK, be sure it has been
  installed.


-- Configuring done
-- Generating done
-- Build files have been written to: /home/mnagy/Build/clFFT_Test/opteron

Without providing CMAKE_PREFIX_PATH on the command-line, the paclage config 
files do not work. What exactly am I doing wrong? According to the CMake wiki

http://www.cmake.org/Wiki/CMake/Tutorials/Package_Registry

it should be working automatically (as is the whole purpose of packages).
-- 

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 exclude top level directory from install(DIRECTORY)

2015-09-01 Thread Ralf Habacker
Hi,

in a cmake project I have a directory structure like shown below:

source/
   subdir1/
 subdir2/
 file
   subdir2/
 file

which should be installed partially.

In one install call I need to exclude subdir1/subdir2 which could be
performed with the following install command.

install(DIRECTORY source DESTINATION . REGEX subdir1/subdir2 EXCLUDE)

but it looks impossible to exclude the top level subdir2. I tried
several variations.

install(DIRECTORY source DESTINATION . REGEX subdir2 EXCLUDE) ->
excludes all directory named 'subdir2'
install(DIRECTORY source DESTINATION . REGEX /subdir2 EXCLUDE) - does
not match any subdir
install(DIRECTORY source DESTINATION . REGEX ./subdir2 EXCLUDE) - does
not match any subdir
install(DIRECTORY source DESTINATION . REGEX ^subdir2 EXCLUDE) - does
not match any subdir
install(DIRECTORY source DESTINATION . REGEX ^/subdir2 EXCLUDE) - does
not match any subdir
install(DIRECTORY source DESTINATION . REGEX ^./subdir2 EXCLUDE) - does
not match any subdir

How to proceed ?

Regards
Ralf




-- 

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] Enhanced version management for the command "project"

2015-09-01 Thread SF Markus Elfring
Hello,

CMake provides an interface for the specification of version information
by the command "project".
http://www.cmake.org/cmake/help/v3.3/command/project.html

I find that there is a growing need to extend it.

1. How do you think about to preserve a software release tag there?

2. Software packages can often evolve and deviate from the specified version
   numbers after the moment they were copied to an useful location.
   Would you like to distinguish the extensions to a base version
   by any additional data (like a commit hash or revision identifier)
   from a content management system?

Regards,
Markus
-- 

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