[cmake] Fix problem concering linking against DRAWEXE
@@ -161,8 +161,14 @@ IF(WITH_OCC)
if(NOT WITH_MECHANISMS)
COMPILE_WITH(OCE 0.15 REQUIRED ONLY mechanics)
SET(SICONOS_HAVE_OCC TRUE)
- LIST(REMOVE_ITEM SICONOS_LINK_LIBRARIES DRAWEXE)
- LIST(REMOVE_ITEM mechanics_LINK_LIBRARIES DRAWEXE)
+ endif()
+ if(OCE_VERSION VERSION_LESS 0.18)
+ # DRAWEXE link fails on some systems and must be removed.
+ # MESSAGE(STATUS "DRAWEXE link fails on some systems is removed.")
+ list(REMOVE_ITEM SICONOS_LINK_LIBRARIES DRAWEXE)
+ list(REMOVE_ITEM mechanics_LINK_LIBRARIES DRAWEXE)
+ set(SICONOS_LINK_LIBRARIES ${SICONOS_LINK_LIBRARIES} "m" CACHE INTERNAL "List of external libraries")
+ set(mechanics_LINK_LIBRARIES ${mechanics_LINK_LIBRARIES} "m" CACHE INTERNAL "List of external libraries")
endif()
ENDIF()
@@ -172,8 +178,9 @@ IF(WITH_MECHANISMS)
message(STATUS "Searching for OCE ....")
compile_with(OCE COMPONENTS ${OCE_TOOLKITS} ONLY mechanics)
- if(OCE_VERSION VERSION_LESS 0.16)
+ if(OCE_VERSION VERSION_LESS 0.18)
# DRAWEXE link fails on some systems and must be removed.
+ #MESSAGE(STATUS "DRAWEXE link fails on some systems is removed.")
list(REMOVE_ITEM mechanics_LINK_LIBRARIES DRAWEXE)
list(REMOVE_ITEM SICONOS_LINK_LIBRARIES DRAWEXE)
set(SICONOS_LINK_LIBRARIES ${SICONOS_LINK_LIBRARIES} "m" CACHE INTERNAL "List of external libraries")
@@ -186,7 +193,6 @@ IF(WITH_MECHANISMS)
message(WARNING "Ignoring OCE installation due to missing toolkit(s): ${OCE_MISSING_TOOLKITS}")
endif(NOT OCE_ALL_FOUND)
endif(OCE_FOUND)
-
if(OCE_FOUND)
# Include files reside in ${OCE_INCLUDE_DIRS};
# include_directories(${OCE_INCLUDE_DIRS})
