Skip to content

Commit

Permalink
update doc, and use cmake-gen-exp for debug suffix
Browse files Browse the repository at this point in the history
Co-authored-by: Tobias Ribizel <ribizel@kit.edu>
  • Loading branch information
yhmtsai and upsj committed Nov 1, 2022
1 parent 8218704 commit 17cf199
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -346,10 +346,12 @@ if(GINKGO_BUILD_DOC)
endif()


# add escape character '\' and convert the list to string
# add escape character '\' for space
string(REPLACE " " "\ " PKG_CMAKE_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")
# add escape character '\' for space in regex mode
list(TRANSFORM GINKGO_INTERFACE_LINK_FLAGS REPLACE " " "\\\\ ")
list(TRANSFORM GINKGO_INTERFACE_CXX_FLAGS REPLACE " " "\\\\ ")
# convert the list to string
string(REPLACE ";" " " GINKGO_INTERFACE_CXX_FLAGS "${GINKGO_INTERFACE_CXX_FLAGS}")
string(REPLACE ";" " " GINKGO_INTERFACE_LINK_FLAGS "${GINKGO_INTERFACE_LINK_FLAGS}")
configure_file(${Ginkgo_SOURCE_DIR}/cmake/ginkgo.pc.in
Expand Down
12 changes: 2 additions & 10 deletions cmake/information_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,7 @@ macro(ginkgo_interface_libraries_recursively INTERFACE_LIBS)
foreach(_libs ${INTERFACE_LIBS})
if (TARGET ${_libs})
if("${_libs}" MATCHES "ginkgo.*")
set(GINKGO_INTERFACE_LIB_NAME "-l${_libs}")
if(upper_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
set(GINKGO_INTERFACE_LIB_NAME "${GINKGO_INTERFACE_LIB_NAME}${CMAKE_DEBUG_POSTFIX}")
endif()
set(GINKGO_INTERFACE_LIB_NAME "-l${_libs}$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>")
list(APPEND GINKGO_INTERFACE_LIBS_FOUND "${GINKGO_INTERFACE_LIB_NAME}")
endif()
# Get the link flags and treat them
Expand Down Expand Up @@ -81,12 +78,7 @@ macro(ginkgo_interface_information)
unset(GINKGO_INTERFACE_LIBS_FOUND)
unset(GINKGO_INTERFACE_CFLAGS_FOUND)
# Prepare recursively populated library list
string(TOUPPER "${CMAKE_BUILD_TYPE}" upper_CMAKE_BUILD_TYPE)
if (upper_CMAKE_BUILD_TYPE STREQUAL "DEBUG")
list(APPEND GINKGO_INTERFACE_LIBS_FOUND "-lginkgo${CMAKE_DEBUG_POSTFIX}")
else()
list(APPEND GINKGO_INTERFACE_LIBS_FOUND "-lginkgo")
endif()
list(APPEND GINKGO_INTERFACE_LIBS_FOUND "-lginkgo$<$<CONFIG:Debug>:${CMAKE_DEBUG_POSTFIX}>")
# Prepare recursively populated include directory list
list(APPEND GINKGO_INTERFACE_CFLAGS_FOUND
"-I${CMAKE_INSTALL_PREFIX}/${GINKGO_INSTALL_INCLUDE_DIR}")
Expand Down

0 comments on commit 17cf199

Please sign in to comment.