Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve #882 static/shared dual build #942

Merged
merged 1 commit into from
Feb 26, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,10 @@
# Copyright Contributors to the OpenEXR Project.

# We require this to get object library link library support
if(OPENEXR_BUILD_BOTH_STATIC_SHARED)
if (${CMAKE_VERSION} VERSION_LESS "3.12.0")
message(FATAL_ERROR "CMake 3.12 or newer is required for object library support when building both static and shared libraries")
endif()
cmake_minimum_required(VERSION 3.12)
else()
cmake_minimum_required(VERSION 3.10)
endif()
cmake_minimum_required(VERSION 3.12)

if(POLICY CMP0074)
# enable find_package(<Package>) to use <Package>_ROOT as a hint
cmake_policy(SET CMP0074 NEW)
endif()

Expand Down
33 changes: 2 additions & 31 deletions Contrib/NuGet/OpenEXR-msvc-x64-build.nuget.bat
Original file line number Diff line number Diff line change
Expand Up @@ -55,31 +55,17 @@ rd /s /q %BUILDTREE%\OpenEXR
mkdir %BUILDTREE%\OpenEXR
cd %BUILDTREE%\OpenEXR
cmake -G %cmake_platform% ^
-DBUILD_ILMBASE_STATIC:BOOL=ON ^
-DOPENEXR_BUILD_ILMBASE:BOOL=ON ^
-DOPENEXR_BUILD_OPENEXR:BOOL=ON ^
-DBUILD_BUILD_SHARED_LIBS:BOOL=OFF ^
-DOPENEXR_BUILD_PYTHON_LIBS:BOOL=OFF ^
-DOPENEXR_BUILD_VIEWERS:BOOL=ON ^
-DOPENEXR_BUILD_TESTS:BOOL=ON ^
-DOPENEXR_RUN_FUZZ_TESTS:BOOL=OFF ^
-DOPENEXR_BUILD_UTILS:BOOL=ON ^
-DOPENEXR_BUILD_SHARED:BOOL=OFF ^
-DOPENEXR_BUILD_STATIC:BOOL=ON ^
-DCMAKE_CXX_FLAGS_RELEASE="/MD" ^
-DCMAKE_CXX_FLAGS_DEBUG="/MDd" ^
-DCMAKE_C_FLAGS_RELEASE="/MD" ^
-DCMAKE_C_FLAGS_DEBUG="/MDd" ^
-DZLIB_LIBRARY=%ZLIBDIR%\lib_release\zlibstatic.lib ^
-DZLIB_INCLUDE_DIR=%ZLIBDIR%\include ^
-DFLTK_BASE_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk.lib ^
-DFLTK_GL_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk_gl.lib ^
-DFLTK_FORMS_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk_forms.lib ^
-DFLTK_IMAGES_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk_images.lib ^
-DFLTK_BASE_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltkd.lib ^
-DFLTK_GL_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltk_gld.lib ^
-DFLTK_FORMS_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltk_formsd.lib ^
-DFLTK_IMAGES_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltk_imagesd.lib ^
-DFLTK_INCLUDE_DIR=%FLTKDIR%\include ^
-DCMAKE_INSTALL_PREFIX=%BINDIR% ^
-DCMAKE_BUILD_TYPE="Release" %SRC%
cmake --build . --config Release --target install
Expand All @@ -93,39 +79,24 @@ rd /s /q %BUILDTREE%\OpenEXR
mkdir %BUILDTREE%\OpenEXR
cd %BUILDTREE%\OpenEXR
cmake -G %cmake_platform% ^
-DBUILD_ILMBASE_STATIC:BOOL=ON ^
-DOPENEXR_BUILD_ILMBASE:BOOL=ON ^
-DOPENEXR_BUILD_OPENEXR:BOOL=ON ^
-DBUILD_BUILD_SHARED_LIBS:BOOL=OFF ^
-DOPENEXR_BUILD_PYTHON_LIBS:BOOL=OFF ^
-DOPENEXR_BUILD_VIEWERS:BOOL=ON ^
-DOPENEXR_BUILD_TESTS:BOOL=ON ^
-DOPENEXR_RUN_FUZZ_TESTS:BOOL=OFF ^
-DOPENEXR_BUILD_UTILS:BOOL=ON ^
-DOPENEXR_BUILD_SHARED:BOOL=OFF ^
-DOPENEXR_BUILD_STATIC:BOOL=ON ^
-DCMAKE_CXX_FLAGS_RELEASE="/MD" ^
-DCMAKE_CXX_FLAGS_DEBUG="/MDd" ^
-DCMAKE_C_FLAGS_RELEASE="/MD" ^
-DCMAKE_C_FLAGS_DEBUG="/MDd" ^
-DZLIB_LIBRARY=%ZLIBDIR%\lib_debug\zlibstaticd.lib ^
-DZLIB_INCLUDE_DIR=%ZLIBDIR%\include ^
-DFLTK_BASE_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk.lib ^
-DFLTK_GL_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk_gl.lib ^
-DFLTK_FORMS_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk_forms.lib ^
-DFLTK_IMAGES_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk_images.lib ^
-DFLTK_BASE_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltkd.lib ^
-DFLTK_GL_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltk_gld.lib ^
-DFLTK_FORMS_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltk_formsd.lib ^
-DFLTK_IMAGES_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltk_imagesd.lib ^
-DFLTK_INCLUDE_DIR=%FLTKDIR%\include ^
-DCMAKE_INSTALL_PREFIX=%BINDIR% ^
-DCMAKE_BUILD_TYPE="DEBUG" %SRC%
cmake --build . --config DEBUG --target install

move %BINDIR%lib %BINDIR%lib_debug
move %BINDIR%bin %BINDIR%bin_debug

REM # TODO: ENABLE SHARED Build
GOTO:nuget_req
mkdir %BINDIR%\static\
move /Y %BINDIR%\lib %BINDIR%\static\
Expand Down
28 changes: 2 additions & 26 deletions Contrib/NuGet/OpenEXR-msvc-x86-build.nuget.bat
Original file line number Diff line number Diff line change
Expand Up @@ -55,31 +55,19 @@ rd /s /q %BUILDTREE%\OpenEXR
mkdir %BUILDTREE%\OpenEXR
cd %BUILDTREE%\OpenEXR
cmake -G %cmake_platform% ^
-DBUILD_ILMBASE_STATIC:BOOL=ON ^
-DBUILD_BUILD_SHARED_LIBS:BOOL=OFF ^
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@meshula, looking at this again, shouldn't this be OPENEXR_BUILD_SHARED_LIBS, or just BUILD_SHARED_LIBS?

-DOPENEXR_BUILD_ILMBASE:BOOL=ON ^
-DOPENEXR_BUILD_OPENEXR:BOOL=ON ^
-DOPENEXR_BUILD_PYTHON_LIBS:BOOL=OFF ^
-DOPENEXR_BUILD_VIEWERS:BOOL=ON ^
-DOPENEXR_BUILD_TESTS:BOOL=ON ^
-DOPENEXR_RUN_FUZZ_TESTS:BOOL=OFF ^
-DOPENEXR_BUILD_UTILS:BOOL=ON ^
-DOPENEXR_BUILD_SHARED:BOOL=OFF ^
-DOPENEXR_BUILD_STATIC:BOOL=ON ^
-DCMAKE_CXX_FLAGS_RELEASE="/MD" ^
-DCMAKE_CXX_FLAGS_DEBUG="/MDd" ^
-DCMAKE_C_FLAGS_RELEASE="/MD" ^
-DCMAKE_C_FLAGS_DEBUG="/MDd" ^
-DZLIB_LIBRARY=%ZLIBDIR%\lib_release\zlibstatic.lib ^
-DZLIB_INCLUDE_DIR=%ZLIBDIR%\include ^
-DFLTK_BASE_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk.lib ^
-DFLTK_GL_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk_gl.lib ^
-DFLTK_FORMS_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk_forms.lib ^
-DFLTK_IMAGES_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk_images.lib ^
-DFLTK_BASE_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltkd.lib ^
-DFLTK_GL_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltk_gld.lib ^
-DFLTK_FORMS_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltk_formsd.lib ^
-DFLTK_IMAGES_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltk_imagesd.lib ^
-DFLTK_INCLUDE_DIR=%FLTKDIR%\include ^
-DCMAKE_INSTALL_PREFIX=%BINDIR% ^
-DCMAKE_BUILD_TYPE="Release" %SRC%
cmake --build . --config Release --target install
Expand All @@ -93,39 +81,27 @@ rd /s /q %BUILDTREE%\OpenEXR
mkdir %BUILDTREE%\OpenEXR
cd %BUILDTREE%\OpenEXR
cmake -G %cmake_platform% ^
-DBUILD_ILMBASE_STATIC:BOOL=ON ^
-DBUILD_BUILD_SHARED_LIBS:BOOL=OFF ^
-DOPENEXR_BUILD_ILMBASE:BOOL=ON ^
-DOPENEXR_BUILD_OPENEXR:BOOL=ON ^
-DOPENEXR_BUILD_PYTHON_LIBS:BOOL=OFF ^
-DOPENEXR_BUILD_VIEWERS:BOOL=ON ^
-DOPENEXR_BUILD_TESTS:BOOL=ON ^
-DOPENEXR_RUN_FUZZ_TESTS:BOOL=OFF ^
-DOPENEXR_BUILD_UTILS:BOOL=ON ^
-DOPENEXR_BUILD_SHARED:BOOL=OFF ^
-DOPENEXR_BUILD_STATIC:BOOL=ON ^
-DCMAKE_CXX_FLAGS_RELEASE="/MD" ^
-DCMAKE_CXX_FLAGS_DEBUG="/MDd" ^
-DCMAKE_C_FLAGS_RELEASE="/MD" ^
-DCMAKE_C_FLAGS_DEBUG="/MDd" ^
-DZLIB_LIBRARY=%ZLIBDIR%\lib_debug\zlibstaticd.lib ^
-DZLIB_INCLUDE_DIR=%ZLIBDIR%\include ^
-DFLTK_BASE_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk.lib ^
-DFLTK_GL_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk_gl.lib ^
-DFLTK_FORMS_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk_forms.lib ^
-DFLTK_IMAGES_LIBRARY_RELEASE=%FLTKDIR%\lib_release\fltk_images.lib ^
-DFLTK_BASE_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltkd.lib ^
-DFLTK_GL_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltk_gld.lib ^
-DFLTK_FORMS_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltk_formsd.lib ^
-DFLTK_IMAGES_LIBRARY_DEBUG=%FLTKDIR%\lib_debug\fltk_imagesd.lib ^
-DFLTK_INCLUDE_DIR=%FLTKDIR%\include ^
-DCMAKE_INSTALL_PREFIX=%BINDIR% ^
-DCMAKE_BUILD_TYPE="DEBUG" %SRC%
cmake --build . --config DEBUG --target install

move %BINDIR%lib %BINDIR%lib_debug
move %BINDIR%bin %BINDIR%bin_debug

REM # TODO: ENABLE SHARED Build
GOTO:nuget_req
mkdir %BINDIR%\static\
move /Y %BINDIR%\lib %BINDIR%\static\
Expand Down
8 changes: 3 additions & 5 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,9 @@ the directory in which to install OpenEXR:

The libraries in OpenEXR follow the standard cmake setting of
``BUILD_SHARED_LIBS`` to control whether to build static or shared
libraries. However, there also exists an option
``OPENEXR_BUILD_BOTH_STATIC_SHARED`` to enable building both shared
and static libraries as part of one configuration, in addition to
other customization options. Please see cmake/OpenEXRSetup.cmake for
these options.
libraries.

Please see cmake/OpenEXRSetup.cmake for other customization options.

## Custom Namespaces

Expand Down
84 changes: 6 additions & 78 deletions cmake/LibraryDefine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,22 @@ function(OPENEXR_DEFINE_LIBRARY libname)
set(multiValueArgs SOURCES HEADERS DEPENDENCIES PRIVATE_DEPS)
cmake_parse_arguments(OPENEXR_CURLIB "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

# only do the object library mechanism in a few cases:
# - xcode doesn't handle "empty" targets (i.e. add_library with
# an object lib only)
# - if we're not compiling both, don't add the extra layer to prevent
# extra compiles since we aren't doing that anyway
if(OPENEXR_BUILD_BOTH_STATIC_SHARED AND NOT (APPLE OR WIN32))
set(use_objlib TRUE)
else()
set(use_objlib)
endif()
if (MSVC)
set(_imath_extra_flags "/EHsc")
endif()
if(use_objlib)
set(objlib ${libname}_Object)
add_library(${objlib} OBJECT
${OPENEXR_CURLIB_HEADERS}
${OPENEXR_CURLIB_SOURCES})
else()
set(objlib ${libname})
add_library(${objlib}
${OPENEXR_CURLIB_HEADERS}
${OPENEXR_CURLIB_SOURCES})
endif()
set(objlib ${libname})
add_library(${objlib}
${OPENEXR_CURLIB_HEADERS}
${OPENEXR_CURLIB_SOURCES})

target_compile_features(${objlib} PUBLIC cxx_std_${OPENEXR_CXX_STANDARD})
if(OPENEXR_CURLIB_PRIV_EXPORT AND BUILD_SHARED_LIBS)
target_compile_definitions(${objlib} PRIVATE ${OPENEXR_CURLIB_PRIV_EXPORT})
if(WIN32 AND NOT OPENEXR_BUILD_BOTH_STATIC_SHARED)
if(WIN32)
target_compile_definitions(${objlib} PUBLIC OPENEXR_DLL)
endif()
endif()

if(OPENEXR_CURLIB_CURDIR)
target_include_directories(${objlib} INTERFACE $<BUILD_INTERFACE:${OPENEXR_CURLIB_CURDIR}>)
endif()
Expand All @@ -61,20 +45,6 @@ function(OPENEXR_DEFINE_LIBRARY libname)
endif()
set_property(TARGET ${objlib} PROPERTY PUBLIC_HEADER ${OPENEXR_CURLIB_HEADERS})

if(use_objlib)
install(TARGETS ${objlib}
EXPORT ${PROJECT_NAME}
PUBLIC_HEADER
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}
)
endif()

# let the default behaviour BUILD_SHARED_LIBS control the
# disposition of the default library...
if(use_objlib)
add_library(${libname} $<TARGET_OBJECTS:${objlib}>)
target_link_libraries(${libname} PUBLIC ${objlib})
endif()
if(BUILD_SHARED_LIBS)
set_target_properties(${libname} PROPERTIES
SOVERSION ${OPENEXR_SOVERSION}
Expand Down Expand Up @@ -104,46 +74,4 @@ function(OPENEXR_DEFINE_LIBRARY libname)
set(verlibname)
set(baselibname)
endif()

if(OPENEXR_BUILD_BOTH_STATIC_SHARED)
if(use_objlib)
add_library(${libname}_static STATIC $<TARGET_OBJECTS:${objlib}>)
target_link_libraries(${libname}_static INTERFACE ${objlib})
else()
# have to build multiple times... but have different flags anyway (i.e. no dll)
target_compile_definitions(${libname} PRIVATE OPENEXR_DLL)
set(curlib ${libname}_static)
add_library(${curlib} STATIC ${OPENEXR_CURLIB_SOURCES})
target_compile_features(${curlib} PUBLIC cxx_std_${OPENEXR_CXX_STANDARD})
if(OPENEXR_CURLIB_CURDIR)
target_include_directories(${curlib} INTERFACE $<BUILD_INTERFACE:${OPENEXR_CURLIB_CURDIR}>)
endif()
if(OPENEXR_CURLIB_CURBINDIR)
target_include_directories(${curlib} PRIVATE $<BUILD_INTERFACE:${OPENEXR_CURLIB_CURBINDIR}>)
endif()
target_link_libraries(${curlib} PUBLIC ${PROJECT_NAME}::Config ${OPENEXR_CURLIB_DEPENDENCIES})
if(OPENEXR_CURLIB_PRIVATE_DEPS)
target_link_libraries(${curlib} PRIVATE ${OPENEXR_CURLIB_PRIVATE_DEPS})
endif()
set(curlib)
endif()

set_target_properties(${libname}_static PROPERTIES
CXX_STANDARD_REQUIRED ON
CXX_EXTENSIONS OFF
POSITION_INDEPENDENT_CODE ON
SOVERSION ${OPENEXR_SOVERSION}
VERSION ${OPENEXR_LIB_VERSION}
OUTPUT_NAME "${libname}${OPENEXR_LIB_SUFFIX}${OPENEXR_STATIC_LIB_SUFFIX}"
)
add_library(${PROJECT_NAME}::${libname}_static ALIAS ${libname}_static)

install(TARGETS ${libname}_static
EXPORT ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
endif()
endfunction()
79 changes: 5 additions & 74 deletions cmake/OpenEXRLibraryDefine.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,15 @@ function(OPENEXR_DEFINE_LIBRARY libname)
set(multiValueArgs SOURCES HEADERS DEPENDENCIES PRIVATE_DEPS)
cmake_parse_arguments(OPENEXR_CURLIB "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})

# only do the object library mechanism in a few cases:
# - xcode doesn't handle "empty" targets (i.e. add_library with
# an object lib only)
# - if we're not compiling both, don't add the extra layer to prevent
# extra compiles since we aren't doing that anyway
if(OPENEXR_BUILD_BOTH_STATIC_SHARED AND NOT (APPLE OR WIN32))
set(use_objlib TRUE)
else()
set(use_objlib)
endif()

if(use_objlib)
set(objlib ${libname}_Object)
add_library(${objlib} OBJECT
${OPENEXR_CURLIB_HEADERS}
${OPENEXR_CURLIB_SOURCES})
else()
set(objlib ${libname})
add_library(${objlib}
${OPENEXR_CURLIB_HEADERS}
${OPENEXR_CURLIB_SOURCES})
endif()
set(objlib ${libname})
add_library(${objlib}
${OPENEXR_CURLIB_HEADERS}
${OPENEXR_CURLIB_SOURCES})

target_compile_features(${objlib} PUBLIC cxx_std_${OPENEXR_CXX_STANDARD})
if(OPENEXR_CURLIB_PRIV_EXPORT AND BUILD_SHARED_LIBS)
target_compile_definitions(${objlib} PRIVATE ${OPENEXR_CURLIB_PRIV_EXPORT})
if(WIN32 AND NOT OPENEXR_BUILD_BOTH_STATIC_SHARED)
if(WIN32)
target_compile_definitions(${objlib} PUBLIC OPENEXR_DLL)
endif()
endif()
Expand All @@ -56,19 +38,6 @@ function(OPENEXR_DEFINE_LIBRARY libname)
)
set_property(TARGET ${objlib} PROPERTY PUBLIC_HEADER ${OPENEXR_CURLIB_HEADERS})

if(use_objlib)
install(TARGETS ${objlib}
EXPORT ${PROJECT_NAME}
PUBLIC_HEADER
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/${OPENEXR_OUTPUT_SUBDIR}
)

# let the default behaviour BUILD_SHARED_LIBS control the
# disposition of the default library...
add_library(${libname} $<TARGET_OBJECTS:${objlib}>)
target_link_libraries(${libname} PUBLIC ${objlib})
endif()

if(BUILD_SHARED_LIBS)
set_target_properties(${libname} PROPERTIES
SOVERSION ${OPENEXR_SOVERSION}
Expand Down Expand Up @@ -99,42 +68,4 @@ function(OPENEXR_DEFINE_LIBRARY libname)
set(baselibname)
endif()

if(OPENEXR_BUILD_BOTH_STATIC_SHARED)
if(use_objlib)
add_library(${libname}_static STATIC $<TARGET_OBJECTS:${objlib}>)
target_link_libraries(${libname}_static INTERFACE ${objlib})
else()
# have to build multiple times... but have different flags anyway (i.e. no dll)
target_compile_definitions(${libname} PRIVATE OPENEXR_DLL)
set(curlib ${libname}_static)
add_library(${curlib} STATIC ${OPENEXR_CURLIB_SOURCES})
target_compile_features(${curlib} PUBLIC cxx_std_${OPENEXR_CXX_STANDARD})
if(OPENEXR_CURLIB_CURDIR)
target_include_directories(${curlib} INTERFACE $<BUILD_INTERFACE:${OPENEXR_CURLIB_CURDIR}>)
endif()
if(OPENEXR_CURLIB_CURBINDIR)
target_include_directories(${curlib} PRIVATE $<BUILD_INTERFACE:${OPENEXR_CURLIB_CURBINDIR}>)
endif()
target_link_libraries(${curlib} PUBLIC ${PROJECT_NAME}::Config ${OPENEXR_CURLIB_DEPENDENCIES})
if(OPENEXR_CURLIB_PRIVATE_DEPS)
target_link_libraries(${curlib} PRIVATE ${OPENEXR_CURLIB_PRIVATE_DEPS})
endif()
set(curlib)
endif()

set_target_properties(${libname}_static PROPERTIES
SOVERSION ${OPENEXR_SOVERSION}
VERSION ${OPENEXR_LIB_VERSION}
OUTPUT_NAME "${libname}${OPENEXR_LIB_SUFFIX}${OPENEXR_STATIC_LIB_SUFFIX}"
)
add_library(${PROJECT_NAME}::${libname}_static ALIAS ${libname}_static)

install(TARGETS ${libname}_static
EXPORT ${PROJECT_NAME}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)
endif()
endfunction()
Loading