[CMake] transitive linkage of OBJECT library targets

2019-05-21 Thread Richard Szabo
Hi cmakers

I'm trying to get the following example working:
```
cmake_minimum_required(VERSION 3.14)
project(test_object_lib_nesting)

set(CMAKE_CXX_STANDARD 14)

add_library(first_object_lib OBJECT first.cpp)

add_library(second_object_lib OBJECT second.cpp)

target_link_libraries(second_object_lib first_object_lib)

add_executable(test_object_lib_nesting main.cpp)

target_link_libraries(test_object_lib_nesting second_object_lib)
```

The problem I have that the linker command line will have only the
second.cpp.o for linking the first.cpp.o will not be added as link
object to the exe. Causing missing symbols on exe linkage.

How to transitively resolve and link "nested" Object library targets ?.
-- 

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-commits] CMake branch, master, updated. v3.14.4-1033-gf01e18e

2019-05-21 Thread Kitware Robot via Cmake-commits
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  f01e18eb4699df530e310d376e66752fa6c1dedf (commit)
  from  0bf53483295a4b7de358e8b85ad44866d89633c5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f01e18eb4699df530e310d376e66752fa6c1dedf
commit f01e18eb4699df530e310d376e66752fa6c1dedf
Author: Kitware Robot 
AuthorDate: Wed May 22 00:01:06 2019 -0400
Commit: Kitware Robot 
CommitDate: Wed May 22 00:01:06 2019 -0400

CMake Nightly Date Stamp

diff --git a/Source/CMakeVersion.cmake b/Source/CMakeVersion.cmake
index 4303c25..e226579 100644
--- a/Source/CMakeVersion.cmake
+++ b/Source/CMakeVersion.cmake
@@ -1,5 +1,5 @@
 # CMake version number components.
 set(CMake_VERSION_MAJOR 3)
 set(CMake_VERSION_MINOR 14)
-set(CMake_VERSION_PATCH 20190521)
+set(CMake_VERSION_PATCH 20190522)
 #set(CMake_VERSION_RC 1)

---

Summary of changes:
 Source/CMakeVersion.cmake | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits


Re: [CMake] Building CMake with custom OpenSSL

2019-05-21 Thread Robert Maynard via CMake
I don't believe that we test CMake with that configuration of OpenSSL.
If it works, I cant promise it will continue to work going forward.

On Mon, May 20, 2019 at 4:44 PM A.Dmitrovsky  wrote:
>
> Hi,
>
> I am building CMake (on x64 linux) with custom OpenSSL and wondering if there 
> are any CMake requirements on how OpenSSL should be compiled. Specifically, 
> I'm interested to know if it is valid to link CMake with single-threaded 
> OpenSSL library (configured with "no-threads" option).
>
> May be it is documented somewhere?
>
> Regards,
> Anton
> --
>
> 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-commits] CMake branch, master, updated. v3.14.4-1032-g0bf5348

2019-05-21 Thread Kitware Robot via Cmake-commits
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  0bf53483295a4b7de358e8b85ad44866d89633c5 (commit)
   via  8538685c85f75d1904800999a50e12d3abb7484e (commit)
   via  368bcba28a9cd4a9f75d6671cd391b8ceef8e973 (commit)
   via  273257222ee6207dcb9ad290a08db5d6b7cc9db8 (commit)
  from  389f795d2e68d287fcbba0d5e0e4678f3d90fe4c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=0bf53483295a4b7de358e8b85ad44866d89633c5
commit 0bf53483295a4b7de358e8b85ad44866d89633c5
Merge: 8538685 2732572
Author: Brad King 
AuthorDate: Tue May 21 13:46:36 2019 +
Commit: Kitware Robot 
CommitDate: Tue May 21 09:46:45 2019 -0400

Merge topic 'string-param'

273257222e Source: change parameters to std::string

Acked-by: Kitware Robot 
Merge-request: !3340


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=8538685c85f75d1904800999a50e12d3abb7484e
commit 8538685c85f75d1904800999a50e12d3abb7484e
Merge: 389f795 368bcba
Author: Brad King 
AuthorDate: Tue May 21 13:44:09 2019 +
Commit: Kitware Robot 
CommitDate: Tue May 21 09:44:19 2019 -0400

Merge topic 'FindPostgreSQL-config-support'

368bcba28a FindPostgreSQL: Find debug lib, imported configs

Acked-by: Kitware Robot 
Merge-request: !3298


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=368bcba28a9cd4a9f75d6671cd391b8ceef8e973
commit 368bcba28a9cd4a9f75d6671cd391b8ceef8e973
Author: Andrei Lebedev 
AuthorDate: Thu May 9 20:17:28 2019 +0300
Commit: Brad King 
CommitDate: Mon May 20 11:29:04 2019 -0400

FindPostgreSQL: Find debug lib, imported configs

* Add find_library calls for debug and release
* Set imported configs for corresponding libraries in imported target
* Set debug/optimized in PostgreSQL_LIBRARIES

Signed-off-by: Andrei Lebedev 

diff --git a/Help/release/dev/FindPostgreSQL-config-support.rst 
b/Help/release/dev/FindPostgreSQL-config-support.rst
new file mode 100644
index 000..f24dc68
--- /dev/null
+++ b/Help/release/dev/FindPostgreSQL-config-support.rst
@@ -0,0 +1,5 @@
+FindPostgreSQL-config-support
+-
+
+* The :module:`FindPostgreSQL` module learned to find debug and release
+  variants separately.
diff --git a/Modules/FindPostgreSQL.cmake b/Modules/FindPostgreSQL.cmake
index 4b5e60e..433eae7 100644
--- a/Modules/FindPostgreSQL.cmake
+++ b/Modules/FindPostgreSQL.cmake
@@ -155,16 +155,30 @@ if ( WIN32 )
   set (PostgreSQL_LIBRARY_TO_FIND 
${PostgreSQL_LIB_PREFIX}${PostgreSQL_LIBRARY_TO_FIND})
 endif()
 
-find_library(PostgreSQL_LIBRARY
- NAMES ${PostgreSQL_LIBRARY_TO_FIND}
- PATHS
-   ${PostgreSQL_ROOT_DIRECTORIES}
- PATH_SUFFIXES
-   lib
-   ${PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES}
- # Help the user find it if we cannot.
- DOC "The ${PostgreSQL_LIBRARY_DIR_MESSAGE}"
-)
+function(__postgresql_find_library _name)
+  find_library(${_name}
+   NAMES ${ARGN}
+   PATHS
+ ${PostgreSQL_ROOT_DIRECTORIES}
+   PATH_SUFFIXES
+ lib
+ ${PostgreSQL_LIBRARY_ADDITIONAL_SEARCH_SUFFIXES}
+   # Help the user find it if we cannot.
+   DOC "The ${PostgreSQL_LIBRARY_DIR_MESSAGE}"
+  )
+endfunction()
+
+# For compatibility with versions prior to this multi-config search, honor
+# any PostgreSQL_LIBRARY that is already specified and skip the search.
+if(PostgreSQL_LIBRARY)
+  set(PostgreSQL_LIBRARIES "${PostgreSQL_LIBRARY}")
+else()
+  __postgresql_find_library(PostgreSQL_LIBRARY_RELEASE 
${PostgreSQL_LIBRARY_TO_FIND})
+  __postgresql_find_library(PostgreSQL_LIBRARY_DEBUG 
${PostgreSQL_LIBRARY_TO_FIND}d)
+  include(${CMAKE_CURRENT_LIST_DIR}/SelectLibraryConfigurations.cmake)
+  select_library_configurations(PostgreSQL)
+  mark_as_advanced(PostgreSQL_LIBRARY_RELEASE PostgreSQL_LIBRARY_DEBUG)
+endif()
 get_filename_component(PostgreSQL_LIBRARY_DIR ${PostgreSQL_LIBRARY} PATH)
 
 if (PostgreSQL_INCLUDE_DIR)
@@ -213,17 +227,36 @@ find_package_handle_standard_args(PostgreSQL
   VERSION_VAR PostgreSQL_VERSION_STRING)
 set(PostgreSQL_FOUND  ${POSTGRESQL_FOUND})
 
+function(__postgresql_import_library _target _var _config)
+  if(_config)
+set(_config_suffix "_${_config}")
+  else()
+set(_config_suffix "")
+  endif()
+
+  set(_lib "${${_var}${_config_suffix}}")
+  if(EXISTS "${_lib}")
+if(_config)
+  set_property(TARGET ${_target} APPEND PROPERTY
+IMPORTED_CONFIGURATIONS ${_config})
+endif()
+set_target_properties(${_target} PROPERTIES
+  IMPORTED_LOCATION${_config_suffix} "${_lib}")
+  endif()
+endfunction()
+
 # Now try to get the include and library path.
 

[Cmake-commits] CMake branch, master, updated. v3.14.4-1028-g389f795

2019-05-21 Thread Kitware Robot via Cmake-commits
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMake".

The branch, master has been updated
   via  389f795d2e68d287fcbba0d5e0e4678f3d90fe4c (commit)
   via  a59662bb5ba571907baf9d6d6ed4ea9dd025e706 (commit)
  from  1db0edb2a65b272a7c91e719e818da2e2ce49fb5 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=389f795d2e68d287fcbba0d5e0e4678f3d90fe4c
commit 389f795d2e68d287fcbba0d5e0e4678f3d90fe4c
Merge: 1db0edb a59662b
Author: Brad King 
AuthorDate: Tue May 21 13:39:52 2019 +
Commit: Kitware Robot 
CommitDate: Tue May 21 09:40:03 2019 -0400

Merge topic 'doc-ipo-check'

a59662bb5b Help: Add CheckIPOSupported link to INTERPROCEDURAL_OPTIMIZATION

Acked-by: Kitware Robot 
Merge-request: !


https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=a59662bb5ba571907baf9d6d6ed4ea9dd025e706
commit a59662bb5ba571907baf9d6d6ed4ea9dd025e706
Author: Ruslan Baratov 
AuthorDate: Thu May 16 23:00:19 2019 +0300
Commit: Ruslan Baratov 
CommitDate: Fri May 17 20:46:00 2019 +0300

Help: Add CheckIPOSupported link to INTERPROCEDURAL_OPTIMIZATION

diff --git a/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.rst 
b/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.rst
index 3f68c31..d3a5e94 100644
--- a/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.rst
+++ b/Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.rst
@@ -4,7 +4,9 @@ INTERPROCEDURAL_OPTIMIZATION
 Enable interprocedural optimization for a target.
 
 If set to true, enables interprocedural optimizations if they are
-known to be supported by the compiler.
+known :module:`to be supported ` by the compiler. Depending
+on value of policy :policy:`CMP0069`, the error will be reported or ignored,
+if interprocedural optimization is enabled but not supported.
 
 This property is initialized by the
 :variable:`CMAKE_INTERPROCEDURAL_OPTIMIZATION` variable if it is set when a

---

Summary of changes:
 Help/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.rst | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
CMake
___
Cmake-commits mailing list
Cmake-commits@cmake.org
https://cmake.org/mailman/listinfo/cmake-commits


Re: [CMake] cmake doesn't run all tests

2019-05-21 Thread hex

hello Eric,

Some of my recent changes prevented my function to add a build target. 
It was building either one or the other but not both. Therefore, half of 
the tests where missing.


You are right it is working correctly now.

thank you for your patience.

This should work at least it "works-for-me" so there must be some 
difference between the CMakeLists.txt in the directory that works and 
in the directory that does not.

Do you have a sample setup which exhibit the issue that you can share?

-- 

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 doesn't run all tests

2019-05-21 Thread Eric Noulard
Le mar. 21 mai 2019 à 11:45, hex  a écrit :

> hello,
>
> I have two modules in my CMake project:
>
> *root*
> *├── foo*
> *│   ├── CMakeLists.txt*
> *│   ├── src*
> *│   │   └── foo.c*
> *│   └── tests*
> *│   ├── foo_unit_test.c*
> *│   └── CMakeLists.txt*
> *├── CMakeLists.txt*
> *└── moo*
> *├── CMakeLists.txt*
> *├── src*
> *│   └── moo.c*
> *└── tests*
> *├── CMakeLists.txt*
> *└── moo_unit_test.c*
>
> my root project has:
>
> *enable_testing()*
>
> *add_subdirectory(adder)*
> *add_subdirectory(viterbi_encoder)*
>
>
> and each module has:
>
> *add_subdirectory(tests)*
>
>
> For the tests I am using add_test() and make all test.
>
> yet, this only runs the tests within the first add_subdirectory. Other
> modules are ignored.
>
> Do the CMakeLists.txt in the sub-directory have their own project command
or is your main top-level CMakeLists.txt the only CMakeLists.txt with
project  command ?

How can I run all tests at once?
>
> How do yu run the tests?

make tests ?
ninja tests ?
ctest ?

What does
$ ctest -N
says?

This should work at least it "works-for-me" so there must be some
difference between the CMakeLists.txt in the directory that works and in
the directory that does not.
Do you have a sample setup which exhibit the issue that you can share?


Thank you in advance.
>
> --
>
> 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
>


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


[CMake] cmake doesn't run all tests

2019-05-21 Thread hex

hello,

I have two modules in my CMake project:

/root//
//├── foo//
//│   ├── CMakeLists.txt//
//│   ├── src//
//│   │   └── foo.c//
//│   └── tests//
//│   ├── foo_unit_test.c//
//│   └── CMakeLists.txt//
//├── CMakeLists.txt//
//└── moo//
//    ├── CMakeLists.txt//
//    ├── src//
//    │   └── moo.c//
//    └── tests//
//    ├── CMakeLists.txt//
//    └── moo_unit_test.c//
/
my root project has:

/enable_testing()//
//
//add_subdirectory(adder)//
//add_subdirectory(viterbi_encoder)/


and each module has:

/add_subdirectory(tests)/


For the tests I am using add_test() and make all test.

yet, this only runs the tests within the first add_subdirectory. Other 
modules are ignored.


How can I run all tests at once?

Thank you in advance.

-- 

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