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

Way to disable CImg plugin during config? #91

Open
Randrianasulu opened this issue Oct 31, 2022 · 3 comments
Open

Way to disable CImg plugin during config? #91

Randrianasulu opened this issue Oct 31, 2022 · 3 comments

Comments

@Randrianasulu
Copy link

I have old CImg hanging around and build fails woth missing inpainting.h include.

right now I have CImg disabled in CMakeLists.txt by just commenting out a lot of references to it, but this is hack.

~ $ cat nocimg.hack.diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bbf98e52..5644532c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -78,7 +78,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/SupportExt)
 INCLUDE_DIRECTORIES(${OPENFX_PATH}/include)
 INCLUDE_DIRECTORIES(${OPENFX_PATH}/Support/include)
 INCLUDE_DIRECTORIES(${OPENFX_PATH}/Support/Plugins/include)
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/CImg)
+#INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/CImg)

 # Define "DEBUG" on debug builds
 SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
@@ -373,9 +373,9 @@ TARGET_COMPILE_DEFINITIONS(Misc PRIVATE OFX_EXTENSIONS_VEGAS OFX_EXTENSIONS_NUKE
 TARGET_LINK_LIBRARIES(Misc ${OPENGL_gl_LIBRARY})

 FILE(GLOB CIMG_SOURCES
-  "CImg/CImg.h"
-  "CImg/CImgFilter.cpp"
-  "CImg/CImgFilter.h"
+#  "CImg/CImg.h"
+#  "CImg/CImgFilter.cpp"
+#  "CImg/CImgFilter.h"
   "CImg/CImgOperator.cpp"
   "CImg/CImgOperator.h"
   "CImg/Bilateral/CImgBilateral.cpp"
@@ -418,19 +418,19 @@ FILE(GLOB CIMG_SOURCES
 )

 FILE(GLOB CIMG_RESOURCES
-  "CImg/Bilateral/net.sf.cimg.CImgBilateral.png"
-  "CImg/Bilateral/net.sf.cimg.CImgBilateral.svg"
-  "CImg/Blur/net.sf.cimg.CImgBlur.png"
-  "CImg/Blur/net.sf.cimg.CImgBlur.svg"
-  "CImg/Blur/net.sf.cimg.CImgChromaBlur.png"
-  "CImg/Blur/net.sf.cimg.CImgChromaBlur.svg"
-  "CImg/Blur/net.sf.cimg.CImgBloom.png"
-  "CImg/Blur/net.sf.cimg.CImgBloom.svg"
-  "CImg/Blur/eu.cimg.EdgeDetect.png"
-  "CImg/Blur/eu.cimg.EdgeDetect.svg"
-  "CImg/Blur/eu.cimg.EdgeExtend.png"
-  "CImg/Blur/eu.cimg.EdgeExtend.svg"
-  "CImg/Blur/fr.inria.EdgeBlur.png"
+#  "CImg/Bilateral/net.sf.cimg.CImgBilateral.png"
+#  "CImg/Bilateral/net.sf.cimg.CImgBilateral.svg"
+#  "CImg/Blur/net.sf.cimg.CImgBlur.png"
+#  "CImg/Blur/net.sf.cimg.CImgBlur.svg"
+#  "CImg/Blur/net.sf.cimg.CImgChromaBlur.png"
+#  "CImg/Blur/net.sf.cimg.CImgChromaBlur.svg"
+#  "CImg/Blur/net.sf.cimg.CImgBloom.png"
+#  "CImg/Blur/net.sf.cimg.CImgBloom.svg"
+#  "CImg/Blur/eu.cimg.EdgeDetect.png"
+#  "CImg/Blur/eu.cimg.EdgeDetect.svg"
+#  "CImg/Blur/eu.cimg.EdgeExtend.png"
+#  "CImg/Blur/eu.cimg.EdgeExtend.svg"
+#  "CImg/Blur/fr.inria.EdgeBlur.png"
   "CImg/Blur/fr.inria.EdgeBlur.svg"
   "CImg/Blur/net.sf.cimg.CImgLaplacian.png"
   "CImg/Blur/net.sf.cimg.CImgLaplacian.svg"
@@ -468,9 +468,9 @@ FILE(GLOB CIMG_RESOURCES
 )


-ADD_LIBRARY(CImg SHARED ${CIMG_SOURCES} ${SUPPORT_SOURCES})
-SET_TARGET_PROPERTIES(CImg PROPERTIES PREFIX "")
-SET_TARGET_PROPERTIES(CImg PROPERTIES SUFFIX ".ofx")
+#ADD_LIBRARY(CImg SHARED ${CIMG_SOURCES} ${SUPPORT_SOURCES})
+#SET_TARGET_PROPERTIES(CImg PROPERTIES PREFIX "")
+#SET_TARGET_PROPERTIES(CImg PROPERTIES SUFFIX ".ofx")

 # Add extra flags to the link step of the plugin
 if(APPLE)
@@ -480,13 +480,13 @@ elseif(WIN32)
     set_target_properties(CImg PROPERTIES LINK_FLAGS "-fvisibility=hidden,--version-script=${OFX_SUPPORT_HEADER_DIR}/linuxSymbols")
 else()
 # Linux & FreeBSD
-    set_target_properties(CImg PROPERTIES LINK_FLAGS "-Wl,-fvisibility=hidden,--version-script=${OFX_SUPPORT_HEADER_DIR}/linuxSymbols")
-    set_target_properties(CImg PROPERTIES INSTALL_RPATH "$ORIGIN/../../Libraries")
+#    set_target_properties(CImg PROPERTIES LINK_FLAGS "-Wl,-fvisibility=hidden,--version-script=${OFX_SUPPORT_HEADER_DIR}/linuxSymbols")
+#    set_target_properties(CImg PROPERTIES INSTALL_RPATH "$ORIGIN/../../Libraries")
 endif()

-TARGET_COMPILE_DEFINITIONS(CImg PRIVATE OFX_EXTENSIONS_VEGAS OFX_EXTENSIONS_NUKE OFX_EXTENSIONS_NATRON OFX_EXTENSIONS_TUTTLE OFX_SUPPORTS_OPENGLRENDER NOMINMAX)
+#TARGET_COMPILE_DEFINITIONS(CImg PRIVATE OFX_EXTENSIONS_VEGAS OFX_EXTENSIONS_NUKE OFX_EXTENSIONS_NATRON OFX_EXTENSIONS_TUTTLE OFX_SUPPORTS_OPENGLRENDER NOMINMAX)
 #TARGET_LINK_LIBRARIES(CImg Support)
-TARGET_LINK_LIBRARIES(CImg)
+#TARGET_LINK_LIBRARIES(CImg)

 # Find OpenMP
 # To compile on homebrew:
@@ -501,9 +501,9 @@ if (OPENMP_FOUND AND NOT MSVC)
     # set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
     # set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${OpenMP_SHARED_LINKER_FLAGS}")
     # set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
-    SET_TARGET_PROPERTIES(CImg PROPERTIES COMPILE_FLAGS "${OpenMP_CXX_FLAGS}")
-    SET_TARGET_PROPERTIES(CImg PROPERTIES LINK_FLAGS "${OpenMP_EXE_LINKER_FLAGS}")
-    TARGET_LINK_LIBRARIES(CImg ${OpenMP_CXX_LIB_NAMES})
+#    SET_TARGET_PROPERTIES(CImg PROPERTIES COMPILE_FLAGS "${OpenMP_CXX_FLAGS}")
+#    SET_TARGET_PROPERTIES(CImg PROPERTIES LINK_FLAGS "${OpenMP_EXE_LINKER_FLAGS}")
+#    TARGET_LINK_LIBRARIES(CImg ${OpenMP_CXX_LIB_NAMES})
 endif(OPENMP_FOUND AND NOT MSVC)

 IF (MSVC)
@@ -585,16 +585,16 @@ ELSE()
   INSTALL(FILES Info.plist
     DESTINATION Misc.ofx.bundle/Contents
   )
-  INSTALL(TARGETS CImg
-    RUNTIME DESTINATION CImg.ofx.bundle/Contents/${OFX_ARCH_NAME}
-    LIBRARY DESTINATION CImg.ofx.bundle/Contents/${OFX_ARCH_NAME}
-  )
-
-  INSTALL(FILES ${CIMG_RESOURCES}
-    DESTINATION CImg.ofx.bundle/Contents/Resources
-  )
-
-  INSTALL(FILES CImg/Info.plist
-    DESTINATION CImg.ofx.bundle/Contents
-  )
+#  INSTALL(TARGETS CImg
+#    RUNTIME DESTINATION CImg.ofx.bundle/Contents/${OFX_ARCH_NAME}
+#    LIBRARY DESTINATION CImg.ofx.bundle/Contents/${OFX_ARCH_NAME}
+ # )
+
+ # INSTALL(FILES ${CIMG_RESOURCES}
+#    DESTINATION CImg.ofx.bundle/Contents/Resources
+ # )
+
+#  INSTALL(FILES CImg/Info.plist
+#    DESTINATION CImg.ofx.bundle/Contents
+  #)
 ENDIF()
~ $
@rodlie
Copy link
Contributor

rodlie commented Oct 31, 2022

Just use the Makefiles (not CMake), you can then only build what you want.

@devernay
Copy link
Member

To clarify: the Makefile downloads CImg.h and Inpaint/inpaint.h with the right version.
All you need to do is (cd CImg && make CImg.h)

then you can proceed with the CMake build.

We should maybe let the CMake build download these directly, but no time to work on it, so feel free to contribute that. CIMGVERSIONshould be declared in a single place and used both by Makefile and CMake build, if possible.

@devernay
Copy link
Member

Note that CImg is header-only, so it won't mess up with your system install of CImg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants