0025498: CMake refuses to build OCCT without any 3rd party libraries
authorrazmyslovich <razmyslovich@volumegraphics.com>
Wed, 19 Nov 2014 10:39:04 +0000 (11:39 +0100)
committerbugmaster <bugmaster@opencascade.com>
Fri, 21 Nov 2014 12:46:01 +0000 (15:46 +0300)
Adding guards for empty CMake variables

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()