Fix a CMake bad code

https://cmake.org/cmake/help/latest/command/if.html#command:if
> `if(ENV{some_var})` will always evaluate to false.
This commit is contained in:
Laurent Rineau 2022-06-17 15:09:50 +02:00
parent b99f1afac6
commit 5a038abf34
6 changed files with 7 additions and 7 deletions

View File

@ -114,7 +114,7 @@ function(CGAL_setup_CGAL_dependencies target)
target_link_libraries(${target} INTERFACE Threads::Threads) target_link_libraries(${target} INTERFACE Threads::Threads)
endif() endif()
if(CGAL_USE_ASAN OR ENV{CGAL_USE_ASAN}) if(CGAL_USE_ASAN OR "$ENV{CGAL_USE_ASAN}")
set(CMAKE_DISABLE_FIND_PACKAGE_TBB TRUE CACHE BOOL "CGAL_USE_ASAN (AddressSanitizer) and TBB are incompatible") set(CMAKE_DISABLE_FIND_PACKAGE_TBB TRUE CACHE BOOL "CGAL_USE_ASAN (AddressSanitizer) and TBB are incompatible")
target_compile_options(${target} INTERFACE -fsanitize=address) target_compile_options(${target} INTERFACE -fsanitize=address)
target_link_options(${target} INTERFACE -fsanitize=address) target_link_options(${target} INTERFACE -fsanitize=address)

View File

@ -189,7 +189,7 @@ endmacro()
# Now to actually find TBB # Now to actually find TBB
# #
#start with looking for TBB_DIR and TBB_ROOT #start with looking for TBB_DIR and TBB_ROOT
if((TBB_ROOT OR ENV{TBB_ROOT} OR ENV{TBB_DIR} ) AND NOT TBB_FOUND) if((TBB_ROOT OR "$ENV{TBB_ROOT}" OR "$ENV{TBB_DIR}" ) AND NOT TBB_FOUND)
find_package(TBB QUIET NO_MODULE NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH) find_package(TBB QUIET NO_MODULE NO_CMAKE_SYSTEM_PATH NO_SYSTEM_ENVIRONMENT_PATH)
endif() endif()
if(TBB_FOUND) if(TBB_FOUND)

View File

@ -13,7 +13,7 @@ find_package(Boost)
option(CGAL_ACTIVATE_CONCURRENT_MESH_3 "Activate parallelism in Mesh_3" OFF) option(CGAL_ACTIVATE_CONCURRENT_MESH_3 "Activate parallelism in Mesh_3" OFF)
if(CGAL_ACTIVATE_CONCURRENT_MESH_3 OR ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3}) if(CGAL_ACTIVATE_CONCURRENT_MESH_3 OR "$ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3}")
add_definitions(-DCGAL_CONCURRENT_MESH_3) add_definitions(-DCGAL_CONCURRENT_MESH_3)
find_package(TBB REQUIRED) find_package(TBB REQUIRED)
include(CGAL_TBB_support) include(CGAL_TBB_support)

View File

@ -39,7 +39,7 @@ endif()
option(CGAL_ACTIVATE_CONCURRENT_PSP3 "Enable concurrency" OFF) option(CGAL_ACTIVATE_CONCURRENT_PSP3 "Enable concurrency" OFF)
set(CGAL_libs CGAL::CGAL) set(CGAL_libs CGAL::CGAL)
if(CGAL_ACTIVATE_CONCURRENT_PSP3 OR ENV{CGAL_ACTIVATE_CONCURRENT_PSP3}) if(CGAL_ACTIVATE_CONCURRENT_PSP3 OR "$ENV{CGAL_ACTIVATE_CONCURRENT_PSP3}")
find_package(TBB REQUIRED) find_package(TBB REQUIRED)
include(CGAL_TBB_support) include(CGAL_TBB_support)
if(TARGET CGAL::TBB_support) if(TARGET CGAL::TBB_support)

View File

@ -110,7 +110,7 @@ endif()
option(CGAL_ACTIVATE_CONCURRENT_MESH_3 "Activate parallelism in Mesh_3" OFF) option(CGAL_ACTIVATE_CONCURRENT_MESH_3 "Activate parallelism in Mesh_3" OFF)
# And add -DCGAL_CONCURRENT_MESH_3 if that option is ON # And add -DCGAL_CONCURRENT_MESH_3 if that option is ON
if(CGAL_ACTIVATE_CONCURRENT_MESH_3 OR ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3}) if(CGAL_ACTIVATE_CONCURRENT_MESH_3 OR "$ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3}")
add_definitions(-DCGAL_CONCURRENT_MESH_3) add_definitions(-DCGAL_CONCURRENT_MESH_3)
if(NOT TBB_FOUND) if(NOT TBB_FOUND)
find_package(TBB REQUIRED) find_package(TBB REQUIRED)
@ -122,7 +122,7 @@ if(CGAL_ACTIVATE_CONCURRENT_MESH_3 OR ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3})
endif() endif()
endif() endif()
else(CGAL_ACTIVATE_CONCURRENT_MESH_3 OR ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3}) else(CGAL_ACTIVATE_CONCURRENT_MESH_3 OR "$ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3}")
option(LINK_WITH_TBB option(LINK_WITH_TBB
"Link with TBB anyway so we can use TBB timers for profiling" ON) "Link with TBB anyway so we can use TBB timers for profiling" ON)
if(LINK_WITH_TBB) if(LINK_WITH_TBB)

View File

@ -24,7 +24,7 @@ include(CGAL_TBB_support)
# Concurrent Mesh_3 # Concurrent Mesh_3
option(CGAL_ACTIVATE_CONCURRENT_MESH_3 "Activate parallelism in Mesh_3" OFF) option(CGAL_ACTIVATE_CONCURRENT_MESH_3 "Activate parallelism in Mesh_3" OFF)
if(CGAL_ACTIVATE_CONCURRENT_MESH_3 OR ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3}) if(CGAL_ACTIVATE_CONCURRENT_MESH_3 OR "$ENV{CGAL_ACTIVATE_CONCURRENT_MESH_3}")
add_definitions(-DCGAL_CONCURRENT_MESH_3) add_definitions(-DCGAL_CONCURRENT_MESH_3)
find_package(TBB REQUIRED) find_package(TBB REQUIRED)
include(CGAL_TBB_support) include(CGAL_TBB_support)