Skip to content

Commit

Permalink
Introduce build_camelcase and remove empty build type
Browse files Browse the repository at this point in the history
  • Loading branch information
masterleinad committed Mar 30, 2023
1 parent 3ba6e69 commit 34bd5d0
Showing 1 changed file with 10 additions and 19 deletions.
29 changes: 10 additions & 19 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ target_compile_options(${DEAL_II_TARGET_NAME} INTERFACE

foreach(build ${DEAL_II_BUILD_TYPES})
string(TOLOWER ${build} build_lowercase)
if("${build}" MATCHES "DEBUG")
set(build_camelcase "Debug")
elseif("${build}" MATCHES "RELEASE")
set(build_camelcase "Release")
endif()

#
# Combine all ${build} OBJECT targets to a ${build} library:
Expand Down Expand Up @@ -145,19 +150,9 @@ foreach(build ${DEAL_II_BUILD_TYPES})
"${DEAL_II_CXX_FLAGS_${build}}"
)
shell_escape_option_groups(_compile_options)
if(${build_lowercase} MATCHES "debug")
target_compile_options(${DEAL_II_TARGET_NAME} INTERFACE
"$<$<CONFIG:Debug>:$<$<COMPILE_LANGUAGE:CXX>:${_compile_options}>>"
)
target_compile_options(${DEAL_II_TARGET_NAME} INTERFACE
"$<$<CONFIG:>:$<$<COMPILE_LANGUAGE:CXX>:${_compile_options}>>"
)
endif()
if(${build_lowercase} MATCHES "release")
target_compile_options(${DEAL_II_TARGET_NAME} INTERFACE
"$<$<CONFIG:Release>:$<$<COMPILE_LANGUAGE:CXX>:${_compile_options}>>"
target_compile_options(${DEAL_II_TARGET_NAME} INTERFACE
"$<$<CONFIG:${build_camelcase}>:$<$<COMPILE_LANGUAGE:CXX>:${_compile_options}>>"
)
endif()

if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
set_target_properties(${DEAL_II_TARGET_NAME}_${build_lowercase}
Expand Down Expand Up @@ -203,13 +198,9 @@ foreach(build ${DEAL_II_BUILD_TYPES})
ARCHIVE DESTINATION ${DEAL_II_LIBRARY_RELDIR}
)

if(${build_lowercase} MATCHES "debug")
target_link_libraries(${DEAL_II_TARGET_NAME} INTERFACE "$<$<CONFIG:Debug>:${DEAL_II_TARGET_NAME}::${DEAL_II_TARGET_NAME}_${build_lowercase}>")
target_link_libraries(${DEAL_II_TARGET_NAME} INTERFACE "$<$<CONFIG:>:${DEAL_II_TARGET_NAME}::${DEAL_II_TARGET_NAME}_${build_lowercase}>")
endif()
if(${build_lowercase} MATCHES "release")
target_link_libraries(${DEAL_II_TARGET_NAME} INTERFACE "$<$<CONFIG:Release>:${DEAL_II_TARGET_NAME}::${DEAL_II_TARGET_NAME}_${build_lowercase}>")
endif()
target_link_libraries(${DEAL_II_TARGET_NAME} INTERFACE
"$<$<CONFIG:${build_camelcase}>:${DEAL_II_TARGET_NAME}::${DEAL_II_TARGET_NAME}_${build_lowercase}>"
)
endforeach()

file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/${DEAL_II_PROJECT_CONFIG_RELDIR})
Expand Down

0 comments on commit 34bd5d0

Please sign in to comment.