Skip to content

Commit

Permalink
CMake: avoid issue with MSBuild and 'GDAL' vs 'gdal' target names (ma…
Browse files Browse the repository at this point in the history
…ster only)
  • Loading branch information
rouault committed Jan 14, 2025
1 parent d2aa1c3 commit a20fe51
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,12 @@ target_public_header(TARGET ${GDAL_LIB_TARGET_NAME} HEADERS gdal_utils.h)

if (BUILD_APPS)
# Default Apps
add_executable(gdal gdal_utils_priv.h gdal.cpp)

# MSBuild has case-insensitive target names, so as GDAL is used as the
# target name for the library, we cannot reuse it for the "gdal" binary.
add_executable(gdal_app gdal_utils_priv.h gdal.cpp)
set_target_properties(gdal_app PROPERTIES OUTPUT_NAME gdal)

add_executable(gdalinfo gdal_utils_priv.h gdalinfo_bin.cpp)
add_executable(gdalbuildvrt gdal_utils_priv.h gdalbuildvrt_bin.cpp)
add_executable(gdaladdo gdal_utils_priv.h gdaladdo.cpp)
Expand Down Expand Up @@ -111,7 +116,7 @@ if (BUILD_APPS)
add_dependencies(utils_common generate_gdal_version_h)

set(APPS_TARGETS
gdal
gdal_app
gdalinfo
gdalbuildvrt
gdaladdo
Expand Down

0 comments on commit a20fe51

Please sign in to comment.