Skip to content
This repository was archived by the owner on Apr 8, 2021. It is now read-only.

Commit 15e4ab3

Browse files
committed
cmake: only shared libraries should be listed among the exported external libraries
1 parent f375c65 commit 15e4ab3

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

cmake/BITPITConfig.cmake.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ foreach(_DEPENDENCY ${_EXTERNAL_DEPENDENCIES})
181181
endforeach()
182182

183183
# Add external libraries
184-
list(APPEND BITPIT_LIBRARIES @BITPIT_EXTERNAL_LIBRARIES@)
184+
list(APPEND BITPIT_LIBRARIES @BITPIT_SHARED_EXTERNAL_LIBRARIES@)
185185

186186
# Add external inclued paths
187187
list(APPEND BITPIT_INCLUDE_DIRS @BITPIT_EXTERNAL_INCLUDE_DIRS@)

cmake/CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,19 @@ cmake_minimum_required(VERSION 2.8)
88
# Directory where the CMake configuration file will be installed
99
set(BITPIT_INSTALL_CMAKE_DIR "lib/cmake/${PROJECT_NAME}-${BITPIT_MAJOR_VERSION}.${BITPIT_MINOR_VERSION}" CACHE INTERNAL "Directory in which cmake modules will be installed")
1010

11+
#------------------------------------------------------------------------------------#
12+
# Generate external dependencies
13+
#
14+
# We need to remove the static libraries from the list of external dependencies.
15+
#------------------------------------------------------------------------------------#
16+
set(BITPIT_SHARED_EXTERNAL_LIBRARIES "")
17+
foreach(ENTRY IN LISTS BITPIT_EXTERNAL_LIBRARIES)
18+
get_filename_component(LIBRARY_EXTENSION ${ENTRY} EXT)
19+
if(NOT ${LIBRARY_EXTENSION} EQUAL ".a")
20+
list(APPEND BITPIT_SHARED_EXTERNAL_LIBRARIES ${ENTRY})
21+
endif()
22+
endforeach()
23+
1124
#------------------------------------------------------------------------------------#
1225
# Generate BITPITConfig.cmake
1326
#------------------------------------------------------------------------------------#

0 commit comments

Comments
 (0)