0025498: CMake refuses to build OCCT without any 3rd party libraries
[occt.git] / CMakeLists.txt
index 80bc04e..02ac8ea 100644 (file)
@@ -182,15 +182,19 @@ if (3RDPARTY_NOT_INCLUDED)
   message (FATAL_ERROR "NOT FOUND: ${3RDPARTY_NOT_INCLUDED}" )
 endif()
 
-list (REMOVE_DUPLICATES 3RDPARTY_INCLUDE_DIRS)
-string (REGEX REPLACE ";" "\n\t" 3RDPARTY_INCLUDE_DIRS_WITH_ENDS "${3RDPARTY_INCLUDE_DIRS}")
-message (STATUS "The directories containing 3rdparty headers: ${3RDPARTY_INCLUDE_DIRS_WITH_ENDS}")
-include_directories (${3RDPARTY_INCLUDE_DIRS})
-
-list (REMOVE_DUPLICATES 3RDPARTY_LIBRARY_DIRS)
-string (REGEX REPLACE ";" "\n\t" 3RDPARTY_LIBRARY_DIRS_WITH_ENDS "${3RDPARTY_LIBRARY_DIRS}")
-message (STATUS "The directories containing 3rdparty libraries: ${3RDPARTY_LIBRARY_DIRS_WITH_ENDS}")
-link_directories (${3RDPARTY_LIBRARY_DIRS})
+if (3RDPARTY_INCLUDE_DIRS)
+  list (REMOVE_DUPLICATES 3RDPARTY_INCLUDE_DIRS)
+  string (REGEX REPLACE ";" "\n\t" 3RDPARTY_INCLUDE_DIRS_WITH_ENDS "${3RDPARTY_INCLUDE_DIRS}")
+  message (STATUS "The directories containing 3rdparty headers: ${3RDPARTY_INCLUDE_DIRS_WITH_ENDS}")
+  include_directories (${3RDPARTY_INCLUDE_DIRS})
+endif()
+
+if (3RDPARTY_LIBRARY_DIRS)
+  list (REMOVE_DUPLICATES 3RDPARTY_LIBRARY_DIRS)
+  string (REGEX REPLACE ";" "\n\t" 3RDPARTY_LIBRARY_DIRS_WITH_ENDS "${3RDPARTY_LIBRARY_DIRS}")
+  message (STATUS "The directories containing 3rdparty libraries: ${3RDPARTY_LIBRARY_DIRS_WITH_ENDS}")
+  link_directories (${3RDPARTY_LIBRARY_DIRS})
+endif()
 
 OCCT_MAKE_BUILD_POSTFIX()