Skip to content

Commit

Permalink
Better namespacing for internal cmake targets (LLNL#210)
Browse files Browse the repository at this point in the history
  • Loading branch information
daboehme authored Sep 20, 2019
1 parent 241f38f commit dfc2ba5
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 10 deletions.
3 changes: 1 addition & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,8 @@ if (WITH_GOTCHA)
else()
set(CALIPER_GOTCHA_CMAKE_MSG "Yes, using internal")
set(gotcha_INCLUDE_DIRS ${CMAKE_CURRENT_SOURCE_DIR}/ext/gotcha/include)
set(gotcha_LIBRARIES $<TARGET_OBJECTS:gotcha>)
set(CALIPER_HAVE_GOTCHA TRUE)
list(APPEND CALIPER_EXTERNAL_SOURCES ${gotcha_LIBRARIES})
list(APPEND CALIPER_EXTERNAL_SOURCES $<TARGET_OBJECTS:caliper-gotcha>)
endif()
else()
message(WARNING "Gotcha support requested but Gotcha requires Linux, this is ${CMAKE_SYSTEM_NAME}")
Expand Down
6 changes: 3 additions & 3 deletions ext/gotcha/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ set(GOTCHA_SOURCES
translations.c
)

add_library(gotcha OBJECT ${GOTCHA_SOURCES})
add_library(caliper-gotcha OBJECT ${GOTCHA_SOURCES})

if (${BUILD_SHARED_LIBS})
set_property(TARGET gotcha PROPERTY POSITION_INDEPENDENT_CODE TRUE)
set_property(TARGET caliper-gotcha PROPERTY POSITION_INDEPENDENT_CODE TRUE)
endif()

target_include_directories(gotcha PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../include")
target_include_directories(caliper-gotcha PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../include")
2 changes: 1 addition & 1 deletion src/caliper/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (${BUILD_SHARED_LIBS})
endif()

set(CALIPER_SERIAL_OBJS
$<TARGET_OBJECTS:util>
$<TARGET_OBJECTS:caliper-util>
$<TARGET_OBJECTS:caliper-common>

$<TARGET_OBJECTS:caliper-reader>
Expand Down
2 changes: 1 addition & 1 deletion src/common/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ set(CALIPER_COMMON_TEST_SOURCES
test_variant.cpp)

add_executable(test_caliper-common
$<TARGET_OBJECTS:util>
$<TARGET_OBJECTS:caliper-util>
$<TARGET_OBJECTS:caliper-common>
${CALIPER_COMMON_TEST_SOURCES})

Expand Down
4 changes: 2 additions & 2 deletions src/common/util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set(UTIL_SOURCES
unitfmt.c
vlenc.c)

add_library(util OBJECT ${UTIL_SOURCES})
add_library(caliper-util OBJECT ${UTIL_SOURCES})

if (${BUILD_SHARED_LIBS})
set_property(TARGET util PROPERTY POSITION_INDEPENDENT_CODE TRUE)
set_property(TARGET caliper-util PROPERTY POSITION_INDEPENDENT_CODE TRUE)
endif()
2 changes: 1 addition & 1 deletion src/reader/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set(CALIPER_READER_TEST_SOURCES
test_nodebuffer.cpp)

add_executable(test_caliper-reader
$<TARGET_OBJECTS:util>
$<TARGET_OBJECTS:caliper-util>
$<TARGET_OBJECTS:caliper-common>
$<TARGET_OBJECTS:caliper-reader>
${CALIPER_READER_TEST_SOURCES})
Expand Down

0 comments on commit dfc2ba5

Please sign in to comment.