From 15365a3acdf8984eb0c66a9c478c410be5bf9db0 Mon Sep 17 00:00:00 2001 From: Christian Schmitt Date: Sun, 7 Oct 2012 00:22:40 +0200 Subject: [PATCH] CMake: the deps are no longer optional. It makes no sense to compile without GDAL --- CMakeLists.txt | 22 ++++++++++------------ src/Lib/Geometry/CMakeLists.txt | 2 -- src/Prep/GDALChop/CMakeLists.txt | 4 ---- src/Prep/OGRDecode/CMakeLists.txt | 4 ---- src/Utils/poly2ogr/CMakeLists.txt | 4 ---- 5 files changed, 10 insertions(+), 26 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 84463bce..4b960133 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,26 +71,24 @@ find_package(Boost REQUIRED) find_package(ZLIB REQUIRED) find_package(Threads REQUIRED) find_package(SimGear 2.5.0 REQUIRED) +find_package(GDAL REQUIRED) +find_package(TIFF REQUIRED) # needed for SRTM +find_package(NewMat11 REQUIRED) +find_library(POCO_FOUNDATION PocoFoundation REQUIRED) +find_library(POCO_NET PocoNet REQUIRED) find_package(CGAL COMPONENTS Core REQUIRED) -if(${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION} VERSION_LESS 4.0) +if (CGAL_FOUND) + if(${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION} VERSION_LESS 4.0) message(FATAL_ERROR "CGAL >= 4.0 is required. Found ${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}") -else(${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION} VERSION_LESS 4.0) + else(${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION} VERSION_LESS 4.0) message(STATUS "Found CGAL ${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION}") -endif(${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION} VERSION_LESS 4.0) + endif(${CGAL_MAJOR_VERSION}.${CGAL_MINOR_VERSION} VERSION_LESS 4.0) +endif (CGAL_FOUND) -find_package(TIFF) # needed for SRTM if (CMAKE_CL_64) find_package(JPEG) # needed for SRTM endif (CMAKE_CL_64) -find_package(NewMat11) - -if(ENABLE_GDAL) - find_package(GDAL) # build OGRDecode -endif(ENABLE_GDAL) - -find_library(POCO_FOUNDATION PocoFoundation REQUIRED) -find_library(POCO_NET PocoNet REQUIRED) check_include_file(unistd.h HAVE_UNISTD_H) check_include_file(sys/time.h HAVE_SYS_TIME_H) diff --git a/src/Lib/Geometry/CMakeLists.txt b/src/Lib/Geometry/CMakeLists.txt index a4728b7e..c517a942 100644 --- a/src/Lib/Geometry/CMakeLists.txt +++ b/src/Lib/Geometry/CMakeLists.txt @@ -1,6 +1,4 @@ -if (GDAL_FOUND) include_directories(${GDAL_INCLUDE_DIR}) -endif (GDAL_FOUND) include( ${CGAL_USE_FILE} ) diff --git a/src/Prep/GDALChop/CMakeLists.txt b/src/Prep/GDALChop/CMakeLists.txt index ebde2875..c18d78b1 100644 --- a/src/Prep/GDALChop/CMakeLists.txt +++ b/src/Prep/GDALChop/CMakeLists.txt @@ -1,6 +1,3 @@ - -if (GDAL_FOUND) - include_directories(${GDAL_INCLUDE_DIR}) add_executable(gdalchop gdalchop.cxx) @@ -10,4 +7,3 @@ target_link_libraries(gdalchop ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} ) install(TARGETS gdalchop RUNTIME DESTINATION bin) -endif(GDAL_FOUND) diff --git a/src/Prep/OGRDecode/CMakeLists.txt b/src/Prep/OGRDecode/CMakeLists.txt index 0aca05c3..a35c517d 100644 --- a/src/Prep/OGRDecode/CMakeLists.txt +++ b/src/Prep/OGRDecode/CMakeLists.txt @@ -1,6 +1,3 @@ - -if (GDAL_FOUND) - include_directories(${GDAL_INCLUDE_DIR}) add_executable(ogr-decode ogr-decode.cxx) @@ -12,4 +9,3 @@ target_link_libraries(ogr-decode ) install(TARGETS ogr-decode RUNTIME DESTINATION bin) -endif(GDAL_FOUND) diff --git a/src/Utils/poly2ogr/CMakeLists.txt b/src/Utils/poly2ogr/CMakeLists.txt index 12a0e8c5..4101fbd1 100644 --- a/src/Utils/poly2ogr/CMakeLists.txt +++ b/src/Utils/poly2ogr/CMakeLists.txt @@ -1,6 +1,3 @@ - -if (GDAL_FOUND) - include_directories(${GDAL_INCLUDE_DIR}) add_executable(poly2ogr poly2ogr.cxx) @@ -16,4 +13,3 @@ target_link_libraries(poly2ogr ) install(TARGETS poly2ogr RUNTIME DESTINATION bin) -endif(GDAL_FOUND)