From: razmyslovich Date: Wed, 19 Nov 2014 10:39:04 +0000 (+0100) Subject: 0025498: CMake refuses to build OCCT without any 3rd party libraries X-Git-Tag: V6_9_0_beta~278 X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=9bb81d6ce89f39883db8a2fc71e7da71b8d652fc;p=occt-copy.git 0025498: CMake refuses to build OCCT without any 3rd party libraries Adding guards for empty CMake variables --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 80bc04e5c7..02ac8ea252 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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()