Re: [CMake] Default visual studio filters

2011-02-25 Thread Yuri Timenkov
Also you could employ SOURCES property of target to get list of files to
eliminate the need of passing them to macro explicitly.

On Fri, Feb 25, 2011 at 8:58 PM, Michael Jackson <
mike.jack...@bluequartz.net> wrote:

> I have the following macro that I use:
>
>
> MACRO (cmp_IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES)
>STRING(REPLACE "/" "" source_group_path ${SOURCE_PATH}  )
>source_group(${source_group_path} FILES ${HEADERS} ${SOURCES})
> ENDMACRO (cmp_IDE_SOURCE_PROPERTIES NAME HEADERS SOURCES INSTALL_FILES)
>
> #Example Usage
> set(SRCS Foo.cpp bar.cpp)
> set(HDRS Foo.h   bar.h)
> cmp_IDE_SOURCE_PROPERTIES( "Source/Lib" "${HDRS}" "${SRCS}")
> add_library( foolib  ${SRCS} ${HDRS})
>
> and in Visual Studio I get Foo.cpp bar.cpp foo.h bar.h all in the same
> "filter"/Folder thingie. Is that what you are looking for?
>
> ___
> Mike Jackson  www.bluequartz.net
> Principal Software Engineer   mike.jack...@bluequartz.net
> BlueQuartz Software   Dayton, Ohio
>
> On Feb 25, 2011, at 12:42 PM, aaron_wri...@selinc.com wrote:
>
> > I was curious about an answer to this question. I don't think source and
> > header files should be separated either. It's just a nag, but if there
> was
> > an easy fix, I'd jump on it.
> >
> > ---
> > Aaron Wright
> >
> >
> >
> >
> > From:   Orcun Gokbulut 
> > To: cmake@cmake.org
> > Date:   02/23/2011 07:48 AM
> > Subject:[CMake] Default visual studio filters
> > Sent by:cmake-boun...@cmake.org
> >
> >
> >
> > Hello cmake users,
> >
> > We are porting our visual studio based build system to cmake and its
> > allmost done with some minor problems.
> >
> > One of the minor problem is default visual c++ filters (source groups)
> > I don't like (actually hate) visual c++'s default *.cpp *.h filters. (Not
> > the filter feature but the default filters) They make navigation hard at
> > solution explorer and I want source and header file to be listed next to
> > each other.
> > Therefore I want all of my source files to be not included in a filter
> and
> > remove "Source Files" and "Header Files" filters.  I have read the
> > documentation and exprimented with SOURCE_GROUP command but I can not
> > figure out how to remove default *.cpp and *.h source groups.
> >
> > Also I'm going to add a special regex filter that combines auto generated
> > source codes in to a filter. Something like
> > source_group (ZPP REGULAR_EXPRESSION ".*\\.zpp")
> >
> >
> > How can I do that ?
> >
> > Thanks every one,
> > Orçun___
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the CMake FAQ at:
> > http://www.cmake.org/Wiki/CMake_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.cmake.org/mailman/listinfo/cmake
> >
> > ___
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.cmake.org/mailman/listinfo/cmake
>
> ___
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

[CMake] FindThreads - CMAKE_USE_PTHREADS_INIT not being set properly

2011-02-25 Thread William Clifford
Not sure if this is an issue that was corrected, as I am working with
cmake 2.8.1, but I'm having some issues with FindThreads. I know that
pthreads is installed on the system. If I use:

# snip --- snip --- snip --- snip

include ( CheckIncludeFiles )
include ( CheckLibraryExists )

check_include_files ( "pthread.h" HAVE_PTHREAD_H )
check_library_exists ( pthread pthread_create "" HAVE_PTHREAD_LIB )

#snip --- snip --- snip --- snip

both HAVE_PTHREAD_H and HAVE_PTHREAD_LIB are set to TRUE. However, if
I use FindThreads, CMAKE_USE_PTHREADS_INIT remains unset, as do the
other CMAKE_*_INIT variables defined therein.

Is there something that I'm missing here and just too much a cmake
noob to see it?

Thanks

-- 
William M. Clifford, M.I.T.
william.clifford@gmail.com
Mobile: 954-347-8037
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Default visual studio filters

2011-02-25 Thread Aaron_Wright
Yeah, actually. I didn't think it would be that easy. Thanks.

---
Aaron Wright




From:   Michael Jackson 
To: aaron_wri...@selinc.com
Cc: cmake@cmake.org
Date:   02/25/2011 09:58 AM
Subject:Re: [CMake] Default visual studio filters



I have the following macro that I use:


MACRO (cmp_IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES)
STRING(REPLACE "/" "" source_group_path ${SOURCE_PATH}  )
source_group(${source_group_path} FILES ${HEADERS} ${SOURCES})
ENDMACRO (cmp_IDE_SOURCE_PROPERTIES NAME HEADERS SOURCES INSTALL_FILES)

#Example Usage
set(SRCS Foo.cpp bar.cpp)
set(HDRS Foo.h   bar.h)
cmp_IDE_SOURCE_PROPERTIES( "Source/Lib" "${HDRS}" "${SRCS}")
add_library( foolib  ${SRCS} ${HDRS})

and in Visual Studio I get Foo.cpp bar.cpp foo.h bar.h all in the same 
"filter"/Folder thingie. Is that what you are looking for? 

___
Mike Jackson  www.bluequartz.net
Principal Software Engineer   mike.jack...@bluequartz.net 
BlueQuartz Software   Dayton, Ohio

On Feb 25, 2011, at 12:42 PM, aaron_wri...@selinc.com wrote:

> I was curious about an answer to this question. I don't think source and 

> header files should be separated either. It's just a nag, but if there 
was 
> an easy fix, I'd jump on it.
> 
> ---
> Aaron Wright
> 
> 
> 
> 
> From:   Orcun Gokbulut 
> To: cmake@cmake.org
> Date:   02/23/2011 07:48 AM
> Subject:[CMake] Default visual studio filters
> Sent by:cmake-boun...@cmake.org
> 
> 
> 
> Hello cmake users,
> 
> We are porting our visual studio based build system to cmake and its 
> allmost done with some minor problems.
> 
> One of the minor problem is default visual c++ filters (source groups)
> I don't like (actually hate) visual c++'s default *.cpp *.h filters. 
(Not 
> the filter feature but the default filters) They make navigation hard at 

> solution explorer and I want source and header file to be listed next to 

> each other. 
> Therefore I want all of my source files to be not included in a filter 
and 
> remove "Source Files" and "Header Files" filters.  I have read the 
> documentation and exprimented with SOURCE_GROUP command but I can not 
> figure out how to remove default *.cpp and *.h source groups. 
> 
> Also I'm going to add a special regex filter that combines auto 
generated 
> source codes in to a filter. Something like
> source_group (ZPP REGULAR_EXPRESSION ".*\\.zpp")
> 
> 
> How can I do that ?
> 
> Thanks every one,
> Orçun___
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
> 
> ___
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake



___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Default visual studio filters

2011-02-25 Thread Michael Jackson
I have the following macro that I use:


MACRO (cmp_IDE_SOURCE_PROPERTIES SOURCE_PATH HEADERS SOURCES)
STRING(REPLACE "/" "" source_group_path ${SOURCE_PATH}  )
source_group(${source_group_path} FILES ${HEADERS} ${SOURCES})
ENDMACRO (cmp_IDE_SOURCE_PROPERTIES NAME HEADERS SOURCES INSTALL_FILES)

#Example Usage
set(SRCS Foo.cpp bar.cpp)
set(HDRS Foo.h   bar.h)
cmp_IDE_SOURCE_PROPERTIES( "Source/Lib" "${HDRS}" "${SRCS}")
add_library( foolib  ${SRCS} ${HDRS})

and in Visual Studio I get Foo.cpp bar.cpp foo.h bar.h all in the same 
"filter"/Folder thingie. Is that what you are looking for? 

___
Mike Jackson  www.bluequartz.net
Principal Software Engineer   mike.jack...@bluequartz.net 
BlueQuartz Software   Dayton, Ohio

On Feb 25, 2011, at 12:42 PM, aaron_wri...@selinc.com wrote:

> I was curious about an answer to this question. I don't think source and 
> header files should be separated either. It's just a nag, but if there was 
> an easy fix, I'd jump on it.
> 
> ---
> Aaron Wright
> 
> 
> 
> 
> From:   Orcun Gokbulut 
> To: cmake@cmake.org
> Date:   02/23/2011 07:48 AM
> Subject:[CMake] Default visual studio filters
> Sent by:cmake-boun...@cmake.org
> 
> 
> 
> Hello cmake users,
> 
> We are porting our visual studio based build system to cmake and its 
> allmost done with some minor problems.
> 
> One of the minor problem is default visual c++ filters (source groups)
> I don't like (actually hate) visual c++'s default *.cpp *.h filters. (Not 
> the filter feature but the default filters) They make navigation hard at 
> solution explorer and I want source and header file to be listed next to 
> each other. 
> Therefore I want all of my source files to be not included in a filter and 
> remove "Source Files" and "Header Files" filters.  I have read the 
> documentation and exprimented with SOURCE_GROUP command but I can not 
> figure out how to remove default *.cpp and *.h source groups. 
> 
> Also I'm going to add a special regex filter that combines auto generated 
> source codes in to a filter. Something like
> source_group (ZPP REGULAR_EXPRESSION ".*\\.zpp")
> 
> 
> How can I do that ?
> 
> Thanks every one,
> Orçun___
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
> 
> ___
> Powered by www.kitware.com
> 
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
> 
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
> 
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake

___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How too set properties on all executables

2011-02-25 Thread Hanna Symanska
Thank you both, i will try these!

On Fri, Feb 25, 2011 at 3:08 AM, Yuri Timenkov  wrote:
> Is changing global compiler/linker flags for all executables an option?
>
> When you enable "show advanced options" in CMake, you should see them as
> CMAKE_EXE_LINKER_FLAGS_.
>
> Also, if you want to set them initially by your build system, use
>
> set(CMAKE_USER_MAKE_RULES_OVERRIDE MyInitialFlags)
>
> This "MyInitialFlags.cmake" is processed after compiler is determined and
> you can modify flags. But note, that they have "_INIT" suffix. For example,
>
> if(WIN32)
>     set(CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT
> "${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} /SUBSYSTEM:WINDOWS")
> endif()
>
> Later the cache will be populated from these _INIT variables (when you call
> project() or enable_language() command).
>
> On Thu, Feb 24, 2011 at 11:34 PM, Hanna Symanska 
> wrote:
>>
>> Hey,
>> I have a fairly large project with multiple executables, about 90 to
>> be exact and I would like to set the subsystem based on the
>> LINK_FLAGS_* property.
>> Is there a way for me to globally set this up in a top level
>> CMakeLists.txt file so that i do not have to place the below code in
>> every single project.
>> add_executable(project_n )
>> IF (WIN32)
>>   SET_TARGET_PROPERTIES(project_n PROPERTIES LINK_FLAGS_RELEASE
>> "/INCREMENTAL:NO /NODEFAULTLIB:LIBCMT.lib /SUBSYSTEM:WINDOWS" )
>>   SET_TARGET_PROPERTIES(project_n PROPERTIES LINK_FLAGS_RELWITHDEBINFO
>> "/NODEFAULTLIB:LIBCMT.lib /SUBSYSTEM:WINDOWS" )
>>   SET_TARGET_PROPERTIES(project_n PROPERTIES LINK_FLAGS_DEBUG
>> "/NODEFAULTLIB:LIBCMTD.lib /SUBSYSTEM:CONSOLE" )
>> ENDIF (WIN32)
>>
>> As it stands right now I have a top level CMakeLists.txt file with
>> several other CMakeLists.txt files in subsequent directories.
>> I have 1 CMakeLists.txt per project executable. I am trying to avoid
>> putting the above code in EVERY CMakeLists.txt file, when the only
>> thing I am changing is the target to reflect the the project that I am
>> setting the properties on.
>> I am using CMake 2.8.4 to generate visual studio 2008 project files to
>> be compiled 64-bit.
>> I do not want to use set_executable(project_n WIN32...) because I want
>> the subsystem to be console for projects that are being compiled as
>> debug.
>> - Hanna
>> ___
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at
>> http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the CMake FAQ at:
>> http://www.cmake.org/Wiki/CMake_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.cmake.org/mailman/listinfo/cmake
>
>
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Default visual studio filters

2011-02-25 Thread Aaron_Wright
I was curious about an answer to this question. I don't think source and 
header files should be separated either. It's just a nag, but if there was 
an easy fix, I'd jump on it.

---
Aaron Wright




From:   Orcun Gokbulut 
To: cmake@cmake.org
Date:   02/23/2011 07:48 AM
Subject:[CMake] Default visual studio filters
Sent by:cmake-boun...@cmake.org



Hello cmake users,
 
We are porting our visual studio based build system to cmake and its 
allmost done with some minor problems.
 
One of the minor problem is default visual c++ filters (source groups)
I don't like (actually hate) visual c++'s default *.cpp *.h filters. (Not 
the filter feature but the default filters) They make navigation hard at 
solution explorer and I want source and header file to be listed next to 
each other. 
Therefore I want all of my source files to be not included in a filter and 
remove "Source Files" and "Header Files" filters.  I have read the 
documentation and exprimented with SOURCE_GROUP command but I can not 
figure out how to remove default *.cpp and *.h source groups. 
 
Also I'm going to add a special regex filter that combines auto generated 
source codes in to a filter. Something like
source_group (ZPP REGULAR_EXPRESSION ".*\\.zpp")
 
 
How can I do that ?
 
Thanks every one,
Orçun___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Override find_package path for qt / multiarchitecture build windows 64 and windows 32

2011-02-25 Thread Clinton Stimpson

Yeah, that works too.
I thought it would be nice to encourage CMAKE_PREFIX_PATH which should work 
with any cmake find module.

I was easily able to control which Qt was found by modifying "myqt" below

#file(TO_CMAKE_PATH "$ENV{USERPROFILE}/qt/qt-4.5.2-2008-64" myqt)
file(TO_CMAKE_PATH "$ENV{USERPROFILE}/qt/qt-4.5.2-2008-32" myqt)
SET(CMAKE_PREFIX_PATH ${myqt} ${CMAKE_PREFIX_PATH})
find_package(Qt4)

The system loader distinguishes 32 from 64 bit, so you can put both Qt bin 
directories in your PATH.

Clint

On Friday, February 25, 2011 09:41:35 am David Cole wrote:
> Just:
> 
>   set( QT_QMAKE_EXECUTABLE ${QT_BINARY_DIR}/qmake.exe )
> 
> should be sufficient here. Everything else that FindQt does switches off of
> the qmake setting... If you change the qmake executable, all the other
> variables will adapt correctly.
> 
> 
> On Fri, Feb 25, 2011 at 10:21 AM, Thomas Wolf
>  
> > wrote:
> > 
> > follow up:
> > 
> > with an additional:
> >set( QT_INCLUDE_DIR $ENV{QTDIR}/include )
> >set( QT_HEADERS_DIR $ENV{QTDIR}/include )
> >set( QT_LIBRARY_DIR $ENV{QTDIR}/lib )
> >set( QT_BINARY_DIR $ENV{QTDIR}/bin )
> >set( QT_LIBRARY_DIR_TMP ${QT_LIBRARY_DIR} )
> >set( QT_QMAKE_EXECUTABLE ${QT_BINARY_DIR}/qmake.exe )
> >find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED )
> > 
> > <<<
> > 
> > it seems to work. I keep you updated. On a sidenote, i discovered your
> > bug request for cmake 2.8.3 regarding this topic.
> > 
> > With PATH and CMAKE_PREFIX_PATH i did not succeed so far..
> > 
> > Still the question remins open, how the systems loader can find the
> > proper dll versions... does QT have proper embedded manifests with the
> > loader beeing able to distinguish between 64bit and 32bit? in that case,
> > the QTDIR/bin for 32 bit and QTDIR64/bin for 64 bit can both be put into
> > the system's environment path..
> > 
> > Have a nice weekend,
> > Thomas
> > ___
> > Powered by www.kitware.com
> > 
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> > 
> > Please keep messages on-topic and check the CMake FAQ at:
> > http://www.cmake.org/Wiki/CMake_FAQ
> > 
> > Follow this link to subscribe/unsubscribe:
> > http://www.cmake.org/mailman/listinfo/cmake
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] cpack issue: %1 is not a valid Win32 application

2011-02-25 Thread thehighhat
> Interesting,
>
> Is the NSIS application used a 32bits or 64bits one?
>

32 bit.
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Override find_package path for qt / multiarchitecture build windows 64 and windows 32

2011-02-25 Thread David Cole
Just:

  set( QT_QMAKE_EXECUTABLE ${QT_BINARY_DIR}/qmake.exe )

should be sufficient here. Everything else that FindQt does switches off of
the qmake setting... If you change the qmake executable, all the other
variables will adapt correctly.


On Fri, Feb 25, 2011 at 10:21 AM, Thomas Wolf  wrote:

> follow up:
>
> with an additional:
>
> >>>
>set( QT_INCLUDE_DIR $ENV{QTDIR}/include )
>set( QT_HEADERS_DIR $ENV{QTDIR}/include )
>set( QT_LIBRARY_DIR $ENV{QTDIR}/lib )
>set( QT_BINARY_DIR $ENV{QTDIR}/bin )
>set( QT_LIBRARY_DIR_TMP ${QT_LIBRARY_DIR} )
>set( QT_QMAKE_EXECUTABLE ${QT_BINARY_DIR}/qmake.exe )
>find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED )
> <<<
>
> it seems to work. I keep you updated. On a sidenote, i discovered your
> bug request for cmake 2.8.3 regarding this topic.
>
> With PATH and CMAKE_PREFIX_PATH i did not succeed so far..
>
> Still the question remins open, how the systems loader can find the
> proper dll versions... does QT have proper embedded manifests with the
> loader beeing able to distinguish between 64bit and 32bit? in that case,
> the QTDIR/bin for 32 bit and QTDIR64/bin for 64 bit can both be put into
> the system's environment path..
>
> Have a nice weekend,
> Thomas
> ___
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Cmake + Cosmic Compiler

2011-02-25 Thread Alexander Neundorf
On Friday 25 February 2011, MS wrote:
> Hi
> Does anybodyknow whether it would be possible to use cross compiler "Cosmic
> Compiler" together with CMake under Windows?
>
> Cosmic consists of compiler(cxs12x.exe), xgate compiler(cxxgate.exe),
> linker(clnk.exe). XGATE is another processor within one integrated circuit.
> So the build process consists of
> 1. compiler execution

Ok.

> 2. xgate compiler execution

What does this do, i.e. what is its input and what is its output ?

> 3. linker execution - that links 1. and 2. part into one binary
>
> 1. When defining cmake toolchain it asks for CXX and C compilers - but we
> have only one  C compiler(cxs12x.exe), how to force CMake to not to use C++
> compiler

Do you mean there is no Cosmic C++ compiler and the projects are C-onlys, so 
cmake should not check at all for CXX ?

Do this by adding a project() call at the toplevel with the languages you want 
to have (i.e. C):

project(MyProject C)

This way cmake will only enable C (and not CXX).

> 2. Where to set XGate compiler

I do not yet understand what this compiler does, see above.

> 3. Linker executable is not the same as compiler executable - is it
> possible to set linker variable in CMake separately from compiler variable

Linking is done via the CMAKE_C_LINK_EXECUTABLE variable (see the files in 
Modules/ for it is set for the currently supported compilers).
I.e. you can basically set this to whatever you want, including checking for a 
CMAKE_LINKER and use that one.

Alex
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Override find_package path for qt / multiarchitecture build windows 64 and windows 32

2011-02-25 Thread Thomas Wolf
follow up:

with an additional:

>>>
set( QT_INCLUDE_DIR $ENV{QTDIR}/include )
set( QT_HEADERS_DIR $ENV{QTDIR}/include )
set( QT_LIBRARY_DIR $ENV{QTDIR}/lib )
set( QT_BINARY_DIR $ENV{QTDIR}/bin )
set( QT_LIBRARY_DIR_TMP ${QT_LIBRARY_DIR} )
set( QT_QMAKE_EXECUTABLE ${QT_BINARY_DIR}/qmake.exe )
find_package(Qt4 COMPONENTS QtCore QtGui REQUIRED )
<<<

it seems to work. I keep you updated. On a sidenote, i discovered your
bug request for cmake 2.8.3 regarding this topic.

With PATH and CMAKE_PREFIX_PATH i did not succeed so far..

Still the question remins open, how the systems loader can find the
proper dll versions... does QT have proper embedded manifests with the
loader beeing able to distinguish between 64bit and 32bit? in that case,
the QTDIR/bin for 32 bit and QTDIR64/bin for 64 bit can both be put into
the system's environment path..

Have a nice weekend,
Thomas
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Cmake + Cosmic Compiler

2011-02-25 Thread MS
Hi
Does anybodyknow whether it would be possible to use cross compiler "Cosmic 
Compiler" together with CMake under Windows?

Cosmic consists of compiler(cxs12x.exe), xgate compiler(cxxgate.exe), 
linker(clnk.exe). XGATE is another processor within one integrated circuit. So 
the build process consists of
1. compiler execution
2. xgate compiler execution
3. linker execution - that links 1. and 2. part into one binary

1. When defining cmake toolchain it asks for CXX and C compilers - but we have 
only one  C compiler(cxs12x.exe), how to force CMake to not to use C++ compiler
2. Where to set XGate compiler
3. Linker executable is not the same as compiler executable - is it possible to 
set linker variable in CMake separately from compiler variable

>From my point of view it's rather impossible staright-forward usage of Cosmic 
>together with CMake - maybe it could be done if some wrapper on all of them 
>was written.
Anyway I'd appreciate any comments concerning this issue.

Thanks
MS
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] target_link_libraries not working with add_library

2011-02-25 Thread Michael Wild
On 02/25/2011 01:48 PM, Felipe Ferreri Tonello wrote:
> Guys,
> 
> I'm doing this:
> add_library(lib_base ${sources})
> target_link_libraries(lib_base ${libs})
> 
> but look at the linker output:
> /usr/bin/ar cr liblib_base.a  CMakeFiles/lib_base.dir/diskman.cpp.o
> CMakeFiles/lib_base.dir/netutils.cpp.o
> CMakeFiles/lib_base.dir/base.cpp.o
> CMakeFiles/lib_base.dir/datetime.cpp.o
> CMakeFiles/lib_base.dir/datasource.cpp.o
> CMakeFiles/lib_base.dir/tinifile.cpp.o
> CMakeFiles/lib_base.dir/list.cpp.o
> CMakeFiles/lib_base.dir/memstream.cpp.o
> CMakeFiles/lib_base.dir/misc.cpp.o CMakeFiles/lib_base.dir/stringz.cpp.o
> CMakeFiles/lib_base.dir/critsec.cpp.o
> CMakeFiles/lib_base.dir/threads.cpp.o
> CMakeFiles/lib_base.dir/sockets.cpp.o
> CMakeFiles/lib_base.dir/sockserver.cpp.o
> CMakeFiles/lib_base.dir/sockthread.cpp.o
> CMakeFiles/lib_base.dir/strfunc.cpp.o CMakeFiles/lib_base.dir/ssl.cpp.o
> CMakeFiles/lib_base.dir/rwlock.cpp.o CMakeFiles/lib_base.dir/ipc.cpp.o
> CMakeFiles/lib_base.dir/decContext.cpp.o
> CMakeFiles/lib_base.dir/decimal.cpp.o
> CMakeFiles/lib_base.dir/decimal32.cpp.o
> CMakeFiles/lib_base.dir/decimal64.cpp.o
> CMakeFiles/lib_base.dir/decimal128.cpp.o
> CMakeFiles/lib_base.dir/decNumber.cpp.o
> CMakeFiles/lib_base.dir/decPacked.cpp.o
> /usr/bin/ranlib liblib_base.a
> 
> see? No linked libraries, only linked objects...
> 
> How to proceed?
> 

Well, you simply *CAN'T* link a static library against another library.
After all, it's just a glorified zip-file. But CMake will remember that
you specified that lib_base depends on ${libs}, and when you link a
executable or dynamic library against lib_base, CMake will link that
target also against ${libs}.

HTH

Michael
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] target_link_libraries not working with add_library

2011-02-25 Thread Felipe Ferreri Tonello

Guys,

I'm doing this:
add_library(lib_base ${sources})
target_link_libraries(lib_base ${libs})

but look at the linker output:
/usr/bin/ar cr liblib_base.a  CMakeFiles/lib_base.dir/diskman.cpp.o 
CMakeFiles/lib_base.dir/netutils.cpp.o 
CMakeFiles/lib_base.dir/base.cpp.o 
CMakeFiles/lib_base.dir/datetime.cpp.o 
CMakeFiles/lib_base.dir/datasource.cpp.o 
CMakeFiles/lib_base.dir/tinifile.cpp.o 
CMakeFiles/lib_base.dir/list.cpp.o 
CMakeFiles/lib_base.dir/memstream.cpp.o 
CMakeFiles/lib_base.dir/misc.cpp.o CMakeFiles/lib_base.dir/stringz.cpp.o 
CMakeFiles/lib_base.dir/critsec.cpp.o 
CMakeFiles/lib_base.dir/threads.cpp.o 
CMakeFiles/lib_base.dir/sockets.cpp.o 
CMakeFiles/lib_base.dir/sockserver.cpp.o 
CMakeFiles/lib_base.dir/sockthread.cpp.o 
CMakeFiles/lib_base.dir/strfunc.cpp.o CMakeFiles/lib_base.dir/ssl.cpp.o 
CMakeFiles/lib_base.dir/rwlock.cpp.o CMakeFiles/lib_base.dir/ipc.cpp.o 
CMakeFiles/lib_base.dir/decContext.cpp.o 
CMakeFiles/lib_base.dir/decimal.cpp.o 
CMakeFiles/lib_base.dir/decimal32.cpp.o 
CMakeFiles/lib_base.dir/decimal64.cpp.o 
CMakeFiles/lib_base.dir/decimal128.cpp.o 
CMakeFiles/lib_base.dir/decNumber.cpp.o 
CMakeFiles/lib_base.dir/decPacked.cpp.o

/usr/bin/ranlib liblib_base.a

see? No linked libraries, only linked objects...

How to proceed?

--
Felipe

___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Override find_package path for qt / multiarchitecture build windows 64 and windows 32

2011-02-25 Thread Thomas Wolf
> 
> Sure, the find_program() call in FindQt4.cmake has registry keys first, but 
> if 
> you look at the docs for find_program(), all of those paths are looked at 
> last.
> 
> The CMAKE_PREFIX_PATH and PATH variables have a higher priority, and you can 
> set those to control which Qt you want found.
> 

Hello,

thanks for the reply! It seems that it is the info I was looking for.

But till now i still did not succeed. Beforehand I have to mention that
i strongly oppose to standard path additons or environment variables to
make builds run, because i believe builds should run out of the box.

In that case, however, i think an exception is appropriate. Or to be
more specific, the build should set the environment or the variables by
itself, and leave the system as it is. This should work, because after
config phase, CMAKE has all its path in the cache, right?

So, this is what i came up with today:

snip --->

if( ${HAVE_64_BIT} )

  if( EXISTS $ENV{QTDIR64} )
MESSAGE( STATUS "* detected QTDIR64 variable with: $ENV{QTDIR64}" )

#redirect
SET( ENV{QTDIR} $ENV{QTDIR64} )
SET( ENV{PATH} "$ENV{PATH};$ENV{QTDIR64}/bin" )
MESSAGE( STATUS "* redirected QTDIR variable to: $ENV{QTDIR}" )
MESSAGE( STATUS " " )
MESSAGE( STATUS "* PATH: $ENV{PATH}" )
MESSAGE( STATUS " " )

#set prefix path
SET(CMAKE_PREFIX_PATH "$ENV{QTDIR64} ${CMAKE_PREFIX_PATH}" )
MESSAGE( STATUS "* CMAKE_PREFIX_PATH: ${CMAKE_PREFIX_PATH}" )
#NO_CMAKE_PACKAGE_REGISTRY NO_SYSTEM_ENVIRONMENT_PATH  PATHS
$ENV{QTDIR64}}

FIND_PACKAGE(Qt4 REQUIRED  HINT $ENV{QTDIR64}/bin )
  else( EXISTS $ENV{QTDIR64} )
MESSAGE ( FATAL_ERROR " !! ARCHITECTURE detected as 64 bit, but no
QTDIR64 found in environment. Aborting !!")
endif( EXISTS $ENV{QTDIR64} )

else( ${HAVE_64_BIT} )
  SET( ENV{PATH} "$ENV{PATH};$ENV{QTDIR}/bin" )
  MESSAGE( STATUS " " )
  MESSAGE( STATUS "* PATH: $ENV{PATH}" )
  MESSAGE( STATUS " " )
  FIND_PACKAGE(Qt4 REQUIRED)
endif ( ${HAVE_64_BIT} )

< --- snap

In the 64 bit console, cmake indeed goes to the QTDIR64 branch, and
QTDIR is set to QTDIR64, and as enforcing every chance i get ( :) ) for
the correct path, i set CMAKE_PREFIX_PATH to the QTDIR64 value. AND i
add it tio the path.. Specifically, I removed the 32bit QTDIR from the
stanard PATH.

*but*

..it does not work yet. So what is wrong? My output is still:


snip --->
-- * detected QTDIR64 variable with: C:\Libs\Qt\4.7.1_vc9_x64
-- * redirected QTDIR variable to: C:\Libs\Qt\4.7.1_vc9_x64
--
-- * PATH:
--
-- * CMAKE_PREFIX_PATH: C:\Libs\Qt\4.7.1_vc9_x64
-- QT_USE_FILE: C:/Program Files (x86)/CMake
2.8/share/cmake-2.8/Modules/UseQt4.cmake
--
-- QT_QTMAIN_LIBRARY_DEBUG:   C:/Libs/Qt/4.7.1_vc9/lib/qtmaind.lib
-- QT_QTMAIN_LIBRARY_RELEASE: C:/Libs/Qt/4.7.1_vc9/lib/qtmain.lib
-- QT_LIBRARY_RELEASE:
-- QT_LIBRARY_DEBUG:
--
-- current include:   C:/Libs/Qt/4.7.1_vc9/include
-- current lib:
-- definitions:   -DQT_DLL
-- CMAKE_CONFIGURATION_TYPES: DebugReleaseMinSizeRelRelWithDebInfo
-- CMAKE_BUILD_TYPE:
--  * done.
< --- snap

Note that i stripped the path output from my console output for sake of
readability, but there is no reference to qt, which i double checked.

So, what did i miss?

Regards,
Thomas

___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] How too set properties on all executables

2011-02-25 Thread Yuri Timenkov
Is changing global compiler/linker flags for all executables an option?

When you enable "show advanced options" in CMake, you should see them as
CMAKE_EXE_LINKER_FLAGS_.

Also, if you want to set them initially by your build system, use

set(CMAKE_USER_MAKE_RULES_OVERRIDE MyInitialFlags)

This "MyInitialFlags.cmake" is processed after compiler is determined and
you can modify flags. But note, that they have "_INIT" suffix. For example,

if(WIN32)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT
"${CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT} /SUBSYSTEM:WINDOWS")
endif()

Later the cache will be populated from these _INIT variables (when you call
project() or enable_language() command).

On Thu, Feb 24, 2011 at 11:34 PM, Hanna Symanska wrote:

> Hey,
> I have a fairly large project with multiple executables, about 90 to
> be exact and I would like to set the subsystem based on the
> LINK_FLAGS_* property.
> Is there a way for me to globally set this up in a top level
> CMakeLists.txt file so that i do not have to place the below code in
> every single project.
> add_executable(project_n )
> IF (WIN32)
>   SET_TARGET_PROPERTIES(project_n PROPERTIES LINK_FLAGS_RELEASE
> "/INCREMENTAL:NO /NODEFAULTLIB:LIBCMT.lib /SUBSYSTEM:WINDOWS" )
>   SET_TARGET_PROPERTIES(project_n PROPERTIES LINK_FLAGS_RELWITHDEBINFO
> "/NODEFAULTLIB:LIBCMT.lib /SUBSYSTEM:WINDOWS" )
>   SET_TARGET_PROPERTIES(project_n PROPERTIES LINK_FLAGS_DEBUG
> "/NODEFAULTLIB:LIBCMTD.lib /SUBSYSTEM:CONSOLE" )
> ENDIF (WIN32)
>
> As it stands right now I have a top level CMakeLists.txt file with
> several other CMakeLists.txt files in subsequent directories.
> I have 1 CMakeLists.txt per project executable. I am trying to avoid
> putting the above code in EVERY CMakeLists.txt file, when the only
> thing I am changing is the target to reflect the the project that I am
> setting the properties on.
> I am using CMake 2.8.4 to generate visual studio 2008 project files to
> be compiled 64-bit.
> I do not want to use set_executable(project_n WIN32...) because I want
> the subsystem to be console for projects that are being compiled as
> debug.
> - Hanna
> ___
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>
___
Powered by www.kitware.com

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

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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake