CMakeLists.txt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. project( QCC_IO_LIB )
  2. add_library( ${PROJECT_NAME} SHARED )
  3. include( cmake/GDALSupport.cmake )
  4. add_subdirectory( include )
  5. add_subdirectory( src )
  6. add_subdirectory( ui )
  7. option( OPTION_USE_DXF_LIB "Build with Ribbonsoft's DXF Lib (AutoCAD DXF files support)" ON )
  8. if( ${OPTION_USE_DXF_LIB} )
  9. set( DXF_LIB_DIR "extern/dxflib" CACHE PATH "DXF lib path" )
  10. add_subdirectory( "${DXF_LIB_DIR}" )
  11. target_link_libraries( ${PROJECT_NAME} dxflib )
  12. endif()
  13. option( OPTION_USE_SHAPE_LIB "Build with ShapeLib (SHP files support)" ON )
  14. if( ${OPTION_USE_SHAPE_LIB} )
  15. set( SHAPELIB_LIB_DIR "extern/shapelib" CACHE PATH "shapelib lib path" )
  16. add_subdirectory( "${SHAPELIB_LIB_DIR}" )
  17. target_link_libraries( ${PROJECT_NAME} shapelib )
  18. endif()
  19. target_link_libraries( ${PROJECT_NAME}
  20. QCC_DB_LIB
  21. )
  22. if( OPTION_USE_GDAL )
  23. target_link_GDAL( ${PROJECT_NAME} )
  24. endif()
  25. # Add custom preprocessor definitions
  26. target_compile_definitions( ${PROJECT_NAME} PRIVATE QCC_IO_LIBRARY_BUILD )
  27. set_target_properties( ${PROJECT_NAME} PROPERTIES
  28. AUTOUIC ON # FIXME Remove after everything has moved to targets and we can set it globally
  29. CXX_VISIBILITY_PRESET hidden
  30. )
  31. if ( BUILD_TESTING )
  32. add_subdirectory( test )
  33. endif()
  34. InstallSharedLibrary( TARGET ${PROJECT_NAME} )