diff --git a/CMakeLists.txt b/CMakeLists.txt index e7b8f152..597a77ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1029,15 +1029,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 @@ -1046,10 +1037,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() diff --git a/cmake/draco_install.cmake b/cmake/draco_install.cmake index b9dda265..f626acce 100644 --- a/cmake/draco_install.cmake +++ b/cmake/draco_install.cmake @@ -66,10 +66,6 @@ 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( @@ -78,6 +74,11 @@ macro(draco_setup_install_target) RUNTIME DESTINATION "${bin_path}" ARCHIVE DESTINATION "${libs_path}" LIBRARY DESTINATION "${libs_path}") + else() + install( + TARGETS draco_static + EXPORT dracoExport + DESTINATION "${libs_path}") endif() endif()