[Bf-blender-cvs] [0b95945] master: CMake: Don't modify global CFlags when enabling/disabling OpenJpeg
Sergey Sharybin
noreply at git.blender.org
Wed Sep 16 16:10:56 CEST 2015
Commit: 0b959458ffc9d253b088fbb61c1b701152c5f71b
Author: Sergey Sharybin
Date: Wed Sep 16 19:08:26 2015 +0500
Branches: master
https://developer.blender.org/rB0b959458ffc9d253b088fbb61c1b701152c5f71b
CMake: Don't modify global CFlags when enabling/disabling OpenJpeg
===================================================================
M CMakeLists.txt
M extern/libopenjpeg/CMakeLists.txt
M source/blender/imbuf/CMakeLists.txt
===================================================================
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5b68ef1..01116ee 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -2320,9 +2320,10 @@ endif()
if(WITH_IMAGE_OPENJPEG)
if(WITH_SYSTEM_OPENJPEG)
# dealt with above
+ set(OPENJPEG_DEFINES "")
else()
set(OPENJPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/libopenjpeg")
- add_definitions(-DOPJ_STATIC)
+ set(OPENJPEG_DEFINES "-DOPJ_STATIC")
endif()
endif()
diff --git a/extern/libopenjpeg/CMakeLists.txt b/extern/libopenjpeg/CMakeLists.txt
index c602ddc..82eeb01 100644
--- a/extern/libopenjpeg/CMakeLists.txt
+++ b/extern/libopenjpeg/CMakeLists.txt
@@ -31,10 +31,13 @@ set(INC_SYS
)
+# TODO(sergey): Handle this via OPENJPEG_DEFINES
if(WIN32)
add_definitions(-DOPJ_STATIC)
endif()
+add_definitions(${OPENJPEG_DEFINES})
+
set(SRC
bio.c
cio.c
diff --git a/source/blender/imbuf/CMakeLists.txt b/source/blender/imbuf/CMakeLists.txt
index bdd8230..295a48d 100644
--- a/source/blender/imbuf/CMakeLists.txt
+++ b/source/blender/imbuf/CMakeLists.txt
@@ -120,7 +120,7 @@ if(WITH_IMAGE_OPENJPEG)
intern/jp2.c
)
- add_definitions(-DWITH_OPENJPEG)
+ add_definitions(-DWITH_OPENJPEG ${OPENJPEG_DEFINES})
endif()
if(WITH_IMAGE_REDCODE)
More information about the Bf-blender-cvs
mailing list