Skip to content

Commit

Permalink
CMake: Don't attempt to create alias target if target of the same nam…
Browse files Browse the repository at this point in the history
…e already exists

Fixes #2546.
  • Loading branch information
dweindl authored Oct 17, 2024
1 parent d4bb0ce commit 9f821d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/CMakeLists.template.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ set(MODEL_DIR ${CMAKE_CURRENT_LIST_DIR})
set(SRC_LIST_LIB TPL_SOURCES ${MODEL_DIR}/wrapfunctions.cpp)

add_library(${PROJECT_NAME} ${SRC_LIST_LIB})
add_library(model ALIAS ${PROJECT_NAME})

# ${PROJECT_NAME} might already be "model"
if(NOT TARGET model)
add_library(model ALIAS ${PROJECT_NAME})
endif()

# Some special functions require boost
#
Expand Down

0 comments on commit 9f821d9

Please sign in to comment.