From e47185adff53dd8bee74e03df75ef8cdeb93e0b7 Mon Sep 17 00:00:00 2001 From: Jonathan Lifflander Date: Thu, 26 Nov 2020 13:01:56 -0800 Subject: [PATCH 1/5] #168: cmake: fix bugs in export and installation --- src/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index aa0ef2c5..699b289a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -140,6 +140,8 @@ target_include_directories( $ ) +install(TARGETS detector EXPORT ${CHECKPOINT_LIBRARY}) + install( TARGETS ${CHECKPOINT_LIBRARY} EXPORT ${CHECKPOINT_LIBRARY} @@ -159,6 +161,7 @@ install( export( TARGETS ${CHECKPOINT_LIBRARY} + detector FILE "checkpointTargets.cmake" NAMESPACE vt::lib:: ) From 06ba3c578c7f70cde8c77422a780fc19fe23dc97 Mon Sep 17 00:00:00 2001 From: Jonathan Lifflander Date: Thu, 26 Nov 2020 13:09:19 -0800 Subject: [PATCH 2/5] #168: cmake: check for how it's being built before exporting target --- src/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 699b289a..015df8e0 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -140,7 +140,12 @@ target_include_directories( $ ) -install(TARGETS detector EXPORT ${CHECKPOINT_LIBRARY}) +if (vt_find_checkpoint_dep) + message(STATUS "Checkpoint: building in the context of a VT lib directory") +else() + install(TARGETS detector EXPORT ${CHECKPOINT_LIBRARY}) + set(DETECTOR_EXPORT detector) +endif() install( TARGETS ${CHECKPOINT_LIBRARY} @@ -161,7 +166,7 @@ install( export( TARGETS ${CHECKPOINT_LIBRARY} - detector + ${DETECTOR_EXPORT} FILE "checkpointTargets.cmake" NAMESPACE vt::lib:: ) From 79763fdda35e87923e8ddeac891237b5803bf64b Mon Sep 17 00:00:00 2001 From: Jonathan Lifflander Date: Thu, 26 Nov 2020 13:10:08 -0800 Subject: [PATCH 3/5] #168: cmake: fix inverted logic --- src/CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 015df8e0..0aef9809 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -142,7 +142,6 @@ target_include_directories( if (vt_find_checkpoint_dep) message(STATUS "Checkpoint: building in the context of a VT lib directory") -else() install(TARGETS detector EXPORT ${CHECKPOINT_LIBRARY}) set(DETECTOR_EXPORT detector) endif() From 5a84033464667d8c019b6275b4f43a8e04bc20ea Mon Sep 17 00:00:00 2001 From: Jonathan Lifflander Date: Thu, 26 Nov 2020 13:26:23 -0800 Subject: [PATCH 4/5] #168: cmake: use a differenct check for sub-directory/top-level --- src/CMakeLists.txt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0aef9809..b573652b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -140,8 +140,10 @@ target_include_directories( $ ) -if (vt_find_checkpoint_dep) - message(STATUS "Checkpoint: building in the context of a VT lib directory") +if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) + message(STATUS "Checkpoint: building as top-level") +else() + message(STATUS "Checkpoint: building as a sub-directory") install(TARGETS detector EXPORT ${CHECKPOINT_LIBRARY}) set(DETECTOR_EXPORT detector) endif() From cf70257895f99be11ec194dd82d96792d843374e Mon Sep 17 00:00:00 2001 From: Jonathan Lifflander Date: Wed, 2 Dec 2020 09:42:50 -0800 Subject: [PATCH 5/5] #168: cmake: fix test for sub-directory --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b573652b..ab029c08 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -140,7 +140,7 @@ target_include_directories( $ ) -if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR) +if("${CMAKE_SOURCE_DIR}/src" STREQUAL PROJECT_SOURCE_DIR) message(STATUS "Checkpoint: building as top-level") else() message(STATUS "Checkpoint: building as a sub-directory")