@@ -79,17 +79,28 @@ set(SWIG_FILES_PATH src/SWIG_files/wrapper)
79
79
################################
80
80
# OCE include and lib location #
81
81
################################
82
- find_package (OCE REQUIRED)
83
- if (OCE_FOUND)
84
- message (STATUS "OpenCASCADE Community Edition found." )
85
- include_directories (${OCE_INCLUDE_DIRS} )
86
- #set(OCE_LIBRARIES ${OCE_REQUIRED_LIBS})
87
- else ()
88
- set (OCE_include_PATH /usr/local/include /oce CACHE PATH "OCE include path" )
89
- set (OCE_LIB_PATH /usr/local/lib CACHE PATH "OCE lib path" )
82
+ if (DEFINED OCE_INCLUDE_PATH)
83
+ if (NOT DEFINED OCE_LIB_PATH)
84
+ message (FATAL_ERROR "OCE_LIB_PATH must be defined" )
85
+ endif (NOT DEFINED OCE_LIB_PATH)
86
+ set (OCE_INCLUDE_PATH ${OCE_INCLUDE_PATH} CACHE PATH "OCE include path" )
87
+ set (OCE_LIB_PATH ${OCE_LIB_PATH} CACHE PATH "OCE lib path" )
90
88
include_directories (${OCE_INCLUDE_PATH} )
91
89
link_directories (${OCE_LIB_PATH} )
92
- endif (OCE_FOUND)
90
+ # if OCE_INCLUDE_PATH is not passed at command line,
91
+ # find OCE automatically
92
+ else (OCE_INCLUDE_PATH)
93
+ find_package (OCE REQUIRED)
94
+ if (OCE_FOUND)
95
+ message (STATUS "OpenCASCADE Community Edition (OCE) found." )
96
+ include_directories (${OCE_INCLUDE_DIRS} )
97
+ else () # set default paths
98
+ set (OCE_INCLUDE_PATH /usr/local/include /oce CACHE PATH "OCE include path" )
99
+ set (OCE_LIB_PATH /usr/local/lib CACHE PATH "OCE lib path" )
100
+ include_directories (${OCE_INCLUDE_PATH} )
101
+ link_directories (${OCE_LIB_PATH} )
102
+ endif (OCE_FOUND)
103
+ endif (DEFINED OCE_INCLUDE_PATH)
93
104
94
105
##############################################
95
106
# Installation directory #
0 commit comments