Re: [CMake] Issue with non-system gcc path

2019-11-02 Thread Rainer Poisel
Hi Mahmood,

I think there is a problem with your toolchain. Maybe there is an
environment variable (hot guess: LD_LIBRARY_PATH or something similar)
missing.

Have a look into the following files in your build directory:
  * CMakeFiles/CMakeOutput.log and
  * CMakeFiles/CMakeError.log

Maybe there is some helpful information there?

Best regards,
  Rainer

On Sat, Nov 2, 2019 at 2:36 PM Mahmood Naderan via CMake
 wrote:
>
> Hi,
>
> May I know what is wrong with the specifying a non-system gcc path?
>
>
> $ cmake .. -DCMAKE_C_COMPILER=/storage/users/mnaderan/tools/gcc-6.1.0/bin/gcc 
> -DCMAKE_CXX_COMPILER=/storage/users/mnaderan/tools/gcc-6.1.0/bin/g++  
>  -- The C compiler identification is unknown
> -- The CXX compiler identification is unknown
> -- Check for working C compiler: 
> /storage/users/mnaderan/tools/gcc-6.1.0/bin/gcc
> -- Check for working C compiler: 
> /storage/users/mnaderan/tools/gcc-6.1.0/bin/gcc -- broken
> CMake Error at 
> /storage/users/mnaderan/tools/cmake-3.15.4/share/cmake-3.15/Modules/CMakeTestCCompiler.cmake:60
>  (message):
>   The C compiler
>
> "/storage/users/mnaderan/tools/gcc-6.1.0/bin/gcc"
>
>   is not able to compile a simple test program.
>
>   It fails with the following output:
>
>
>
>
> Regards,
> Mahmood
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] Combining two static libraries into one

2019-07-03 Thread Rainer Poisel
I think there is no platform-independent way to solve this. Maybe you
could create two OBJECT libraries that are "linked" together into one
static lib.

Best regards,
  Rainer

On Tue, Jul 2, 2019 at 5:30 PM Cristian Adam  wrote:
>
>
> On Tue, Jul 2, 2019 at 5:14 PM vinay kumar Kotegowder 
>  wrote:
>>
>> Hi Everyone,
>>
>> I have a requirement on combining two static library into one.
>> Can anyone tell me how can I achieve this?
>>
>> Regards,
>> Vinay
>>
>
> If your compiler is GCC or Visual C++, you can use this as a base:
> https://cristianadam.eu/20190501/bundling-together-static-libraries-with-cmake/
>
> Cheers,
> Cristian.
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at: 
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more 
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at 
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] [ANNOUNCE] CMake 3.12.0-rc1 is ready for testing

2018-06-14 Thread Rainer Poisel
This is great news, thank you! Transitive dependencies for
OBJECT-libraries was one of the major missing features on my side.
Will definitely give it a try.

Regards,
  Rainer

On Thu, Jun 14, 2018 at 9:11 PM Robert Maynard
 wrote:
>
> I am proud to announce the first CMake 3.12 release candidate.
>   https://cmake.org/download/
>
> Documentation is available at:
>   https://cmake.org/cmake/help/v3.12
>
> Release notes appear below and are also published at
>   https://cmake.org/cmake/help/v3.12/release/3.12.html
>
> Some of the more significant changes in CMake 3.12 are:
>
> * The "target_link_libraries()" command now supports Object
>   Libraries. Linking to an object library uses its object files in
>   direct dependents and also propagates usage requirements.
>
> * The "target_link_libraries()" command may now be called to modify
>   targets created outside the current directory.
>
> * The "file(GLOB)" and "file(GLOB_RECURSE)" commands learned a new
>   flag "CONFIGURE_DEPENDS" which enables expression of build system
>   dependency on globbed directory's contents.
>
> * The "Compile Features" functionality is now aware of C++ 20.  No
>   specific features are yet enumerated besides the "cxx_std_20" meta-
>   feature.
>
> * The Visual Studio Generators for VS 2017 learned to support a
>   "version=14.##" option in the "CMAKE_GENERATOR_TOOLSET" value (e.g.
>   via the "cmake(1)" "-T" option) to specify a toolset version number.
>
> * The "cmake(1)" Build Tool Mode ("cmake --build") gained "--
>   parallel []" and "-j []" options to specify a parallel
>   build level.  They map to corresponding options of the native build
>   tool.
>
> * The "add_compile_definitions()" command was added to set
>   preprocessor definitions at directory level.  This supersedes
>   "add_definitions()".
>
> * The "cmake_minimum_required()" and "cmake_policy(VERSION)"
>   commands now accept a version range using the form
>   "[...]". The "" version is required but policies are
>   set based on the "" version.  This allows projects to specify a
>   range of versions for which they have been updated and avoid
>   explicit policy settings.
>
> * The "find_package()" command now searches a prefix specified by a
>   "PackageName_ROOT" CMake or environment variable.  Package roots are
>   maintained as a stack so nested calls to all "find_*" commands
>   inside find modules also search the roots as prefixes. See policy
>   "CMP0074".
>
> * A new "$" and "$"
>   "generator expression" has been added to enable consumption of
>   generator expressions whose evaluation results itself in generator
>   expressions.
>
> * A new "$" "generator expression" has been
>   added.
>
> * A new "$" "generator expression" has
>   been added.
>
> * The "FindCURL" module now provides imported targets.
>
> * The "FindJPEG" module now provides imported targets.
>
> * A "FindODBC" module was added to find an Open Database
>   Connectivity (ODBC) library.
>
> * New "FindPython3" and "FindPython2" modules, as well as a new
>   "FindPython" module, have been added to provide a new way to locate
>   python environments.
>
>
> CMake 3.12 Release Notes
> 
>
> Changes made since CMake 3.11 include the following.
>
>
> New Features
> 
>
>
> Generators
> --
>
> * The Visual Studio Generators for VS 2017 learned to support a
>   "version=14.##" option in the "CMAKE_GENERATOR_TOOLSET" value (e.g.
>   via the "cmake(1)" "-T" option) to specify a toolset version number.
>
>
> Command-Line
> 
>
> * The "cmake(1)" Build Tool Mode ("cmake --build") gained "--
>   parallel []" and "-j []" options to specify a parallel
>   build level.  They map to corresponding options of the native build
>   tool.
>
>
> Commands
> 
>
> * The "add_compile_definitions()" command was added to set
>   preprocessor definitions at directory level.  This supersedes
>   "add_definitions()".
>
> * The "cmake_minimum_required()" and "cmake_policy(VERSION)"
>   commands now accept a version range using the form
>   "[...]". The "" version is required but policies are
>   set based on the "" version.  This allows projects to specify a
>   range of versions for which they have been updated and avoid
>   explicit policy settings.
>
> * The "file(GLOB)" and "file(GLOB_RECURSE)" commands learned a new
>   flag "CONFIGURE_DEPENDS" which enables expression of build system
>   dependency on globbed directory's contents.
>
> * The "file(TOUCH)" and "file(TOUCH_NOCREATE)" commands were added
>   to expose "TOUCH" functionality without having to use CMake's
>   command- line tool mode with "execute_process()".
>
> * The "find_package()" command now searches a prefix specified by a
>   "PackageName_ROOT" CMake or environment variable.  Package roots are
>   maintained as a stack so nested calls to all "find_*" commands
>   inside find modules also search the roots as prefixes. See policy
>   "CMP0074".
>
> * The "install()" command learned an 

[CMake] Core-dumping CTest tests that fail

2018-01-31 Thread Rainer Poisel
Hello,

I have a few CTest tests that fail (e. g. SEGFAULT) or timeout on
Linux from time to time. The tests are performed in a Continuous
Integration (CI) environment and I would like to simplify the analysis
in case a test fails.

Is there a way to make failing CTest tests to dump their core? In my
CI I would then invoke gdb automatically to print a call-stack of all
involved threads.

Thanks and regards,
  Rainer
-- 

Powered by www.kitware.com

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

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

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

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

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


Re: [CMake] CMake: using dlopen

2018-01-06 Thread Rainer Poisel
Hi,

I would use ${CMAKE_DL_LIBS} in target_link_libraries:

  * https://cmake.org/cmake/help/v3.0/variable/CMAKE_DL_LIBS.html

Regards,
  Rainer


On Jan 6, 2018 16:19, "J Decker"  wrote:

probably just need target_link_libraries(  dl )

On Sat, Jan 6, 2018 at 6:34 AM, Franck Houssen 
wrote:

> Hello,
>
> I have an executable that needs dlopen.
>
> Googled this a bit: seems (surprisingly) there is no FindDLUtils ?!..
> Correct ? If so, why is this ?
> My understanding is that I need to go:
> ~BUILD> cmake -DCMAKE_LD_LIBS="-ldl -L/path/to/dl" ..
> which is, basically, telling to CMake where dl is (although this is the
> job of a build system, no ?!)
>
> Did I understand correctly ? Did I miss something ?
>
> Franck
>
> --
>
> 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/opensou
> rce/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> https://cmake.org/mailman/listinfo/cmake
>
>

--

Powered by www.kitware.com

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

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

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

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

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

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

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

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


[CMake] Duplicating a shared library and replacing target link libraries

2016-12-04 Thread Rainer Poisel
Hello,

I am currently developing a test-framework that offers two versions of
a base-library:
  * the "originalLibrary" and
  * a library "originalLibraryForward" that has the same interface as
the "originalLibrary". Calls to "originalLibraryForward"-functions can
be forwarded to the "originalLibrary", however it is also possible to
install pre- and post-call hooks, implement different behavior,
reference counting, etc.

Other libraries linking against "originalLibrary" can be tested by
linking against "originalLibraryForward". In my build environment I
want to have both versions of a library: one linking against
"originalLibrary" and one linking against "originalLibraryForward".

In order to minimize the effort to create the library linking against
"originalLibraryForward", I wrote a function that "recreates" the
library, however the linker is instructed to link against
"originalLibraryForward" instead of "originalLibrary":

8<==
function(AddMockedLibrary libraryName)
get_target_property(sourceFiles ${libraryName} SOURCES)
get_target_property(linkLibs ${libraryName} LINK_LIBRARIES)
get_target_property(includeDirs ${libraryName} INCLUDE_DIRECTORIES)
get_target_property(compileDefinitions ${libraryName} COMPILE_DEFINITIONS)
get_target_property(compileOptions ${libraryName} COMPILE_OPTIONS)

add_library(${libraryName}_MOCK SHARED
${sourceFiles}
)

target_include_directories(${libraryName}_MOCK PRIVATE
${includeDirs}
)

list(REMOVE_ITEM linkLibs
originalLibrary
)
target_link_libraries(${libraryName}_MOCK PRIVATE
${linkLibs}
originalLibraryForward
)

if (compileOptions)
target_compile_options(${libraryName}_MOCK PRIVATE
${compileOptions}
)
endif()

if (compileDefinitions)
target_compile_definitions(${libraryName}_MOCK PRIVATE
${compileDefinitions}
)
endif()
endfunction()
8<==

Now to my problems: this approach works fairly well with two exceptions:

The library linking against "originalLibraryForward" has to be
compiled from the original sources too. Actually performing the
linking step should be sufficient. Is there a way to accomplish that?

The function does not work when the library passed to
AddMockedLibrary() uses target_link_libraries() with IMPORTED targets
from, e. g. calls to find_package(). In order to make creating the
_MOCK-Library work I have to duplicate the original call to
find_package() before calling AddMockedLibrary(). Is there a way to
automate this as well?

Thanks for your help,
  Rainer
-- 

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] Exporting files that are not targets

2016-08-14 Thread Rainer Poisel
Hello,

I am currently working on a project that exports a static library
target including its dependencies so that it can be used with the
`find_package()' command.

With include files this is quite easy by using the $
and the $ generator expressions in combination with
the `installl()' command.

However, with dependent libraries which are not built by my project
things are a bit more complicated because
`target_include_directories()' and `target_link_libraries()' search
differently for their arguments.

Is there a way to add dependent libraries (they are all static) to my
package so that they are automatically found and linked to targets
which use my library target?

Thanks for your thoughts and your help,
  Rainer
-- 

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] Imported libraries and cyclic dependencies

2016-01-07 Thread Rainer Poisel
Hello,

I am using CMake 3.4.1.

Best regards,
  Rainer


On Fri, Jan 8, 2016 at 2:18 AM, iosif neitzke
<iosif.neitzke+cm...@gmail.com> wrote:
> Which version of CMake are you using?
>
>
> On 01/07/2016 04:28 PM, Rainer Poisel wrote:
>>
>> Hi,
>>
>> I am having troubles with linking a bunch of imported libraries that
>> have cyclic dependencies.
>>
>> This is what I am doing:
>>
>> 8<===
>> find_library(ESP8266_SDK_LIB_MAIN main ${ESP8266_SDK_BASE}/lib)
>> add_library(esp8266_main UNKNOWN IMPORTED)
>> set_property(TARGET esp8266_main PROPERTY IMPORTED_LOCATION
>> "${ESP8266_SDK_LIB_MAIN}")
>>
>> find_library(ESP8266_SDK_LIB_PHY phy ${ESP8266_SDK_BASE}/lib)
>> add_library(esp8266_phy UNKNOWN IMPORTED)
>> set_property(TARGET esp8266_phy PROPERTY IMPORTED_LOCATION
>> "${ESP8266_SDK_LIB_PHY}")
>>
>> find_library(ESP8266_SDK_LIB_PP pp ${ESP8266_SDK_BASE}/lib)
>> add_library(esp8266_pp UNKNOWN IMPORTED)
>> set_property(TARGET esp8266_pp PROPERTY IMPORTED_LOCATION
>> "${ESP8266_SDK_LIB_PP}")
>>
>> find_library(ESP8266_SDK_LIB_LWIP lwip ${ESP8266_SDK_BASE}/lib)
>> add_library(esp8266_lwip UNKNOWN IMPORTED)
>> set_property(TARGET esp8266_lwip PROPERTY IMPORTED_LOCATION
>> "${ESP8266_SDK_LIB_LWIP}")
>>
>> target_link_libraries(ESP8266_SDK INTERFACE
>> gcc
>> esp8266_lwip
>> esp8266_main
>> esp8266_phy
>> esp8266_pp
>> )
>>
>> target_link_libraries(esp8266_main INTERFACE
>> esp8266_lwip
>> esp8266_pp
>> esp8266_phy
>> )
>> 8<===
>>
>> The given example is not complete. However, I hope it is sufficient to
>> give you an idea of what I want to achieve: I would like to specify
>> the dependencies between imported libraries. Subsequently I want to
>> make the linker call mention my libraries several times in order to
>> make the linker resolve all dependency cycles (multiplicity).
>>
>> This is the corresponding error message:
>>
>> 8<===
>> CMake Error at external/esp8266-cmake/sdk/nonos-1.4.0.cmake:111
>> (target_link_libraries):
>> Cannot specify link libraries for target "esp8266_main" which is not built
>> by this project.
>> 8<===
>>
>> As a workaround I added the -Wl,--start-group (referred to as
>> BUILD_LINK_PREFIX) and the -Wl,--end-group (referred to as
>> BUILD_LINK_SUFFIX) arguments (yes, it is a GCC) directly to the
>> invocation of target_link_libraries() of my executable which has been
>> defined by add_executable() beforehand. But I think that this is just
>> a botch-up.
>>
>> Here is an example of the complete code (using the before-mentioned
>> workaround):
>>   * https://github.com/rpoisel/esp8266-mqtt
>>   *
>> https://github.com/rpoisel/esp8266-cmake/blob/master/main/CMakeLists.txt
>>
>> Thanks for any suggestions in advance,
>>   Rainer
>>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

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

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

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


[CMake] Imported libraries and cyclic dependencies

2016-01-07 Thread Rainer Poisel
Hi,

I am having troubles with linking a bunch of imported libraries that
have cyclic dependencies.

This is what I am doing:

8<===
find_library(ESP8266_SDK_LIB_MAIN main ${ESP8266_SDK_BASE}/lib)
add_library(esp8266_main UNKNOWN IMPORTED)
set_property(TARGET esp8266_main PROPERTY IMPORTED_LOCATION
"${ESP8266_SDK_LIB_MAIN}")

find_library(ESP8266_SDK_LIB_PHY phy ${ESP8266_SDK_BASE}/lib)
add_library(esp8266_phy UNKNOWN IMPORTED)
set_property(TARGET esp8266_phy PROPERTY IMPORTED_LOCATION
"${ESP8266_SDK_LIB_PHY}")

find_library(ESP8266_SDK_LIB_PP pp ${ESP8266_SDK_BASE}/lib)
add_library(esp8266_pp UNKNOWN IMPORTED)
set_property(TARGET esp8266_pp PROPERTY IMPORTED_LOCATION
"${ESP8266_SDK_LIB_PP}")

find_library(ESP8266_SDK_LIB_LWIP lwip ${ESP8266_SDK_BASE}/lib)
add_library(esp8266_lwip UNKNOWN IMPORTED)
set_property(TARGET esp8266_lwip PROPERTY IMPORTED_LOCATION
"${ESP8266_SDK_LIB_LWIP}")

target_link_libraries(ESP8266_SDK INTERFACE
gcc
esp8266_lwip
esp8266_main
esp8266_phy
esp8266_pp
)

target_link_libraries(esp8266_main INTERFACE
esp8266_lwip
esp8266_pp
esp8266_phy
)
8<===

The given example is not complete. However, I hope it is sufficient to
give you an idea of what I want to achieve: I would like to specify
the dependencies between imported libraries. Subsequently I want to
make the linker call mention my libraries several times in order to
make the linker resolve all dependency cycles (multiplicity).

This is the corresponding error message:

8<===
CMake Error at external/esp8266-cmake/sdk/nonos-1.4.0.cmake:111
(target_link_libraries):
Cannot specify link libraries for target "esp8266_main" which is not built
by this project.
8<===

As a workaround I added the -Wl,--start-group (referred to as
BUILD_LINK_PREFIX) and the -Wl,--end-group (referred to as
BUILD_LINK_SUFFIX) arguments (yes, it is a GCC) directly to the
invocation of target_link_libraries() of my executable which has been
defined by add_executable() beforehand. But I think that this is just
a botch-up.

Here is an example of the complete code (using the before-mentioned workaround):
  * https://github.com/rpoisel/esp8266-mqtt
  * https://github.com/rpoisel/esp8266-cmake/blob/master/main/CMakeLists.txt

Thanks for any suggestions in advance,
  Rainer
-- 

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] debugging symbols in project

2016-01-02 Thread Rainer Poisel
Owen,

sorry, I replied directly to you instead of replying to this mailing list.

Have you tried passing "-DCMAKE_BUILD_TYPE=Debug" to CMake when invoking it?

It is also possible to set this option when using "cmake-gui".

Many regards,
  Rainer


On Sat, Jan 2, 2016 at 9:23 PM, Owen Hogarth II  wrote:
> I have a simple cmake project that I am trying to test with gdb but I am
> having trouble. GDB is reporting now debugging symbols.
>
> CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)
> PROJECT(core_e)
>
>
> SET(CMAKE_MACOSX_RPATH 1)
>
> set(CMAKE_C_FLAGS "-g -Wall")
>
> FIND_PACKAGE(OpenGL REQUIRED)
>
> SET(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/headers/core_e.h)
> SET(SRC_FILES ${CMAKE_CURRENT_SOURCE_DIR}/core_e.c)
> SET(TARGET_LIBS glfw ${OPENGL_LIBRARIES})
> SET(TARGET_INC_DIR "${CMAKE_CURRENT_SOURCE_DIR}/headers" )
>
> ADD_LIBRARY(core_e SHARED ${SRC_FILES} ${HEADER_FILES})
> TARGET_LINK_LIBRARIES(core_en\ ${TARGET_LIBS})
> TARGET_INCLUDE_DIRECTORIES(core_e PUBLIC ${TARGET_INC_DIR})
>
>
>
>
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/support.html
> CMake Consulting: http://cmake.org/cmake/help/consulting.html
> CMake Training Courses: http://cmake.org/cmake/help/training.html
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/cmake
-- 

Powered by www.kitware.com

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

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

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

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

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


[CMake] Exporting/Publishing settings (e. g. include directories) from subdirectories

2015-07-14 Thread Rainer Poisel
Hi list,

I have a project that consists of several subdirectories. For example:

project-dir
+- component1
|  +- src
|  +- include-dir1
|  +- include-dir2
+- component2

Let's say I want component2 to add include-dir1 and include-dir2
from component1 as include directories without component2 knowing
that these two directories exist.

Therefore my question: Is there a way to import project
settings/properties which have been exported from other
subdirectories? And is cmake intended to be used like that?

I don't know whether I use the correct terms here but I hope that the
idea is clear.

Regards,
  Rainer
-- 

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] CPack: Different installation prefixes per CPACK_GENERATOR

2015-06-19 Thread Rainer Poisel
Hi,

and thanks for your quick reply!

Starting from a minimal, stripped down version of my build
configuration (thx for the tip!) I found that what I described
initially actually works. The reason it was not working was, that I
had turned the CPACK_SET_DESTDIR flag on in another place. After
removing the relevant SET() directive the installation prefixes worked
as desired.

For the record, this is my minimal, stripped down working version:

8 CMakeLists.txt =
cmake_minimum_required(VERSION 3.2)
project(stripped-down C)

add_executable(main main.c)

install(TARGETS main
RUNTIME DESTINATION bin
)

set(CPACK_GENERATOR DEB;TGZ)
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_SOURCE_DIR}/package.txt)

set(CPACK_PACKAGE_CONTACT Some One some@somewhere.com)

include(CPack)
8=

8 ${CMAKE_SOURCE_DIR}/package.txt) =
IF (CPACK_GENERATOR MATCHES DEB)
set(CPACK_PACKAGING_INSTALL_PREFIX /opt)
ELSEIF(CPACK_GENERATOR MATCHES TGZ)
set(CPACK_PACKAGING_INSTALL_PREFIX )
ENDIF()
8==

Best regards,
  Rainer

On Fri, Jun 19, 2015 at 10:38 PM, Eric Noulard eric.noul...@gmail.com wrote:


 2015-06-19 21:13 GMT+02:00 Rainer Poisel rainer.poi...@gmail.com:

 Dear list,

 how can I specify different installation prefixes for the different
 CPACK_GENERATORs?

 For example:

   * the DEB package should be installed to `/opt/project`
   * the TGZ archive should consist only of the `project` directory

 From the documentation I understood that I would have to use the
 CPACK_PROJECT_CONFIG_FILE variable. Using that, it should be possible
 to achieve the desired goal. However, it did not work for me.

 This is my CPack configuration:

 8
 set(CPACK_GENERATOR DEB;TGZ)
 set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_SOURCE_DIR}/cmake/package.linux.txt)
 8


 Did you set those before include(CPack) ?


 And this is my ${CMAKE_SOURCE_DIR}/cmake/package.linux.txt file:

 8
 IF (CPACK_GENERATOR MATCHES DEB)
 set(CPACK_NATIVE_INSTALL_DIRECTORY /opt)
 set(CMAKE_INSTALL_PREFIX /opt)
 set(CPACK_PACKAGING_INSTALL_PREFIX /opt)
 set(CPACK_INSTALL_DIRECTORY /opt)
 ELSEIF(CPACK_GENERATOR MATCHES TGZ)
 set(CPACK_NATIVE_INSTALL_DIRECTORY )
 set(CMAKE_INSTALL_PREFIX )
 set(CPACK_PACKAGING_INSTALL_PREFIX )
 set(CPACK_INSTALL_DIRECTORY )
 ENDIF()
 8

 I ensured that all files get parsed using MESSAGE() directives, but
 the prefix of my packages is always /usr/local.


 Looks good Strange enough...
  Would you be able to give us a standalone strip down example project of
 this
 and may be tell us which version of CPack/CMake you are using on which
 platform.


 What happen if you do something like;

 cpack -G DEB -D CPACK_PACKAGING_INSTALL_PREFIX=/tmp

 ?


 Thanks for giving me a few hints,
   Rainer
 --

 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




 --
 Eric
-- 

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] CPack: Different installation prefixes per CPACK_GENERATOR

2015-06-19 Thread Rainer Poisel
Dear list,

how can I specify different installation prefixes for the different
CPACK_GENERATORs?

For example:

  * the DEB package should be installed to `/opt/project`
  * the TGZ archive should consist only of the `project` directory

From the documentation I understood that I would have to use the
CPACK_PROJECT_CONFIG_FILE variable. Using that, it should be possible
to achieve the desired goal. However, it did not work for me.

This is my CPack configuration:

8
set(CPACK_GENERATOR DEB;TGZ)
set(CPACK_PROJECT_CONFIG_FILE ${CMAKE_SOURCE_DIR}/cmake/package.linux.txt)
8

And this is my ${CMAKE_SOURCE_DIR}/cmake/package.linux.txt file:

8
IF (CPACK_GENERATOR MATCHES DEB)
set(CPACK_NATIVE_INSTALL_DIRECTORY /opt)
set(CMAKE_INSTALL_PREFIX /opt)
set(CPACK_PACKAGING_INSTALL_PREFIX /opt)
set(CPACK_INSTALL_DIRECTORY /opt)
ELSEIF(CPACK_GENERATOR MATCHES TGZ)
set(CPACK_NATIVE_INSTALL_DIRECTORY )
set(CMAKE_INSTALL_PREFIX )
set(CPACK_PACKAGING_INSTALL_PREFIX )
set(CPACK_INSTALL_DIRECTORY )
ENDIF()
8

I ensured that all files get parsed using MESSAGE() directives, but
the prefix of my packages is always /usr/local.

Thanks for giving me a few hints,
  Rainer
-- 

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