Skip to content

Commit

Permalink
CMake: Simplify add_library(DGtal) into one command
Browse files Browse the repository at this point in the history
No need to have two `add_library` commands based on `BUILD_SHARED_LIBS`.
`SHARED` will be added automatically if `BUILD_SHARED_LIBS` is `ON`
and `STATIC` if `OFF`.
  • Loading branch information
phcerdan committed Dec 8, 2020
1 parent c86b448 commit 309b81b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ list(TRANSFORM BOARD_SRC PREPEND "src/")
list(TRANSFORM DGTALIO_SRC PREPEND "src/")

# DGtal Target. Library is added on the top directory to use target_link_libraries for CMake < 3.13
if (BUILD_SHARED_LIBS)
add_library (DGtal SHARED ${DGTAL_SRC} ${DGTALIO_SRC} ${BOARD_SRC} )
else()
add_library (DGtal STATIC ${DGTAL_SRC} ${DGTALIO_SRC} ${BOARD_SRC})
endif()
add_library (DGtal ${DGTAL_SRC} ${DGTALIO_SRC} ${BOARD_SRC} )
target_include_directories(DGtal PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/src>
Expand Down

0 comments on commit 309b81b

Please sign in to comment.