Re: [CMake] ExternalProject_Add Visual Studio build Install Target

2019-10-20 Thread J Decker
On Sat, Aug 31, 2019 at 9:56 PM J Decker  wrote:

> Why does it seem I'm the only one with this problem?
>

This is an external CMakeLists.txt that fails.

cmake_minimum_required(VERSION 3.15)

set_property(GLOBAL PROPERTY USE_FOLDERS On)

project( B )
include( ExternalProject )

add_executable( b b.c )

## Specifically this line causes the fails #
SET_TARGET_PROPERTIES(b PROPERTIES FOLDER "install" )

install( TARGETS b )
-





A full Test  ...
--- CMakeLists.txt---
cmake_minimum_required(VERSION 3.15)

if( NOT EXISTS b )
file(MAKE_DIRECTORY b)
file( WRITE b/b.c "#include \nint main(void) { printf(
\"Program.\\n\" ); }" )
file( WRITE b/CMakeLists.txt  "cmake_minimum_required(VERSION
3.15)\n\nset_property(GLOBAL PROPERTY USE_FOLDERS On)\n\nproject( B
)\ninclude( ExternalProject )\n\nadd_executable( b b.c
)\nSET_TARGET_PROPERTIES(b PROPERTIES\n  FOLDER \"install\"
)\n\ninstall( TARGETS b )\n" )

endif( NOT EXISTS b )

set_property(GLOBAL PROPERTY USE_FOLDERS On)

project( Test )

include( ExternalProject )

ExternalProject_Add( b
PREFIX b-src
SOURCE_DIR ${CMAKE_SOURCE_DIR}/b
BINARY_DIR b_exe
INSTALL_DIR ${CMAKE_INSTALL_PREFIX}
BUILD_ALWAYS 1
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=
-DCMAKE_BUILD_TYPE:PATH=${CMAKE_BUILD_TYPE}
)

--- End CMakeLists.txt---

mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=output
cmake --build . --target install

Error Output:
 MSBUILD : error MSB1009: Project file does not exist.
[M:\tmp\cmake_vs_install\build\b.vcxproj]
  Switch: install


---

  SET_TARGET_PROPERTIES(b PROPERTIES FOLDER "Install" ) # capitalize I
bypasses the issue
  SET_TARGET_PROPERTIES(b PROPERTIES FOLDER "Install and Deploy" ) # make
it really log also bypasses the issue...

otherwise capitalizing --target INSTALL in the ExternalProject.cmake, for
visual studio, also fixed the problem, since the real target is 'INSTALL'
and not 'install'
-- 

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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add Visual Studio build Install Target

2019-08-31 Thread J Decker
Why does it seem I'm the only one with this problem?
I've recently updated this other portable system while I'm on the road, and
the latest version of course fails the same way.

 The Current build output

1>-- Build started: Project: intershell
(ExternalProjectTargets\intershell\intershell), Configuration:
RelWithDebInfo x64 --
1>  Performing install step for 'intershell'
1>  Microsoft (R) Build Engine version 14.0.23107.0
1>  Copyright (C) Microsoft Corporation. All rights reserved.
1>
1>MSBUILD : error MSB1009: Project file does not exist.
1>  Switch: install
== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==

-
share\cmake-3.15\Modules\ExternalProject.cmake
line 1853

  if(step STREQUAL "INSTALL")
list(APPEND args --target install)
  endif()


Change to
  if(step STREQUAL "INSTALL")
list(APPEND args --target INSTALL)
  endif()

 ---

And then the output looks like
 --
1>-- Build started: Project: intershell
(ExternalProjectTargets\intershell\intershell), Configuration:
RelWithDebInfo x64 --
1>  Performing install step for 'intershell'
1>  Microsoft (R) Build Engine version 14.0.23107.0
1>  Copyright (C) Microsoft Corporation. All rights reserved.
1>
1>InterShell.Service.vcxproj ->
M:\javascript\sack-gui\build\sack-src\src\intershell-build\service.shell\RelWithDebInfo\InterShell.Service.exe
..
(completes successfully )



On Thu, Apr 25, 2019 at 1:27 AM J Decker  wrote:

> I've had to make this modification the last few versions...
>
> cmake/share/cmake-3.14/Modules/ExternalProject.cmake
>
> line 1870 from
>
>   if(step STREQUAL "INSTALL")
> list(APPEND args --target install)
>   endif()
>
> to
>
>   if(step STREQUAL "INSTALL")
> list(APPEND args --target INSTALL)
>   endif()
>
> Otherwise, when building with visual studio, and trying to run the
> -install.rule  rule, it says 'no such project'
>
> I don't think the same issue happens when building from the command line.
>
-- 

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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add() setting build command to run external project's makefile

2019-05-31 Thread Michael Ellery
It seems like the error might be related to the download/extract step. I think 
the fact that you are using the same dir for PREFIX, SOURCE_DIR and 
DOWNLOAD_DIR might be confusing things. I would try commenting out those three 
properties and see if it makes any difference, and then you can fine-tune those 
properties as needed once you get it working (maybe but just setting PREFIX).

-Mike

> On May 31, 2019, at 7:41 AM, David Starkweather  wrote:
> 
> Hello
> First off, much thanks to all the contributors of cmake. A truly invaluable 
> build utility. Your efforts
> are greatly appreciated.
> 
> I've been successfully using cmake to build an external project (the client 
> library for redis, hiredis) 
> that has already been downloaded. I was able to do this with BUILD_IN_SOURCE 
> set to true, like so:
> 
> ExternalProject_Add(hiredis  
> PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/hiredis
> SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hiredis
> BUILD_IN_SOURCE 1
> CONFIGURE_COMMAND echo configure
> BUILD_COMMAND make static
> INSTALL_COMMAND echo install)
> 
> 
> However, now i'd like to automatically download the source from github.  So, 
> I switch to 
> the following:
> 
> set(HIREDIS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hiredis)
> set(HIREDIS_INCLUDE_DIRS ${HIREDIS_DIR}/include)
> ExternalProject_Add(hiredis
>   URL https://github.com/redis/hiredis/archive/v0.9.0.tar.gz
>   PREFIX ${CMAKE_CURRENT_BINARY_DIR}/hiredis
>   SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/hiredis
>   DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/hiredis
>   BUILD_IN_SOURCE 1
>   CONFIGURE_COMMAND ""
>   BUILD_COMMAND make static
>   INSTALL_COMMAND "")
> 
> And I get the following error:
> 
> [  3%] Creating directories for 'hiredis'
> [  6%] Performing download step (download, verify and extract) for 'hiredis'
> -- Downloading...
>dst='/home/david/projects/clipseekr/hiredis/v0.9.0.tar.gz'
>timeout='none'
> -- Using src='https://github.com/redis/hiredis/archive/v0.9.0.tar.gz'
> -- Downloading... done
> -- extracting...
>  src='/home/david/projects/clipseekr/hiredis/v0.9.0.tar.gz'
>  dst='/home/david/projects/clipseekr/hiredis'
> -- extracting... [tar xfz]
> -- extracting... [analysis]
> -- extracting... [rename]
> -- extracting... [clean up]
> -- extracting... done
> make[2]: *** [CMakeFiles/hiredis.dir/build.make:93: 
> hiredis/src/hiredis-stamp/hiredis-download] Error 1
> make[1]: *** [CMakeFiles/Makefile2:147: CMakeFiles/hiredis.dir/all] Error 2
> make: *** [Makefile:163: all] Error 2
> 
> It seems cmake is trying to invoke its internal cmake make files, rather than 
> just run the "make static"
> build command.  How do I just run the the "make static" command directly? 
> 
> Once again, thanks.
> starkdg
>  
>   
> -- 
> 
> 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:
> https://cmake.org/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:
https://cmake.org/mailman/listinfo/cmake


[CMake] ExternalProject_Add() setting build command to run external project's makefile

2019-05-31 Thread David Starkweather
Hello
First off, much thanks to all the contributors of cmake. A truly invaluable
build utility. Your efforts
are greatly appreciated.

I've been successfully using cmake to build an external project (the client
library for redis, hiredis)
that has already been downloaded. I was able to do this with
BUILD_IN_SOURCE set to true, like so:

ExternalProject_Add(hiredis
PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/hiredis
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hiredis
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND echo configure
BUILD_COMMAND make static
INSTALL_COMMAND echo install)

However, now i'd like to automatically download the source from github.
So, I switch to
the following:

set(HIREDIS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hiredis)
set(HIREDIS_INCLUDE_DIRS ${HIREDIS_DIR}/include)
ExternalProject_Add(hiredis
  URL https://github.com/redis/hiredis/archive/v0.9.0.tar.gz
  PREFIX ${CMAKE_CURRENT_BINARY_DIR}/hiredis
  SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/hiredis
  DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/hiredis
  BUILD_IN_SOURCE 1
  CONFIGURE_COMMAND ""
  BUILD_COMMAND make static
  INSTALL_COMMAND "")

*And I get the following error:*

[  3%] Creating directories for 'hiredis'
[  6%] Performing download step (download, verify and extract) for 'hiredis'
-- Downloading...
   dst='/home/david/projects/clipseekr/hiredis/v0.9.0.tar.gz'
   timeout='none'
-- Using src='https://github.com/redis/hiredis/archive/v0.9.0.tar.gz'
-- Downloading... done
-- extracting...
 src='/home/david/projects/clipseekr/hiredis/v0.9.0.tar.gz'
 dst='/home/david/projects/clipseekr/hiredis'
-- extracting... [tar xfz]
-- extracting... [analysis]
-- extracting... [rename]
-- extracting... [clean up]
-- extracting... done
make[2]: *** [CMakeFiles/hiredis.dir/build.make:93:
hiredis/src/hiredis-stamp/hiredis-download] Error 1
make[1]: *** [CMakeFiles/Makefile2:147: CMakeFiles/hiredis.dir/all] Error 2
make: *** [Makefile:163: all] Error 2

It seems cmake is trying to invoke its internal cmake make files, rather
than just run the "make static"
build command.  How do I just run the the "make static" command directly?

Once again, thanks.
starkdg
-- 

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:
https://cmake.org/mailman/listinfo/cmake


[CMake] ExternalProject_Add() Trouble Invoking Build Command to run the projects makefile

2019-05-31 Thread David Starkweather
set(HIREDIS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hiredis)
set(HIREDIS_INCLUDE_DIRS ${HIREDIS_DIR}/include)
ExternalProject_Add(hiredis
  URL https://github.com/redis/hiredis/archive/v0.9.0.tar.gz
  PREFIX ${CMAKE_CURRENT_BINARY_DIR}/hiredis
  SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/hiredis
  DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/hiredis
  BUILD_IN_SOURCE 1
  CONFIGURE_COMMAND ""
  BUILD_COMMAND make static
  INSTALL_COMMAND "")
-- 

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:
https://cmake.org/mailman/listinfo/cmake


[CMake] ExternalProject_Add Visual Studio build Install Target

2019-04-25 Thread J Decker
I've had to make this modification the last few versions...

cmake/share/cmake-3.14/Modules/ExternalProject.cmake

line 1870 from

  if(step STREQUAL "INSTALL")
list(APPEND args --target install)
  endif()

to

  if(step STREQUAL "INSTALL")
list(APPEND args --target INSTALL)
  endif()

Otherwise, when building with visual studio, and trying to run the
-install.rule  rule, it says 'no such project'

I don't think the same issue happens when building from the command line.
-- 

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:
https://cmake.org/mailman/listinfo/cmake


[CMake] externalproject_add & install( target ... )

2018-05-27 Thread alexander . sizov
hello, world!sorry for my english:I have several libraries that come to me in archives compiled with their header files. for unpacking and configuring the primary method I use externalproject_add(). next, I need to install them and create configuration scripts for further importing into several projects using the find_package() method. however, in this script:# externalproject_add( libA_external ... )add_library( libA STATIC IMPORTED )set_target_properties( libA PROPERTIES IMPORTED_LOCATION ... )install( TARGETS libA ... ) # < I got error: install TARGETS given target "libA" which does not exist in this directory.# how to write such a script so that a configuration file is automatically created for importing the library and headers with find_package()?perhaps someone has an example?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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add and Git Update? How do I make these work?

2017-12-23 Thread Kris Thielemans
Hi

The strange thing here is

Cannot rebase: You have unstaged changes.
Please commit or stash them.
No rebase in progress?

Why would it be rebasing? Maybe a local config setting that a pull is always
pull --rebase? In any case, my guess is that your discount/Source is in a
funny state compare to the github version. Try a "git pull" there manually
to see what happens then.

HTH
kris

-Original Message-
From: CMake [mailto:cmake-boun...@cmake.org] On Behalf Of Michael Jackson
Sent: 22 December 2017 19:51
To: CMake Mail List 
Subject: [CMake] ExternalProject_Add and Git Update? How do I make these
work?

ExternalProject_Add(${extProjectName}
  GIT_REPOSITORY "g
it://github.com/BlueQuartzSoftware/discount.git"
  GIT_PROGRESS 1
  #GIT_TAG master

  TMP_DIR
"${DREAM3D_SDK}/superbuild/${extProjectName}/tmp/${CMAKE_BUILD_TYPE}"
  STAMP_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/Stamp"
  DOWNLOAD_DIR ${DREAM3D_SDK}/superbuild/${extProjectName}/Download
  SOURCE_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/Source"
  BINARY_DIR
"${DREAM3D_SDK}/superbuild/${extProjectName}/Build/${CMAKE_BUILD_TYPE}"
  INSTALL_DIR
"${DREAM3D_SDK}/${extProjectName}-${discount_VERSION}-${CMAKE_BUILD_TYPE}"

  #UPDATE_COMMAND "${GIT_EXECUTABLE} pull --rebase origin master"
  PATCH_COMMAND ""

  CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=

  LOG_DOWNLOAD 1
  LOG_UPDATE 1
  LOG_CONFIGURE 1
  LOG_BUILD 1
  LOG_TEST 1
  LOG_INSTALL 1
)

The above is my cmake code. This worked great the first time through. Then I
discovered an issue in the project that I was cloning (discount) and fixed
it and pushed it. Now the repository at GitHub is a few commits ahead of
what I have. So I rerun CMake and then "ninja" and I get an error when the
"update" command is run:

Cannot rebase: You have unstaged changes.
Please commit or stash them.
No rebase in progress?
CMake Error at
/Users/Shared/DREAM3D_SDK/superbuild/discount/tmp/Debug/discount-gitupdate.c
make:105 (message):
  

  Failed to rebase in:
  '/Users/Shared/DREAM3D_SDK/superbuild/discount/Source/'.

  You will have to resolve the conflicts manually


Doing a "git status" in the "Source" directory gives this:

[mjackson@ferb:Source]$ git status
On branch master
Your branch is behind 'origin/master' by 2 commits, and can be
fast-forwarded.
  (use "git pull" to update your local branch) Untracked files:
  (use "git add ..." to include in what will be committed)

"tests/mu\303\261oz.t"

nothing added to commit but untracked files present (use "git add" to track)


There was something funning with the file that is untracked. Not sure if
this is causing the issues? 
--
Michael Jackson | Owner, President
  BlueQuartz Software
[e] mike.jack...@bluequartz.net
[w] 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:
https://cmake.org/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:
https://cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add and Git Update? How do I make these work?

2017-12-22 Thread Konstantin Tokarev


> ExternalProject_Add(${extProjectName}
> GIT_REPOSITORY "git://github.com/BlueQuartzSoftware/discount.git"
> GIT_PROGRESS 1
> #GIT_TAG master
> 
> TMP_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/tmp/${CMAKE_BUILD_TYPE}"
> STAMP_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/Stamp"
> DOWNLOAD_DIR ${DREAM3D_SDK}/superbuild/${extProjectName}/Download
> SOURCE_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/Source"
> BINARY_DIR 
> "${DREAM3D_SDK}/superbuild/${extProjectName}/Build/${CMAKE_BUILD_TYPE}"
> INSTALL_DIR 
> "${DREAM3D_SDK}/${extProjectName}-${discount_VERSION}-${CMAKE_BUILD_TYPE}"
> 
> #UPDATE_COMMAND "${GIT_EXECUTABLE} pull --rebase origin master"
> PATCH_COMMAND ""
> 
> CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=
> 
> LOG_DOWNLOAD 1
> LOG_UPDATE 1
> LOG_CONFIGURE 1
> LOG_BUILD 1
> LOG_TEST 1
> LOG_INSTALL 1
> )
> 
> The above is my cmake code. This worked great the first time through. Then I 
> discovered an issue in the project that I was cloning (discount) and fixed it 
> and pushed it. Now the repository at GitHub is a few commits ahead of what I 
> have. 

If you want to make modifications in projects that you build with 
ExternalProject, you might want to use
git submodules instead of specifying GIT_REPOSITORY in ExternalProject_Add

>So I rerun CMake and then "ninja" and I get an error when the "update" command 
>is run:
> 
> Cannot rebase: You have unstaged changes.
> Please commit or stash them.
> No rebase in progress?
> CMake Error at 
> /Users/Shared/DREAM3D_SDK/superbuild/discount/tmp/Debug/discount-gitupdate.cmake:105
>  (message):
> 
> Failed to rebase in:
> '/Users/Shared/DREAM3D_SDK/superbuild/discount/Source/'.
> 
> You will have to resolve the conflicts manually
> 
> Doing a "git status" in the "Source" directory gives this:
> 
> [mjackson@ferb:Source]$ git status
> On branch master
> Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.
> (use "git pull" to update your local branch)
> Untracked files:
> (use "git add ..." to include in what will be committed)
> 
> "tests/mu\303\261oz.t"
> 
> nothing added to commit but untracked files present (use "git add" to track)
> 
> There was something funning with the file that is untracked. Not sure if this 
> is causing the issues?
> 
> --
> Michael Jackson | Owner, President
> BlueQuartz Software
> [e] mike.jack...@bluequartz.net
> [w] 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:
> https://cmake.org/mailman/listinfo/cmake
-- 
Regards,
Konstantin
-- 

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:
https://cmake.org/mailman/listinfo/cmake


[CMake] ExternalProject_Add and Git Update? How do I make these work?

2017-12-22 Thread Michael Jackson
ExternalProject_Add(${extProjectName}
  GIT_REPOSITORY "git://github.com/BlueQuartzSoftware/discount.git"
  GIT_PROGRESS 1
  #GIT_TAG master

  TMP_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/tmp/${CMAKE_BUILD_TYPE}"
  STAMP_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/Stamp"
  DOWNLOAD_DIR ${DREAM3D_SDK}/superbuild/${extProjectName}/Download
  SOURCE_DIR "${DREAM3D_SDK}/superbuild/${extProjectName}/Source"
  BINARY_DIR 
"${DREAM3D_SDK}/superbuild/${extProjectName}/Build/${CMAKE_BUILD_TYPE}"
  INSTALL_DIR 
"${DREAM3D_SDK}/${extProjectName}-${discount_VERSION}-${CMAKE_BUILD_TYPE}"

  #UPDATE_COMMAND "${GIT_EXECUTABLE} pull --rebase origin master"
  PATCH_COMMAND ""

  CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=

  LOG_DOWNLOAD 1
  LOG_UPDATE 1
  LOG_CONFIGURE 1
  LOG_BUILD 1
  LOG_TEST 1
  LOG_INSTALL 1
)

The above is my cmake code. This worked great the first time through. Then I 
discovered an issue in the project that I was cloning (discount) and fixed it 
and pushed it. Now the repository at GitHub is a few commits ahead of what I 
have. So I rerun CMake and then "ninja" and I get an error when the "update" 
command is run:

Cannot rebase: You have unstaged changes.
Please commit or stash them.
No rebase in progress?
CMake Error at 
/Users/Shared/DREAM3D_SDK/superbuild/discount/tmp/Debug/discount-gitupdate.cmake:105
 (message):
  

  Failed to rebase in:
  '/Users/Shared/DREAM3D_SDK/superbuild/discount/Source/'.

  You will have to resolve the conflicts manually


Doing a "git status" in the "Source" directory gives this:

[mjackson@ferb:Source]$ git status
On branch master
Your branch is behind 'origin/master' by 2 commits, and can be fast-forwarded.
  (use "git pull" to update your local branch)
Untracked files:
  (use "git add ..." to include in what will be committed)

"tests/mu\303\261oz.t"

nothing added to commit but untracked files present (use "git add" to track)


There was something funning with the file that is untracked. Not sure if this 
is causing the issues? 
--
Michael Jackson | Owner, President
  BlueQuartz Software
[e] mike.jack...@bluequartz.net
[w] 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:
https://cmake.org/mailman/listinfo/cmake


[CMake] externalproject_add install_dir doesn't work

2017-10-22 Thread J Decker
A smiple cmakelists like this.  Without specifying the CMAKE_ARGS
CMAKE_INSTALL_PREFIX this tries to install into c:\program files.

-
cmake_minimum_required(VERSION 3.6)

include( ExternalProject )

ExternalProject_Add( external
PREFIX ${CMAKE_BINARY_DIR}/tmpout
   SOURCE_DIR ${CMAKE_SOURCE_DIR}/extern
   INSTALL_DIR ${CMAKE_BINARY_DIR}/output
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/output

)

 ./extern/cmakelists.txt
cmake_minimum_required(VERSION 3.6)

INSTALL( FILES tmp.bat DESTINATION data )



I was trying to figure out why the install is failing on another project,
it says (using vs 2015 generator)

MSBUILD : error MSB1009: Project file does not exist.
[M:\javascript\vfs\native\build\sack.vcxproj]
  Switch: install

in which the rule that runs
C:\tools\unix\cmake\bin\cmake.exe --build . --config Debug --target install

is failling... to work it would have to be INSTALL.

but my simple case isn't causing the same failure


Been tinkering with this for a couple hours trying to make the example more
close to the full case, but cannot; if I edit the rule and make the
'--target INSTALL'  then it works in the actual case... although the same
thing works fine in the simplified example



Line 1766 of ExternalProject in latest cmake download
list(APPEND args --target install)

should(could) be

if( MSVC )
list(APPEND args --target INSTALL)
else( MSVC )
list(APPEND args --target install)
endif( MSVC )


which fixes my issue.
-- 

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] ExternalProject_Add fails with gcc-4.9.3

2017-07-29 Thread T.Sariyski
cmake version 3.4.3

Hi,

I have ExternalProject_Add (attached), which works with gcc-4.4.7, but fails
with gcc-4.9.3:

...
...
[100%] Performing build step for 'ep_netcdf'
CMake Error at
/scratch/tesari/build/cee/gnu.dbg/netcdf/src/ep_netcdf-stamp/ep_netcdf-build
-DEBUG.cmake:16 (message):
Command failed: 2
 'make'
 See also
 
/scratch/tesari/build/cee/gnu.dbg/netcdf/src/ep_netcdf-stamp/ep_netcdf-build
-*.log (attached).

If I execute configure and make, as defined in  ${CONFIGURE_COMMAND}, it
works.

What is the meaning of  "Command failed: 2 'make'" error message, and how
should I track it down? Any help is highly appreciated.

Thanks in advance,
Ted 


ExternalProject_Add( ep_netcdf
  URL ${CMAKE_SOURCE_DIR}/src/netcdf/netcdf_distro.tar
  PREFIX ${CMAKE_CURRENT_BINARY_DIR}/netcdf
  LOG_CONFIGURE 1  
  LOG_BUILD 1
  LOG_INSTALL 1   
  LOG_DOWNLOAD 0
  LOG_UPDATE 0
  BUILD_IN_SOURCE 1
  CONFIGURE_COMMAND
${CMAKE_CURRENT_BINARY_DIR}/netcdf/src/ep_netcdf/configure  
   --enable-64bit FC=" " F90=${CMAKE_Fortran_COMPILER}
CXX=${CMAKE_CXX_COMPILER}  CC=${CMAKE_C_COMPILER} 
  BUILD_COMMAND ${MAKE}
)


ep_netcdf-build-DEBUG.cmake

set(command "${make}")
execute_process(
  COMMAND ${command}
  RESULT_VARIABLE result
  OUTPUT_FILE
"/scratch/tesari/build/cee/gnu.dbg/netcdf/src/ep_netcdf-stamp/ep_netcdf-buil
d-out.log"
  ERROR_FILE
"/scratch/tesari/build/cee/gnu.dbg/netcdf/src/ep_netcdf-stamp/ep_netcdf-buil
d-err.log"
  )
if(result)
  set(msg "Command failed: ${result}\n")
  foreach(arg IN LISTS command)
set(msg "${msg} '${arg}'")
  endforeach()
  set(msg "${msg}\nSee also\n
/scratch/tesari/build/cee/gnu.dbg/netcdf/src/ep_netcdf-stamp/ep_netcdf-build
-*.log")
  message(FATAL_ERROR "${msg}")
else()
  set(msg "ep_netcdf build command succeeded.  See also
/scratch/tesari/build/cee/gnu.dbg/netcdf/src/ep_netcdf-stamp/ep_netcdf-build
-*.log")
  message(STATUS "${msg}")
endif()


-- 

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] ExternalProject_Add and include_external_msproject dynamic duo... but what if their powers combined?

2017-04-08 Thread Brian Davis
crickets crickets... crickets...

That's the response I get from the internet?

Here are some other interesting bits:

https://cmake.org/cmake/help/v3.8/manual/cmake-packages.7.html

Does not make any reference to

configure_package_config_file

in

https://cmake.org/cmake/help/v3.8/module/CMakePackageConfigHelpers.html

But happily goes about telling pkg maintainers to go about and do with
config_file what doc on
configure_package_config_file says not to do... and that is NOT to use
configure_file in the first place at:

https://cmake.org/cmake/help/v3.8/manual/cmake-packages.7.html#id16

And then there is INSTALL_DESTINATION in:

configure_package_config_file( 
  INSTALL_DESTINATION 

which gives the pkg maintainer just enough rope to hang themselves with.

I mean hey they could (and have) put it just about anywhere like

${CMAKE_INSTALL_PREFIX}/CMake  or
${CMAKE_INSTALL_PREFIX}/lib/cmake or
${CMAKE_INSTALL_PREFIX}/lib/cmake/pkgname or
${CMAKE_INSTALL_PREFIX}/lib/cmake/pkgname- or
${CMAKE_INSTALL_PREFIX}/share/pkgname or
${CMAKE_INSTALL_PREFIX}/share/cmake/pkgname or

... well you get the idea.  With or without version info. Where IMO
configure_package_config_file should require version info and put in
"standard directory" whatever that may be.

Please someone in internet land tell me I am wrong.

I'll await the crickets.
-- 

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] ExternalProject_Add ... output directy (sln file directory)

2017-03-31 Thread Christophe Demez

Also,

I have try with a sample, just a main and a lib. But it seems that the 
lib CMakeLists.txt file is not called !


The project is created, but it does not point to the source code by 
example and the "message" are not displayed in the console too !


The download link :

https://www.dropbox.com/s/eto84gwtw2rx8oe/CMakeTest.zip?dl=0



On 30/03/2017 17:11, Christophe Demez wrote:


BTW,

I notice this too, if I use the following command line with an empty 
cmakelists.txt file : cmake -G "Visual Studio 15 2017 Win64"


And it also generate the .sln (and other files) in the same folder, 
but I don't request to build such a solution ! right ?


In reality, I only need a cmakelists.txt file that will build an 
external library for Android (Ninja generator, directly from 
AndroidStudio).

For now I use the wrong generator for test.


On 30/03/2017 16:20, David Cole wrote:

Do give it a BINARY_DIR, but do NOT give it a BUILD_COMMAND. Giving it
an empty BUILD_COMMAND means "do nothing" for the build step and using
"cmake --build ./LibraryBuild" does not work unless cmake is in your
PATH, and with a Visual Studio solution, you also need to specify
"--config Release" or "--config Debug"

Also posted on SO.


HTH,
David C.



On Thu, Mar 30, 2017 at 10:10 AM, Christophe Demez
  wrote:

Hi,

I'm currently using one CMakeLists.txt file that will execute an external
CMakeLists.txt (and dependency).

For this I use the ExternalProject_Add command, but I can't find a way to
specify where the ".sln" file will be generated.

I have also created StackOverflow question here with more information, if
someone have an idea for a solution ?

http://stackoverflow.com/questions/43117117/cmake-use-externalproject-add-and-specify-the-output-folder

Thanks
--

Powered bywww.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


--
Luciad Email Signature *Christophe Demez *
PROJECT LEADER

*LUCIAD*  CONNECT •  VISUALIZE •  ANALYZE •  ACT

christophe.de...@luciad.com  •  T 
+32 16 23 95 91
Follow us on LinkedIn or 
@LUCIADconnect 


Luciad




--
Luciad Email Signature *Christophe Demez *
PROJECT LEADER

*LUCIAD*  CONNECT •  VISUALIZE •  ANALYZE •  ACT

christophe.de...@luciad.com  •  T 
+32 16 23 95 91
Follow us on LinkedIn or 
@LUCIADconnect 


Luciad
-- 

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] ExternalProject_Add ... output directy (sln file directory)

2017-03-30 Thread Christophe Demez

BTW,

I notice this too, if I use the following command line with an empty 
cmakelists.txt file : cmake -G "Visual Studio 15 2017 Win64"


And it also generate the .sln (and other files) in the same folder, but 
I don't request to build such a solution ! right ?


In reality, I only need a cmakelists.txt file that will build an 
external library for Android (Ninja generator, directly from AndroidStudio).

For now I use the wrong generator for test.


On 30/03/2017 16:20, David Cole wrote:

Do give it a BINARY_DIR, but do NOT give it a BUILD_COMMAND. Giving it
an empty BUILD_COMMAND means "do nothing" for the build step and using
"cmake --build ./LibraryBuild" does not work unless cmake is in your
PATH, and with a Visual Studio solution, you also need to specify
"--config Release" or "--config Debug"

Also posted on SO.


HTH,
David C.



On Thu, Mar 30, 2017 at 10:10 AM, Christophe Demez
 wrote:

Hi,

I'm currently using one CMakeLists.txt file that will execute an external
CMakeLists.txt (and dependency).

For this I use the ExternalProject_Add command, but I can't find a way to
specify where the ".sln" file will be generated.

I have also created StackOverflow question here with more information, if
someone have an idea for a solution ?

http://stackoverflow.com/questions/43117117/cmake-use-externalproject-add-and-specify-the-output-folder

Thanks
--

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


--
Luciad Email Signature *Christophe Demez *
PROJECT LEADER

*LUCIAD*  CONNECT •  VISUALIZE •  ANALYZE •  ACT

christophe.de...@luciad.com  •  T 
+32 16 23 95 91
Follow us on LinkedIn or 
@LUCIADconnect 


Luciad
-- 

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] ExternalProject_Add and include_external_msproject dynamic duo... but what if their powers combined?

2017-03-30 Thread Brian Davis
Apologies for not responding sooner... this fell off my radar and I found
it in my email.

On Thu, Jan 12, 2017 at 6:29 AM, David Cole  wrote:

> Why not just use a BUILD_COMMAND which builds the VS project using the
> msbuild command line directly?


Do you have an example of this?

Even if this is an option it would not seem to allow adding the vcxproj
project files to VS solution, but may be a better option for the way
ExternalProject_Add wraps the underlying project and hides all sub-project
goop in a single target.  With what I am proposing the vcxproj files would
be added to VS solution as individual targets.


I have used BUILD_COMMAND in the past for *attempting* build of boost in
CMake, but due to complaints on command line argument length in VS had to
resort to using BUILD_COMMAND to call bjam/b2 in bat file generated using
configure_file then called from ExternalProject_add.  I then went on to
write and configure_file the roll my own boost CMake package support and
install.  Ultimately I was able to get it to work.  I can now build any
version of boost from within CMake simply by selecting version in CMake gui.

I have been working on a superbuild of superbuilds [Super-E-Duper-Builder
SEDB / SeeDeb See Dependency downloaded, built and installed) which in
theory could download, build, and install any C++ code in the Ether that
ExternalProject_Add supports though zip, git, svn, hg etc.  It's goes where
ExternalProject add and find_package left the dev community... with a
finite quantum of tools, but no abilty to get any software  downloaded,
built and installed though say an "ultimate package manager".

This is where a programmer comes to the realization of the "wild west" of
3rd Party lib developers use of CMake package.  Some are new to it like
fltk and do not version files or there cmake package directory nor do they
put package files in lib/cmake/flltk-/ as itk and vmtk
do and instead put it in ${CMAKE_INSTALL_PREFIX}/CMake/.  Others
like dcmtk put it in share\dcmtk (again without version info as itk and
vmtk do \lib\cmake\ITK-4.8\).  But ITK is no great example either
as on windows has a limit due to path length limiting on where ITK can be
build (build dir) I think it's something like 56 characters (resulting in
build paths outside the project like C:\itk\src\ITK-4.8.1)  and I have
stated my aggravation regarding this on ITK's user forum.   I must be
joking right?  well from ITK root CMakeLists.txt file:

if( CMAKE_HOST_WIN32 )

  string( LENGTH "${CMAKE_CURRENT_SOURCE_DIR}" n )
  if( n GREATER 50 )
message(
  FATAL_ERROR
  "ITK source code directory path length is too long (${n} > 50)."
  "Please move the ITK source code directory to a directory with a
shorter path."
  )
  endif()

Sadly no and .. ok so it's 50.

VMTK puts stuff in build dir minus needed libs like tet.lib and nl.lib and
pkgfiles point back to get this... the build dir and not install dir for
include files.  I feel like a CMake package marshal trying to herd cats on
the internet... lost cause for sure.  Then there are 3rdParty libs that use
superbuild themselves to checkout and build various libs (vmtk usign vtk
and itk).  VMTK allows user to use installed version.  But lets say two 3rd
party libs use super build to build two different versions of packages such
as  fltk or dcmtk and install into a single directory
${CMAKE_PACKAGE_PREFIX} = C:\projects\proj1\install... what happens to the
package files... yep the last build blast away the installed package files
as no versioning was used.  Also 3rdparty lib devs expand vars in installed
package files and do not use configure_file( ... @ONLY) to keep things
relative.

Then there is the "roll their own" use of CMAKE__PREFIX where they
don't use (or don't know it exists) it but instead postfix ('d') it
themselves (fltk) based on build config so if developer comes along and
sets it as it do ends up with dd.lib... I mean that's a double d
lib... and must be for super debugging.  And what is it about CMake not
supporting CMAKE__PREFIX automatically for executables as though
they are second class targets.  Leaving devs to use

SET_TARGET_PROPERTIES(
${APP_NAME} PROPERTIES
COMPILE_DEFINITIONS "${DEFINITIONS_STRING}"
DEBUG_POSTFIX ${CMAKE_DEBUG_POSTFIX} )

The guide at https://cmake.org/cmake/help/v3.8/manual/cmake-packages.7.html
is certainly a great start though

include(CMakePackageConfigHelpers)

Could do a great deal more to aid in creating some sort of standards and
aid 3rdPart lib devs in putting bits in the right place and correctly
versioning.  Not to mention... er wait I'll mention it ... 3rd party dev's
use of project(thirdPartyProjName)  where version info is not used so by
default on windows CMAKE_INSTALL_PREFIX defaults to C:\Program
Files\thirdPartyProjName and not thirdPartyProjName- where again
things can get blasted away.  One could say it's the 3rd party lib devs
fault for not adhering to CMake standard/best practices... but CMake

Re: [CMake] ExternalProject_Add ... output directy (sln file directory)

2017-03-30 Thread David Cole via CMake
Do give it a BINARY_DIR, but do NOT give it a BUILD_COMMAND. Giving it
an empty BUILD_COMMAND means "do nothing" for the build step and using
"cmake --build ./LibraryBuild" does not work unless cmake is in your
PATH, and with a Visual Studio solution, you also need to specify
"--config Release" or "--config Debug"

Also posted on SO.


HTH,
David C.



On Thu, Mar 30, 2017 at 10:10 AM, Christophe Demez
 wrote:
> Hi,
>
> I'm currently using one CMakeLists.txt file that will execute an external
> CMakeLists.txt (and dependency).
>
> For this I use the ExternalProject_Add command, but I can't find a way to
> specify where the ".sln" file will be generated.
>
> I have also created StackOverflow question here with more information, if
> someone have an idea for a solution ?
>
> http://stackoverflow.com/questions/43117117/cmake-use-externalproject-add-and-specify-the-output-folder
>
> Thanks
> --
>
> 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] ExternalProject_Add ... output directy (sln file directory)

2017-03-30 Thread Christophe Demez

Hi,

I'm currently using one CMakeLists.txt file that will execute an 
external CMakeLists.txt (and dependency).


For this I use the ExternalProject_Add command, but I can't find a way 
to specify where the ".sln" file will be generated.


I have also created StackOverflow question here with more information, 
if someone have an idea for a solution ?


http://stackoverflow.com/questions/43117117/cmake-use-externalproject-add-and-specify-the-output-folder 



Thanks
--

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] ExternalProject_add not buing launched

2017-02-27 Thread Michele Portolan

Hello,

I am trying to set my Cmake project to build the "xmlrpc-c" library, 
which is built using autotools. I was somewhat able to set it up 
following this example: 
http://mirkokiefer.com/blog/2013/03/cmake-by-example/


My resulting CMakeList is the following:

ExternalProject_Add( project_xmlprc
  SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc-c"
  PREFIX "${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc-c"
  CONFIGURE_COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/xmlrpc-c/configure 
--prefix=${CMAKE_CURRENT_BINARY_DIR}/xmlrpc-c/

  BUILD_COMMAND make
  INSTALL_COMMAND make install
  BUILD_IN_SOURCE 1
)

ExternalProject_Get_Property(project_xmlprc install_dir)


add_library(xmlprc SHARED IMPORTED)
set_property(TARGET xmlprc PROPERTY IMPORTED_LOCATION 
${install_dir}/lib/libxmlrpc++.so)
set_property(TARGET xmlprc PROPERTY IMPORTED_LOCATION 
${install_dir}/lib/libxmlrpc_packetsocket.so)
set_property(TARGET xmlprc PROPERTY IMPORTED_LOCATION 
${install_dir}/lib/libxmlrpc_client.so)
set_property(TARGET xmlprc PROPERTY IMPORTED_LOCATION 
${install_dir}/lib/libxmlrpc_client++.so)
set_property(TARGET xmlprc PROPERTY IMPORTED_LOCATION 
${install_dir}/lib/libxmlrpc_server++.so)
set_property(TARGET xmlprc PROPERTY IMPORTED_LOCATION 
${install_dir}/lib/libxmlrpc_server_abyss++.so)
set_property(TARGET xmlprc PROPERTY IMPORTED_LOCATION 
${install_dir}/lib/libxmlrpc_util.so)
set_property(TARGET xmlprc PROPERTY IMPORTED_LOCATION 
${install_dir}/lib/libxmlrpc_util++.so)

add_dependencies(xmlprc project_xmlprc)

It sort of works, meaning I can see the library being built in 
${CMAKE_CURRENT_BINARY_DIR}/xmlrpc-c/.


My problem is that the build is launched only the first time! If I 
delete the ${CMAKE_CURRENT_BINARY_DIR} and re-launch cmake, the 
ExternalProjet is not rebuilt. To have a rebuild, I have to do this 
strange workaround:


  - modify "BUILD_IN_SOURCE" to 0

 - run cmake+make. I get an error as xmlrpc only support in-source build

 - put "BUILD_IN_SOURCE"back to 1

 - run cmake+make. This time it works.


Looks like it is some issue in the source tree remaining dirty, but even 
running a "make distclean" does not change anything, I need to do the 
workaround.


Any idea of where the problem lies?

Thanks,


Michele



--

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] externalproject_add and generating sources

2017-01-29 Thread David Jobet
Oh ok, I see how it works, it makes sense, but I'm somehow disappointed : in 
order to use it, I'm going to have to change my own project while I originally 
thought it was going to be a kind of FindXXX on steroid...
I'll give it a try though, tx for pointing it out.

David

Le 26 janvier 2017 13:02:43 GMT+00:00, Nicholas Braden 
 a écrit :
>You'll also want to build your own project with ExternalProject, and
>use
>the DEPENDS option to control build order. This ensures that all
>dependencies are fully installed before your own project is even
>configured. The project with all the ExternalProject calls is typically
>called a superbuild, and effectively becomes an optional convenience to
>building your own project.
>
>On Thu, Jan 26, 2017 at 3:23 AM, David Jobet 
>wrote:
>
>> Hello,
>>
>> suppose I want to use protobuf and integrate it in my project with
>> externalproject_add. (actually, I just have precompiled binaries and
>libs +
>> header files, I don't have the full sources)
>> Once the project has been 'built' (actually, installed by a custom
>> rpm-like tool to a shared path), I can use the protoc compiler to
>generate
>> protobuf c++ files (.pb.h and .pb.cpp files) from a .proto
>description file.
>> I can add_dependencies so that the external project is built before
>> projects depending on libprotobuf.a.
>>
>> However, I don't know how to do the same thing with .pb.h and .pb.cpp
>> files which use a .proto file and the protoc compiler.
>>
>> make is fine with it, but ninja complains with an error like this :
>> ninja: error:
>'/path_to_external_projects/protobuf/2.6.0.4/bin/protoc',
>> needed by 'some_project/SomeFile.pb.h', missing and no known rule to
>make it
>>
>> how can I tell ninja that protoc is going to be provided by
>> externalproject ?
>> If I use byproducts, ninja is happy, but "ninja clean" deletes
>> /path_to_external_projects/protobuf/2.6.0.4/bin/protoc.
>> I don't want that to happen since
>/path_to_external_projects/protobuf/
>> 2.6.0.4/bin/protoc is shared with other users.
>>
>> With regards
>>
>> 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
>>

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma 
brièveté.-- 

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] externalproject_add and generating sources

2017-01-29 Thread David Jobet
Hello,

Yes, main reason is I had to hack FindProtobuf.cmake to make our existing 
project compile.
Also since I need to make it "installable", I had to add some stuff to have the 
binaries and header installed automatically when referenced.
The latter reason led me to experiment with ExternalProject.

David

Le 26 janvier 2017 16:05:47 GMT+00:00, Michael Ellery  a 
écrit :
>
>> On Jan 26, 2017, at 1:23 AM, David Jobet  wrote:
>> 
>> Hello,
>> 
>> suppose I want to use protobuf and integrate it in my project with
>externalproject_add. (actually, I just have precompiled binaries and
>libs + header files, I don't have the full sources)
>> Once the project has been 'built' (actually, installed by a custom
>rpm-like tool to a shared path), I can use the protoc compiler to
>generate protobuf c++ files (.pb.h and .pb.cpp files) from a .proto
>description file.
>> I can add_dependencies so that the external project is built before
>projects depending on libprotobuf.a.
>> 
>> However, I don't know how to do the same thing with .pb.h and .pb.cpp
>files which use a .proto file and the protoc compiler.
>> 
>> make is fine with it, but ninja complains with an error like this :
>> ninja: error:
>'/path_to_external_projects/protobuf/2.6.0.4/bin/protoc', needed by
>'some_project/SomeFile.pb.h', missing and no known rule to make it
>> 
>> how can I tell ninja that protoc is going to be provided by
>externalproject ?
>> If I use byproducts, ninja is happy, but "ninja clean" deletes
>/path_to_external_projects/protobuf/2.6.0.4/bin/protoc.
>> I don't want that to happen since
>/path_to_external_projects/protobuf/2.6.0.4/bin/protoc is shared with
>other users.
>> 
>
>I’ve never used protobufs as an external project (I’ve always just done
>a one-time setup/install)…but is there a reason you can’t just use the
>standard finder to locate it? 
>https://github.com/Kitware/CMake/blob/master/Modules/FindProtobuf.cmake
>
>-Mike

-- 
Envoyé de mon appareil Android avec Courriel K-9 Mail. Veuillez excuser ma 
brièveté.-- 

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] externalproject_add and generating sources

2017-01-26 Thread Michael Ellery

> On Jan 26, 2017, at 1:23 AM, David Jobet  wrote:
> 
> Hello,
> 
> suppose I want to use protobuf and integrate it in my project with 
> externalproject_add. (actually, I just have precompiled binaries and libs + 
> header files, I don't have the full sources)
> Once the project has been 'built' (actually, installed by a custom rpm-like 
> tool to a shared path), I can use the protoc compiler to generate protobuf 
> c++ files (.pb.h and .pb.cpp files) from a .proto description file.
> I can add_dependencies so that the external project is built before projects 
> depending on libprotobuf.a.
> 
> However, I don't know how to do the same thing with .pb.h and .pb.cpp files 
> which use a .proto file and the protoc compiler.
> 
> make is fine with it, but ninja complains with an error like this :
> ninja: error: '/path_to_external_projects/protobuf/2.6.0.4/bin/protoc', 
> needed by 'some_project/SomeFile.pb.h', missing and no known rule to make it
> 
> how can I tell ninja that protoc is going to be provided by externalproject ?
> If I use byproducts, ninja is happy, but "ninja clean" deletes 
> /path_to_external_projects/protobuf/2.6.0.4/bin/protoc.
> I don't want that to happen since 
> /path_to_external_projects/protobuf/2.6.0.4/bin/protoc is shared with other 
> users.
> 

I’ve never used protobufs as an external project (I’ve always just done a 
one-time setup/install)…but is there a reason you can’t just use the standard 
finder to locate it?  
https://github.com/Kitware/CMake/blob/master/Modules/FindProtobuf.cmake

-Mike

-- 

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] externalproject_add and generating sources

2017-01-26 Thread Nicholas Braden
You'll also want to build your own project with ExternalProject, and use
the DEPENDS option to control build order. This ensures that all
dependencies are fully installed before your own project is even
configured. The project with all the ExternalProject calls is typically
called a superbuild, and effectively becomes an optional convenience to
building your own project.

On Thu, Jan 26, 2017 at 3:23 AM, David Jobet  wrote:

> Hello,
>
> suppose I want to use protobuf and integrate it in my project with
> externalproject_add. (actually, I just have precompiled binaries and libs +
> header files, I don't have the full sources)
> Once the project has been 'built' (actually, installed by a custom
> rpm-like tool to a shared path), I can use the protoc compiler to generate
> protobuf c++ files (.pb.h and .pb.cpp files) from a .proto description file.
> I can add_dependencies so that the external project is built before
> projects depending on libprotobuf.a.
>
> However, I don't know how to do the same thing with .pb.h and .pb.cpp
> files which use a .proto file and the protoc compiler.
>
> make is fine with it, but ninja complains with an error like this :
> ninja: error: '/path_to_external_projects/protobuf/2.6.0.4/bin/protoc',
> needed by 'some_project/SomeFile.pb.h', missing and no known rule to make it
>
> how can I tell ninja that protoc is going to be provided by
> externalproject ?
> If I use byproducts, ninja is happy, but "ninja clean" deletes
> /path_to_external_projects/protobuf/2.6.0.4/bin/protoc.
> I don't want that to happen since /path_to_external_projects/protobuf/
> 2.6.0.4/bin/protoc is shared with other users.
>
> With regards
>
> 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
>
-- 

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] externalproject_add and generating sources

2017-01-26 Thread David Jobet
Hello,

suppose I want to use protobuf and integrate it in my project with 
externalproject_add. (actually, I just have precompiled binaries and libs + 
header files, I don't have the full sources)
Once the project has been 'built' (actually, installed by a custom rpm-like 
tool to a shared path), I can use the protoc compiler to generate protobuf c++ 
files (.pb.h and .pb.cpp files) from a .proto description file.
I can add_dependencies so that the external project is built before projects 
depending on libprotobuf.a.

However, I don't know how to do the same thing with .pb.h and .pb.cpp files 
which use a .proto file and the protoc compiler.

make is fine with it, but ninja complains with an error like this :
ninja: error: '/path_to_external_projects/protobuf/2.6.0.4/bin/protoc', needed 
by 'some_project/SomeFile.pb.h', missing and no known rule to make it

how can I tell ninja that protoc is going to be provided by externalproject ?
If I use byproducts, ninja is happy, but "ninja clean" deletes 
/path_to_external_projects/protobuf/2.6.0.4/bin/protoc.
I don't want that to happen since 
/path_to_external_projects/protobuf/2.6.0.4/bin/protoc is shared with other 
users.

With regards

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] ExternalProject_Add

2017-01-22 Thread Saad Khattak
That is a good point. I found that a side effect of the superbuild is that
my project can be built independently and I can distribute it without the
superbuild parent project. Thanks Nicholas!

On Sun, Jan 22, 2017 at 10:33 PM Nicholas Braden 
wrote:

> Yes, that is what I do in my superbuilds. Generally I make is such that my
> project could be built without the superbuild, and the superbuild is just a
> convenience.
>
> On Sat, Jan 21, 2017 at 12:17 PM, Saad Khattak 
> wrote:
>
> >> One possibility is the often mentioned superbuild
>
> That is a tempting and I started to go down that route - however, I ran
> into a problem where my project (which is now also built using
> ExternalProject_Add) does not have access to the CMake variables. Is the
> only solution to pass them through the CMAKE_ARGS variable in
> ExternalProject_Add?
>
> On Mon, Jan 9, 2017 at 12:07 AM Hendrik Sattler 
> wrote:
>
> One possibility is the often mentioned superbuild, another is not using
> find_library() but setting the variables with the library file paths
> manually (that's static info anyway).
>
>
> Am 8. Januar 2017 22:49:52 MEZ schrieb Saad Khattak  >:
> >Hello,
> >
> >I have an external project glfw that I added to my project like this:
> >
> >==
> >include(ExternalProject)
> >ExternalProject_Add(glfw
> >  GIT_REPOSITORY "https://github.com/glfw/glfw.git";
> >  GIT_TAG "master"
> >
> >  SOURCE_DIR "${CMAKE_SOURCE_DIR}/dep/glfw"
> >  CMAKE_ARGS -DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_TESTS=OFF
> >-DGLFW_BUILD_EXAMPLES=OFF
> >-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/install/glfw/
> >-DCMAKE_DEBUG_POSTFIX=_d
> >
> >  TEST_COMMAND ""
> >  )
> >set(GLFW_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/install/glfw/include/")
> >set(GLFW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/install/glfw/lib/")
> >==
> >
> >Then I include it in my project like so:
> >
> >==
> >find_library(GLFW_LIB_D  glfw3_d ${GLFW_LIBRARY_DIR})
> >find_library(GLFW_LIBglfw3   ${GLFW_LIBRARY_DIR})
> >
> >include_directories(${GLFW_INCLUDE_DIR})
> >
> >add_executable(vk_test
> >  src/vulkan_test.cpp
> >  )
> >target_link_libraries(vk_test debug ${GLFW_LIB_D} optimized
> >${GLFW_LIB})
> >add_dependencies(vk_test glfw)
> >==
> >
> >As you can see, I depend on the libraries compiled by the external
> >project
> >glfw. Unfortunately, when I first configure the project, CMake
> >complains
> >that it cannot find the libraries specified by ${GLFW_LIB_D} and
> >${GLFW_LIB} variables.
> >
> >Of course, this is because CMake did not begin cloning, configuring and
> >building the glfw project. That only happens AFTER my project has been
> >configured and starts building. This becomes a chicken and the egg
> >problem.
> >
> >Currently, my solution is to add dummy .lib files so that I can at
> >least
> >configure and generate my project. My question is, am I approaching
> >this
> >problem in the wrong way? If yes, what is the correct way to add a
> >dependency to an external project and have it clone/configure/build
> >BEFORE
> >the "find_library" call?
>
> --
> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
> gesendet.
>
>
> --
>
> 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

Re: [CMake] ExternalProject_Add

2017-01-22 Thread Nicholas Braden
Yes, that is what I do in my superbuilds. Generally I make is such that my
project could be built without the superbuild, and the superbuild is just a
convenience.

On Sat, Jan 21, 2017 at 12:17 PM, Saad Khattak  wrote:

> >> One possibility is the often mentioned superbuild
>
> That is a tempting and I started to go down that route - however, I ran
> into a problem where my project (which is now also built using
> ExternalProject_Add) does not have access to the CMake variables. Is the
> only solution to pass them through the CMAKE_ARGS variable in
> ExternalProject_Add?
>
> On Mon, Jan 9, 2017 at 12:07 AM Hendrik Sattler 
> wrote:
>
> One possibility is the often mentioned superbuild, another is not using
> find_library() but setting the variables with the library file paths
> manually (that's static info anyway).
>
>
> Am 8. Januar 2017 22:49:52 MEZ schrieb Saad Khattak  >:
> >Hello,
> >
> >I have an external project glfw that I added to my project like this:
> >
> >==
> >include(ExternalProject)
> >ExternalProject_Add(glfw
> >  GIT_REPOSITORY "https://github.com/glfw/glfw.git";
> >  GIT_TAG "master"
> >
> >  SOURCE_DIR "${CMAKE_SOURCE_DIR}/dep/glfw"
> >  CMAKE_ARGS -DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_TESTS=OFF
> >-DGLFW_BUILD_EXAMPLES=OFF
> >-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/install/glfw/
> >-DCMAKE_DEBUG_POSTFIX=_d
> >
> >  TEST_COMMAND ""
> >  )
> >set(GLFW_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/install/glfw/include/")
> >set(GLFW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/install/glfw/lib/")
> >==
> >
> >Then I include it in my project like so:
> >
> >==
> >find_library(GLFW_LIB_D  glfw3_d ${GLFW_LIBRARY_DIR})
> >find_library(GLFW_LIBglfw3   ${GLFW_LIBRARY_DIR})
> >
> >include_directories(${GLFW_INCLUDE_DIR})
> >
> >add_executable(vk_test
> >  src/vulkan_test.cpp
> >  )
> >target_link_libraries(vk_test debug ${GLFW_LIB_D} optimized
> >${GLFW_LIB})
> >add_dependencies(vk_test glfw)
> >==
> >
> >As you can see, I depend on the libraries compiled by the external
> >project
> >glfw. Unfortunately, when I first configure the project, CMake
> >complains
> >that it cannot find the libraries specified by ${GLFW_LIB_D} and
> >${GLFW_LIB} variables.
> >
> >Of course, this is because CMake did not begin cloning, configuring and
> >building the glfw project. That only happens AFTER my project has been
> >configured and starts building. This becomes a chicken and the egg
> >problem.
> >
> >Currently, my solution is to add dummy .lib files so that I can at
> >least
> >configure and generate my project. My question is, am I approaching
> >this
> >problem in the wrong way? If yes, what is the correct way to add a
> >dependency to an external project and have it clone/configure/build
> >BEFORE
> >the "find_library" call?
>
> --
> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
> gesendet.
>
>
> --
>
> 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

Re: [CMake] ExternalProject_Add

2017-01-21 Thread Saad Khattak
>> One possibility is the often mentioned superbuild

That is a tempting and I started to go down that route - however, I ran
into a problem where my project (which is now also built using
ExternalProject_Add) does not have access to the CMake variables. Is the
only solution to pass them through the CMAKE_ARGS variable in
ExternalProject_Add?

On Mon, Jan 9, 2017 at 12:07 AM Hendrik Sattler 
wrote:

One possibility is the often mentioned superbuild, another is not using
find_library() but setting the variables with the library file paths
manually (that's static info anyway).


Am 8. Januar 2017 22:49:52 MEZ schrieb Saad Khattak :
>Hello,
>
>I have an external project glfw that I added to my project like this:
>
>==
>include(ExternalProject)
>ExternalProject_Add(glfw
>  GIT_REPOSITORY "https://github.com/glfw/glfw.git";
>  GIT_TAG "master"
>
>  SOURCE_DIR "${CMAKE_SOURCE_DIR}/dep/glfw"
>  CMAKE_ARGS -DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_TESTS=OFF
>-DGLFW_BUILD_EXAMPLES=OFF
>-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/install/glfw/
>-DCMAKE_DEBUG_POSTFIX=_d
>
>  TEST_COMMAND ""
>  )
>set(GLFW_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/install/glfw/include/")
>set(GLFW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/install/glfw/lib/")
>==
>
>Then I include it in my project like so:
>
>==
>find_library(GLFW_LIB_D  glfw3_d ${GLFW_LIBRARY_DIR})
>find_library(GLFW_LIBglfw3   ${GLFW_LIBRARY_DIR})
>
>include_directories(${GLFW_INCLUDE_DIR})
>
>add_executable(vk_test
>  src/vulkan_test.cpp
>  )
>target_link_libraries(vk_test debug ${GLFW_LIB_D} optimized
>${GLFW_LIB})
>add_dependencies(vk_test glfw)
>==
>
>As you can see, I depend on the libraries compiled by the external
>project
>glfw. Unfortunately, when I first configure the project, CMake
>complains
>that it cannot find the libraries specified by ${GLFW_LIB_D} and
>${GLFW_LIB} variables.
>
>Of course, this is because CMake did not begin cloning, configuring and
>building the glfw project. That only happens AFTER my project has been
>configured and starts building. This becomes a chicken and the egg
>problem.
>
>Currently, my solution is to add dummy .lib files so that I can at
>least
>configure and generate my project. My question is, am I approaching
>this
>problem in the wrong way? If yes, what is the correct way to add a
>dependency to an external project and have it clone/configure/build
>BEFORE
>the "find_library" call?

--
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
-- 

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] ExternalProject_Add

2017-01-13 Thread James Sutherland
I found this solution helpful:
  https://crascit.com/2015/07/25/cmake-gtest
It is unfortunate that CMake doesn't have a proper way to accomplish this.
--James


On Sun, Jan 8, 2017 at 10:07 PM, Hendrik Sattler 
wrote:

> One possibility is the often mentioned superbuild, another is not using
> find_library() but setting the variables with the library file paths
> manually (that's static info anyway).
>
>
> Am 8. Januar 2017 22:49:52 MEZ schrieb Saad Khattak  >:
> >Hello,
> >
> >I have an external project glfw that I added to my project like this:
> >
> >==
> >include(ExternalProject)
> >ExternalProject_Add(glfw
> >  GIT_REPOSITORY "https://github.com/glfw/glfw.git";
> >  GIT_TAG "master"
> >
> >  SOURCE_DIR "${CMAKE_SOURCE_DIR}/dep/glfw"
> >  CMAKE_ARGS -DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_TESTS=OFF
> >-DGLFW_BUILD_EXAMPLES=OFF
> >-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/install/glfw/
> >-DCMAKE_DEBUG_POSTFIX=_d
> >
> >  TEST_COMMAND ""
> >  )
> >set(GLFW_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/install/glfw/include/")
> >set(GLFW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/install/glfw/lib/")
> >==
> >
> >Then I include it in my project like so:
> >
> >==
> >find_library(GLFW_LIB_D  glfw3_d ${GLFW_LIBRARY_DIR})
> >find_library(GLFW_LIBglfw3   ${GLFW_LIBRARY_DIR})
> >
> >include_directories(${GLFW_INCLUDE_DIR})
> >
> >add_executable(vk_test
> >  src/vulkan_test.cpp
> >  )
> >target_link_libraries(vk_test debug ${GLFW_LIB_D} optimized
> >${GLFW_LIB})
> >add_dependencies(vk_test glfw)
> >==
> >
> >As you can see, I depend on the libraries compiled by the external
> >project
> >glfw. Unfortunately, when I first configure the project, CMake
> >complains
> >that it cannot find the libraries specified by ${GLFW_LIB_D} and
> >${GLFW_LIB} variables.
> >
> >Of course, this is because CMake did not begin cloning, configuring and
> >building the glfw project. That only happens AFTER my project has been
> >configured and starts building. This becomes a chicken and the egg
> >problem.
> >
> >Currently, my solution is to add dummy .lib files so that I can at
> >least
> >configure and generate my project. My question is, am I approaching
> >this
> >problem in the wrong way? If yes, what is the correct way to add a
> >dependency to an external project and have it clone/configure/build
> >BEFORE
> >the "find_library" call?
>
> --
> Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail
> gesendet.
> --
>
> 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] ExternalProject_Add and include_external_msproject dynamic duo... but what if their powers combined?

2017-01-11 Thread Brian J. Davis
Every time I create a superbuild using ExternalProject_Add sooner or 
later a project will not support cmake, but will have buried within its 
bowels  a visual studio solution project .sln and sometimes gobs of 
.vcxproj files (read CPython).  Now ofcourse include_external_msproject 
can do this.  If only these two wonder twins 
(https://en.wikipedia.org/wiki/Wonder_Twins) could work together in the 
same ExternalProject_Add command.  Maybe by adding after HG_TAG say 
VCX_PROJS or some such.


Only thing better would be getting original project maintainer to 
support CMake.


So feature request: Can we get ExternalProject_Add to support visual 
studio project files?




--

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] ExternalProject_Add

2017-01-08 Thread Hendrik Sattler
One possibility is the often mentioned superbuild, another is not using 
find_library() but setting the variables with the library file paths manually 
(that's static info anyway).


Am 8. Januar 2017 22:49:52 MEZ schrieb Saad Khattak :
>Hello,
>
>I have an external project glfw that I added to my project like this:
>
>==
>include(ExternalProject)
>ExternalProject_Add(glfw
>  GIT_REPOSITORY "https://github.com/glfw/glfw.git";
>  GIT_TAG "master"
>
>  SOURCE_DIR "${CMAKE_SOURCE_DIR}/dep/glfw"
>  CMAKE_ARGS -DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_TESTS=OFF
>-DGLFW_BUILD_EXAMPLES=OFF
>-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/install/glfw/
>-DCMAKE_DEBUG_POSTFIX=_d
>
>  TEST_COMMAND ""
>  )
>set(GLFW_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/install/glfw/include/")
>set(GLFW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/install/glfw/lib/")
>==
>
>Then I include it in my project like so:
>
>==
>find_library(GLFW_LIB_D  glfw3_d ${GLFW_LIBRARY_DIR})
>find_library(GLFW_LIBglfw3   ${GLFW_LIBRARY_DIR})
>
>include_directories(${GLFW_INCLUDE_DIR})
>
>add_executable(vk_test
>  src/vulkan_test.cpp
>  )
>target_link_libraries(vk_test debug ${GLFW_LIB_D} optimized
>${GLFW_LIB})
>add_dependencies(vk_test glfw)
>==
>
>As you can see, I depend on the libraries compiled by the external
>project
>glfw. Unfortunately, when I first configure the project, CMake
>complains
>that it cannot find the libraries specified by ${GLFW_LIB_D} and
>${GLFW_LIB} variables.
>
>Of course, this is because CMake did not begin cloning, configuring and
>building the glfw project. That only happens AFTER my project has been
>configured and starts building. This becomes a chicken and the egg
>problem.
>
>Currently, my solution is to add dummy .lib files so that I can at
>least
>configure and generate my project. My question is, am I approaching
>this
>problem in the wrong way? If yes, what is the correct way to add a
>dependency to an external project and have it clone/configure/build
>BEFORE
>the "find_library" call?

-- 
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.
-- 

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] ExternalProject_Add

2017-01-08 Thread Nicholas Braden
The way to solve this is to use a superbuild project layout - you use
ExternalProject_Add to build your dependencies AND your own project, using
the DEPENDS option to control build order. Thus by the time it gets around
to configuring your project, the dependencies have already been built and
installed fully.

On Sun, Jan 8, 2017 at 3:49 PM, Saad Khattak  wrote:

> Hello,
>
> I have an external project glfw that I added to my project like this:
>
> ==
> include(ExternalProject)
> ExternalProject_Add(glfw
>   GIT_REPOSITORY "https://github.com/glfw/glfw.git";
>   GIT_TAG "master"
>
>   SOURCE_DIR "${CMAKE_SOURCE_DIR}/dep/glfw"
>   CMAKE_ARGS -DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_TESTS=OFF
> -DGLFW_BUILD_EXAMPLES=OFF -DCMAKE_INSTALL_PREFIX=${
> CMAKE_SOURCE_DIR}/install/glfw/ -DCMAKE_DEBUG_POSTFIX=_d
>
>   TEST_COMMAND ""
>   )
> set(GLFW_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/install/glfw/include/")
> set(GLFW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/install/glfw/lib/")
> ==
>
> Then I include it in my project like so:
>
> ==
> find_library(GLFW_LIB_D  glfw3_d ${GLFW_LIBRARY_DIR})
> find_library(GLFW_LIBglfw3   ${GLFW_LIBRARY_DIR})
>
> include_directories(${GLFW_INCLUDE_DIR})
>
> add_executable(vk_test
>   src/vulkan_test.cpp
>   )
> target_link_libraries(vk_test debug ${GLFW_LIB_D} optimized ${GLFW_LIB})
> add_dependencies(vk_test glfw)
> ==
>
> As you can see, I depend on the libraries compiled by the external project
> glfw. Unfortunately, when I first configure the project, CMake complains
> that it cannot find the libraries specified by ${GLFW_LIB_D} and
> ${GLFW_LIB} variables.
>
> Of course, this is because CMake did not begin cloning, configuring and
> building the glfw project. That only happens AFTER my project has been
> configured and starts building. This becomes a chicken and the egg problem.
>
> Currently, my solution is to add dummy .lib files so that I can at least
> configure and generate my project. My question is, am I approaching this
> problem in the wrong way? If yes, what is the correct way to add a
> dependency to an external project and have it clone/configure/build BEFORE
> the "find_library" call?
>
>
> --
>
> 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] ExternalProject_Add

2017-01-08 Thread Saad Khattak
Hello,

I have an external project glfw that I added to my project like this:

==
include(ExternalProject)
ExternalProject_Add(glfw
  GIT_REPOSITORY "https://github.com/glfw/glfw.git";
  GIT_TAG "master"

  SOURCE_DIR "${CMAKE_SOURCE_DIR}/dep/glfw"
  CMAKE_ARGS -DGLFW_BUILD_DOCS=OFF -DGLFW_BUILD_TESTS=OFF
-DGLFW_BUILD_EXAMPLES=OFF
-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}/install/glfw/
-DCMAKE_DEBUG_POSTFIX=_d

  TEST_COMMAND ""
  )
set(GLFW_INCLUDE_DIR "${CMAKE_SOURCE_DIR}/install/glfw/include/")
set(GLFW_LIBRARY_DIR "${CMAKE_SOURCE_DIR}/install/glfw/lib/")
==

Then I include it in my project like so:

==
find_library(GLFW_LIB_D  glfw3_d ${GLFW_LIBRARY_DIR})
find_library(GLFW_LIBglfw3   ${GLFW_LIBRARY_DIR})

include_directories(${GLFW_INCLUDE_DIR})

add_executable(vk_test
  src/vulkan_test.cpp
  )
target_link_libraries(vk_test debug ${GLFW_LIB_D} optimized ${GLFW_LIB})
add_dependencies(vk_test glfw)
==

As you can see, I depend on the libraries compiled by the external project
glfw. Unfortunately, when I first configure the project, CMake complains
that it cannot find the libraries specified by ${GLFW_LIB_D} and
${GLFW_LIB} variables.

Of course, this is because CMake did not begin cloning, configuring and
building the glfw project. That only happens AFTER my project has been
configured and starts building. This becomes a chicken and the egg problem.

Currently, my solution is to add dummy .lib files so that I can at least
configure and generate my project. My question is, am I approaching this
problem in the wrong way? If yes, what is the correct way to add a
dependency to an external project and have it clone/configure/build BEFORE
the "find_library" call?
-- 

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] ExternalProject_Add : set the location of CMakeLists.txt

2016-10-26 Thread Benjamin Ballet via CMake
It's not listed in changelog though :
https://cmake.org/cmake/help/v3.7/release/3.7.html

2016-10-26 11:34 GMT+02:00 Benjamin Ballet :

> Ok I'm quiet lucky : There is what I need in CMake 3.7 (SOURCE_SUBDIR)
>
> 2016-10-25 19:54 GMT+02:00 Konstantin Podsvirov 
> :
>
>> Hello again.
>>
>> 25.10.2016, 20:31, "Konstantin Podsvirov" :
>> > Hello, Benjamin.
>> >
>> > 25.10.2016, 19:41, "Benjamin Ballet via CMake" :
>> >>  Hi,
>> >>
>> >>  I'm trying to get GLEW (https://github.com/nigels-com/glew) with
>> ExternalProject_Add
>> >>  It's buildable with cmake but the CMakeLists.txt is in build/cmake
>> directory.
>> >>
>> >>  Is there a way to specify the directory of the CMakeLists.txt file ?
>> >>
>> >>  If I change SOURCE_DIR it will only clone the repo in SOURCE_DIR and
>> still run the cmake command in repo root.
>> >>
>> >>  --
>> >>  Benjamin BALLET
>> >>  Ingénieur R&D
>> >>
>> >>  ACTIVISU
>> >>  19, rue Klock - 92110 Clichy
>> >>>  Standard Tél :  01 44 69 37 37
>> >>>  www.activisu.com
>> >>  ,--
>> >
>> > Try it:
>> >
>> > ExternalProject_Add(
>> >   ...
>> >   SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/source
>> >   ...
>> >   CONFIGURE_COMMAND ${CMAKE_COMMAND} [additional args...]
>> ${CMAKE_CURRENT_BINARY_DIR}/source/build/cmake
>> >   ...)
>>
>>
>> Or try it:
>>
>> ExternalProject_Add(
>>   ...
>>   SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/source
>>   ...
>>   CONFIGURE_COMMAND ${CMAKE_COMMAND} [additional args...]
>>-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
>>-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
>>-DCMAKE_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET}
>> ${CMAKE_CURRENT_BINARY_DIR}/source/build/cmake
>>   ...)
>>
>> --
>> Regards,
>> Konstantin Podsvirov
>>
>
>
>
> --
> *Benjamin BALLET*
> Ingénieur R&D
>
> *ACTIVISU*
> 19, rue Klock - 92110 Clichy
> *> Standard Tél* :  01 44 69 37 37
> *>* www.activisu.com
>



-- 
*Benjamin BALLET*
Ingénieur R&D

*ACTIVISU*
19, rue Klock - 92110 Clichy
*> Standard Tél* :  01 44 69 37 37
*>* www.activisu.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

Re: [CMake] ExternalProject_Add : set the location of CMakeLists.txt

2016-10-26 Thread Benjamin Ballet via CMake
Ok I'm quiet lucky : There is what I need in CMake 3.7 (SOURCE_SUBDIR)

2016-10-25 19:54 GMT+02:00 Konstantin Podsvirov :

> Hello again.
>
> 25.10.2016, 20:31, "Konstantin Podsvirov" :
> > Hello, Benjamin.
> >
> > 25.10.2016, 19:41, "Benjamin Ballet via CMake" :
> >>  Hi,
> >>
> >>  I'm trying to get GLEW (https://github.com/nigels-com/glew) with
> ExternalProject_Add
> >>  It's buildable with cmake but the CMakeLists.txt is in build/cmake
> directory.
> >>
> >>  Is there a way to specify the directory of the CMakeLists.txt file ?
> >>
> >>  If I change SOURCE_DIR it will only clone the repo in SOURCE_DIR and
> still run the cmake command in repo root.
> >>
> >>  --
> >>  Benjamin BALLET
> >>  Ingénieur R&D
> >>
> >>  ACTIVISU
> >>  19, rue Klock - 92110 Clichy
> >>>  Standard Tél :  01 44 69 37 37
> >>>  www.activisu.com
> >>  ,--
> >
> > Try it:
> >
> > ExternalProject_Add(
> >   ...
> >   SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/source
> >   ...
> >   CONFIGURE_COMMAND ${CMAKE_COMMAND} [additional args...]
> ${CMAKE_CURRENT_BINARY_DIR}/source/build/cmake
> >   ...)
>
>
> Or try it:
>
> ExternalProject_Add(
>   ...
>   SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/source
>   ...
>   CONFIGURE_COMMAND ${CMAKE_COMMAND} [additional args...]
>-DCMAKE_GENERATOR=${CMAKE_GENERATOR}
>-DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
>-DCMAKE_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET}
> ${CMAKE_CURRENT_BINARY_DIR}/source/build/cmake
>   ...)
>
> --
> Regards,
> Konstantin Podsvirov
>



-- 
*Benjamin BALLET*
Ingénieur R&D

*ACTIVISU*
19, rue Klock - 92110 Clichy
*> Standard Tél* :  01 44 69 37 37
*>* www.activisu.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

Re: [CMake] ExternalProject_Add : set the location of CMakeLists.txt

2016-10-25 Thread Konstantin Podsvirov
Hello again.

25.10.2016, 20:31, "Konstantin Podsvirov" :
> Hello, Benjamin.
>
> 25.10.2016, 19:41, "Benjamin Ballet via CMake" :
>>  Hi,
>>
>>  I'm trying to get GLEW (https://github.com/nigels-com/glew) with 
>> ExternalProject_Add
>>  It's buildable with cmake but the CMakeLists.txt is in build/cmake 
>> directory.
>>
>>  Is there a way to specify the directory of the CMakeLists.txt file ?
>>
>>  If I change SOURCE_DIR it will only clone the repo in SOURCE_DIR and still 
>> run the cmake command in repo root.
>>
>>  --
>>  Benjamin BALLET
>>  Ingénieur R&D
>>
>>  ACTIVISU
>>  19, rue Klock - 92110 Clichy
>>>  Standard Tél :  01 44 69 37 37
>>>  www.activisu.com
>>  ,--
>
> Try it:
>
> ExternalProject_Add(
>   ...
>   SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/source
>   ...
>   CONFIGURE_COMMAND ${CMAKE_COMMAND} [additional args...] 
> ${CMAKE_CURRENT_BINARY_DIR}/source/build/cmake
>   ...)


Or try it:

ExternalProject_Add(
  ...
  SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/source
  ...
  CONFIGURE_COMMAND ${CMAKE_COMMAND} [additional args...]
   -DCMAKE_GENERATOR=${CMAKE_GENERATOR}
   -DCMAKE_GENERATOR_PLATFORM=${CMAKE_GENERATOR_PLATFORM}
   -DCMAKE_GENERATOR_TOOLSET=${CMAKE_GENERATOR_TOOLSET}
${CMAKE_CURRENT_BINARY_DIR}/source/build/cmake
  ...)

--
Regards,
Konstantin Podsvirov
-- 

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] ExternalProject_Add : set the location of CMakeLists.txt

2016-10-25 Thread Konstantin Podsvirov
Hello, Benjamin.

25.10.2016, 19:41, "Benjamin Ballet via CMake" :
> Hi,
>
> I'm trying to get GLEW (https://github.com/nigels-com/glew) with 
> ExternalProject_Add
> It's buildable with cmake but the CMakeLists.txt is in build/cmake directory.
>
> Is there a way to specify the directory of the CMakeLists.txt file ?
>
> If I change SOURCE_DIR it will only clone the repo in SOURCE_DIR and still 
> run the cmake command in repo root.
>
> --
> Benjamin BALLET
> Ingénieur R&D
>
> ACTIVISU
> 19, rue Klock - 92110 Clichy
>> Standard Tél :  01 44 69 37 37
>> www.activisu.com
> ,--

Try it:

ExternalProject_Add(
  ...
  SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/source
  ...
  CONFIGURE_COMMAND ${CMAKE_COMMAND} [additional args...] 
${CMAKE_CURRENT_BINARY_DIR}/source/build/cmake
  ...)

---
Regards,
Konstantin Podsvirov
-- 

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] ExternalProject_Add : set the location of CMakeLists.txt

2016-10-25 Thread Benjamin Ballet via CMake
Hi,

I'm trying to get GLEW (https://github.com/nigels-com/glew) with
ExternalProject_Add
It's buildable with cmake but the CMakeLists.txt is in build/cmake
directory.

Is there a way to specify the directory of the CMakeLists.txt file ?

If I change SOURCE_DIR it will only clone the repo in SOURCE_DIR and still
run the cmake command in repo root.

-- 
*Benjamin BALLET*
Ingénieur R&D

*ACTIVISU*
19, rue Klock - 92110 Clichy
*> Standard Tél* :  01 44 69 37 37
*>* www.activisu.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

Re: [CMake] ExternalProject_Add not honoring the INSTALL_DIR argument.

2016-08-29 Thread Nicholas Braden
Hmm, you're right, I just tested and it seems the INSTALL_DIR is
ignored or not handled properly, I'm not sure why. But if you use the
CMAKE_ARGS option to manually set
"-DCMAKE_INSTALL_PREFIX=/tmp/Fusion/qhull-2015.2" it works, so at
least there's an easy workaround. Maybe someone else knows how the
INSTALL_DIR option is meant to be used?

On Mon, Aug 29, 2016 at 11:00 AM, Michael Jackson
 wrote:
> So that was a typo on my part but changing it had no effect after deleting
> every build/download/tmp/stamp directory and trying again.
>
> --
> Michael A. Jackson
> BlueQuartz Software, LLC
> [e]: mike.jack...@bluequartz.net
>
>
> Nicholas Braden wrote:
>>
>> Have you tried changing the = to a space, as with the other parameters?
>>
>> On Mon, Aug 29, 2016 at 10:52 AM, Michael Jackson
>>   wrote:
>>>
>>> I have the following CMake file:
>>>
>>> set(QHull_GIT_REPO "git://github.com/qhull/qhull")
>>> set(QHull_GIT_TAG "")
>>> set(QHull_INSTALL_NAME "qhull")
>>> set(QHull_INSTALL_NAME "qhull-2015.2")
>>>
>>>
>>> ExternalProject_Add(${QHull_INSTALL_NAME}
>>>PREFIX ${Fusion_SDK_ROOT}
>>>URL "http://www.qhull.org/download/qhull-2015-src-7.2.0.tgz";
>>>INSTALL_DIR=/tmp/Fusion/qhull-2015.2
>>>  LOG_DOWNLOAD 1
>>>  LOG_UPDATE 1
>>>  LOG_CONFIGURE 1
>>>  LOG_BUILD 1
>>>  LOG_INSTALL 1
>>>
>>> )
>>>
>>>   and when I invoke the initial cmake with this:
>>>
>>>   cmake -G Ninja -DBUILD_SHARED_LIBS=ON  -DCMAKE_BUILD_TYPE=Release
>>> -DFusion_SDK_ROOT=/tmp/Fusion_SDK ../
>>>
>>> I get a valid "configure" step. Then I run "ninja" and I get errors on
>>> installation. The errors are because CMake is attempting to install QHull
>>> in
>>> /usr/local/lib.
>>>
>>> Why is that? I am not sure what I am doing wrong as this seems like a
>>> pretty
>>> trivial case. I have cmake 3.5.1 and read the docs at
>>> https://cmake.org/cmake/help/v3.5/module/ExternalProject.html but somehow
>>> cmake is messing up.
>>>
>>> Thoughts?
>>>
>>>
>>> --
>>> Michael A. Jackson
>>> BlueQuartz Software, LLC
>>> [e]: mike.jack...@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
>
> --
>
> 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


Re: [CMake] ExternalProject_Add not honoring the INSTALL_DIR argument.

2016-08-29 Thread Michael Jackson
So that was a typo on my part but changing it had no effect after 
deleting every build/download/tmp/stamp directory and trying again.


--
Michael A. Jackson
BlueQuartz Software, LLC
[e]: mike.jack...@bluequartz.net


Nicholas Braden wrote:

Have you tried changing the = to a space, as with the other parameters?

On Mon, Aug 29, 2016 at 10:52 AM, Michael Jackson
  wrote:

I have the following CMake file:

set(QHull_GIT_REPO "git://github.com/qhull/qhull")
set(QHull_GIT_TAG "")
set(QHull_INSTALL_NAME "qhull")
set(QHull_INSTALL_NAME "qhull-2015.2")


ExternalProject_Add(${QHull_INSTALL_NAME}
   PREFIX ${Fusion_SDK_ROOT}
   URL "http://www.qhull.org/download/qhull-2015-src-7.2.0.tgz";
   INSTALL_DIR=/tmp/Fusion/qhull-2015.2
 LOG_DOWNLOAD 1
 LOG_UPDATE 1
 LOG_CONFIGURE 1
 LOG_BUILD 1
 LOG_INSTALL 1

)

  and when I invoke the initial cmake with this:

  cmake -G Ninja -DBUILD_SHARED_LIBS=ON  -DCMAKE_BUILD_TYPE=Release
-DFusion_SDK_ROOT=/tmp/Fusion_SDK ../

I get a valid "configure" step. Then I run "ninja" and I get errors on
installation. The errors are because CMake is attempting to install QHull in
/usr/local/lib.

Why is that? I am not sure what I am doing wrong as this seems like a pretty
trivial case. I have cmake 3.5.1 and read the docs at
https://cmake.org/cmake/help/v3.5/module/ExternalProject.html but somehow
cmake is messing up.

Thoughts?


--
Michael A. Jackson
BlueQuartz Software, LLC
[e]: mike.jack...@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

--

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] ExternalProject_Add not honoring the INSTALL_DIR argument.

2016-08-29 Thread Nicholas Braden
Have you tried changing the = to a space, as with the other parameters?

On Mon, Aug 29, 2016 at 10:52 AM, Michael Jackson
 wrote:
> I have the following CMake file:
>
> set(QHull_GIT_REPO "git://github.com/qhull/qhull")
> set(QHull_GIT_TAG "")
> set(QHull_INSTALL_NAME "qhull")
> set(QHull_INSTALL_NAME "qhull-2015.2")
>
>
> ExternalProject_Add(${QHull_INSTALL_NAME}
>   PREFIX ${Fusion_SDK_ROOT}
>   URL "http://www.qhull.org/download/qhull-2015-src-7.2.0.tgz";
>   INSTALL_DIR=/tmp/Fusion/qhull-2015.2
> LOG_DOWNLOAD 1
> LOG_UPDATE 1
> LOG_CONFIGURE 1
> LOG_BUILD 1
> LOG_INSTALL 1
>
> )
>
>  and when I invoke the initial cmake with this:
>
>  cmake -G Ninja -DBUILD_SHARED_LIBS=ON  -DCMAKE_BUILD_TYPE=Release
> -DFusion_SDK_ROOT=/tmp/Fusion_SDK ../
>
> I get a valid "configure" step. Then I run "ninja" and I get errors on
> installation. The errors are because CMake is attempting to install QHull in
> /usr/local/lib.
>
> Why is that? I am not sure what I am doing wrong as this seems like a pretty
> trivial case. I have cmake 3.5.1 and read the docs at
> https://cmake.org/cmake/help/v3.5/module/ExternalProject.html but somehow
> cmake is messing up.
>
> Thoughts?
>
>
> --
> Michael A. Jackson
> BlueQuartz Software, LLC
> [e]: mike.jack...@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
-- 

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] ExternalProject_Add not honoring the INSTALL_DIR argument.

2016-08-29 Thread Michael Jackson

I have the following CMake file:

set(QHull_GIT_REPO "git://github.com/qhull/qhull")
set(QHull_GIT_TAG "")
set(QHull_INSTALL_NAME "qhull")
set(QHull_INSTALL_NAME "qhull-2015.2")


ExternalProject_Add(${QHull_INSTALL_NAME}
  PREFIX ${Fusion_SDK_ROOT}
  URL "http://www.qhull.org/download/qhull-2015-src-7.2.0.tgz";
  INSTALL_DIR=/tmp/Fusion/qhull-2015.2
LOG_DOWNLOAD 1
LOG_UPDATE 1
LOG_CONFIGURE 1
LOG_BUILD 1
LOG_INSTALL 1

)

 and when I invoke the initial cmake with this:

 cmake -G Ninja -DBUILD_SHARED_LIBS=ON  -DCMAKE_BUILD_TYPE=Release 
-DFusion_SDK_ROOT=/tmp/Fusion_SDK ../


I get a valid "configure" step. Then I run "ninja" and I get errors on 
installation. The errors are because CMake is attempting to install 
QHull in /usr/local/lib.


Why is that? I am not sure what I am doing wrong as this seems like a 
pretty trivial case. I have cmake 3.5.1 and read the docs at 
https://cmake.org/cmake/help/v3.5/module/ExternalProject.html but 
somehow cmake is messing up.


Thoughts?


--
Michael A. Jackson
BlueQuartz Software, LLC
[e]: mike.jack...@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] ExternalProject_Add + imported targets: no rule to make yourlibrary.so

2016-05-03 Thread Bill Hoffman

On 4/28/2016 4:31 PM, SnakE wrote:

set_target_properties(foo PROPERTIES IMPORTED_LOCATION foo.so)

https://cmake.org/cmake/help/v3.0/prop_tgt/IMPORTED_LOCATION.html?highlight=imported_location

"Full path to the main file on disk for an IMPORTED target."

You need to use a full path to foo.so, works by luck with make.

-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] ExternalProject_Add + imported targets: no rule to make yourlibrary.so

2016-04-28 Thread SnakE
Hello,

I think I've found a bug in the ninja generator. I wonder if it's fixed
already in a more recent cmake version.

I'm using cmake 3.3.1. My project uses ExternalProject_Add() to pull some
pre-built binaries from an internal repository in some configurations. In
other configurations however that same dependency may be picked from the
system, and yet in other configurations it is built from sources. So I want
to unify the usage by only requiring the user code to do
target_link_libraries().

I'm trying to utilize imported targets to achieve that. But I get errors
immediately after I run the build before any download can happen.

Here's a very simple CMakeLists.txt which allows to reproduce this on
Linux. The foo_file target imitates downloading. You'll need to provide
some trivial main.c, like "main() { return 0; }". If generated with the
Makefile generator the build starts and then fails with an expected error:
foo.so is indeed not a proper shared object. But if I generate for Ninja
the build fails immediately with the error: "ninja: error: 'foo.so', needed
by 'bar', missing and no known rule to make it"

--8

Re: [CMake] ExternalProject_Add with flexible install commands

2016-02-25 Thread Knox, Kent
I don't need to use indirection, but the reason I decided to try was to 
simplify my code.  I could either wrap the ExternalProject_Add() call in a 
branch/switch or a single set() call.  

I am using your 'hack' thusly:
set( libxxx_inst_comm INSTALL_COMMAND ${CMAKE_COMMAND} -E echo_append )

and it's working great for me.  I have no problem documenting what i'm doing in 
my code.

Thank you for your input!

K

From: David Cole 
Sent: Thursday, February 25, 2016 10:57 AM
To: Knox, Kent
Cc: Petr Kmoch; cmake@cmake.org
Subject: Re: [CMake] ExternalProject_Add with flexible install commands

Do you need to do it indirectly through a variable like this?

If you just use:
  INSTALL_COMMAND ""

directly in the ExternalProject_Add call, it will work.

If you really need to do it indirectly, there's probably a way, but it
will also probably be more confusing for people reading the code in
the future. Not sure it's worth that trade-off. You could always
"cheat" and execute a no-op command for the install step rather than
"skipping" it. i.e. INSTALL_COMMAND ${CMAKE_COMMAND} -E echo
NoInstallStep ...


HTH,
David C.




On Thu, Feb 25, 2016 at 11:03 AM, Knox, Kent  wrote:
> Hi Petr~
>
> Thanks for your reply.
>
>
> These set statements do not appear to work.  Either the command 'installs'
> the dependency, or an error pops up.
>
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND "" )
> --> this installs the dependency
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND " " )
> --> /bin/sh: 1:  : not found
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND """" )
> --> CMake Warning (dev) in CMakeLists.txt
> --> Argument not separated from preceding token by whitespace.
>
> Kent
>
> 
> From: Petr Kmoch 
> Sent: Thursday, February 25, 2016 2:46 AM
> To: Knox, Kent
> Cc: cmake@cmake.org
> Subject: Re: [CMake] ExternalProject_Add with flexible install commands
>
> Hi Kent,
>
> I believe it's not "empty quotes" that disables the install command, it's
> the empty string. So you should not escape the quotes:
>
> ###
>
> # Default behavior is to NOT install library, empty quotes should disable
> install
> set( libxxx_inst_comm INSTALL_COMMAND "" )
>
> # Build the library as an external project
>   ExternalProject_Add( libxxx
> SOURCE_DIR ${PROJECT_SOURCE_DIR}/src
> ${libxxx_inst_comm}
>   )
> ###
>
> 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
-- 

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] ExternalProject_Add with flexible install commands

2016-02-25 Thread David Cole via CMake
Do you need to do it indirectly through a variable like this?

If you just use:
  INSTALL_COMMAND ""

directly in the ExternalProject_Add call, it will work.

If you really need to do it indirectly, there's probably a way, but it
will also probably be more confusing for people reading the code in
the future. Not sure it's worth that trade-off. You could always
"cheat" and execute a no-op command for the install step rather than
"skipping" it. i.e. INSTALL_COMMAND ${CMAKE_COMMAND} -E echo
NoInstallStep ...


HTH,
David C.




On Thu, Feb 25, 2016 at 11:03 AM, Knox, Kent  wrote:
> Hi Petr~
>
> Thanks for your reply.
>
>
> These set statements do not appear to work.  Either the command 'installs'
> the dependency, or an error pops up.
>
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND "" )
> --> this installs the dependency
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND " " )
> --> /bin/sh: 1:  : not found
>
> set( rocblas_INSTALL_COMMAND INSTALL_COMMAND """" )
> --> CMake Warning (dev) in CMakeLists.txt
> --> Argument not separated from preceding token by whitespace.
>
> Kent
>
> ____
> From: Petr Kmoch 
> Sent: Thursday, February 25, 2016 2:46 AM
> To: Knox, Kent
> Cc: cmake@cmake.org
> Subject: Re: [CMake] ExternalProject_Add with flexible install commands
>
> Hi Kent,
>
> I believe it's not "empty quotes" that disables the install command, it's
> the empty string. So you should not escape the quotes:
>
> ###
>
> # Default behavior is to NOT install library, empty quotes should disable
> install
> set( libxxx_inst_comm INSTALL_COMMAND "" )
>
> # Build the library as an external project
>   ExternalProject_Add( libxxx
> SOURCE_DIR ${PROJECT_SOURCE_DIR}/src
> ${libxxx_inst_comm}
>   )
> ###
>
> 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
-- 

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] ExternalProject_Add with flexible install commands

2016-02-25 Thread Knox, Kent
Hi Petr~

Thanks for your reply.


These set statements do not appear to work.  Either the command 'installs' the 
dependency, or an error pops up.


set( rocblas_INSTALL_COMMAND INSTALL_COMMAND "" )
--> this installs the dependency

set( rocblas_INSTALL_COMMAND INSTALL_COMMAND " " )
--> /bin/sh: 1:  : not found

set( rocblas_INSTALL_COMMAND INSTALL_COMMAND """" )
--> CMake Warning (dev) in CMakeLists.txt
--> Argument not separated from preceding token by whitespace.

Kent


From: Petr Kmoch 
Sent: Thursday, February 25, 2016 2:46 AM
To: Knox, Kent
Cc: cmake@cmake.org
Subject: Re: [CMake] ExternalProject_Add with flexible install commands

Hi Kent,

I believe it's not "empty quotes" that disables the install command, it's the 
empty string. So you should not escape the quotes:


###

# Default behavior is to NOT install library, empty quotes should disable 
install
set( libxxx_inst_comm INSTALL_COMMAND "" )

# Build the library as an external project
  ExternalProject_Add( libxxx
SOURCE_DIR ${PROJECT_SOURCE_DIR}/src
${libxxx_inst_comm}
  )
###

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] ExternalProject_Add with flexible install commands

2016-02-25 Thread Petr Kmoch
Hi Kent,

I believe it's not "empty quotes" that disables the install command, it's
the empty string. So you should not escape the quotes:

###
# Default behavior is to NOT install library, empty quotes should disable
install
set( libxxx_inst_comm INSTALL_COMMAND "" )

# Build the library as an external project
  ExternalProject_Add( libxxx
SOURCE_DIR ${PROJECT_SOURCE_DIR}/src
${libxxx_inst_comm}
  )
###

Petr


On Thu, Feb 25, 2016 at 7:04 AM, Knox, Kent  wrote:

> I am having a problem passing parameters as a variable into
> ExternalProject_Add(). I seem to be fighting syntax, i've tried many
> different variants with the set() statement
>
>
> ###
>
> # Default behavior is to NOT install library, empty quotes should disable
> install
> set( libxxx_inst_comm INSTALL_COMMAND "\"\"" )
>
> # Build the library as an external project
>   ExternalProject_Add( libxxx
> SOURCE_DIR ${PROJECT_SOURCE_DIR}/src
> ${libxxx_inst_comm}
>   )
> ###
>
> I get this message, which appears to be within ExternalProject_add()
> using add_custom_command.  Is there a way around this?
>
> CMake Error at
> /opt/homebrew-cask/Caskroom/cmake/3.2.2/CMake.app/Contents/share/cmake-3.2/Modules/ExternalProject.cmake:1487
> (add_custom_command):
>
>   COMMAND may not contain literal quotes:
>
>
> ""
>
>
> --
>
> 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] ExternalProject_Add with flexible install commands

2016-02-25 Thread Knox, Kent
I am having a problem passing parameters as a variable into 
ExternalProject_Add(). I seem to be fighting syntax, i've tried many different 
variants with the set() statement


###

# Default behavior is to NOT install library, empty quotes should disable 
install
set( libxxx_inst_comm INSTALL_COMMAND "\"\"" )

# Build the library as an external project
  ExternalProject_Add( libxxx
SOURCE_DIR ${PROJECT_SOURCE_DIR}/src
${libxxx_inst_comm}
  )
###

I get this message, which appears to be within ExternalProject_add() using 
add_custom_command.  Is there a way around this?


CMake Error at 
/opt/homebrew-cask/Caskroom/cmake/3.2.2/CMake.app/Contents/share/cmake-3.2/Modules/ExternalProject.cmake:1487
 (add_custom_command):

  COMMAND may not contain literal quotes:


""

-- 

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] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-21 Thread fkillus via CMake
Nice, thank you very much! This solves my problem.

On Thu, Jan 21, 2016 at 3:56 PM, Nicholas Braden  wrote:

> Ah, I ran into this quirk too - the issue is that you have the quotes
> incorrect:
>
> -DCMAKE_CXX_FLAGS="-march=native"
>
> Should be like this instead:
>
> "-DCMAKE_CXX_FLAGS=-march=native"
>
> Try that and see if it helps, I am pretty sure I ran into the exact
> same problem.
>
> On Thu, Jan 21, 2016 at 8:27 AM, fkillus  wrote:
> > Thanks for clarifying that external projects are not aware of the project
> > they are embedded in.
> > The CMAKE_COMPILER_IS_GNUCXX variable should be set automatically by
> CMake
> > as far
> > as I understand it (see https://cmake.org/Wiki/CMake_Useful_Variables).
> >
> > I narrowed down the problem by creating a minimal setup which still
> > reproduces the issue.
> > In this case the super project is simply a wrapper around an external
> dummy
> > project.
> >
> > external/CMakeLists.txt:
> >
> >   cmake_minimum_required( VERSION 3.4 )
> >   project( external )
> >   message( "External - CMAKE_COMPILER_IS_GNUCXX: "
> > ${CMAKE_COMPILER_IS_GNUCXX} )
> >   message( "External - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID}
> )
> >   message( "External - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
> >
> > super/CMakeLists.txt:
> >
> >   cmake_minimum_required( VERSION 3.4 )
> >   project( super )
> >   message( "Super - CMAKE_COMPILER_IS_GNUCXX: "
> ${CMAKE_COMPILER_IS_GNUCXX}
> > )
> >   message( "Super - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
> >   message( "Super - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
> >   include( ExternalProject )
> >   ExternalProject_Add(
> > external
> > DOWNLOAD_COMMAND ""
> > SOURCE_DIR ${CMAKE_SOURCE_DIR}/../external
> > CMAKE_ARGS
> >   -DCMAKE_CXX_FLAGS="-march=native"
> > INSTALL_COMMAND  ""
> >   )
> >
> > The problem occurs when the CMAKE_CXX_FLAGS variable is set inside the
> > ExternalProject_Add
> > command using quotes (i.e. "-march=native" in this example). The output
> > obtained when configuring
> > the super project with 'cmake ../super' is:
> >
> > -- The C compiler identification is GNU 5.2.0
> > -- The CXX compiler identification is GNU 5.2.0
> > -- 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
> > -- Detecting C compile features
> > -- Detecting C compile features - 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
> > -- Detecting CXX compile features
> > -- Detecting CXX compile features - done
> > Super - CMAKE_COMPILER_IS_GNUCXX: 1
> > Super - CMAKE_CXX_COMPILER_ID: GNU
> > Super - CMAKE_CXX_FLAGS:
> > -- Configuring done
> > -- Generating done
> >
> > Afterwards building with 'make' results in:
> >
> > [ 12%] Creating directories for 'external'
> > [ 25%] No download step for 'external'
> > [ 37%] No patch step for 'external'
> > [ 50%] No update step for 'external'
> > [ 62%] Performing configure step for 'external'
> > -- The C compiler identification is GNU 5.2.0
> > -- The CXX compiler identification is unknown
> > -- 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
> > -- Detecting C compile features
> > -- Detecting C compile features - 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
> > External - CMAKE_COMPILER_IS_GNUCXX:
> > External - CMAKE_CXX_COMPILER_ID:
> > External - CMAKE_CXX_FLAGS: "-march=native"
> > -- Configuring done
> > -- Generating done
> >
> > This shows the compiler is not correctly identified for the external
> > project. Directly configuring
> > the external project with 'cmake -DCMAKE_CXX_FLAGS="-march=native"
> > ../external' works though:
> >
> > -- The C compiler identification is GNU 5.2.0
> > -- The CXX compiler identification is GNU 5.2.0
> > -- 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
> > -- Detecting C compile features
> > -- Detecting C compile features - 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
> > -- Detecting CXX compile features
> > -- Detecting CXX compile features - done
> > External - CMAKE_COMPILER_IS_GNUCXX: 1
> > External - CMAKE_CXX_COMPILER_ID: GNU
> > External - CMAKE_CXX_FLAGS: -march=native
> > -- Configuring done
> > -- Generating done
> >
> >
> > It also works if

Re: [CMake] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-21 Thread Nicholas Braden
Ah, I ran into this quirk too - the issue is that you have the quotes incorrect:

-DCMAKE_CXX_FLAGS="-march=native"

Should be like this instead:

"-DCMAKE_CXX_FLAGS=-march=native"

Try that and see if it helps, I am pretty sure I ran into the exact
same problem.

On Thu, Jan 21, 2016 at 8:27 AM, fkillus  wrote:
> Thanks for clarifying that external projects are not aware of the project
> they are embedded in.
> The CMAKE_COMPILER_IS_GNUCXX variable should be set automatically by CMake
> as far
> as I understand it (see https://cmake.org/Wiki/CMake_Useful_Variables).
>
> I narrowed down the problem by creating a minimal setup which still
> reproduces the issue.
> In this case the super project is simply a wrapper around an external dummy
> project.
>
> external/CMakeLists.txt:
>
>   cmake_minimum_required( VERSION 3.4 )
>   project( external )
>   message( "External - CMAKE_COMPILER_IS_GNUCXX: "
> ${CMAKE_COMPILER_IS_GNUCXX} )
>   message( "External - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
>   message( "External - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
>
> super/CMakeLists.txt:
>
>   cmake_minimum_required( VERSION 3.4 )
>   project( super )
>   message( "Super - CMAKE_COMPILER_IS_GNUCXX: " ${CMAKE_COMPILER_IS_GNUCXX}
> )
>   message( "Super - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
>   message( "Super - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
>   include( ExternalProject )
>   ExternalProject_Add(
> external
> DOWNLOAD_COMMAND ""
> SOURCE_DIR ${CMAKE_SOURCE_DIR}/../external
> CMAKE_ARGS
>   -DCMAKE_CXX_FLAGS="-march=native"
> INSTALL_COMMAND  ""
>   )
>
> The problem occurs when the CMAKE_CXX_FLAGS variable is set inside the
> ExternalProject_Add
> command using quotes (i.e. "-march=native" in this example). The output
> obtained when configuring
> the super project with 'cmake ../super' is:
>
> -- The C compiler identification is GNU 5.2.0
> -- The CXX compiler identification is GNU 5.2.0
> -- 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
> -- Detecting C compile features
> -- Detecting C compile features - 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
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> Super - CMAKE_COMPILER_IS_GNUCXX: 1
> Super - CMAKE_CXX_COMPILER_ID: GNU
> Super - CMAKE_CXX_FLAGS:
> -- Configuring done
> -- Generating done
>
> Afterwards building with 'make' results in:
>
> [ 12%] Creating directories for 'external'
> [ 25%] No download step for 'external'
> [ 37%] No patch step for 'external'
> [ 50%] No update step for 'external'
> [ 62%] Performing configure step for 'external'
> -- The C compiler identification is GNU 5.2.0
> -- The CXX compiler identification is unknown
> -- 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
> -- Detecting C compile features
> -- Detecting C compile features - 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
> External - CMAKE_COMPILER_IS_GNUCXX:
> External - CMAKE_CXX_COMPILER_ID:
> External - CMAKE_CXX_FLAGS: "-march=native"
> -- Configuring done
> -- Generating done
>
> This shows the compiler is not correctly identified for the external
> project. Directly configuring
> the external project with 'cmake -DCMAKE_CXX_FLAGS="-march=native"
> ../external' works though:
>
> -- The C compiler identification is GNU 5.2.0
> -- The CXX compiler identification is GNU 5.2.0
> -- 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
> -- Detecting C compile features
> -- Detecting C compile features - 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
> -- Detecting CXX compile features
> -- Detecting CXX compile features - done
> External - CMAKE_COMPILER_IS_GNUCXX: 1
> External - CMAKE_CXX_COMPILER_ID: GNU
> External - CMAKE_CXX_FLAGS: -march=native
> -- Configuring done
> -- Generating done
>
>
> It also works if the quotations marks in the super project listfile are
> removed. I.e. changing
>   CMAKE_ARGS
>-DCMAKE_CXX_FLAGS="-march=native"
> to
>   CMAKE_ARGS
>-DCMAKE_CXX_FLAGS=-march=native
>
> The question is now, is it still possible to add mutiple compile flags if
> one cannot use quotation marks?
>
>
> On Wed, Jan 20, 2016 at 6:58 PM, Nicholas Braden
>  wrote:
>>

Re: [CMake] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-21 Thread fkillus via CMake
Thanks for your suggestion! I consider trying it soon.

On Wed, Jan 20, 2016 at 11:44 PM, Craig Scott 
wrote:

>
> From: fkillus 
>> To: cmake@cmake.org
>> Cc:
>> Date: Wed, 20 Jan 2016 18:41:26 +0100
>> Subject: [CMake] ExternalProject_Add() macro does not set
>> CMAKE_COMPILER_IS_GNUCXX
>> I have been trying to compile Ogre [1] as external dependency with
>> ExternalProject_Add(). In theory this should be straightforward since Ogre
>> itself also uses CMake as buildsystem. However, in the process I
>> encountered the following problem:
>>
>
>> Ogre checks the value of the CMAKE_COMPILER_IS_GNUCXX variable in some
>> places (e.g. [2]). I am running Linux and compiling with g++ and everything
>> works fine if I manually configure Ogre with cmake or cmake-gui.
>> Unfortunately, after wrapping everything inside ExternalProject_Add(), the
>> CMAK_COMPILER_IS_GNUCXX variable is no longer being set correctly.
>>
>> A simple workaround is to manually set this variable, i.e.:
>>
>>  ExternalProject_Add(
>> ogre
>> URL https://bitbucket.org/sinbad/ogre/get/v1-9-0.zip
>> CMAKE_ARGS
>>   -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_OUTPUT_DIR}
>>   -DCMAKE_COMPILER_IS_GNUCXX=${CMAKE_COMPILER_IS_GNUCXX}   # workaround
>>   )
>>
>> This works, but I'm uncertain if this should be necessary. Is this a bug
>> or a feature?
>>
>>
>> [1] https://bitbucket.org/sinbad/ogre
>> [2]
>> https://bitbucket.org/sinbad/ogre/src/0d580c7216abe27fafe41cb43e31d8ed86ded591/CMake/Utils/OgreConfigTargets.cmake?at=default&fileviewer=file-view-default#OgreConfigTargets.cmake-277
>>
>>
>
> Since Ogre is a CMake project, you may find the technique described at the
> following link useful. It uses GoogleTest as its example, but it should
> also apply to your situation. The approach uses ExternalProject only to
> download the source at CMake time. It then pulls it into your normal build
> via add_subdirectory(), so it gets all the same compiler details, etc. as
> your main build because it IS part of your main build.
>
> http://crascit.com/2015/07/25/cmake-gtest/
>
> I am not familiar with Ogre's build, so I can't comment on whether it will
> play nice if pulled into a parent build like this, but it's worth a try.
> The article links to a github repo which provides a fully generalised
> implementation you should be able to use out of the box.
>
>
> --
> Craig Scott
> Melbourne, Australia
> http://crascit.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
>
-- 

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] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-21 Thread fkillus via CMake
Thanks for clarifying that external projects are not aware of the project
they are embedded in.
The CMAKE_COMPILER_IS_GNUCXX variable should be set automatically by CMake
as far
as I understand it (see https://cmake.org/Wiki/CMake_Useful_Variables).

I narrowed down the problem by creating a minimal setup which still
reproduces the issue.
In this case the super project is simply a wrapper around an external dummy
project.

external/CMakeLists.txt:

  cmake_minimum_required( VERSION 3.4 )
  project( external )
  message( "External - CMAKE_COMPILER_IS_GNUCXX: "
${CMAKE_COMPILER_IS_GNUCXX} )
  message( "External - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
  message( "External - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )

super/CMakeLists.txt:

  cmake_minimum_required( VERSION 3.4 )
  project( super )
  message( "Super - CMAKE_COMPILER_IS_GNUCXX: " ${CMAKE_COMPILER_IS_GNUCXX}
)
  message( "Super - CMAKE_CXX_COMPILER_ID: " ${CMAKE_CXX_COMPILER_ID} )
  message( "Super - CMAKE_CXX_FLAGS: " ${CMAKE_CXX_FLAGS} )
  include( ExternalProject )
  ExternalProject_Add(
external
DOWNLOAD_COMMAND ""
SOURCE_DIR ${CMAKE_SOURCE_DIR}/../external
CMAKE_ARGS
  -DCMAKE_CXX_FLAGS="-march=native"
INSTALL_COMMAND  ""
  )

The problem occurs when the CMAKE_CXX_FLAGS variable is set inside the
ExternalProject_Add
command using quotes (i.e. "-march=native" in this example). The output
obtained when configuring
the super project with 'cmake ../super' is:

-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is GNU 5.2.0
-- 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
-- Detecting C compile features
-- Detecting C compile features - 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
-- Detecting CXX compile features
-- Detecting CXX compile features - done
Super - CMAKE_COMPILER_IS_GNUCXX: 1
Super - CMAKE_CXX_COMPILER_ID: GNU
Super - CMAKE_CXX_FLAGS:
-- Configuring done
-- Generating done

Afterwards building with 'make' results in:

[ 12%] Creating directories for 'external'
[ 25%] No download step for 'external'
[ 37%] No patch step for 'external'
[ 50%] No update step for 'external'
[ 62%] Performing configure step for 'external'
-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is unknown
-- 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
-- Detecting C compile features
-- Detecting C compile features - 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
External - CMAKE_COMPILER_IS_GNUCXX:
External - CMAKE_CXX_COMPILER_ID:
External - CMAKE_CXX_FLAGS: "-march=native"
-- Configuring done
-- Generating done

This shows the compiler is not correctly identified for the external
project. Directly configuring
the external project with 'cmake -DCMAKE_CXX_FLAGS="-march=native"
../external' works though:

-- The C compiler identification is GNU 5.2.0
-- The CXX compiler identification is GNU 5.2.0
-- 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
-- Detecting C compile features
-- Detecting C compile features - 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
-- Detecting CXX compile features
-- Detecting CXX compile features - done
External - CMAKE_COMPILER_IS_GNUCXX: 1
External - CMAKE_CXX_COMPILER_ID: GNU
External - CMAKE_CXX_FLAGS: -march=native
-- Configuring done
-- Generating done


It also works if the quotations marks in the super project listfile are
removed. I.e. changing
  CMAKE_ARGS
   -DCMAKE_CXX_FLAGS="-march=native"
to
  CMAKE_ARGS
   -DCMAKE_CXX_FLAGS=-march=native

The question is now, is it still possible to add mutiple compile flags if
one cannot use quotation marks?


On Wed, Jan 20, 2016 at 6:58 PM, Nicholas Braden  wrote:

> Where/how is that variable normally set? External projects have no
> awareness of the project they are in, they just run CMake as usual the
> same way you would. If the variable is normally set by CMake itself,
> make sure that your containing project and the external project both
> find the same compiler. (They each do their own automatic search for
> compilers)
>
> On Wed, Jan 20, 2016 at 11:41 AM, fkillus via CMake 
> wrote:
> > I have been trying to compile Ogre [1] as external dependency with
> > ExternalProject_Add(). In theory this should be 

[CMake] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-20 Thread Craig Scott
> From: fkillus 
> To: cmake@cmake.org
> Cc:
> Date: Wed, 20 Jan 2016 18:41:26 +0100
> Subject: [CMake] ExternalProject_Add() macro does not set
> CMAKE_COMPILER_IS_GNUCXX
> I have been trying to compile Ogre [1] as external dependency with
> ExternalProject_Add(). In theory this should be straightforward since Ogre
> itself also uses CMake as buildsystem. However, in the process I
> encountered the following problem:
>

> Ogre checks the value of the CMAKE_COMPILER_IS_GNUCXX variable in some
> places (e.g. [2]). I am running Linux and compiling with g++ and everything
> works fine if I manually configure Ogre with cmake or cmake-gui.
> Unfortunately, after wrapping everything inside ExternalProject_Add(), the
> CMAK_COMPILER_IS_GNUCXX variable is no longer being set correctly.
>
> A simple workaround is to manually set this variable, i.e.:
>
>  ExternalProject_Add(
> ogre
> URL https://bitbucket.org/sinbad/ogre/get/v1-9-0.zip
> CMAKE_ARGS
>   -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_OUTPUT_DIR}
>   -DCMAKE_COMPILER_IS_GNUCXX=${CMAKE_COMPILER_IS_GNUCXX}   # workaround
>   )
>
> This works, but I'm uncertain if this should be necessary. Is this a bug
> or a feature?
>
>
> [1] https://bitbucket.org/sinbad/ogre
> [2]
> https://bitbucket.org/sinbad/ogre/src/0d580c7216abe27fafe41cb43e31d8ed86ded591/CMake/Utils/OgreConfigTargets.cmake?at=default&fileviewer=file-view-default#OgreConfigTargets.cmake-277
>
>

Since Ogre is a CMake project, you may find the technique described at the
following link useful. It uses GoogleTest as its example, but it should
also apply to your situation. The approach uses ExternalProject only to
download the source at CMake time. It then pulls it into your normal build
via add_subdirectory(), so it gets all the same compiler details, etc. as
your main build because it IS part of your main build.

http://crascit.com/2015/07/25/cmake-gtest/

I am not familiar with Ogre's build, so I can't comment on whether it will
play nice if pulled into a parent build like this, but it's worth a try.
The article links to a github repo which provides a fully generalised
implementation you should be able to use out of the box.


-- 
Craig Scott
Melbourne, Australia
http://crascit.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

Re: [CMake] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-20 Thread Nicholas Braden
Where/how is that variable normally set? External projects have no
awareness of the project they are in, they just run CMake as usual the
same way you would. If the variable is normally set by CMake itself,
make sure that your containing project and the external project both
find the same compiler. (They each do their own automatic search for
compilers)

On Wed, Jan 20, 2016 at 11:41 AM, fkillus via CMake  wrote:
> I have been trying to compile Ogre [1] as external dependency with
> ExternalProject_Add(). In theory this should be straightforward since Ogre
> itself also uses CMake as buildsystem. However, in the process I encountered
> the following problem:
>
> Ogre checks the value of the CMAKE_COMPILER_IS_GNUCXX variable in some
> places (e.g. [2]). I am running Linux and compiling with g++ and everything
> works fine if I manually configure Ogre with cmake or cmake-gui.
> Unfortunately, after wrapping everything inside ExternalProject_Add(), the
> CMAK_COMPILER_IS_GNUCXX variable is no longer being set correctly.
>
> A simple workaround is to manually set this variable, i.e.:
>
>  ExternalProject_Add(
> ogre
> URL https://bitbucket.org/sinbad/ogre/get/v1-9-0.zip
> CMAKE_ARGS
>   -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_OUTPUT_DIR}
>   -DCMAKE_COMPILER_IS_GNUCXX=${CMAKE_COMPILER_IS_GNUCXX}   # workaround
>   )
>
> This works, but I'm uncertain if this should be necessary. Is this a bug or
> a feature?
>
>
> [1] https://bitbucket.org/sinbad/ogre
> [2]
> https://bitbucket.org/sinbad/ogre/src/0d580c7216abe27fafe41cb43e31d8ed86ded591/CMake/Utils/OgreConfigTargets.cmake?at=default&fileviewer=file-view-default#OgreConfigTargets.cmake-277
>
> --
>
> 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] ExternalProject_Add() macro does not set CMAKE_COMPILER_IS_GNUCXX

2016-01-20 Thread fkillus via CMake
I have been trying to compile Ogre [1] as external dependency with
ExternalProject_Add(). In theory this should be straightforward since Ogre
itself also uses CMake as buildsystem. However, in the process I
encountered the following problem:

Ogre checks the value of the CMAKE_COMPILER_IS_GNUCXX variable in some
places (e.g. [2]). I am running Linux and compiling with g++ and everything
works fine if I manually configure Ogre with cmake or cmake-gui.
Unfortunately, after wrapping everything inside ExternalProject_Add(), the
CMAK_COMPILER_IS_GNUCXX variable is no longer being set correctly.

A simple workaround is to manually set this variable, i.e.:

 ExternalProject_Add(
ogre
URL https://bitbucket.org/sinbad/ogre/get/v1-9-0.zip
CMAKE_ARGS
  -DCMAKE_INSTALL_PREFIX=${DEPENDENCIES_OUTPUT_DIR}
  -DCMAKE_COMPILER_IS_GNUCXX=${CMAKE_COMPILER_IS_GNUCXX}   # workaround
  )

This works, but I'm uncertain if this should be necessary. Is this a bug or
a feature?


[1] https://bitbucket.org/sinbad/ogre
[2]
https://bitbucket.org/sinbad/ogre/src/0d580c7216abe27fafe41cb43e31d8ed86ded591/CMake/Utils/OgreConfigTargets.cmake?at=default&fileviewer=file-view-default#OgreConfigTargets.cmake-277
-- 

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] ExternalProject_Add support for git clone -o option

2016-01-15 Thread Adam Rankin
To elaborate on my reply:

I do indeed interact with the repository after it's cloned (as per my previous 
email).

With regards to implementation, I have implemented it such that the git remote 
name is only involved if git is chosen as the source of choice, in much the 
same manner as the git_tag implementation. My implementation makes the git 
remote name completely optional and defaults to "origin".

Regards,
Adam

-Original Message-
From: Nicholas Braden [mailto:nicholas11bra...@gmail.com] 
Sent: Friday, January 15, 2016 12:02 PM
To: Adam Rankin 
Cc: cmake@cmake.org
Subject: Re: [CMake] ExternalProject_Add support for git clone -o option

Why would you like to have names other than origin? I am struggling to think of 
a use case for this, seeing as you never directly interact with the cloned 
repository. I don't even think it's safe to assume that a git repository is 
involved at all, for all you know it could be changed to just download the code 
and never even involve git. (Maybe it is guaranteed somewhere but I don't see 
such a guarantee in the
documentation)

On Fri, Jan 15, 2016 at 10:03 AM, Adam Rankin  wrote:
> Hello all,
>
>
>
> I am reading through the ExternalProject source for 3.2 at the moment 
> (if updating to 3.4 is the answer, great!) and trying to determine if 
> there is support for the –o option when using a git repository.
>
>
>
> Has anyone accomplished this? I would like to have names other than “origin”
>
>
>
> Cheers,
>
> Adam
>
>
> --
>
> 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

Re: [CMake] ExternalProject_Add support for git clone -o option

2016-01-15 Thread Adam Rankin
My use case is for forked repositories and sending pull requests upstream. In 
this case "origin" is ambiguous as manage both remotes and I would like to give 
the cloned repository a more accurate name.

Cheers,
Adam

-Original Message-
From: Nicholas Braden [mailto:nicholas11bra...@gmail.com] 
Sent: Friday, January 15, 2016 12:02 PM
To: Adam Rankin 
Cc: cmake@cmake.org
Subject: Re: [CMake] ExternalProject_Add support for git clone -o option

Why would you like to have names other than origin? I am struggling to think of 
a use case for this, seeing as you never directly interact with the cloned 
repository. I don't even think it's safe to assume that a git repository is 
involved at all, for all you know it could be changed to just download the code 
and never even involve git. (Maybe it is guaranteed somewhere but I don't see 
such a guarantee in the
documentation)

On Fri, Jan 15, 2016 at 10:03 AM, Adam Rankin  wrote:
> Hello all,
>
>
>
> I am reading through the ExternalProject source for 3.2 at the moment 
> (if updating to 3.4 is the answer, great!) and trying to determine if 
> there is support for the –o option when using a git repository.
>
>
>
> Has anyone accomplished this? I would like to have names other than “origin”
>
>
>
> Cheers,
>
> Adam
>
>
> --
>
> 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

Re: [CMake] ExternalProject_Add support for git clone -o option

2016-01-15 Thread Nicholas Braden
Why would you like to have names other than origin? I am struggling to
think of a use case for this, seeing as you never directly interact
with the cloned repository. I don't even think it's safe to assume
that a git repository is involved at all, for all you know it could be
changed to just download the code and never even involve git. (Maybe
it is guaranteed somewhere but I don't see such a guarantee in the
documentation)

On Fri, Jan 15, 2016 at 10:03 AM, Adam Rankin  wrote:
> Hello all,
>
>
>
> I am reading through the ExternalProject source for 3.2 at the moment (if
> updating to 3.4 is the answer, great!) and trying to determine if there is
> support for the –o option when using a git repository.
>
>
>
> Has anyone accomplished this? I would like to have names other than “origin”
>
>
>
> Cheers,
>
> Adam
>
>
> --
>
> 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] ExternalProject_Add support for git clone -o option

2016-01-15 Thread Adam Rankin
Hello all,

I am reading through the ExternalProject source for 3.2 at the moment (if 
updating to 3.4 is the answer, great!) and trying to determine if there is 
support for the -o option when using a git repository.

Has anyone accomplished this? I would like to have names other than "origin"

Cheers,
Adam
-- 

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] ExternalProject_Add and inheritance

2015-12-15 Thread CHEVRIER, Marc
The problem is not a CMake one but a runtime environment one.
You built an executable with a specific environment (GCC 5) but try to execute 
it in a different environment (default platform): When an executable is built, 
system libraries paths are not stored as part of the executable so without 
specific env, wrong library is used. You can solve this problem using, as you 
already found, LD_LIBRARY_PATH or, may be (not tried), using various CMake 
related RPATH variables and properties to force storage of system library path.


From: Cedric Doucet mailto:cedric.dou...@inria.fr>>
Date: Friday 11 December 2015 at 10:05
To: SAP SAP mailto:marc.chevr...@sap.com>>
Cc: "cmake@cmake.org<mailto:cmake@cmake.org>" 
mailto:cmake@cmake.org>>
Subject: Re: [CMake] ExternalProject_Add and inheritance


Hello Marc,

thank you very much for your answer!

I am not sure to understand how to overcome my problem with these variables.
I can explain my problem further.

I have a toy example of the problem which contains:
- a call to ExternalProject_Add to install boost and yaml-ccp (the latter 
depends on the former)
- a main function which loads a file with yaml-cpp (just one line of code)

Everything compiles with GCC 5 and I obtain an executable file (called 
gcc_example).
However, when I run this executable file, I get the following error message :

./gcc_example: relocation error: ./gcc_example: symbol 
_ZTVNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE, version 
GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference

And I can overcome this problem by setting LD_LIBRARY_PATH to the right value:

LD_LIBRARY_PATH=/home/libraries/gcc/5.2.0/lib64/ ./gcc_example

The origin of the problem is that the definition of strings is different since 
GCC 5.
Unfortunately, the default behavior is to call the C++ standard library of my 
Ubuntu system, and the version of this library is older than the version of GCC 
5.

I can check it with 'ldd ./gcc_example':

linux-vdso.so.1 =>  (0x7ffd02ef7000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 
(0x003a7140)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x003d03a0)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x003a7100)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x003d02e0)
/lib64/ld-linux-x86-64.so.2 (0x003d02a0)

But I don't understand why I have still this problem since I put these lines in 
my CMakeLists file (of course the right value of GCC_ROOT is passed to the 
cmake command at configuration step):

link_directories(${GCC_ROOT}/lib64)
target_link_libraries(gcc_example ${GCC_ROOT}/lib64/libstdc++.so)

I can provide my simple toy example if it helps to understand.
You just need to compile it with GCC 5 to see the problem (with older versions 
of GCC, everything works fine because strings are defined in the "classical" 
way).


Best,


Cédric






De: "Marc CHEVRIER" mailto:marc.chevr...@sap.com>>
À: "Cedric Doucet" mailto:cedric.dou...@inria.fr>>, 
cmake@cmake.org<mailto:cmake@cmake.org>
Envoyé: Vendredi 11 Décembre 2015 08:44:38
Objet: Re: [CMake] ExternalProject_Add and inheritance

With CMake, you can control compilation and link flags with the following 
environment variables:

  *   CC: specify C compiler
  *   CFLAGS: C compiler flags
  *   CXX: specify C++ compiler
  *   CXXFLAGS: C++ compiler flags
  *   LDFLAGS: linker flags

And to finish you can overload make command for generation using CMAKE_COMMAND 
option of ExternalProject_Add:
CMAKE_CMMAND “${CMAKE_COMMAND}” -E env CXX=${CMAKE_CXX_COMPILER} LDFLAGS=“…” 
“${CMAKE_COMMAND}”




From: CMake mailto:cmake-boun...@cmake.org>> on behalf 
of Cedric Doucet mailto:cedric.dou...@inria.fr>>
Date: Thursday 10 December 2015 at 18:21
To: "cmake@cmake.org<mailto:cmake@cmake.org>" 
mailto:cmake@cmake.org>>
Subject: [CMake] ExternalProject_Add and inheritance


Hello,

I use the ExternalProject_Add command to manage third-party libraries.
In the same time, I need to overcome some compatibility problems between GCC 4 
and GCC 5 (strings are not defined in the same way in the STL).
The solution I use is the one given here:
http://stackoverflow.com/questions/33500337/how-to-handle-dual-abi-in-gcc-5
It allows me to force to use the libstdc++.so given by the GCC repository given 
to the cmake command.

The problem is that trick does not work with the ExternalProject_Add command 
because configuration steps of third-party libraries are autonomous.
Do you know how to solve the problem?

For example, if I use the ExternalProject_Add command to manage a third-library 
whose configuration also depends on a cmake script, how could I tell this 
script to use the compilers and the libstdc++.so I provided to my own cmake 
script?

Best,

Cédric

-- 


Re: [CMake] ExternalProject_Add and inheritance

2015-12-11 Thread Cedric Doucet
Hello Marc, 

thank you very much for your answer! 

I am not sure to understand how to overcome my problem with these variables. 
I can explain my problem further. 

I have a toy example of the problem which contains: 
- a call to ExternalProject_Add to install boost and yaml-ccp (the latter 
depends on the former) 
- a main function which loads a file with yaml-cpp (just one line of code) 

Everything compiles with GCC 5 and I obtain an executable file (called 
gcc_example). 
However, when I run this executable file, I get the following error message : 

./gcc_example: relocation error: ./gcc_example: symbol 
_ZTVNSt7__cxx1118basic_stringstreamIcSt11char_traitsIcESaIcEEE, version 
GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time reference 

And I can overcome this problem by setting LD_LIBRARY_PATH to the right value: 

LD_LIBRARY_PATH=/home/libraries/gcc/5.2.0/lib64/ ./gcc_example 

The origin of the problem is that the definition of strings is different since 
GCC 5. 
Unfortunately, the default behavior is to call the C++ standard library of my 
Ubuntu system, and the version of this library is older than the version of GCC 
5. 

I can check it with 'ldd ./gcc_example': 

linux-vdso.so.1 => (0x7ffd02ef7000) 
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x003a7140) 
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x003d03a0) 
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x003a7100) 
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x003d02e0) 
/lib64/ld-linux-x86-64.so.2 (0x003d02a0) 

But I don't understand why I have still this problem since I put these lines in 
my CMakeLists file (of course the right value of GCC_ROOT is passed to the 
cmake command at configuration step): 

link_directories(${GCC_ROOT}/lib64) 
target_link_libraries(gcc_example ${GCC_ROOT}/lib64/libstdc++.so) 

I can provide my simple toy example if it helps to understand. 
You just need to compile it with GCC 5 to see the problem (with older versions 
of GCC, everything works fine because strings are defined in the "classical" 
way). 

Best, 

Cédric 

- Mail original -

> De: "Marc CHEVRIER" 
> À: "Cedric Doucet" , cmake@cmake.org
> Envoyé: Vendredi 11 Décembre 2015 08:44:38
> Objet: Re: [CMake] ExternalProject_Add and inheritance

> With CMake, you can control compilation and link flags with the following
> environment variables:

> * CC: specify C compiler
> * CFLAGS: C compiler flags
> * CXX: specify C++ compiler
> * CXXFLAGS: C++ compiler flags
> * LDFLAGS: linker flags

> And to finish you can overload make command for generation using
> CMAKE_COMMAND option of ExternalProject_Add:
> CMAKE_CMMAND “${CMAKE_COMMAND}” -E env CXX=${CMAKE_CXX_COMPILER} LDFLAGS=“…”
> “${CMAKE_COMMAND}”

> From: CMake < cmake-boun...@cmake.org > on behalf of Cedric Doucet <
> cedric.dou...@inria.fr >
> Date: Thursday 10 December 2015 at 18:21
> To: " cmake@cmake.org " < cmake@cmake.org >
> Subject: [CMake] ExternalProject_Add and inheritance

> Hello,

> I use the ExternalProject_Add command to manage third-party libraries.
> In the same time, I need to overcome some compatibility problems between GCC
> 4 and GCC 5 (strings are not defined in the same way in the STL).
> The solution I use is the one given here:
> http://stackoverflow.com/questions/33500337/how-to-handle-dual-abi-in-gcc-5
> It allows me to force to use the libstdc++.so given by the GCC repository
> given to the cmake command.

> The problem is that trick does not work with the ExternalProject_Add command
> because configuration steps of third-party libraries are autonomous.
> Do you know how to solve the problem?

> For example, if I use the ExternalProject_Add command to manage a
> third-library whose configuration also depends on a cmake script, how could
> I tell this script to use the compilers and the libstdc++.so I provided to
> my own cmake script?

> Best,

> Cédric
-- 

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] ExternalProject_Add and inheritance

2015-12-10 Thread CHEVRIER, Marc
With CMake, you can control compilation and link flags with the following 
environment variables:

  *   CC: specify C compiler
  *   CFLAGS: C compiler flags
  *   CXX: specify C++ compiler
  *   CXXFLAGS: C++ compiler flags
  *   LDFLAGS: linker flags

And to finish you can overload make command for generation using CMAKE_COMMAND 
option of ExternalProject_Add:
CMAKE_CMMAND “${CMAKE_COMMAND}” -E env CXX=${CMAKE_CXX_COMPILER} LDFLAGS=“…” 
“${CMAKE_COMMAND}”



From: CMake mailto:cmake-boun...@cmake.org>> on behalf 
of Cedric Doucet mailto:cedric.dou...@inria.fr>>
Date: Thursday 10 December 2015 at 18:21
To: "cmake@cmake.org<mailto:cmake@cmake.org>" 
mailto:cmake@cmake.org>>
Subject: [CMake] ExternalProject_Add and inheritance


Hello,

I use the ExternalProject_Add command to manage third-party libraries.
In the same time, I need to overcome some compatibility problems between GCC 4 
and GCC 5 (strings are not defined in the same way in the STL).
The solution I use is the one given here:
http://stackoverflow.com/questions/33500337/how-to-handle-dual-abi-in-gcc-5
It allows me to force to use the libstdc++.so given by the GCC repository given 
to the cmake command.

The problem is that trick does not work with the ExternalProject_Add command 
because configuration steps of third-party libraries are autonomous.
Do you know how to solve the problem?

For example, if I use the ExternalProject_Add command to manage a third-library 
whose configuration also depends on a cmake script, how could I tell this 
script to use the compilers and the libstdc++.so I provided to my own cmake 
script?

Best,

Cédric
-- 

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] ExternalProject_Add and inheritance

2015-12-10 Thread Cedric Doucet

Hello, 

I use the ExternalProject_Add command to manage third-party libraries. 
In the same time, I need to overcome some compatibility problems between GCC 4 
and GCC 5 (strings are not defined in the same way in the STL). 
The solution I use is the one given here: 
http://stackoverflow.com/questions/33500337/how-to-handle-dual-abi-in-gcc-5 
It allows me to force to use the libstdc++.so given by the GCC repository given 
to the cmake command. 

The problem is that trick does not work with the ExternalProject_Add command 
because configuration steps of third-party libraries are autonomous. 
Do you know how to solve the problem? 

For example, if I use the ExternalProject_Add command to manage a third-library 
whose configuration also depends on a cmake script, how could I tell this 
script to use the compilers and the libstdc++.so I provided to my own cmake 
script? 

Best, 

Cédric 
-- 

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] ExternalProject_Add and proxy

2015-10-22 Thread D. Barbier
On 2015-10-21 18:07 GMT+02:00 Cedric Doucet wrote:
> Hello Denis!
>
> Thank you for your answer.
> Actually, there is no login and no password.
> It's an academic proxy.
> So the initial syntax of http_proxy should to be correct.

Hello,

CMake uses libcurl, so check your proxy settings with curl instead of wget.
As libcurl does not use any config file, pass -q flag, this should be
quite similar to libcurl and thus CMake.
For instance, if

  curl -q -I https://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz

works, CMake should work too.

Denis
-- 

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] ExternalProject_Add and proxy

2015-10-21 Thread Cedric Doucet



Hello Denis!

Thank you for your answer.
Actually, there is no login and no password.
It's an academic proxy.
So the initial syntax of http_proxy should to be correct.

Cédric

- Mail original -
> De: "D. Barbier" 
> À: "Cedric Doucet" 
> Cc: cmake@cmake.org
> Envoyé: Mercredi 21 Octobre 2015 17:35:47
> Objet: Re: [CMake] ExternalProject_Add and proxy
> 
> On 2015-10-21 14:58 GMT+02:00 Cedric Doucet wrote:
> >
> > Hello,
> >
> > I try to download a library with ExternalProject_Add.
> > The URL is correct and the CMake script works well, except when there is a
> > proxy to define.
> >
> > The URL is : http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz
> >
> > After having set
> >
> > http_proxy=http://proxy.name.fr:1234
> > https_proxy=https://proxy.name.fr:1234
> >
> > I can download the archive with: wget
> > http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz
> 
> Hello,
> 
> Since you do not provide login/password to your proxy, it is stored
> elsewhere, either in ~/.netrc or ~/.wgetrc.
> Delete these files and you will encounter the same problem.
> 
> > But when I type 'make' to use the ExternalProject_Add command, I get (after
> > some minutes):
> > ===
> > [ 44%] Performing download step (download, verify and extract) for 'eigen'
> > -- downloading...
> >  src='http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz'
> >
> > dst='/home/cdoucet/Documents/soutien/matherials/simol/build/third-party/eigen/download/3.2.4.tar.gz'
> >  timeout='none'
> > CMake Error at stamp/download-eigen.cmake:19 (message):
> >   error: downloading 'http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz'
> >   failed
> [...]
> 
> Try with
>   http_proxy=http://your_login:your_passw...@proxy.name.fr:1234
> 
> Denis
> 
-- 

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] ExternalProject_Add and proxy

2015-10-21 Thread D. Barbier
On 2015-10-21 14:58 GMT+02:00 Cedric Doucet wrote:
>
> Hello,
>
> I try to download a library with ExternalProject_Add.
> The URL is correct and the CMake script works well, except when there is a
> proxy to define.
>
> The URL is : http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz
>
> After having set
>
> http_proxy=http://proxy.name.fr:1234
> https_proxy=https://proxy.name.fr:1234
>
> I can download the archive with: wget
> http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz

Hello,

Since you do not provide login/password to your proxy, it is stored
elsewhere, either in ~/.netrc or ~/.wgetrc.
Delete these files and you will encounter the same problem.

> But when I type 'make' to use the ExternalProject_Add command, I get (after
> some minutes):
> ===
> [ 44%] Performing download step (download, verify and extract) for 'eigen'
> -- downloading...
>  src='http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz'
>
> dst='/home/cdoucet/Documents/soutien/matherials/simol/build/third-party/eigen/download/3.2.4.tar.gz'
>  timeout='none'
> CMake Error at stamp/download-eigen.cmake:19 (message):
>   error: downloading 'http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz'
>   failed
[...]

Try with
  http_proxy=http://your_login:your_passw...@proxy.name.fr:1234

Denis
-- 

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] ExternalProject_Add and proxy

2015-10-21 Thread Cedric Doucet

Hello, 

I try to download a library with ExternalProject_Add. 
The URL is correct and the CMake script works well, except when there is a 
proxy to define. 

The URL is : http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz 

After having set 

http_proxy=http://proxy.name.fr:1234 
https_proxy=https://proxy.name.fr:1234 

I can download the archive with: wget 
http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz 


But when I type 'make' to use the ExternalProject_Add command, I get (after 
some minutes): 
=== 
[ 44%] Performing download step (download, verify and extract) for 'eigen' 
-- downloading... 
src='http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz' 
dst='/home/cdoucet/Documents/soutien/matherials/simol/build/third-party/eigen/download/3.2.4.tar.gz'
 
timeout='none' 
CMake Error at stamp/download-eigen.cmake:19 (message): 
error: downloading 'http://bitbucket.org/eigen/eigen/get/3.2.4.tar.gz' 
failed 

status_code: 7 
status_string: "Couldn't connect to server" 
log: About to connect() to bitbucket.org port 80 (#0) 
Trying 131.103.20.167... Connection timed out 
Trying 131.103.20.168... Connection timed out 

couldn't connect to host 

Closing connection #0 

Couldn't connect to server 
=== 

Do you know how to solve this problem? 

Thank you very much! 

Cédric Doucet 

-- 

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] ExternalProject_Add // git shallow clone

2015-05-05 Thread David Cole via CMake
Of course. It would be useful. Perhaps you could propose a patch to add it?


On Tuesday, May 5, 2015, Sergei Nikulov  wrote:

> Hello David,
>
> Thank you for answer.
>
> It could be useful feature for ExternalProject.cmake
> What do your think?
>
>
> 2015-05-05 16:13 GMT+03:00 David Cole  >:
>
>> It's possible to do anything you want if you provide your own custom
>> DOWNLOAD_COMMAND.
>>
>> I'm not aware of any depth options exposed via ExternalProject_Add,
>> though.
>>
>>
>> HTH,
>> David C.
>>
>>
>> > On May 5, 2015, at 5:19 AM, Sergei Nikulov > > wrote:
>> >
>> > Hello All,
>> >
>> > Is it possible to provide git depth option for ExternalProject_Add
>> command?
>> > I see no such option for GIT_... parameters in documentation.
>> >
>> >
>> > Thank you.
>> >
>> >
>> > --
>> > Best Regards,
>> > Sergei Nikulov
>> > --
>> >
>> > 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
>>
>
>
>
> --
> Best Regards,
> Sergei Nikulov
>
-- 

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] ExternalProject_Add // git shallow clone

2015-05-05 Thread Sergei Nikulov
Hello David,

Thank you for answer.

It could be useful feature for ExternalProject.cmake
What do your think?


2015-05-05 16:13 GMT+03:00 David Cole :

> It's possible to do anything you want if you provide your own custom
> DOWNLOAD_COMMAND.
>
> I'm not aware of any depth options exposed via ExternalProject_Add, though.
>
>
> HTH,
> David C.
>
>
> > On May 5, 2015, at 5:19 AM, Sergei Nikulov 
> wrote:
> >
> > Hello All,
> >
> > Is it possible to provide git depth option for ExternalProject_Add
> command?
> > I see no such option for GIT_... parameters in documentation.
> >
> >
> > Thank you.
> >
> >
> > --
> > Best Regards,
> > Sergei Nikulov
> > --
> >
> > 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
>



-- 
Best Regards,
Sergei Nikulov
-- 

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] ExternalProject_Add // git shallow clone

2015-05-05 Thread David Cole via CMake
It's possible to do anything you want if you provide your own custom 
DOWNLOAD_COMMAND.

I'm not aware of any depth options exposed via ExternalProject_Add, though.


HTH,
David C.


> On May 5, 2015, at 5:19 AM, Sergei Nikulov  wrote:
> 
> Hello All,
> 
> Is it possible to provide git depth option for ExternalProject_Add command?
> I see no such option for GIT_... parameters in documentation.
> 
> 
> Thank you.
> 
> 
> -- 
> Best Regards,
> Sergei Nikulov
> -- 
> 
> 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


Re: [CMake] ExternalProject_Add // git shallow clone

2015-05-05 Thread David Cole via CMake
It's possible to do anything you want if you provide your own custom 
DOWNLOAD_COMMAND.

I'm not aware of any depth options exposed via ExternalProject_Add, though.


HTH,
David


> On May 5, 2015, at 5:19 AM, Sergei Nikulov  wrote:
> 
> Hello All,
> 
> Is it possible to provide git depth option for ExternalProject_Add command?
> I see no such option for GIT_... parameters in documentation.
> 
> 
> Thank you.
> 
> 
> -- 
> Best Regards,
> Sergei Nikulov
> -- 
> 
> 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] ExternalProject_Add // git shallow clone

2015-05-05 Thread Sergei Nikulov
Hello All,

Is it possible to provide git depth option for ExternalProject_Add command?
I see no such option for GIT_... parameters in documentation.


Thank you.


-- 
Best Regards,
Sergei Nikulov
-- 

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] ExternalProject_Add not re-building when source changes

2015-04-24 Thread Andrey Pokrovskiy
I don't like my current solution for such problem, but it works for me
well. Note "file(GLOB_RECURSE ..." and custom "copy" step in the end.
Also you can try to google "cmake super build" which probably will
provide you more ideas.

include(ExternalProject)

set(WEBSOCKETS_PATCH_DIR "${CMAKE_CURRENT_SOURCE_DIR}/patch")
set(WEBSOCKETS_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libwebsockets-1.4")
set(WEBSOCKETS_BUILD_SOURCE_DIR
"${CMAKE_CURRENT_BINARY_DIR}/libwebsockets-1.4.source")
set(WEBSOCKETS_BUILD_DIR "${CMAKE_CURRENT_BINARY_DIR}/libwebsockets-1.4.build")
set(WEBSOCKETS_INSTALL_PREFIX
"${CMAKE_CURRENT_BINARY_DIR}/libwebsockets-1.4.install")

ExternalProject_Add(websockets_ep
EXCLUDE_FROM_ALL 1
SOURCE_DIR ${WEBSOCKETS_BUILD_SOURCE_DIR}
BINARY_DIR ${WEBSOCKETS_BUILD_DIR}
DOWNLOAD_COMMAND ""
PATCH_COMMAND find ${WEBSOCKETS_PATCH_DIR} -name "*.patch" -exec
patch -d ${WEBSOCKETS_BUILD_SOURCE_DIR} -p1 -i {} $
INSTALL_DIR ${WEBSOCKETS_INSTALL_PREFIX}
CMAKE_ARGS
-DCMAKE_TOOLCHAIN_FILE:string=${CMAKE_TOOLCHAIN_FILE}
CMAKE_CACHE_ARGS
-DCMAKE_BUILD_TYPE:string=${CMAKE_BUILD_TYPE}
-DCMAKE_INSTALL_PREFIX:string=
-DCMAKE_PREFIX_PATH:string=${CMAKE_PREFIX_PATH})

file(GLOB_RECURSE WEBSOCKETS_SOURCES RELATIVE
"${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*")
ExternalProject_Add_Step(websockets_ep copy
COMMAND ${CMAKE_COMMAND} -E copy_directory
${WEBSOCKETS_SOURCE_DIR} ${WEBSOCKETS_BUILD_SOURCE_DIR}
DEPENDS ${WEBSOCKETS_SOURCES}
DEPENDEES download
DEPENDERS patch)

add_library(websockets INTERFACE)
target_include_directories(websockets INTERFACE
${WEBSOCKETS_INSTALL_PREFIX}/include)
target_link_libraries(websockets INTERFACE
${WEBSOCKETS_INSTALL_PREFIX}/lib/libwebsockets.a)
add_dependencies(websockets websockets_ep)

On Thu, Apr 23, 2015 at 4:54 PM, Rob McDonald  wrote:
> I've used ExternalProject_Add to trick CMake into supporting two
> compilers to build my project.
>
> Part of my project needs OpenMP, but other parts do not.  So, on
> MacOS, I would prefer to build most of the project with CLang, but the
> OpenMP requiring part with gcc.
>
> I have CMake set up to detect whether the compiler supports OpenMP.
> If it does not, it checks for a user-supplied alternate compiler.
>
> If the user has supplied an alternate compiler, CMake treats the
> current directory as an ExternalProject , but passes the alternate
> OpenMP capable compiler.
>
> In general, this works well.  However, this arrangement does not
> notice when the source files have changed and cause the External
> Project to rebuild.
>
> I'm using ExternalProject_ForceBuild to try to make the EP build every
> time -- that works, but once inside the EP, make doesn't recognize
> that the source files have been updated.
>
> The meat of the situation is something like this
>
> ExternalProject_Add( MYPROJECT
> URL ${CMAKE_CURRENT_SOURCE_DIR}
> CMAKE_ARGS -DCMAKE_C_COMPILER=${C_ALTERNATE_COMPILER}
> -DCMAKE_CXX_COMPILER=${CXX_ALTERNATE_COMPILER}
> -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
> -DEP_BUILD=TRUE
> INSTALL_COMMAND ""
> )
> EP_ForceBuild( MYPROJECT )
>
> I use the -DEP_BUILD=TRUE as an extra safety to prevent infinite
> recursion -- if the user supplied a non OpenMP capable compiler as the
> ALTERNATE_COMPILER.
>
> So, I think the problem is with my use of 'URL
> ${CMAKE_CURRENT_SOURCE_DIR}'.  Is there a better way to achieve the
> same thing?
>
> Thanks in advance,
>
> Rob
> --
>
> 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] ExternalProject_Add not re-building when source changes

2015-04-23 Thread Rob McDonald
I've used ExternalProject_Add to trick CMake into supporting two
compilers to build my project.

Part of my project needs OpenMP, but other parts do not.  So, on
MacOS, I would prefer to build most of the project with CLang, but the
OpenMP requiring part with gcc.

I have CMake set up to detect whether the compiler supports OpenMP.
If it does not, it checks for a user-supplied alternate compiler.

If the user has supplied an alternate compiler, CMake treats the
current directory as an ExternalProject , but passes the alternate
OpenMP capable compiler.

In general, this works well.  However, this arrangement does not
notice when the source files have changed and cause the External
Project to rebuild.

I'm using ExternalProject_ForceBuild to try to make the EP build every
time -- that works, but once inside the EP, make doesn't recognize
that the source files have been updated.

The meat of the situation is something like this

ExternalProject_Add( MYPROJECT
URL ${CMAKE_CURRENT_SOURCE_DIR}
CMAKE_ARGS -DCMAKE_C_COMPILER=${C_ALTERNATE_COMPILER}
-DCMAKE_CXX_COMPILER=${CXX_ALTERNATE_COMPILER}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DEP_BUILD=TRUE
INSTALL_COMMAND ""
)
EP_ForceBuild( MYPROJECT )

I use the -DEP_BUILD=TRUE as an extra safety to prevent infinite
recursion -- if the user supplied a non OpenMP capable compiler as the
ALTERNATE_COMPILER.

So, I think the problem is with my use of 'URL
${CMAKE_CURRENT_SOURCE_DIR}'.  Is there a better way to achieve the
same thing?

Thanks in advance,

Rob
-- 

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] ExternalProject_Add contributing to top-level Package

2015-04-05 Thread Rob McDonald
Ok, I think I've answered my own question...

I added the following after the ExternalProject_Add command...

ExternalProject_Get_Property( ALTBUILD BINARY_DIR )
INSTALL( PROGRAMS ${BINARY_DIR}/myprogram DESTINATION . )

Rob


On Sat, Apr 4, 2015 at 12:57 PM, Rob McDonald  wrote:
> All,
>
> I have a project that is typically compiled with CLang/LLVM.  However,
> I'm now adding a component that is preferentially built with OpenMP.
> CLang doesn't support OpenMP, so I'd like to build that component with
> GCC while still building everything else with CLang.
>
> So far, I'm approaching the problem as shown in the below
> CMakeLists.txt.  The program understands -DUSE_OPENMP, so if OpenMP
> isn't found, it will build a uni-processor version.  The user can
> optionally pass -DC_OMP_COMPILER and -DCXX_OMP_COMPILER when CMake is
> run.  Those will specify alternate OpenMP capable compilers.  The
> EP_BUILD variable prevents infinite recursion.
>
> So, in the case where the primary compiler does not support OpenMP,
> and the user specifies an alternate compiler, this will use
> ExternalProject_Add to establish a new build environment with the
> alternate compiler, and build that.  So far, so good.
>
> The problem I have is that I would like the executable built by
> ExternalProject to be added to the top-level project's package.  So,
> instead of the recursion protected INSTALL at the bottom, I want a
> roughly equivalent INSTALL command that specifically works in the
> ExternalProject case.
>
> Best,
>
> Rob
>
> #
> FIND_PACKAGE( OpenMP )
>
> if(OPENMP_FOUND)
>   set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} -DUSE_OPENMP")
>   set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -DUSE_OPENMP")
>   set(BUILD_IT true)
> else()
>
> if( CXX_OMP_COMPILER AND NOT EP_BUILD )
>
>   INCLUDE( ExternalProject )
>
>   set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake 
> ${CMAKE_MODULE_PATH})
>   INCLUDE( ExternalProject_ForceBuild )
>
>   ExternalProject_Add( ALTBUILD
> URL ${CMAKE_CURRENT_SOURCE_DIR}
> CMAKE_ARGS -DCMAKE_C_COMPILER=${C_OMP_COMPILER}
> -DCMAKE_CXX_COMPILER=${CXX_OMP_COMPILER}
> -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
> -DEP_BUILD=TRUE
> INSTALL_COMMAND ""
> )
> EP_ForceBuild( ALTBUILD )
>
>   else()
> set(BUILD_IT true)
>   endif()
> endif()
>
> if(BUILD_IT)
>
>   ADD_EXECUTABLE( myprogram
>   main.cpp
>   )
>
>   TARGET_LINK_LIBRARIES( myprogram
>   )
>
>   if ( NOT EP_BUILD )
> INSTALL( TARGETS myprogram RUNTIME DESTINATION . )
>   endif()
>
> endif()
-- 

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] ExternalProject_Add contributing to top-level Package

2015-04-04 Thread Rob McDonald
All,

I have a project that is typically compiled with CLang/LLVM.  However,
I'm now adding a component that is preferentially built with OpenMP.
CLang doesn't support OpenMP, so I'd like to build that component with
GCC while still building everything else with CLang.

So far, I'm approaching the problem as shown in the below
CMakeLists.txt.  The program understands -DUSE_OPENMP, so if OpenMP
isn't found, it will build a uni-processor version.  The user can
optionally pass -DC_OMP_COMPILER and -DCXX_OMP_COMPILER when CMake is
run.  Those will specify alternate OpenMP capable compilers.  The
EP_BUILD variable prevents infinite recursion.

So, in the case where the primary compiler does not support OpenMP,
and the user specifies an alternate compiler, this will use
ExternalProject_Add to establish a new build environment with the
alternate compiler, and build that.  So far, so good.

The problem I have is that I would like the executable built by
ExternalProject to be added to the top-level project's package.  So,
instead of the recursion protected INSTALL at the bottom, I want a
roughly equivalent INSTALL command that specifically works in the
ExternalProject case.

Best,

Rob

#
FIND_PACKAGE( OpenMP )

if(OPENMP_FOUND)
  set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS} -DUSE_OPENMP")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS} -DUSE_OPENMP")
  set(BUILD_IT true)
else()

if( CXX_OMP_COMPILER AND NOT EP_BUILD )

  INCLUDE( ExternalProject )

  set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH})
  INCLUDE( ExternalProject_ForceBuild )

  ExternalProject_Add( ALTBUILD
URL ${CMAKE_CURRENT_SOURCE_DIR}
CMAKE_ARGS -DCMAKE_C_COMPILER=${C_OMP_COMPILER}
-DCMAKE_CXX_COMPILER=${CXX_OMP_COMPILER}
-DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE}
-DEP_BUILD=TRUE
INSTALL_COMMAND ""
)
EP_ForceBuild( ALTBUILD )

  else()
set(BUILD_IT true)
  endif()
endif()

if(BUILD_IT)

  ADD_EXECUTABLE( myprogram
  main.cpp
  )

  TARGET_LINK_LIBRARIES( myprogram
  )

  if ( NOT EP_BUILD )
INSTALL( TARGETS myprogram RUNTIME DESTINATION . )
  endif()

endif()
-- 

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] ExternalProject_Add, static library, Ninja generator

2015-04-02 Thread Charles Nicholson
I see now; thank you for the explanation.

Best,
Charles

On Thu, Apr 2, 2015, 7:17 AM Nils Gladitz  wrote:

> On 04/02/2015 04:05 PM, Charles Nicholson wrote:
> > Thanks for the quick response, Nils, that fixed it!
> >
> > I'm curious, though, why wasn't simply marking my lib as depending on
> > the externalproject_add target enough? I like using the byproducts line
> > since it's more exact and descriptive, but shouldn't it work without
> that?
>
> The target dependency takes care of order which is enough for the other
> generators.
>
> Ninja in particular needs to account for the library file that you
> depend on in the beginning.
>
> Without marking it a byproduct ninja does not know that it is a file
> that will be created later on by one of your targets and assumes it
> missing.
>
> 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] ExternalProject_Add, static library, Ninja generator

2015-04-02 Thread Nils Gladitz

On 04/02/2015 04:05 PM, Charles Nicholson wrote:

Thanks for the quick response, Nils, that fixed it!

I'm curious, though, why wasn't simply marking my lib as depending on
the externalproject_add target enough? I like using the byproducts line
since it's more exact and descriptive, but shouldn't it work without that?


The target dependency takes care of order which is enough for the other 
generators.


Ninja in particular needs to account for the library file that you 
depend on in the beginning.


Without marking it a byproduct ninja does not know that it is a file 
that will be created later on by one of your targets and assumes it missing.


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] ExternalProject_Add, static library, Ninja generator

2015-04-02 Thread Charles Nicholson
Thanks for the quick response, Nils, that fixed it!

I'm curious, though, why wasn't simply marking my lib as depending on the
externalproject_add target enough? I like using the byproducts line since
it's more exact and descriptive, but shouldn't it work without that?

Thanks again,
Charles

On Wed, Apr 1, 2015 at 11:42 PM, Nils Gladitz  wrote:

> On 04/02/2015 07:15 AM, Charles Nicholson wrote:
>
>  I'm assuming that I'm not correctly expressing the dependencies. Would
>> anyone mind taking a quick look? I'd really appreciate it!
>>
>
> Try adding the following to your ExternalProject_Add call:
>   BUILD_BYPRODUCTS ${HIDAPI_ROOT}/bin/lib/libhidapi.a
>
> This is required so that the ninja generator knows which target produces
> the named output.
>
> 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] ExternalProject_Add, static library, Ninja generator

2015-04-01 Thread Nils Gladitz

On 04/02/2015 07:15 AM, Charles Nicholson wrote:


I'm assuming that I'm not correctly expressing the dependencies. Would
anyone mind taking a quick look? I'd really appreciate it!


Try adding the following to your ExternalProject_Add call:
  BUILD_BYPRODUCTS ${HIDAPI_ROOT}/bin/lib/libhidapi.a

This is required so that the ninja generator knows which target produces 
the named output.


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


[CMake] ExternalProject_Add, static library, Ninja generator

2015-04-01 Thread Charles Nicholson
Hi all-

I'm using ExternalProject_Add to pull down, configure, build, and install
the OSS "hidapi" project.

The output of the hidapi build is, among other things, a library called
libhidapi.a. I'm creating an imported static library using add_library, and
then using add_dependency to indicate that the library depends on the
ExternalProject_Add target.

I've seen examples of this approach here

and here
,
but can't get it working.

The funny part is that this works fine using the Makefile generator but
fails with the Ninja generator.

I've put up a very small and self-contained repro case here:
https://github.com/charlesnicholson/cmake-external-project-test

It requires that cmake and ninja are installed (I'm using cmake 3.2.1 and
ninja v1.5.3.). Other than that, just clone and run ./b from the root.

I'm assuming that I'm not correctly expressing the dependencies. Would
anyone mind taking a quick look? I'd really appreciate it!

Thanks in advance,
Charles
-- 

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] ExternalProject_Add + find_package

2015-03-09 Thread Alvaro Denis
Hello,
I am using cmake(I am a novice) for a big project, this contain multiple
independent projects(no use add_subdirectory), so take an example:
Project A depend of B, when  I run cmake for A this check for B with
find_package(), if this fail the user is notified and need install
B, I think that manage this automatically is desirable, I propose
ExternalProject_Add, so this download, configure, build and install the
dependence automatically but my problem is:
When I execute cmake for A this say that B not found, so find this
and install, but then the "first" make fail because the first time the
"imported targets"
are empty, so I need rerun cmake, this time find_package()
fill the "imported targets" and build ok.
How I can avoid this(execute cmake ; make ; cmake ; make).
Thanks a lot.

-- 

   [image: --]

ALvaro Denis Acosta
[image: http://]about.me/denisacostaq
   
-- 

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] ExternalProject_Add: directing cmake to a different

2015-02-07 Thread Miklos Espak
Specify a patch command that creates a toplevel cmake list with one
'add_subdirectory(A)'  line.

On Sun, 8 Feb 2015 4:14 am Neil Carlson  wrote:

> I'm trying to get ExternalProject_Add to build a TPL that doesn't have a
> CMakeLists.txt file in the top-level directory.  The TPL untars as
> foo/{A,B} where A and B each contain a CMakeLists.txt file and are
> independent of each other.  I only want to build "A" and would like to have
> cmake run with "foo/A" as the .  Unfortunately I can't seem
> to manage it. The tar file is unpacked with ${SOURCE_DIR} as its root, and
> that same directory is used as the  for the cmake command
> -- I want ${SOURCE_DIR}/A.  Any suggestions on how to make ExternalProject
> do what I want?  Clearly I can just repackage the tar file, but I'd rather
> use the pristine tar file if I can.
>
> Thanks
> --
>
> 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] ExternalProject_Add: directing cmake to a different

2015-02-07 Thread Neil Carlson
I'm trying to get ExternalProject_Add to build a TPL that doesn't have a
CMakeLists.txt file in the top-level directory.  The TPL untars as
foo/{A,B} where A and B each contain a CMakeLists.txt file and are
independent of each other.  I only want to build "A" and would like to have
cmake run with "foo/A" as the .  Unfortunately I can't seem
to manage it. The tar file is unpacked with ${SOURCE_DIR} as its root, and
that same directory is used as the  for the cmake command
-- I want ${SOURCE_DIR}/A.  Any suggestions on how to make ExternalProject
do what I want?  Clearly I can just repackage the tar file, but I'd rather
use the pristine tar file if I can.

Thanks
-- 

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] ExternalProject_add and add_subdirectory in one step

2015-02-06 Thread Petr Kmoch
Hi Franz.

The "canonical" approach to ExternalProject is to use a "superbuild" setup.
Design your top-level CMakeList so that it *only* contains
ExternalProject_add() calls, treating your "original" project as just
another external project. Build the superbuild once, getting all the
dependencies downloaded, built, installed etc. as necessary. Then, switch
to working with only your "original" project subcomponent of the superbuild.

Petr

On Thu, Feb 5, 2015 at 5:32 PM, Franz Engel  wrote:

>  Hi,
>
>
>
> I try to clone an repository from my bare-repository and to build my
> project tree. Therefore I use the following commands:
>
>
>
> ExternalProject_Add ( demoA
>
>PREFIX ${MAIN_PATH}/demoA
>
>GIT_REPOSITORY ${REPOSITORY_PATH}/demoA
>
>GIT_TAG origin/master
>
>UPDATE_COMMAND ""
>
>INSTALL_COMMAND "" )
>
>
>
> add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../demoA/src/DemoA
> ${CMAKE_CURRENT_SOURCE_DIR}/demoA)
>
>
>
> Know I have the following problem. I load the Cmake-file with QtCreator.
> If I run CMake I get the error message “does not contain a CMakeLists.txt
> file”. That message is clear for me, because the repository only get loaded
> when I compile the code. The question is, if it is possible to clone the
> repo in the step of CMake. Does somebody has an idea? Or is there another
> method to build the project tree?
>
>
>
> Br,
>
> Franz
>
> --
>
>
> Franz Engel
>
> AIRBUS APWORKS GmbH
> 81663 Munich - Germany
> T: +49 (0) 89 607 29103
> M: +49 (0) 170 44 59 006
> franz.en...@apworks.de
>
> AIRBUS APWORKS GmbH
> Registered Office: Ottobrunn
> District Court of Munich: HRB 141734
> Managing Director: Joachim Zettler
> Internet: www.apworks.de
>
> --
>
>
>
> --
>
> 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] ExternalProject_add and add_subdirectory in one step

2015-02-05 Thread Franz Engel
Hi,

I try to clone an repository from my bare-repository and to build my project 
tree. Therefore I use the following commands:

ExternalProject_Add ( demoA
   PREFIX ${MAIN_PATH}/demoA
   GIT_REPOSITORY ${REPOSITORY_PATH}/demoA
   GIT_TAG origin/master
   UPDATE_COMMAND ""
   INSTALL_COMMAND "" )

add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/../demoA/src/DemoA 
${CMAKE_CURRENT_SOURCE_DIR}/demoA)

Know I have the following problem. I load the Cmake-file with QtCreator. If I 
run CMake I get the error message "does not contain a CMakeLists.txt file". 
That message is clear for me, because the repository only get loaded when I 
compile the code. The question is, if it is possible to clone the repo in the 
step of CMake. Does somebody has an idea? Or is there another method to build 
the project tree?

Br,
Franz

___
 
Franz Engel

AIRBUS APWORKS GmbH
81663 Munich - Germany 
T: +49 (0) 89 607 29103   
M: +49 (0) 170 44 59 006  
franz.en...@apworks.de 

AIRBUS APWORKS GmbH
Registered Office: Ottobrunn
District Court of Munich: HRB 141734
Managing Director: Joachim Zettler
Internet: www.apworks.de
___

-- 

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] ExternalProject_Add with custom build/make command for Boost

2014-09-25 Thread David Cole via CMake
INSTALL_COMMAND ""

should work. (Assuming you're doing "./b2 install" as the BUILD_COMMAND...?)

Check out how the open chemistry project builds boost as an
ExternalProject as a reference point:
https://github.com/OpenChemistry/openchemistry/blob/master/cmake/External_boost.cmake


HTH,
David C.


On Thu, Sep 25, 2014 at 5:40 PM, Nicholas Yue  wrote:
> Hi,
>
>   I am trying to build Boost (1.47.0) using CMake's ExternalProject_Add()
>
>   I got it to build and install via it's bjam "./b2 install"
>
>   However, there is an implicit "make install" generated by CMake which will
> fail because there is no Makefile so to speak with an install target.
>
>   ExternalProject_Add() has many configuration parameter and I am wondering
> if there is one which I can use to tell it not to attempt to "make install"
>
> Cheers
> --
> Nicholas Yue
> Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5
> Custom Dev - C++ porting, OSX, Linux, Windows
> http://au.linkedin.com/in/nicholasyue
> https://vimeo.com/channels/naiadtools
>
> --
>
> 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] ExternalProject_Add with custom build/make command for Boost

2014-09-25 Thread Nicholas Yue
Hi,

  I am trying to build Boost (1.47.0) using CMake's ExternalProject_Add()

  I got it to build and install via it's bjam "./b2 install"

  However, there is an implicit "make install" generated by CMake which
will fail because there is no Makefile so to speak with an install target.

  ExternalProject_Add() has many configuration parameter and I am wondering
if there is one which I can use to tell it not to attempt to "make install"

Cheers
-- 
Nicholas Yue
Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5
Custom Dev - C++ porting, OSX, Linux, Windows
http://au.linkedin.com/in/nicholasyue
https://vimeo.com/channels/naiadtools
-- 

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] ExternalProject_Add dependency graph (dot/graphviz?) ?

2014-09-23 Thread Nicholas Yue
Hi Micha,

  My interest is in "show me the dependencies the external project depends
on"

  I am considering migrating an in-house build system to build opensource
projects to using CMake.
  As there are many external packages and versions (close to 100), I'd like
to be able to visualize their dependency.
  Once the new system based on CMake is working, I need to build them for
different target OS to assist in migration from current OS to future OS
version.

  e.g.

ExternalProject_Add ( python264_static

  )

ExternalProject_Add ( python264
  DEPENDS
  python264_static

  )

ExternalProject_Add ( boost_1_47_0
  DEPENDS
  python264

  )

ExternalProject_Add ( alembic_1_5_5
  DEPENDS
  python264 boost_1_47_0

  )

Cheers


On 23 September 2014 11:58, Micha Hergarden 
wrote:

> On 09/22/2014 04:59 PM, Nicholas Yue wrote:
> > Hi,
> >
> > CMake has graphviz output capability for dependency within a project.
> >
> > Is there a way to graph dependency at the ExternalProject_Add()
> > level ?
> >
> > Cheers
> >
> Hello Nicholas,
>
> Can you clarify your question a bit more? Do you mean 'show me the
> external projects a target in my project depends on' or do you mean
> 'show me the dependencies the external project depens on', or something
> different altogether?
>
> With kind regards,
> Micha Hergarden
>
>


-- 
Nicholas Yue
Graphics - Arnold, Alembic, RenderMan, OpenGL, HDF5
Custom Dev - C++ porting, OSX, Linux, Windows
http://au.linkedin.com/in/nicholasyue
https://vimeo.com/channels/naiadtools
-- 

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] ExternalProject_Add dependency graph (dot/graphviz?) ?

2014-09-23 Thread Micha Hergarden
On 09/22/2014 04:59 PM, Nicholas Yue wrote:
> Hi,
>
> CMake has graphviz output capability for dependency within a project.
>
> Is there a way to graph dependency at the ExternalProject_Add()
> level ?
>
> Cheers
>
Hello Nicholas,

Can you clarify your question a bit more? Do you mean 'show me the
external projects a target in my project depends on' or do you mean
'show me the dependencies the external project depens on', or something
different altogether?

With kind regards,
Micha Hergarden



signature.asc
Description: OpenPGP digital signature
-- 

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] ExternalProject_Add dependency graph (dot/graphviz?) ?

2014-09-22 Thread Nicholas Yue

Hi,

CMake has graphviz output capability for dependency within a project.

Is there a way to graph dependency at the ExternalProject_Add() level ?

Cheers

--
Nicholas Yue
Graphics - RenderMan, Visualization, OpenGL, HDF5
Custom Dev - C++ porting, OSX, Linux, Windows
http://au.linkedin.com/in/nicholasyue
https://vimeo.com/channels/naiadtools

--

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] ExternalProject_Add always try to connect to SVN server

2014-09-15 Thread David Cole via CMake
If you are using SVN_REVISION with a specific revision number like 
that, you can do:


   UPDATE_COMMAND ""

because there is never any need to update after the initial checkout at 
that revision.


If you then later change to another revision, the parameters to the svn 
checkout ("dowload") step change when you change the revision number, 
and it should do another checkout on a subsequent build after that.



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


[CMake] ExternalProject_Add always try to connect to SVN server

2014-09-13 Thread Anton Deguet
Hello,

I'm wondering if I'm doing something wrong using ExternalProject_Add for a 
subversion repository.  I would expect the following behavior:

- First run, see if local copy of code has been checked out.  If not 'svn 
checkout'.  Fails if not connected to internet.
- Consecutive runs:
  - if svn local revision different from SVN_REVISION, do a `svn update` to 
revision specified in ExternalProject_Add
  - if svn local revision same as requested, do nothing

I'm having some issues with the last case, i.e. the code is checked out and 
'svn info' tells me I have the desired revision but somehow the build process 
is still trying to reach the svn server.   Since I'm working off the grid, my 
build fails.

Questions:
- Did I do something wrong or set an options somewhere that forces CMake to 
check the SVN server systematically?
- Is there an option or command I can set to build when not connected to 
internet?

Sincerely,

Anton


CMake version:  2.8.12.2 on Ubuntu 14.04
Code:
  include (ExternalProject)
  set (cisstJSON_PREFIX cisstJSONExternal)
  set (CISST_JSON_SVN_REPOSITORY 
http://svn.code.sf.net/p/jsoncpp/code/trunk/jsoncpp)
  set (CISST_JSON_SVN_REVISION 276)
  ExternalProject_Add (cisstJSONExternal
   PREFIX ${cisstJSON_PREFIX}
   SVN_REPOSITORY ${CISST_JSON_SVN_REPOSITORY}
   SVN_REVISION   -r ${CISST_JSON_SVN_REVISION}
   CMAKE_CACHE_ARGS 
-DCMAKE_OSX_ARCHITECTURES:STRING=${CMAKE_OSX_ARCHITECTURES}

-DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}

-DCMAKE_CXX_FLAGS:STRING=${CMAKE_CXX_FLAGS}
-DOPTION_BUILD_EXAMPLES:BOOL=OFF
-DJSONCPP_WITH_TESTS:BOOL=OFF

-DJSONCPP_WITH_POST_BUILD_UNITTEST:BOOL=OFF

-DCMAKE_INSTALL_PREFIX:FILEPATH=${cisst_BINARY_DIR}/cisstJSON
   INSTALL_DIR ${cisst_BINARY_DIR}/cisstJSON
   TIMEOUT 3
   )


-- 

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] ExternalProject_Add show sources in Visual Studio

2014-03-20 Thread NoRulez
Ok, thank you very much.

I will try your examples.

Best Regards

> Am 19.03.2014 um 15:40 schrieb David Cole :
> 
> That's one "workaround". Two more come to mind:
> 
> (1) Another would be to force the configure/build steps of an external 
> project to run *always* rather than when the stamp file indicates they are 
> out of date. You could take a look at the open chemistry super build to see 
> an example.
> 
> Specifically, check out the code here:
> 
>
> https://github.com/OpenChemistry/openchemistry/blob/master/CMakeLists.txt#L32
> 
> And here:
> 
>
> https://github.com/OpenChemistry/openchemistry/blob/master/cmake/External_avogadrolibs.cmake#L20
> 
> Then, when forced, a build of the outer project will always trigger the build 
> of the external project and make sure it's up to date with respect to its own 
> source tree.
> 
> But, if you have a lot of these, it just slows your build down in the normal 
> case of not changing anything in the external projects. So use it sparingly, 
> not globally.
> 
> (2) One more workaround worth mentioning: the manual one. ExternalProject_Add 
> will generate VS projects for the sub-projects if they are CMake-based and 
> your containing project is using a VS generator, and then open the generated 
> sub-projects directly to see the "normal" view of things. Make mods in there, 
> and build/install in there, then go back to your containing project, and it's 
> already up to date.
> 
> To each his own... Good luck.
> 
> 
> HTH,
> David C.
> 
> 
> 
> -Original Message-
> From: NoRulez 
> To: David Cole 
> Cc: cmake 
> Sent: Wed, Mar 19, 2014 9:48 am
> Subject: Re: [CMake] ExternalProject_Add show sources in Visual Studio
> 
> 
> Ok, so the only "workaround" to archive this is to use "file(GLOB_RECURS...)"
> and rebuild the changed external project. Right?
> 
> Best Regards
> 
>> Am 19.03.2014 um 12:44 schrieb David Cole :
>> 
>> Well, that sounds like the perfect way to use ExternalProject.
>> 
>> But why do you want to show the sources in Visual Studio? Just for
> ease of
> looking at them?
>> 
>> As I said in my earlier reply... even if we showed the sources,
> editing them
> would not trigger a rebuild of the external project. The dependencies are
> tracked via custom commands and stamp files that indicate last successful run
> time of those custom commands. They are not tracked by Visual Studio on a
> per-source-file/per-obj-file basis as they are in a normal VS project.
>> 
>> The main goal of ExternalProject is to provide an easy-to-use way of
> *building*, *installing* and depending on an external project... It is most
> definitely NOT to provide an easy way to do active development on a project.
>> 
>> If you need to see the sources for something that you're building
> within
> Visual Studio, then to me, that's a big red flag that it should not be an
> external project.
>> 
>> 
>> 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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add show sources in Visual Studio

2014-03-19 Thread David Cole

That's one "workaround". Two more come to mind:

(1) Another would be to force the configure/build steps of an external 
project to run *always* rather than when the stamp file indicates they 
are out of date. You could take a look at the open chemistry super 
build to see an example.


Specifically, check out the code here:


https://github.com/OpenChemistry/openchemistry/blob/master/CMakeLists.txt#L32


And here:


https://github.com/OpenChemistry/openchemistry/blob/master/cmake/External_avogadrolibs.cmake#L20


Then, when forced, a build of the outer project will always trigger the 
build of the external project and make sure it's up to date with 
respect to its own source tree.


But, if you have a lot of these, it just slows your build down in the 
normal case of not changing anything in the external projects. So use 
it sparingly, not globally.


(2) One more workaround worth mentioning: the manual one. 
ExternalProject_Add will generate VS projects for the sub-projects if 
they are CMake-based and your containing project is using a VS 
generator, and then open the generated sub-projects directly to see the 
"normal" view of things. Make mods in there, and build/install in 
there, then go back to your containing project, and it's already up to 
date.


To each his own... Good luck.


HTH,
David C.



-Original Message-
From: NoRulez 
To: David Cole 
Cc: cmake 
Sent: Wed, Mar 19, 2014 9:48 am
Subject: Re: [CMake] ExternalProject_Add show sources in Visual Studio


Ok, so the only "workaround" to archive this is to use 
"file(GLOB_RECURS...)"

and rebuild the changed external project. Right?

Best Regards


Am 19.03.2014 um 12:44 schrieb David Cole :

Well, that sounds like the perfect way to use ExternalProject.

But why do you want to show the sources in Visual Studio? Just for 

ease of
looking at them?


As I said in my earlier reply... even if we showed the sources, 

editing them
would not trigger a rebuild of the external project. The dependencies 
are
tracked via custom commands and stamp files that indicate last 
successful run
time of those custom commands. They are not tracked by Visual Studio on 
a

per-source-file/per-obj-file basis as they are in a normal VS project.


The main goal of ExternalProject is to provide an easy-to-use way of
*building*, *installing* and depending on an external project... It is 
most
definitely NOT to provide an easy way to do active development on a 
project.


If you need to see the sources for something that you're building 

within
Visual Studio, then to me, that's a big red flag that it should not be 
an

external project.



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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add show sources in Visual Studio

2014-03-19 Thread NoRulez
Ok, so the only "workaround" to archive this is to use "file(GLOB_RECURS...)" 
and rebuild the changed external project. Right?

Best Regards

> Am 19.03.2014 um 12:44 schrieb David Cole :
> 
> Well, that sounds like the perfect way to use ExternalProject.
> 
> But why do you want to show the sources in Visual Studio? Just for ease of 
> looking at them?
> 
> As I said in my earlier reply... even if we showed the sources, editing them 
> would not trigger a rebuild of the external project. The dependencies are 
> tracked via custom commands and stamp files that indicate last successful run 
> time of those custom commands. They are not tracked by Visual Studio on a 
> per-source-file/per-obj-file basis as they are in a normal VS project.
> 
> The main goal of ExternalProject is to provide an easy-to-use way of 
> *building*, *installing* and depending on an external project... It is most 
> definitely NOT to provide an easy way to do active development on a project.
> 
> If you need to see the sources for something that you're building within 
> Visual Studio, then to me, that's a big red flag that it should not be an 
> external project.
> 
> 
> 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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add show sources in Visual Studio

2014-03-19 Thread David Cole

Well, that sounds like the perfect way to use ExternalProject.

But why do you want to show the sources in Visual Studio? Just for ease 
of looking at them?


As I said in my earlier reply... even if we showed the sources, editing 
them would not trigger a rebuild of the external project. The 
dependencies are tracked via custom commands and stamp files that 
indicate last successful run time of those custom commands. They are 
not tracked by Visual Studio on a per-source-file/per-obj-file basis as 
they are in a normal VS project.


The main goal of ExternalProject is to provide an easy-to-use way of 
*building*, *installing* and depending on an external project... It is 
most definitely NOT to provide an easy way to do active development on 
a project.


If you need to see the sources for something that you're building 
within Visual Studio, then to me, that's a big red flag that it should 
not be an external project.



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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add show sources in Visual Studio

2014-03-19 Thread NoRulez
Because the external projects depends on different library versions than the 
"SuperProject". Maybe I misconfigured something, but i don't know an 
alternative.

E.g.: super project (AA) builds with version 9 of library X.

The external project B requires version 5 of library X and had some source 
files.

The external project C requires version 3 of library X and had some different 
sources.

The external projects are only shared libraries (which are also standalone 
projects with there own source tree) which are then used by the super project.

If I understand it correctly then ExternalProject_Add should be the solution 
for this, right?

Best Regards

> Am 17.03.2014 um 15:24 schrieb David Cole :
> 
> Why do you want to do that?
> 
> The ExternalProject will not rebuild correctly when you modify these source 
> files... Unless you are forcing the build step to run every single time.
> 
> You are using ExternalProject as if it were NOT external. Why not just use 
> add_subdirectory instead and have an "internal" project?
> 
> 
> D
> 
-- 

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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add show sources in Visual Studio

2014-03-17 Thread David Cole

Why do you want to do that?

The ExternalProject will not rebuild correctly when you modify these 
source files... Unless you are forcing the build step to run every 
single time.


You are using ExternalProject as if it were NOT external. Why not just 
use add_subdirectory instead and have an "internal" project?



D

--

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://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] ExternalProject_Add show sources in Visual Studio

2014-03-17 Thread NoRulez
I've added the source files with "file(GLOB_RECURSE..." and set source file 
property for each of these files with HEADER_FILE_OLY to TRUE.

It seems to work, but I'm not sure if this is the right way.


> Am 17.03.2014 um 08:49 schrieb NoRulez :
> 
> Hello,
> 
> if I add an external project with ExternalProject_Add, is it possible to show 
> the sources of that project in Visual Studio too?
> 
> I don't know if this is the reason, but currently the projects type is set to 
> utility.
> 
> Best Regards
> -- 
> 
> 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://www.cmake.org/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://www.cmake.org/mailman/listinfo/cmake


  1   2   >