Skip to content

Commit

Permalink
CMake: Always build gie if testing is requested (#2899)
Browse files Browse the repository at this point in the history
Co-authored-by: Even Rouault <even.rouault@spatialys.com>
  • Loading branch information
mwtoews and rouault authored Oct 10, 2021
1 parent 7f0b6bd commit d94e045
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ if(BUILD_PROJINFO)
set(BIN_TARGETS ${BIN_TARGETS} binprojinfo)
endif()

if(BUILD_GIE)
# Always build gie if testing is requested
if(BUILD_GIE OR BUILD_TESTING)
include(bin_gie.cmake)
set(BIN_TARGETS ${BIN_TARGETS} gie)
endif()
Expand Down
6 changes: 4 additions & 2 deletions src/bin_gie.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ add_executable(gie ${GIE_SRC} ${GIE_INCLUDE})
target_link_libraries(gie PRIVATE ${PROJ_LIBRARIES})
target_compile_options(gie PRIVATE ${PROJ_CXX_WARN_FLAGS})

install(TARGETS gie
DESTINATION ${BINDIR})
if(BUILD_GIE)
install(TARGETS gie
DESTINATION ${BINDIR})
endif()

if(MSVC AND BUILD_SHARED_LIBS)
target_compile_definitions(gie PRIVATE PROJ_MSVC_DLL_IMPORT=1)
Expand Down

0 comments on commit d94e045

Please sign in to comment.