CMake: Attempt to fix compilation error on Windows after recent changes
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 17 Sep 2015 09:17:00 +0000 (14:17 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 17 Sep 2015 09:17:00 +0000 (14:17 +0500)
CMakeLists.txt
extern/libopenjpeg/CMakeLists.txt

index 01116eec429b5a4d0b8632015d5d880e584de2fc..deafa90dbb54eb9435254e28f75346b18519c26b 100644 (file)
@@ -2325,6 +2325,10 @@ if(WITH_IMAGE_OPENJPEG)
                set(OPENJPEG_INCLUDE_DIRS "${CMAKE_SOURCE_DIR}/extern/libopenjpeg")
                set(OPENJPEG_DEFINES "-DOPJ_STATIC")
        endif()
+       # Special handling of Windows platform where openjpeg is always static.
+       if(WIN32)
+               set(OPENJPEG_DEFINES "-DOPJ_STATIC")
+       endif()
 endif()
 
 if(WITH_IMAGE_REDCODE)
index 82eeb01b4d4c988776344151fca8dcb900342cc0..ad49eee25b6d72f71fa1981c092d1688189b08c9 100644 (file)
@@ -31,11 +31,6 @@ set(INC_SYS
 
 )
 
-# TODO(sergey): Handle this via OPENJPEG_DEFINES
-if(WIN32)
-       add_definitions(-DOPJ_STATIC)
-endif()
-
 add_definitions(${OPENJPEG_DEFINES})
 
 set(SRC