Skip to content

Commit 748769a

Browse files
committed
Handling options in cmake file improved
1 parent 62d0171 commit 748769a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,18 @@ option(APR_PREFER_EXTERNAL_GTEST "When found, use the installed GTEST libs inste
1818
option(APR_PREFER_EXTERNAL_BLOSC "When found, use the installed BLOSC libs instead of included sources" OFF)
1919
option(APR_BUILD_JAVA_WRAPPERS "Build APR JAVA wrappers" OFF)
2020
option(APR_USE_CUDA "should APR use CUDA? (experimental - under development)" OFF)
21+
option(APR_USE_OPENMP "should APR use OpenMP?" ON)
2122
option(APR_BENCHMARK "add benchmarking code" OFF)
2223

2324
# Validation of options
2425
if (NOT APR_BUILD_SHARED_LIB AND NOT APR_BUILD_STATIC_LIB)
2526
message(FATAL_ERROR "At least one target: APR_BUILD_SHARED_LIB or APR_BUILD_STATIC_LIB must be build!")
2627
endif()
28+
if (NOT APR_USE_LIBTIFF)
29+
if (APR_TESTS OR APR_BUILD_EXAMPLES)
30+
message(FATAL_ERROR "Building tests or examples not possible when APR_USE_LIBTIFF=OFF!")
31+
endif()
32+
endif()
2733

2834
list(APPEND CMAKE_MODULE_PATH
2935
${CMAKE_CURRENT_SOURCE_DIR}/cmake/
@@ -63,7 +69,7 @@ endif()
6369

6470
# Handle OpenMP
6571
find_package(OpenMP)
66-
if(NOT OPENMP_FOUND OR DISABLE_OPENMP)
72+
if(NOT OPENMP_FOUND OR NOT APR_USE_OPENMP)
6773
message(WARNING "OpenMP support not found or disabled with current compiler. While APR can compile like this, performance might not be optimal. Please see README.md for instructions.")
6874
else()
6975
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DHAVE_OPENMP ${OpenMP_C_FLAGS}")

0 commit comments

Comments
 (0)