Re: [CMake] Get Visual Studio target Arch

2014-09-16 Thread Gilles Khouzam
Hi David, Alexey

I'm glad to hear your enthusiasm about our involvement with CMake. We're still 
trying to understand the issues that people are facing and how we can help 
improve those. The multi-platform support is something somewhat experimental 
that will have issues, but getting feedback will help address the issues that 
you might run into. 

Alexey, the issue with CMAKE_SYSTEM_PROCESSOR seems to come from the 
CMakeDetermineSystem.cmake (lines 110 and below) file which only sets it for 
WINCE based on the MSVC_C_ARCHITECTURE_ID and uses the HOST processor 
otherwise. That's probably why you're seeing AMD64 all the time. My initial 
thought is that using MSVC_C_ARCHITECTURE_ID should give you at least the right 
processor for the compile.

BTW, I've only enabled the multiplatform support for cross-compiling for 
Windows Phone and Windows Store apps (to reduce the potential regressions) but 
if you would like to have it for native Windows apps, I should be able to 
easily enable it.

Looking forward to being able to help more.

Gilles Khouzam
Senior Development Lead
Microsoft OSG

-Original Message-
From: David Cole [mailto:dlrd...@aol.com] 
Sent: Tuesday, September 16, 2014 03:37
To: alexey.petruc...@gmail.com; Gilles Khouzam
Cc: cmake@cmake.org
Subject: Re: [CMake] Get Visual Studio target Arch

> I still cant really make some arch specific ifdefs in my cmake scripts 
> using this approach.


That's the point of a multi-configuration, multi-architecture Visual Studio 
solution: you defer choosing the configuration *and* the architecture until 
build time.

No "CMake time" decisions are possible based on the configuration or the 
architecture with this approach because neither is known until compile time.

It is inappropriate to "choose the configuration or architecture" in CMake code 
with this approach, and you should re-think about it and see if you can make 
compile time decisions instead, possibly with #ifdef sections in your C/C++ 
code...

Rather than re-organize your libraries, you could easily just use 
"win32/libs/$(Platform)" as your value when using the VS generators, and this 
should work.


By the way, Gilles, I echo the sentiment: nice work! I wish MS had gotten 
involved in CMake even earlier... but welcome!


HTH,
David C.


-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] FW: Parallel GNU make issue

2014-09-16 Thread Hennigan, Gary L
Bill and David,

Thanks for the replies. I had to shift to something else for a bit but I'm back 
to looking at this...

Bill, I'm not sure what you mean by "external projects"? My software is built 
as part of a large suite of open-source software collectively named Trilinos 
that is owned, or at least managed, by my company. My own code project isn't 
directly part of the Trilinos project but they have  a mechanism that allows 
for the build of my code to be incorporated into their build process. All of 
the software being built is either part of Trilinos or my own code. Nothing 
from "outside" is included in the build. All of it relies on cmake.

David, memory usage was certainly a  good thought, but from what I can tell 
there's no memory issue. While the build is huge it's on a system with 128GB of 
RAM and while it's a bit tricky getting memory usage of a process on Linux, use 
of "ps", "free", and "vmstat" didn't seem to indicate that memory usage was an 
issue.

I did notice, by using "ps -ef" during the "ctest" build, there are lots of 
zombie cmake processes. I suspect these zombies are eating up the GNU-make 
parallel slots that are available. I have no idea why these are being created 
and why they're not being killed.

Anyway, I believe we have a support contract with Kitware so I'm going to track 
down the proper local contacts to use that "official" channel. 

Thanks again,
Gary

-Original Message-

Date: Thu, 11 Sep 2014 17:28:31 -0400
From: Bill Hoffman 
To: cmake@cmake.org
Subject: Re: [CMake] FW: Parallel GNU make issue
Message-ID: <541213ff.3020...@kitware.com>
Content-Type: text/plain; charset=windows-1252; format=flowed

On 9/11/2014 4:09 PM, Hennigan, Gary L wrote:
> Thanks for the reply Chuck.
Do you have an external projects in this build?

-Bill



--

Date: Thu, 11 Sep 2014 21:15:42 -0400
From: David Cole 
To: glhe...@sandia.gov, chuck.atk...@kitware.com
Cc: cmake@cmake.org
Subject: Re: [CMake] FW: Parallel GNU make issue
Message-ID: <8d19c3e352a769f-2b64-43...@webmail-m253.sysops.aol.com>
Content-Type: text/plain; charset="us-ascii"; format=flowed

Is there a significant amount of output from make? What does make do if it's 
running low on RAM?

ctest may be holding onto "too much" memory trying to process the output if 
it's very large...

Just a thought -- worth a look, though.


D



--

Subject: Digest Footer

-- 

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

--

End of CMake Digest, Vol 125, Issue 23
**
-- 

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] QUIET option removes all output of find_package

2014-09-16 Thread Nicola Mori via CMake

According to the Cmake documentation for find_package:

  http://www.cmake.org/cmake/help/v3.0/command/find_package.html

the QUIET option should suppress the output only when a package cannot
be found:

"The QUIET option disables messages if the package cannot be found."

From my experience, QUIET removes all the output, even when the package
has been found. For example in my custom module I print the result of
find using this:

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ROOT FOUND_VAR ROOT_FOUND
REQUIRED_VARS ROOT_CONFIG_EXECUTABLE
ROOTSYS ROOT_VERSION ROOT_INCLUDE_DIR ROOT_LIBRARIES ROOT_LIBRARY_DIR
VERSION_VAR ROOT_VERSION)

Without the QUIET option, on a successful search I get:

-- Found ROOT: /home/mori/software/install/ROOT_5.34.20/bin/root-config
(found version "5.34.20")

while with QUIET I don't get any output, even when the package has been
found.

Is this the intended behaviour? Maybe I misinterpreted the 
documentation or maybe I'm doping something wrong with 
find_package_handle_standard_args?

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] project not found despite being found

2014-09-16 Thread Nils Gladitz

On 16.09.2014 17:38, Biddiscombe, John A. wrote:

"
   Found package configuration file:

 /Users/biddisco/build/cmakesuper/xxx/xxx-config.cmake

   but it set xxx_FOUND to FALSE so package “xxx" is
   considered to be NOT FOUND.
“

Which is not expected. If I set xxx_FOUND in the config, it goes away, but I 
was under the impression that the cmake find_package command itself should set 
the xxx_FOUND internally and not be done by the user.

Is the find_package command trying to tell me something by showing this message?


It think the message indicates that the config file was setting 
xxx_FOUND explicitly to FALSE itself.


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] project not found despite being found

2014-09-16 Thread Biddiscombe, John A.
I have a project which generates a project-config.cmake file and a 
project-config-version.cmake file in the relevant place,
When another project tries to find_package it, I receive this message from cmake

"
  Found package configuration file:

/Users/biddisco/build/cmakesuper/xxx/xxx-config.cmake

  but it set xxx_FOUND to FALSE so package “xxx" is
  considered to be NOT FOUND.
“

Which is not expected. If I set xxx_FOUND in the config, it goes away, but I 
was under the impression that the cmake find_package command itself should set 
the xxx_FOUND internally and not be done by the user.

Is the find_package command trying to tell me something by showing this message?

Thanks

JB
-- 

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] how to force assign sequence in multi-thread in cmake

2014-09-16 Thread Yu Jing
Hello All,
It is is because of 
# AUX_SOURCE_DIRECTORY(. DIR_TARGET)
# ADD_LIBRARY (relfiles ${DIR_TARGET})

That’s really a stupid fault ,and thanks for your debug …TAT

I adjust the usage of External project , and it seems much better . 
Thanks for your help . Thanks for Micha Hergarden’s patience …

By the way , 
set_property(TARGET leveldb_proj PROPERTY EXCLUDE_FROM_ALL TRUE) 
 I removed this property and it seems still works.



On Sep 16, 2014, at 19:58, Yu Jing  wrote:

> I am trying … That’s a very clear organization 
> 
> 
> On Sep 16, 2014, at 19:57, Micha Hergarden  wrote:
> 
>> Hello Yu,
>> 
>> That is because of the following lines:
>> 
>> AUX_SOURCE_DIRECTORY(. DIR_TARGET)
>> ADD_LIBRARY (relfiles ${DIR_TARGET})
>> 
>> I think you may be misusing the aux_source_directory command. I have tested 
>> your setup on a linux machine with -j8 and it still builds. Did you take a 
>> look at the openchemistry setup?
>> 
>> Regards,
>> Micha
>> 
>> On 09/16/2014 01:42 PM, Yu Jing wrote:
>>> Hello Micha,
>>> It seems still not work….
>>> 
>>> On Sep 16, 2014, at 17:36, Micha Hergarden  
>>> wrote:
>>> 
 Hello Yu,
 
 It seems I too needed another trick to make it work:
 set_property(TARGET CRFPP_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE)
 set_property(TARGET LEVELDB_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE)
 
 ADD_DEPENDENCIES(cmake_sample iniparser_static CRFPP_EX_PROJ 
 LEVELDB_EX_PROJ)
 
 By default the ExternalProject_Add will add that target to the ALL target, 
 and that confuses the Make dependency checker. I have removed those 
 dependencies in my project. On the whole I agree with Marcel Loose and 
 Petr Kmoch however. Combining their solution makes for a 'cleaner' 
 project. To be honest, I am halfway of migrating my project to a 
 superbuild as well. Take a look at the openchemistry project if you would 
 like to see an example of that: 
 https://github.com/OpenChemistry/openchemistry
 
 Regards,
 Micha Hergarden
 
 
 On 09/16/2014 11:04 AM, Marcel Loose wrote:
> Hi Yu,
> 
> I think you need to add an explicit dependency of main.cc on the 
> "generated" (well, not really generated, but installed) header file 
> crfpp.h. CMake has no clue as to what files are being compiled/installed 
> by your external project, so you have to make this explicit.
> 
> HTH,
> Marcel Loose.
> 
> 
> On 16/09/14 10:41, Yu Jing wrote:
>> Hello  Micha ,
>> 
>> It seems doesn’t work.
>> I updated code , and move the external project to src , and it still not 
>> work.
>> 
>> what should be noticed is :
>> 1. If I just use 
>> $ make
>> as make command ,all styles are work
>> 2. If I use in multi jobs
>> $ make -j8
>> It will run abnormal (not desired sequence) .
>> 
>> 
>> On Sep 16, 2014, at 15:27, Micha Hergarden  
>> wrote:
>> 
>>> It may be that you have line 63 and 64 the wrong way around:
>>> ADD_SUBDIRECTORY(src)
>>> ADD_SUBDIRECTORY(lib)
>>> 
>>> The externalproject is added in lib, but you add a dependency on it in 
>>> src. CMake will descend in the subdirectories in the order you supply 
>>> them.
>>> Does reversing the directories help?
>>> 
>>> Regards,
>>> Micha
>>> 
>>> On 09/16/2014 09:17 AM, Yu Jing wrote:
 I am in OSX 10.9.4 , a sample in  github is : 
 https://github.com/yujing5b5d/cmake_sample
 after git clone this project , a operation like this :
 
 
 yu:cmake_sample yu$ mkdir build
 yu:cmake_sample yu$ cd build/
 yu:build yu$ cmake ..
 …. # skip some useless output
 -- Configuring done
 -- Generating done
 -- Build files have been written to: 
 /Users/yu/Workspace/res/cmake_sample/build
 yu:build yu$ make -j8 ### <<<
 Scanning dependencies of target LEVELDB_EX_PROJ
 Scanning dependencies of target iniparser
 Scanning dependencies of target relfiles
 Scanning dependencies of target CRFPP_EX_PROJ
 Scanning dependencies of target iniparser_static
 [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object 
 lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o
 Creating directories for 'CRFPP_EX_PROJ'
 Creating directories for 'LEVELDB_EX_PROJ'
 Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o
 Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o
 [ 30%] [ 35%] Performing download step (git clone) for 
 'LEVELDB_EX_PROJ'
 Performing download step (git clone) for 'CRFPP_EX_PROJ'
 /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 

Re: [CMake] how to force assign sequence in multi-thread in cmake

2014-09-16 Thread Yu Jing
I am trying … That’s a very clear organization 


On Sep 16, 2014, at 19:57, Micha Hergarden  wrote:

> Hello Yu,
> 
> That is because of the following lines:
> 
> AUX_SOURCE_DIRECTORY(. DIR_TARGET)
> ADD_LIBRARY (relfiles ${DIR_TARGET})
> 
> I think you may be misusing the aux_source_directory command. I have tested 
> your setup on a linux machine with -j8 and it still builds. Did you take a 
> look at the openchemistry setup?
> 
> Regards,
> Micha
> 
> On 09/16/2014 01:42 PM, Yu Jing wrote:
>> Hello Micha,
>> It seems still not work….
>> 
>> On Sep 16, 2014, at 17:36, Micha Hergarden  wrote:
>> 
>>> Hello Yu,
>>> 
>>> It seems I too needed another trick to make it work:
>>> set_property(TARGET CRFPP_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE)
>>> set_property(TARGET LEVELDB_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE)
>>> 
>>> ADD_DEPENDENCIES(cmake_sample iniparser_static CRFPP_EX_PROJ 
>>> LEVELDB_EX_PROJ)
>>> 
>>> By default the ExternalProject_Add will add that target to the ALL target, 
>>> and that confuses the Make dependency checker. I have removed those 
>>> dependencies in my project. On the whole I agree with Marcel Loose and Petr 
>>> Kmoch however. Combining their solution makes for a 'cleaner' project. To 
>>> be honest, I am halfway of migrating my project to a superbuild as well. 
>>> Take a look at the openchemistry project if you would like to see an 
>>> example of that: https://github.com/OpenChemistry/openchemistry
>>> 
>>> Regards,
>>> Micha Hergarden
>>> 
>>> 
>>> On 09/16/2014 11:04 AM, Marcel Loose wrote:
 Hi Yu,
 
 I think you need to add an explicit dependency of main.cc on the 
 "generated" (well, not really generated, but installed) header file 
 crfpp.h. CMake has no clue as to what files are being compiled/installed 
 by your external project, so you have to make this explicit.
 
 HTH,
 Marcel Loose.
 
 
 On 16/09/14 10:41, Yu Jing wrote:
> Hello  Micha ,
> 
> It seems doesn’t work.
> I updated code , and move the external project to src , and it still not 
> work.
> 
> what should be noticed is :
> 1. If I just use 
> $ make
> as make command ,all styles are work
> 2. If I use in multi jobs
> $ make -j8
> It will run abnormal (not desired sequence) .
> 
> 
> On Sep 16, 2014, at 15:27, Micha Hergarden  
> wrote:
> 
>> It may be that you have line 63 and 64 the wrong way around:
>> ADD_SUBDIRECTORY(src)
>> ADD_SUBDIRECTORY(lib)
>> 
>> The externalproject is added in lib, but you add a dependency on it in 
>> src. CMake will descend in the subdirectories in the order you supply 
>> them.
>> Does reversing the directories help?
>> 
>> Regards,
>> Micha
>> 
>> On 09/16/2014 09:17 AM, Yu Jing wrote:
>>> I am in OSX 10.9.4 , a sample in  github is : 
>>> https://github.com/yujing5b5d/cmake_sample
>>> after git clone this project , a operation like this :
>>> 
>>> 
>>> yu:cmake_sample yu$ mkdir build
>>> yu:cmake_sample yu$ cd build/
>>> yu:build yu$ cmake ..
>>> …. # skip some useless output
>>> -- Configuring done
>>> -- Generating done
>>> -- Build files have been written to: 
>>> /Users/yu/Workspace/res/cmake_sample/build
>>> yu:build yu$ make -j8 ### <<<
>>> Scanning dependencies of target LEVELDB_EX_PROJ
>>> Scanning dependencies of target iniparser
>>> Scanning dependencies of target relfiles
>>> Scanning dependencies of target CRFPP_EX_PROJ
>>> Scanning dependencies of target iniparser_static
>>> [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object 
>>> lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o
>>> Creating directories for 'CRFPP_EX_PROJ'
>>> Creating directories for 'LEVELDB_EX_PROJ'
>>> Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o
>>> Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o
>>> [ 30%] [ 35%] Performing download step (git clone) for 'LEVELDB_EX_PROJ'
>>> Performing download step (git clone) for 'CRFPP_EX_PROJ'
>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 
>>> 'crfpp.h' file not found
>>> #include "crfpp.h" // crfpp
>>>  ^
>>> Cloning into 'CRFPP_EX_PROJ'...
>>> Cloning into 'LEVELDB_EX_PROJ'...
>>> Linking C static library ../libiniparser.a
>>> Linking C shared library ../libiniparser.dylib
>>> [ 35%] [ 35%] Built target iniparser_static
>>> Built target iniparser
>>> Scanning dependencies of target cmake_sample
>>> [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o
>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 
>>> 'crfpp.h' file not found
>>> #include "crfpp.h" // crfpp
>>>  ^
>>> 1 e

Re: [CMake] how to force assign sequence in multi-thread in cmake

2014-09-16 Thread Micha Hergarden
Hello Yu,

That is because of the following lines:

AUX_SOURCE_DIRECTORY(. DIR_TARGET)
ADD_LIBRARY (relfiles ${DIR_TARGET})

I think you may be misusing the aux_source_directory command. I have
tested your setup on a linux machine with -j8 and it still builds. Did
you take a look at the openchemistry setup?

Regards,
Micha

On 09/16/2014 01:42 PM, Yu Jing wrote:
> Hello Micha,
> It seems still not work….
>
> On Sep 16, 2014, at 17:36, Micha Hergarden  > wrote:
>
>> Hello Yu,
>>
>> It seems I too needed another trick to make it work:
>> set_property(TARGET CRFPP_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE)
>> set_property(TARGET LEVELDB_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE)
>>
>> ADD_DEPENDENCIES(cmake_sample iniparser_static CRFPP_EX_PROJ
>> LEVELDB_EX_PROJ)
>>
>> By default the ExternalProject_Add will add that target to the ALL
>> target, and that confuses the Make dependency checker. I have removed
>> those dependencies in my project. On the whole I agree with Marcel
>> Loose and Petr Kmoch however. Combining their solution makes for a
>> 'cleaner' project. To be honest, I am halfway of migrating my project
>> to a superbuild as well. Take a look at the openchemistry project if
>> you would like to see an example of that:
>> https://github.com/OpenChemistry/openchemistry
>>
>> Regards,
>> Micha Hergarden
>>
>>
>> On 09/16/2014 11:04 AM, Marcel Loose wrote:
>>> Hi Yu,
>>>
>>> I think you need to add an explicit dependency of main.cc
>>>  on the "generated" (well, not really generated, but
>>> installed) header file crfpp.h. CMake has no clue as to what files
>>> are being compiled/installed by your external project, so you have
>>> to make this explicit.
>>>
>>> HTH,
>>> Marcel Loose.
>>>
>>>
>>> On 16/09/14 10:41, Yu Jing wrote:
 Hello  Micha ,

 It seems doesn’t work.
 I updated code , and move the external project to src , and it
 still not work.

 what should be noticed is :
 1. If I just use 
 $ make
 as make command ,all styles are work
 2. If I use in multi jobs
 $ make -j8
 It will run abnormal (not desired sequence) .


 On Sep 16, 2014, at 15:27, Micha Hergarden
 mailto:micha.hergar...@gmail.com>> wrote:

> It may be that you have line 63 and 64 the wrong way around:
> ADD_SUBDIRECTORY(src)
> ADD_SUBDIRECTORY(lib)
>
> The externalproject is added in lib, but you add a dependency on
> it in src. CMake will descend in the subdirectories in the order
> you supply them.
> Does reversing the directories help?
>
> Regards,
> Micha
>
> On 09/16/2014 09:17 AM, Yu Jing wrote:
>> I am in OSX 10.9.4 , a sample in  github is
>> : https://github.com/yujing5b5d/cmake_sample
>> after git clone this project , a operation like this :
>> 
>>
>> *yu:cmake_sample yu$ mkdir build*
>> *yu:cmake_sample yu$ cd build/*
>> *yu:build yu$ cmake ..*
>> …. # skip some useless output
>> -- Configuring done
>> -- Generating done
>> -- Build files have been written to:
>> /Users/yu/Workspace/res/cmake_sample/build
>> *yu:build yu$ make -j8 ### <<<*
>> Scanning dependencies of target LEVELDB_EX_PROJ
>> Scanning dependencies of target iniparser
>> Scanning dependencies of target relfiles
>> Scanning dependencies of target CRFPP_EX_PROJ
>> Scanning dependencies of target iniparser_static
>> [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object
>> lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o
>> Creating directories for 'CRFPP_EX_PROJ'
>> Creating directories for 'LEVELDB_EX_PROJ'
>> Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o
>> Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o
>> [ 30%] [ 35%] Performing download step (git clone) for
>> 'LEVELDB_EX_PROJ'
>> Performing download step (git clone) for 'CRFPP_EX_PROJ'
>> /Users/yu/Workspace/res/cmake_sample/src/main.cc
>> :3:10: fatal error: 'crfpp.h' file not found
>> #include "crfpp.h" // crfpp
>>  ^
>> Cloning into 'CRFPP_EX_PROJ'...
>> Cloning into 'LEVELDB_EX_PROJ'...
>> Linking C static library ../libiniparser.a
>> Linking C shared library ../libiniparser.dylib
>> [ 35%] [ 35%] Built target iniparser_static
>> Built target iniparser
>> Scanning dependencies of target cmake_sample
>> [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o
>> /Users/yu/Workspace/res/cmake_sample/src/main.cc
>> :3:10: fatal error: 'crfpp.h' file not found
>> #include "crfpp.h" // crfpp
>>  ^
>> 1 error generated.
>> 1 error generated.
>> make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1
>> make[2]: *** [src/CMakeFil

Re: [CMake] how to force assign sequence in multi-thread in cmake

2014-09-16 Thread Yu Jing
Hello Micha,
It seems still not work….

On Sep 16, 2014, at 17:36, Micha Hergarden  wrote:

> Hello Yu,
> 
> It seems I too needed another trick to make it work:
> set_property(TARGET CRFPP_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE)
> set_property(TARGET LEVELDB_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE)
> 
> ADD_DEPENDENCIES(cmake_sample iniparser_static CRFPP_EX_PROJ LEVELDB_EX_PROJ)
> 
> By default the ExternalProject_Add will add that target to the ALL target, 
> and that confuses the Make dependency checker. I have removed those 
> dependencies in my project. On the whole I agree with Marcel Loose and Petr 
> Kmoch however. Combining their solution makes for a 'cleaner' project. To be 
> honest, I am halfway of migrating my project to a superbuild as well. Take a 
> look at the openchemistry project if you would like to see an example of 
> that: https://github.com/OpenChemistry/openchemistry
> 
> Regards,
> Micha Hergarden
> 
> 
> On 09/16/2014 11:04 AM, Marcel Loose wrote:
>> Hi Yu,
>> 
>> I think you need to add an explicit dependency of main.cc on the "generated" 
>> (well, not really generated, but installed) header file crfpp.h. CMake has 
>> no clue as to what files are being compiled/installed by your external 
>> project, so you have to make this explicit.
>> 
>> HTH,
>> Marcel Loose.
>> 
>> 
>> On 16/09/14 10:41, Yu Jing wrote:
>>> Hello  Micha ,
>>> 
>>> It seems doesn’t work.
>>> I updated code , and move the external project to src , and it still not 
>>> work.
>>> 
>>> what should be noticed is :
>>> 1. If I just use 
>>> $ make
>>> as make command ,all styles are work
>>> 2. If I use in multi jobs
>>> $ make -j8
>>> It will run abnormal (not desired sequence) .
>>> 
>>> 
>>> On Sep 16, 2014, at 15:27, Micha Hergarden  
>>> wrote:
>>> 
 It may be that you have line 63 and 64 the wrong way around:
 ADD_SUBDIRECTORY(src)
 ADD_SUBDIRECTORY(lib)
 
 The externalproject is added in lib, but you add a dependency on it in 
 src. CMake will descend in the subdirectories in the order you supply them.
 Does reversing the directories help?
 
 Regards,
 Micha
 
 On 09/16/2014 09:17 AM, Yu Jing wrote:
> I am in OSX 10.9.4 , a sample in  github is : 
> https://github.com/yujing5b5d/cmake_sample
> after git clone this project , a operation like this :
> 
> 
> yu:cmake_sample yu$ mkdir build
> yu:cmake_sample yu$ cd build/
> yu:build yu$ cmake ..
> …. # skip some useless output
> -- Configuring done
> -- Generating done
> -- Build files have been written to: 
> /Users/yu/Workspace/res/cmake_sample/build
> yu:build yu$ make -j8 ### <<<
> Scanning dependencies of target LEVELDB_EX_PROJ
> Scanning dependencies of target iniparser
> Scanning dependencies of target relfiles
> Scanning dependencies of target CRFPP_EX_PROJ
> Scanning dependencies of target iniparser_static
> [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object 
> lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o
> Creating directories for 'CRFPP_EX_PROJ'
> Creating directories for 'LEVELDB_EX_PROJ'
> Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o
> Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o
> [ 30%] [ 35%] Performing download step (git clone) for 'LEVELDB_EX_PROJ'
> Performing download step (git clone) for 'CRFPP_EX_PROJ'
> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 
> 'crfpp.h' file not found
> #include "crfpp.h" // crfpp
>  ^
> Cloning into 'CRFPP_EX_PROJ'...
> Cloning into 'LEVELDB_EX_PROJ'...
> Linking C static library ../libiniparser.a
> Linking C shared library ../libiniparser.dylib
> [ 35%] [ 35%] Built target iniparser_static
> Built target iniparser
> Scanning dependencies of target cmake_sample
> [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o
> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 
> 'crfpp.h' file not found
> #include "crfpp.h" // crfpp
>  ^
> 1 error generated.
> 1 error generated.
> make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1
> make[2]: *** [src/CMakeFiles/cmake_sample.dir/main.cc.o] Error 1
> make[1]: *** [src/CMakeFiles/relfiles.dir/all] Error 2
> make[1]: *** Waiting for unfinished jobs
> make[1]: *** [src/CMakeFiles/cmake_sample.dir/all] Error 2
> ….
> 
> 
> BE CAREFUL OF THIS LINE :
> >> yu:build yu$ make -j8
> 
> the ExternalProject CRFPP_EX_PROJ’s result contains copy a crfpp.h  
> header to a special path, after this process , we can use #include 
> “crfpp.h" ,and If I use 

Re: [CMake] Get Visual Studio target Arch

2014-09-16 Thread David Cole via CMake
> I still cant really make some arch specific ifdefs in my cmake
> scripts using this approach.


That's the point of a multi-configuration, multi-architecture Visual
Studio solution: you defer choosing the configuration *and* the
architecture until build time.

No "CMake time" decisions are possible based on the configuration or
the architecture with this approach because neither is known until
compile time.

It is inappropriate to "choose the configuration or architecture" in
CMake code with this approach, and you should re-think about it and see
if you can make compile time decisions instead, possibly with #ifdef
sections in your C/C++ code...

Rather than re-organize your libraries, you could easily just use
"win32/libs/$(Platform)" as your value when using the VS generators,
and this should work.


By the way, Gilles, I echo the sentiment: nice work! I wish MS had
gotten involved in CMake even earlier... but welcome!


HTH,
David C.


-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] how to force assign sequence in multi-thread in cmake

2014-09-16 Thread Micha Hergarden
Hello Yu,

It seems I too needed another trick to make it work:
set_property(TARGET CRFPP_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE)
set_property(TARGET LEVELDB_EX_PROJ PROPERTY EXCLUDE_FROM_ALL TRUE)

ADD_DEPENDENCIES(cmake_sample iniparser_static CRFPP_EX_PROJ
LEVELDB_EX_PROJ)

By default the ExternalProject_Add will add that target to the ALL
target, and that confuses the Make dependency checker. I have removed
those dependencies in my project. On the whole I agree with Marcel Loose
and Petr Kmoch however. Combining their solution makes for a 'cleaner'
project. To be honest, I am halfway of migrating my project to a
superbuild as well. Take a look at the openchemistry project if you
would like to see an example of that:
https://github.com/OpenChemistry/openchemistry

Regards,
Micha Hergarden


On 09/16/2014 11:04 AM, Marcel Loose wrote:
> Hi Yu,
>
> I think you need to add an explicit dependency of main.cc on the
> "generated" (well, not really generated, but installed) header file
> crfpp.h. CMake has no clue as to what files are being
> compiled/installed by your external project, so you have to make this
> explicit.
>
> HTH,
> Marcel Loose.
>
>
> On 16/09/14 10:41, Yu Jing wrote:
>> Hello  Micha ,
>>
>> It seems doesn’t work.
>> I updated code , and move the external project to src , and it still
>> not work.
>>
>> what should be noticed is :
>> 1. If I just use 
>> $ make
>> as make command ,all styles are work
>> 2. If I use in multi jobs
>> $ make -j8
>> It will run abnormal (not desired sequence) .
>>
>>
>> On Sep 16, 2014, at 15:27, Micha Hergarden > > wrote:
>>
>>> It may be that you have line 63 and 64 the wrong way around:
>>> ADD_SUBDIRECTORY(src)
>>> ADD_SUBDIRECTORY(lib)
>>>
>>> The externalproject is added in lib, but you add a dependency on it
>>> in src. CMake will descend in the subdirectories in the order you
>>> supply them.
>>> Does reversing the directories help?
>>>
>>> Regards,
>>> Micha
>>>
>>> On 09/16/2014 09:17 AM, Yu Jing wrote:
 I am in OSX 10.9.4 , a sample in  github is
 : https://github.com/yujing5b5d/cmake_sample
 after git clone this project , a operation like this :
 

 *yu:cmake_sample yu$ mkdir build*
 *yu:cmake_sample yu$ cd build/*
 *yu:build yu$ cmake ..*
 …. # skip some useless output
 -- Configuring done
 -- Generating done
 -- Build files have been written to:
 /Users/yu/Workspace/res/cmake_sample/build
 *yu:build yu$ make -j8 ### <<<*
 Scanning dependencies of target LEVELDB_EX_PROJ
 Scanning dependencies of target iniparser
 Scanning dependencies of target relfiles
 Scanning dependencies of target CRFPP_EX_PROJ
 Scanning dependencies of target iniparser_static
 [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object
 lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o
 Creating directories for 'CRFPP_EX_PROJ'
 Creating directories for 'LEVELDB_EX_PROJ'
 Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o
 Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o
 [ 30%] [ 35%] Performing download step (git clone) for
 'LEVELDB_EX_PROJ'
 Performing download step (git clone) for 'CRFPP_EX_PROJ'
 /Users/yu/Workspace/res/cmake_sample/src/main.cc
 :3:10: fatal error: 'crfpp.h' file not found
 #include "crfpp.h" // crfpp
  ^
 Cloning into 'CRFPP_EX_PROJ'...
 Cloning into 'LEVELDB_EX_PROJ'...
 Linking C static library ../libiniparser.a
 Linking C shared library ../libiniparser.dylib
 [ 35%] [ 35%] Built target iniparser_static
 Built target iniparser
 Scanning dependencies of target cmake_sample
 [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o
 /Users/yu/Workspace/res/cmake_sample/src/main.cc
 :3:10: fatal error: 'crfpp.h' file not found
 #include "crfpp.h" // crfpp
  ^
 1 error generated.
 1 error generated.
 make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1
 make[2]: *** [src/CMakeFiles/cmake_sample.dir/main.cc.o] Error 1
 make[1]: *** [src/CMakeFiles/relfiles.dir/all] Error 2
 make[1]: *** Waiting for unfinished jobs
 make[1]: *** [src/CMakeFiles/cmake_sample.dir/all] Error 2
 ….
 

 BE CAREFUL OF THIS LINE :
 *>> yu:build yu$ make -j8*
 *
 *
 the ExternalProject CRFPP_EX_PROJ’s result contains copy a crfpp.h
  header to a special path, after this process , we can use #include
 “crfpp.h" ,and If I use 
 make -j8
 this means 8 jobs can be running at the same time, I can not
 constraints and let my compiler compile my main.cc
  after CRFPP_EX

Re: [CMake] how to force assign sequence in multi-thread in cmake

2014-09-16 Thread Marcel Loose
Hi Yu,

I think you need to add an explicit dependency of main.cc on the
"generated" (well, not really generated, but installed) header file
crfpp.h. CMake has no clue as to what files are being compiled/installed
by your external project, so you have to make this explicit.

HTH,
Marcel Loose.


On 16/09/14 10:41, Yu Jing wrote:
> Hello  Micha ,
>
> It seems doesn’t work.
> I updated code , and move the external project to src , and it still
> not work.
>
> what should be noticed is :
> 1. If I just use 
> $ make
> as make command ,all styles are work
> 2. If I use in multi jobs
> $ make -j8
> It will run abnormal (not desired sequence) .
>
>
> On Sep 16, 2014, at 15:27, Micha Hergarden  > wrote:
>
>> It may be that you have line 63 and 64 the wrong way around:
>> ADD_SUBDIRECTORY(src)
>> ADD_SUBDIRECTORY(lib)
>>
>> The externalproject is added in lib, but you add a dependency on it
>> in src. CMake will descend in the subdirectories in the order you
>> supply them.
>> Does reversing the directories help?
>>
>> Regards,
>> Micha
>>
>> On 09/16/2014 09:17 AM, Yu Jing wrote:
>>> I am in OSX 10.9.4 , a sample in  github is
>>> : https://github.com/yujing5b5d/cmake_sample
>>> after git clone this project , a operation like this :
>>> 
>>>
>>> *yu:cmake_sample yu$ mkdir build*
>>> *yu:cmake_sample yu$ cd build/*
>>> *yu:build yu$ cmake ..*
>>> …. # skip some useless output
>>> -- Configuring done
>>> -- Generating done
>>> -- Build files have been written to:
>>> /Users/yu/Workspace/res/cmake_sample/build
>>> *yu:build yu$ make -j8 ### <<<*
>>> Scanning dependencies of target LEVELDB_EX_PROJ
>>> Scanning dependencies of target iniparser
>>> Scanning dependencies of target relfiles
>>> Scanning dependencies of target CRFPP_EX_PROJ
>>> Scanning dependencies of target iniparser_static
>>> [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object
>>> lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o
>>> Creating directories for 'CRFPP_EX_PROJ'
>>> Creating directories for 'LEVELDB_EX_PROJ'
>>> Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o
>>> Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o
>>> [ 30%] [ 35%] Performing download step (git clone) for 'LEVELDB_EX_PROJ'
>>> Performing download step (git clone) for 'CRFPP_EX_PROJ'
>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc
>>> :3:10: fatal error: 'crfpp.h' file not found
>>> #include "crfpp.h" // crfpp
>>>  ^
>>> Cloning into 'CRFPP_EX_PROJ'...
>>> Cloning into 'LEVELDB_EX_PROJ'...
>>> Linking C static library ../libiniparser.a
>>> Linking C shared library ../libiniparser.dylib
>>> [ 35%] [ 35%] Built target iniparser_static
>>> Built target iniparser
>>> Scanning dependencies of target cmake_sample
>>> [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o
>>> /Users/yu/Workspace/res/cmake_sample/src/main.cc
>>> :3:10: fatal error: 'crfpp.h' file not found
>>> #include "crfpp.h" // crfpp
>>>  ^
>>> 1 error generated.
>>> 1 error generated.
>>> make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1
>>> make[2]: *** [src/CMakeFiles/cmake_sample.dir/main.cc.o] Error 1
>>> make[1]: *** [src/CMakeFiles/relfiles.dir/all] Error 2
>>> make[1]: *** Waiting for unfinished jobs
>>> make[1]: *** [src/CMakeFiles/cmake_sample.dir/all] Error 2
>>> ….
>>> 
>>>
>>> BE CAREFUL OF THIS LINE :
>>> *>> yu:build yu$ make -j8*
>>> *
>>> *
>>> the ExternalProject CRFPP_EX_PROJ’s result contains copy a crfpp.h
>>>  header to a special path, after this process , we can use #include
>>> “crfpp.h" ,and If I use 
>>> make -j8
>>> this means 8 jobs can be running at the same time, I can not
>>> constraints and let my compiler compile my main.cc 
>>> after CRFPP_EX_PROJ finished.
>>>
>>> Of course , I’m not sure is this my misuse this project .
>>>
>>>
>>>
>>> On Sep 16, 2014, at 14:55, Micha Hergarden
>>> mailto:micha.hergar...@gmail.com>> wrote:
>>>
 Hello all,

 I do use the ExternalProject to prebuild some binaries, without the
 'superproject' setup, and it does seem to work. Using the
 add_dependencies, I can make sure some third party libs are
 prebuild before I start to build my project. I have seen some
 issues with ExternalProject (failing to extract, or build), but
 they are too rare to pinpoint and create a bugreport.

 What exactly does not work? Is the external project not build at
 all, or just not in time?

 Regards,
 Micha

 On 09/16/2014 08:30 AM, Petr Kmoch wrote:
> Hi.
>
> I've never worked with ExternalProject myself, so I can't comment
> with certainty, but from what I understand, the correct way of
> using Extern

Re: [CMake] how to force assign sequence in multi-thread in cmake

2014-09-16 Thread Yu Jing
Hello  Micha ,

It seems doesn’t work.
I updated code , and move the external project to src , and it still not work.

what should be noticed is :
1. If I just use 
$ make
as make command ,all styles are work
2. If I use in multi jobs
$ make -j8
It will run abnormal (not desired sequence) .


On Sep 16, 2014, at 15:27, Micha Hergarden  wrote:

> It may be that you have line 63 and 64 the wrong way around:
> ADD_SUBDIRECTORY(src)
> ADD_SUBDIRECTORY(lib)
> 
> The externalproject is added in lib, but you add a dependency on it in src. 
> CMake will descend in the subdirectories in the order you supply them.
> Does reversing the directories help?
> 
> Regards,
> Micha
> 
> On 09/16/2014 09:17 AM, Yu Jing wrote:
>> I am in OSX 10.9.4 , a sample in  github is : 
>> https://github.com/yujing5b5d/cmake_sample
>> after git clone this project , a operation like this :
>> 
>> 
>> yu:cmake_sample yu$ mkdir build
>> yu:cmake_sample yu$ cd build/
>> yu:build yu$ cmake ..
>> …. # skip some useless output
>> -- Configuring done
>> -- Generating done
>> -- Build files have been written to: 
>> /Users/yu/Workspace/res/cmake_sample/build
>> yu:build yu$ make -j8 ### <<<
>> Scanning dependencies of target LEVELDB_EX_PROJ
>> Scanning dependencies of target iniparser
>> Scanning dependencies of target relfiles
>> Scanning dependencies of target CRFPP_EX_PROJ
>> Scanning dependencies of target iniparser_static
>> [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object 
>> lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o
>> Creating directories for 'CRFPP_EX_PROJ'
>> Creating directories for 'LEVELDB_EX_PROJ'
>> Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o
>> Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o
>> [ 30%] [ 35%] Performing download step (git clone) for 'LEVELDB_EX_PROJ'
>> Performing download step (git clone) for 'CRFPP_EX_PROJ'
>> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 
>> 'crfpp.h' file not found
>> #include "crfpp.h" // crfpp
>>  ^
>> Cloning into 'CRFPP_EX_PROJ'...
>> Cloning into 'LEVELDB_EX_PROJ'...
>> Linking C static library ../libiniparser.a
>> Linking C shared library ../libiniparser.dylib
>> [ 35%] [ 35%] Built target iniparser_static
>> Built target iniparser
>> Scanning dependencies of target cmake_sample
>> [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o
>> /Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 
>> 'crfpp.h' file not found
>> #include "crfpp.h" // crfpp
>>  ^
>> 1 error generated.
>> 1 error generated.
>> make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1
>> make[2]: *** [src/CMakeFiles/cmake_sample.dir/main.cc.o] Error 1
>> make[1]: *** [src/CMakeFiles/relfiles.dir/all] Error 2
>> make[1]: *** Waiting for unfinished jobs
>> make[1]: *** [src/CMakeFiles/cmake_sample.dir/all] Error 2
>> ….
>> 
>> 
>> BE CAREFUL OF THIS LINE :
>> >> yu:build yu$ make -j8
>> 
>> the ExternalProject CRFPP_EX_PROJ’s result contains copy a crfpp.h  header 
>> to a special path, after this process , we can use #include “crfpp.h" ,and 
>> If I use 
>> make -j8
>> this means 8 jobs can be running at the same time, I can not constraints and 
>> let my compiler compile my main.cc after CRFPP_EX_PROJ finished.
>> 
>> Of course , I’m not sure is this my misuse this project .
>> 
>> 
>> 
>> On Sep 16, 2014, at 14:55, Micha Hergarden  wrote:
>> 
>>> Hello all,
>>> 
>>> I do use the ExternalProject to prebuild some binaries, without the 
>>> 'superproject' setup, and it does seem to work. Using the add_dependencies, 
>>> I can make sure some third party libs are prebuild before I start to build 
>>> my project. I have seen some issues with ExternalProject (failing to 
>>> extract, or build), but they are too rare to pinpoint and create a 
>>> bugreport.
>>> 
>>> What exactly does not work? Is the external project not build at all, or 
>>> just not in time?
>>> 
>>> Regards,
>>> Micha
>>> 
>>> On 09/16/2014 08:30 AM, Petr Kmoch wrote:
 Hi.
 
 I've never worked with ExternalProject myself, so I can't comment with 
 certainty, but from what I understand, the correct way of using 
 ExternalProject is to add your own project as an ExternalProject as well. 
 Basically, the toplevel CMakeList becomes a superbuild which *only* does 
 ExternalProject_Add() calls and does not add any libraries/executables 
 directly. After you build the superbuild once to get all the dependencies 
 correct, you switch to the "external" project of your own code and work 
 with that normally.
 
 Petr
 
 On Mon, Sep 15, 2014 at 4:13 PM, Yu Jing  wrote:
 I had asked in http://stackoverflow.com/questions/25841602  , someone told 
 me maybe her

Re: [CMake] how to force assign sequence in multi-thread in cmake

2014-09-16 Thread Micha Hergarden
It may be that you have line 63 and 64 the wrong way around:
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(lib)

The externalproject is added in lib, but you add a dependency on it in
src. CMake will descend in the subdirectories in the order you supply them.
Does reversing the directories help?

Regards,
Micha

On 09/16/2014 09:17 AM, Yu Jing wrote:
> I am in OSX 10.9.4 , a sample in  github is
> : https://github.com/yujing5b5d/cmake_sample
> after git clone this project , a operation like this :
> 
>
> *yu:cmake_sample yu$ mkdir build*
> *yu:cmake_sample yu$ cd build/*
> *yu:build yu$ cmake ..*
> …. # skip some useless output
> -- Configuring done
> -- Generating done
> -- Build files have been written to:
> /Users/yu/Workspace/res/cmake_sample/build
> *yu:build yu$ make -j8 ### <<<*
> Scanning dependencies of target LEVELDB_EX_PROJ
> Scanning dependencies of target iniparser
> Scanning dependencies of target relfiles
> Scanning dependencies of target CRFPP_EX_PROJ
> Scanning dependencies of target iniparser_static
> [ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object
> lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o
> Creating directories for 'CRFPP_EX_PROJ'
> Creating directories for 'LEVELDB_EX_PROJ'
> Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o
> Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o
> [ 30%] [ 35%] Performing download step (git clone) for 'LEVELDB_EX_PROJ'
> Performing download step (git clone) for 'CRFPP_EX_PROJ'
> /Users/yu/Workspace/res/cmake_sample/src/main.cc
> :3:10: fatal error: 'crfpp.h' file not found
> #include "crfpp.h" // crfpp
>  ^
> Cloning into 'CRFPP_EX_PROJ'...
> Cloning into 'LEVELDB_EX_PROJ'...
> Linking C static library ../libiniparser.a
> Linking C shared library ../libiniparser.dylib
> [ 35%] [ 35%] Built target iniparser_static
> Built target iniparser
> Scanning dependencies of target cmake_sample
> [ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o
> /Users/yu/Workspace/res/cmake_sample/src/main.cc
> :3:10: fatal error: 'crfpp.h' file not found
> #include "crfpp.h" // crfpp
>  ^
> 1 error generated.
> 1 error generated.
> make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1
> make[2]: *** [src/CMakeFiles/cmake_sample.dir/main.cc.o] Error 1
> make[1]: *** [src/CMakeFiles/relfiles.dir/all] Error 2
> make[1]: *** Waiting for unfinished jobs
> make[1]: *** [src/CMakeFiles/cmake_sample.dir/all] Error 2
> ….
> 
>
> BE CAREFUL OF THIS LINE :
> *>> yu:build yu$ make -j8*
> *
> *
> the ExternalProject CRFPP_EX_PROJ’s result contains copy a crfpp.h
>  header to a special path, after this process , we can use #include
> “crfpp.h" ,and If I use 
> make -j8
> this means 8 jobs can be running at the same time, I can not
> constraints and let my compiler compile my main.cc 
> after CRFPP_EX_PROJ finished.
>
> Of course , I’m not sure is this my misuse this project .
>
>
>
> On Sep 16, 2014, at 14:55, Micha Hergarden  > wrote:
>
>> Hello all,
>>
>> I do use the ExternalProject to prebuild some binaries, without the
>> 'superproject' setup, and it does seem to work. Using the
>> add_dependencies, I can make sure some third party libs are prebuild
>> before I start to build my project. I have seen some issues with
>> ExternalProject (failing to extract, or build), but they are too rare
>> to pinpoint and create a bugreport.
>>
>> What exactly does not work? Is the external project not build at all,
>> or just not in time?
>>
>> Regards,
>> Micha
>>
>> On 09/16/2014 08:30 AM, Petr Kmoch wrote:
>>> Hi.
>>>
>>> I've never worked with ExternalProject myself, so I can't comment
>>> with certainty, but from what I understand, the correct way of using
>>> ExternalProject is to add your own project as an ExternalProject as
>>> well. Basically, the toplevel CMakeList becomes a superbuild which
>>> *only* does ExternalProject_Add() calls and does not add any
>>> libraries/executables directly. After you build the superbuild once
>>> to get all the dependencies correct, you switch to the "external"
>>> project of your own code and work with that normally.
>>>
>>> Petr
>>>
>>> On Mon, Sep 15, 2014 at 4:13 PM, Yu Jing >> > wrote:
>>>
>>> I had asked in http://stackoverflow.com/questions/25841602  ,
>>> someone told me maybe here is a better place to ask.
>>>
>>> I am writing a project base on crfpp , a external project. I use
>>> cmake to integerate this project as follow .
>>>
>>> firstly , I add a extenal project like this:
>>>
>>> |EXTERNALPROJECT_ADD(
>>> CRFPP_EX_PROJ
>>> GIT_REPOSITORY g...@github.com:yujing5b5d/crfpp.git
>>> 

Re: [CMake] how to force assign sequence in multi-thread in cmake

2014-09-16 Thread Yu Jing
I am in OSX 10.9.4 , a sample in  github is : 
https://github.com/yujing5b5d/cmake_sample
after git clone this project , a operation like this :


yu:cmake_sample yu$ mkdir build
yu:cmake_sample yu$ cd build/
yu:build yu$ cmake ..
…. # skip some useless output
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/yu/Workspace/res/cmake_sample/build
yu:build yu$ make -j8 ### <<<
Scanning dependencies of target LEVELDB_EX_PROJ
Scanning dependencies of target iniparser
Scanning dependencies of target relfiles
Scanning dependencies of target CRFPP_EX_PROJ
Scanning dependencies of target iniparser_static
[ 15%] [ 15%] [ 20%] [ 20%] [ 25%] Building C object 
lib/iniparser/CMakeFiles/iniparser_static.dir/ini.c.o
Creating directories for 'CRFPP_EX_PROJ'
Creating directories for 'LEVELDB_EX_PROJ'
Building C object lib/iniparser/CMakeFiles/iniparser.dir/ini.c.o
Building CXX object src/CMakeFiles/relfiles.dir/main.cc.o
[ 30%] [ 35%] Performing download step (git clone) for 'LEVELDB_EX_PROJ'
Performing download step (git clone) for 'CRFPP_EX_PROJ'
/Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' 
file not found
#include "crfpp.h" // crfpp
 ^
Cloning into 'CRFPP_EX_PROJ'...
Cloning into 'LEVELDB_EX_PROJ'...
Linking C static library ../libiniparser.a
Linking C shared library ../libiniparser.dylib
[ 35%] [ 35%] Built target iniparser_static
Built target iniparser
Scanning dependencies of target cmake_sample
[ 40%] Building CXX object src/CMakeFiles/cmake_sample.dir/main.cc.o
/Users/yu/Workspace/res/cmake_sample/src/main.cc:3:10: fatal error: 'crfpp.h' 
file not found
#include "crfpp.h" // crfpp
 ^
1 error generated.
1 error generated.
make[2]: *** [src/CMakeFiles/relfiles.dir/main.cc.o] Error 1
make[2]: *** [src/CMakeFiles/cmake_sample.dir/main.cc.o] Error 1
make[1]: *** [src/CMakeFiles/relfiles.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs
make[1]: *** [src/CMakeFiles/cmake_sample.dir/all] Error 2
….


BE CAREFUL OF THIS LINE :
>> yu:build yu$ make -j8

the ExternalProject CRFPP_EX_PROJ’s result contains copy a crfpp.h  header to a 
special path, after this process , we can use #include “crfpp.h" ,and If I use 
make -j8
this means 8 jobs can be running at the same time, I can not constraints and 
let my compiler compile my main.cc after CRFPP_EX_PROJ finished.

Of course , I’m not sure is this my misuse this project .



On Sep 16, 2014, at 14:55, Micha Hergarden  wrote:

> Hello all,
> 
> I do use the ExternalProject to prebuild some binaries, without the 
> 'superproject' setup, and it does seem to work. Using the add_dependencies, I 
> can make sure some third party libs are prebuild before I start to build my 
> project. I have seen some issues with ExternalProject (failing to extract, or 
> build), but they are too rare to pinpoint and create a bugreport.
> 
> What exactly does not work? Is the external project not build at all, or just 
> not in time?
> 
> Regards,
> Micha
> 
> On 09/16/2014 08:30 AM, Petr Kmoch wrote:
>> Hi.
>> 
>> I've never worked with ExternalProject myself, so I can't comment with 
>> certainty, but from what I understand, the correct way of using 
>> ExternalProject is to add your own project as an ExternalProject as well. 
>> Basically, the toplevel CMakeList becomes a superbuild which *only* does 
>> ExternalProject_Add() calls and does not add any libraries/executables 
>> directly. After you build the superbuild once to get all the dependencies 
>> correct, you switch to the "external" project of your own code and work with 
>> that normally.
>> 
>> Petr
>> 
>> On Mon, Sep 15, 2014 at 4:13 PM, Yu Jing  wrote:
>> I had asked in http://stackoverflow.com/questions/25841602  , someone told 
>> me maybe here is a better place to ask.
>> 
>> I am writing a project base on crfpp , a external project. I use cmake to 
>> integerate this project as follow .
>> 
>> firstly , I add a extenal project like this:
>> 
>> EXTERNALPROJECT_ADD(
>> CRFPP_EX_PROJ
>> GIT_REPOSITORY g...@github.com:yujing5b5d/crfpp.git
>> PREFIX ${CMAKE_CURRENT_BINARY_DIR}
>> CONFIGURE_COMMAND ./configure
>> BUILD_COMMAND make -j8
>> BUILD_IN_SOURCE 1
>> INSTALL_COMMAND cp .libs/libcrfpp.a ${PROJECT_BINARY_DIR}/lib && 
>> cp crfpp.h ${PROJECT_BINARY_DIR}/include 
>> )
>> this will generate some .a file and copy a header file crfpp.h to folder 
>> ${PROJECT_BINARY_DIR}/include , which is included in my project.
>> 
>> and then , use the ${PROJECT_BINARY_DIR}/include as include path as follow .
>> 
>> INCLUDE_DIRECTORIES(
>> ${PROJECT_SOURCE_DIR}/include
>> ${PROJECT_BINARY_DIR}/include
>> )
>> finally , when I compile the