From 636dac3d3e5d0017742339cae5ec99675965bc5a Mon Sep 17 00:00:00 2001 From: Radovan Bast Date: Fri, 3 May 2019 09:56:05 +0200 Subject: [PATCH] do not link against OBJECT library directly; fixes #33 --- numgrid/CMakeLists.txt | 12 +++++++++++- test/CMakeLists.txt | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/numgrid/CMakeLists.txt b/numgrid/CMakeLists.txt index 694a5d9..5ea3702 100644 --- a/numgrid/CMakeLists.txt +++ b/numgrid/CMakeLists.txt @@ -33,6 +33,16 @@ add_library( $ ) +# this is an ugly hack to make the unit tests link +# a nicer solution would be not to duplicate this info +# since the target dependencies are already expressed +# in numgrid-objects +target_include_directories( + numgrid-shared + PUBLIC + ${CMAKE_CURRENT_BINARY_DIR} + ) + set_target_properties( numgrid-shared PROPERTIES @@ -61,7 +71,7 @@ if(ENABLE_FC_SUPPORT) target_link_libraries( numgrid_fortran_bindings PRIVATE - numgrid-objects + numgrid-shared ) endif() diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 731d74d..5532801 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -33,7 +33,7 @@ target_include_directories( target_link_libraries( cpp_test PRIVATE - numgrid-objects + numgrid-shared gtest_main ) @@ -52,7 +52,7 @@ if(ENABLE_FC_SUPPORT) target_link_libraries( fortran_${_test} numgrid_fortran_bindings - numgrid-objects + numgrid-shared ) add_test(