diff --git a/CMakeLists.txt b/CMakeLists.txt index a0b6bf56..621834c4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,6 +28,7 @@ find_package(Boost REQUIRED) find_package(ZLIB REQUIRED) find_package(Threads REQUIRED) find_package(SimGear 2.5.0 REQUIRED) +find_package(GPC REQUIRED) find_package(TIFF) # needed for SRTM find_package(NewMat11) @@ -73,8 +74,6 @@ include_directories(${PROJECT_BINARY_DIR}/src/Include) add_definitions(-DHAVE_CONFIG_H) -#check_function_exists(mkfifo HAVE_MKFIFO) - # configure a header file to pass some of the CMake settings # to the source code configure_file ( diff --git a/CMakeModules/FindGPC.cmake b/CMakeModules/FindGPC.cmake new file mode 100644 index 00000000..054e4e1d --- /dev/null +++ b/CMakeModules/FindGPC.cmake @@ -0,0 +1,25 @@ + +FIND_PATH(GPC_INCLUDE_DIR gpc.h + HINTS $ENV{GPC_DIR} + PATH_SUFFIXES include + PATHS + /usr/local + /usr + /opt +) + + +FIND_LIBRARY(GPC_LIBRARY + NAMES genpolyclip gpc + HINTS + $ENV{GPC_DIR} + PATH_SUFFIXES lib64 lib libs64 libs libs/Win32 libs/Win64 + PATHS + /usr/local + /usr + /opt +) + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(GPC DEFAULT_MSG + GPC_LIBRARY GPC_INCLUDE_DIR) diff --git a/src/Airports/GenAirports/CMakeLists.txt b/src/Airports/GenAirports/CMakeLists.txt index 9f4c3b8c..4c799eac 100644 --- a/src/Airports/GenAirports/CMakeLists.txt +++ b/src/Airports/GenAirports/CMakeLists.txt @@ -26,6 +26,6 @@ target_link_libraries(genapts TriangleJRS ${SIMGEAR_CORE_LIBRARIES} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} - genpolyclip + ${GPC_LIBRARY} ${NEWMAT_LIBRARY}) diff --git a/src/BuildTiles/Clipper/CMakeLists.txt b/src/BuildTiles/Clipper/CMakeLists.txt index 25b53a74..298dbd49 100644 --- a/src/BuildTiles/Clipper/CMakeLists.txt +++ b/src/BuildTiles/Clipper/CMakeLists.txt @@ -10,4 +10,4 @@ target_link_libraries(testclipper Clipper Osgb36 Triangulate Polygon Geometry ${SIMGEAR_CORE_LIBRARIES} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} - genpolyclip) + ${GPC_LIBRARY}) diff --git a/src/BuildTiles/Main/CMakeLists.txt b/src/BuildTiles/Main/CMakeLists.txt index 02e09df7..648610e3 100644 --- a/src/BuildTiles/Main/CMakeLists.txt +++ b/src/BuildTiles/Main/CMakeLists.txt @@ -9,14 +9,14 @@ set_target_properties(fgfs-construct PROPERTIES "DEFAULT_USGS_MAPFILE=\"${PKGDATADIR}/usgsmap.txt\";DEFAULT_PRIORITIES_FILE=\"${PKGDATADIR}/default_priorities.txt\"" ) target_link_libraries(fgfs-construct - Clipper Osgb36 Triangulate GenOutput + Clipper GenOutput Osgb36 Triangulate Match Polygon Geometry Array Optimize Output landcover poly2tri TriangleJRS ${SIMGEAR_CORE_LIBRARIES} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} - genpolyclip) + ${GPC_LIBRARY}) add_executable(fgfs-master @@ -25,4 +25,4 @@ add_executable(fgfs-master target_link_libraries(fgfs-master ${SIMGEAR_CORE_LIBRARIES} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} - ) \ No newline at end of file + ) diff --git a/src/Lib/CMakeLists.txt b/src/Lib/CMakeLists.txt index c8cc4e94..5cca9c65 100644 --- a/src/Lib/CMakeLists.txt +++ b/src/Lib/CMakeLists.txt @@ -5,7 +5,7 @@ include_directories(${PROJECT_SOURCE_DIR}/src/Lib) include_directories(${PROJECT_SOURCE_DIR}/src/BuildTiles) add_subdirectory(Array) -add_subdirectory(Dem) +add_subdirectory(DEM) add_subdirectory(Geometry) add_subdirectory(HGT) add_subdirectory(Optimize) diff --git a/src/Lib/TriangleJRS/CMakeLists.txt b/src/Lib/TriangleJRS/CMakeLists.txt index 7108d4d9..001c3ee0 100644 --- a/src/Lib/TriangleJRS/CMakeLists.txt +++ b/src/Lib/TriangleJRS/CMakeLists.txt @@ -10,7 +10,8 @@ add_library(TriangleJRS STATIC set_target_properties(TriangleJRS PROPERTIES COMPILE_DEFINITIONS TRILIBRARY ) -add_executable(test_triangle test_triangle.c) +#add_executable(test_triangle test_triangle.c) -target_link_libraries(test_triangle - TriangleJRS) +#target_link_libraries(test_triangle +# TriangleJRS +# ) diff --git a/src/Prep/E00Lines/CMakeLists.txt b/src/Prep/E00Lines/CMakeLists.txt index a9946639..b776b88f 100644 --- a/src/Prep/E00Lines/CMakeLists.txt +++ b/src/Prep/E00Lines/CMakeLists.txt @@ -7,5 +7,5 @@ target_link_libraries(e00lines Polygon Geometry Output poly2tri TriangleJRS vpf ${SIMGEAR_CORE_LIBRARIES} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} - genpolyclip) + ${GPC_LIBRARY}) diff --git a/src/Prep/GSHHS/CMakeLists.txt b/src/Prep/GSHHS/CMakeLists.txt index 8202aa0a..4af0eb6a 100644 --- a/src/Prep/GSHHS/CMakeLists.txt +++ b/src/Prep/GSHHS/CMakeLists.txt @@ -8,7 +8,7 @@ target_link_libraries(gshhs Polygon Geometry Output poly2tri ${SIMGEAR_CORE_LIBRARIES} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} - genpolyclip) + ${GPC_LIBRARY}) add_executable(gshhs_debug debug.cxx) @@ -17,5 +17,5 @@ target_link_libraries(gshhs_debug Polygon Geometry Output poly2tri ${SIMGEAR_CORE_LIBRARIES} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} - genpolyclip) + ${GPC_LIBRARY}) diff --git a/src/Prep/ShapeFile/CMakeLists.txt b/src/Prep/ShapeFile/CMakeLists.txt index fafcea48..01cf635b 100644 --- a/src/Prep/ShapeFile/CMakeLists.txt +++ b/src/Prep/ShapeFile/CMakeLists.txt @@ -6,7 +6,7 @@ target_link_libraries(shape-decode shape Polygon Geometry Output poly2tri TriangleJRS vpf ${SIMGEAR_CORE_LIBRARIES} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} - genpolyclip) + ${GPC_LIBRARY}) add_executable(noaa-decode noaa-decode.cxx) @@ -14,5 +14,5 @@ target_link_libraries(noaa-decode shape Polygon Geometry Output poly2tri TriangleJRS vpf ${SIMGEAR_CORE_LIBRARIES} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} - genpolyclip) + ${GPC_LIBRARY}) diff --git a/src/Prep/ShapeFile/noaa-decode.cxx b/src/Prep/ShapeFile/noaa-decode.cxx index aedc655e..7a7030f9 100644 --- a/src/Prep/ShapeFile/noaa-decode.cxx +++ b/src/Prep/ShapeFile/noaa-decode.cxx @@ -26,6 +26,7 @@ #include #include +#include #include #include diff --git a/src/Prep/TGVPF/CMakeLists.txt b/src/Prep/TGVPF/CMakeLists.txt index b74ab766..b7b945fa 100644 --- a/src/Prep/TGVPF/CMakeLists.txt +++ b/src/Prep/TGVPF/CMakeLists.txt @@ -5,5 +5,5 @@ target_link_libraries(tgvpf Polygon Geometry Output poly2tri TriangleJRS vpf ${SIMGEAR_CORE_LIBRARIES} ${SIMGEAR_CORE_LIBRARY_DEPENDENCIES} - genpolyclip) + ${GPC_LIBRARY})