Re: [CMake] building a library named 'general'

2013-11-20 Thread Michael DiCuccio
Yes, that works.


On Tue, Nov 19, 2013 at 7:21 PM, Matthew Woehlke <
matthew.woeh...@kitware.com> wrote:

> On 2013-11-19 19:07, Michael DiCuccio wrote:
>
>> Suppose you have a library named general:
>>
>> -
>> add_library(general foo bar)
>> -
>>
>> and then try to link it into an application:
>>
>> -
>> add_executable(myapp baz)
>> target_link_libraries(myapp general)
>> -
>>
>> cmake complains about the fact that 'general' is a reserved keyword, and I
>> have found no way to force or finagle linkage against a library named
>> 'libgeneral'.
>>
>
> Name the target something else (e.g. 'libgeneral') and modify its
> OUTPUT_NAME? (See set_target_properties and the OUTPUT_NAME property.)
>
> If all you need is to produce a 'libgeneral.so', that may suffice. If you
> also need the target name to be 'general'...
>
> --
> Matthew
>
> --
>
> 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

[CMake] building a library named 'general'

2013-11-19 Thread Michael DiCuccio
Hi!

I've come across an odd conundrum and need a little help resolving it.  I'm
porting a large toolkit to use CMake instead of an autoconf /
configure-based makefile system.  One problem we tripped across is a
library named 'libgeneral.so', built as part of the toolkit itself.  The
trouble is that the syltax of a CMakeLists.txt file does not permit linking
a library named general.

Suppose you have a library named general:

-
add_library(general foo bar)
-

...and then try to link it into an application:
-
add_executable(myapp baz)
target_link_libraries(myapp general)
-

cmake complains about the fact that 'general' is a reserved keyword, and I
have found no way to force or finagle linkage against a library named
'libgeneral'.

Any ideas?
--

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

[CMake] Bug in FindwxWidgets.cmake

2013-09-25 Thread Michael DiCuccio
Hi!

I've tripped across a bug in FindwxWidgets.cmake, in which (on Linux/Unix)
paths returned by wxconfig will be modified if their path names contain a
'-D'.  The patch below fixes this.  Can this please be applied?  Thanks!

--- FindwxWidgets.cmake.orig2013-09-25 10:34:52.835469000 -0400
+++ FindwxWidgets.cmake 2013-09-25 10:33:39.826506000 -0400
@@ -738,13 +738,13 @@

 # parse definitions from cxxflags;
 #   drop -D* from CXXFLAGS and the -D prefix
-string(REGEX MATCHALL "-D[^;]+"
+string(REGEX MATCHALL "\\<-D[^;]+"
   wxWidgets_DEFINITIONS  "${wxWidgets_CXX_FLAGS}")
-string(REGEX REPLACE "-D[^;]+(;|$)" ""
+string(REGEX REPLACE "\\<-D[^;]+(;|$)" ""
   wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
 string(REGEX REPLACE ";$" ""
   wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}")
-string(REPLACE "-D" ""
+string(REPLACE "\\<-D" ""
   wxWidgets_DEFINITIONS "${wxWidgets_DEFINITIONS}")

 # parse include dirs from cxxflags; drop -I prefix
--

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