pineapple-src/externals/vcpkg/ports/openjpeg/fix-static.patch
2022-07-23 03:01:36 +02:00

60 lines
1.8 KiB
Diff
Executable File

diff --git a/src/bin/jp2/CMakeLists.txt b/src/bin/jp2/CMakeLists.txt
index 4d4bd952f..e14b5a692 100644
--- a/src/bin/jp2/CMakeLists.txt
+++ b/src/bin/jp2/CMakeLists.txt
@@ -33,14 +33,6 @@ include_directories(
${TIFF_INCLUDE_DIRNAME}
)
-if(WIN32)
- if(BUILD_SHARED_LIBS)
- add_definitions(-DOPJ_EXPORTS)
- else()
- add_definitions(-DOPJ_STATIC)
- endif()
-endif()
-
# Loop over all executables:
foreach(exe opj_decompress opj_compress opj_dump)
add_executable(${exe} ${exe}.c ${common_SRCS})
diff --git a/src/lib/openjp2/CMakeLists.txt b/src/lib/openjp2/CMakeLists.txt
index ea4131a3e..dc63f49dd 100644
--- a/src/lib/openjp2/CMakeLists.txt
+++ b/src/lib/openjp2/CMakeLists.txt
@@ -84,12 +84,12 @@ endif()
# Build the library
if(WIN32)
+ add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS)
else()
- add_definitions(-DOPJ_STATIC)
+ target_compile_definitions(${OPENJPEG_LIBRARY_NAME} PUBLIC OPJ_STATIC)
endif()
- add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME})
else()
if(BUILD_SHARED_LIBS AND BUILD_STATIC_LIBS)
diff --git a/src/lib/openjpip/CMakeLists.txt b/src/lib/openjpip/CMakeLists.txt
index b3cb8ce88..fc6a9dde3 100644
--- a/src/lib/openjpip/CMakeLists.txt
+++ b/src/lib/openjpip/CMakeLists.txt
@@ -52,14 +52,14 @@ set(LOCAL_SRCS
)
# Build the library
+add_library(openjpip ${OPENJPIP_SRCS} ${LOCAL_SRCS})
if(WIN32)
if(BUILD_SHARED_LIBS)
add_definitions(-DOPJ_EXPORTS)
else()
- add_definitions(-DOPJ_STATIC)
+ target_compile_definitions(openjpip PUBLIC OPJ_STATIC)
endif()
endif()
-add_library(openjpip ${OPENJPIP_SRCS} ${LOCAL_SRCS})
set_target_properties(openjpip
PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
if(NOT ${CMAKE_VERSION} VERSION_LESS "2.8.12")