Skip to content

Commit

Permalink
Build as shared library or static library
Browse files Browse the repository at this point in the history
  • Loading branch information
topazus committed May 5, 2023
1 parent 9f856ab commit 099774c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
20 changes: 10 additions & 10 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1022,15 +1022,6 @@ else()
add_library(draco::draco ALIAS draco)

else()
draco_add_library(
NAME draco_static
OUTPUT_NAME draco
TYPE STATIC
DEFINES ${draco_defines}
INCLUDES ${draco_include_paths}
OBJLIB_DEPS ${draco_object_library_deps}
LIB_DEPS ${draco_lib_deps})

if(BUILD_SHARED_LIBS)
draco_add_library(
NAME draco_shared
Expand All @@ -1039,10 +1030,19 @@ else()
TYPE SHARED
DEFINES ${draco_defines}
INCLUDES ${draco_include_paths}
LIB_DEPS draco_static)
OBJLIB_DEPS ${draco_object_library_deps}
LIB_DEPS ${draco_lib_deps})
add_library(draco::draco ALIAS draco_shared)
set_target_properties(draco_shared PROPERTIES EXPORT_NAME draco)
else()
draco_add_library(
NAME draco_static
OUTPUT_NAME draco
TYPE STATIC
DEFINES ${draco_defines}
INCLUDES ${draco_include_paths}
OBJLIB_DEPS ${draco_object_library_deps}
LIB_DEPS ${draco_lib_deps})
add_library(draco::draco ALIAS draco_static)
set_target_properties(draco_static PROPERTIES EXPORT_NAME draco)
endif()
Expand Down
10 changes: 5 additions & 5 deletions cmake/draco_install.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,18 @@ macro(draco_setup_install_target)
ARCHIVE DESTINATION "${libs_path}"
LIBRARY DESTINATION "${libs_path}")
else()
install(
TARGETS draco_static
EXPORT dracoExport
DESTINATION "${libs_path}")

if(BUILD_SHARED_LIBS)
install(
TARGETS draco_shared
EXPORT dracoExport
RUNTIME DESTINATION "${bin_path}"
ARCHIVE DESTINATION "${libs_path}"
LIBRARY DESTINATION "${libs_path}")
else()
install(
TARGETS draco_static
EXPORT dracoExport
DESTINATION "${libs_path}")
endif()
endif()

Expand Down

0 comments on commit 099774c

Please sign in to comment.