diff --git a/definitions/CMakeLists.txt b/definitions/CMakeLists.txt index 1c8c3ea64..bbd1a1122 100644 --- a/definitions/CMakeLists.txt +++ b/definitions/CMakeLists.txt @@ -21,9 +21,11 @@ install( DIRECTORY budg bufr cdf common grib1 grib2 gts mars metar tide hdf5 wr # link to the definitions. See GRIB-786 file( MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/share/${PROJECT_NAME} ) -execute_process( COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink" - "${CMAKE_CURRENT_SOURCE_DIR}" - "${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/definitions" ) +if( NOT EXISTS "${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/definitions" ) + execute_process( COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink" + "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/definitions" ) +endif() # copy the definitions to the build directory #file( COPY ${definition_files} ${table_files} ${text_files} diff --git a/samples/CMakeLists.txt b/samples/CMakeLists.txt index 02409dde8..7262adc3f 100644 --- a/samples/CMakeLists.txt +++ b/samples/CMakeLists.txt @@ -13,7 +13,8 @@ set( ECCODES_SAMPLES_FILES ${ECCODES_SAMPLES_FILES} PARENT_SCOPE ) # link to the samples in the build directory. See GRIB-786 file( MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/share/${PROJECT_NAME} ) -execute_process( COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink" - "${CMAKE_CURRENT_SOURCE_DIR}" - "${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/samples" ) - +if( NOT EXISTS "${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/samples" ) + execute_process( COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink" + "${CMAKE_CURRENT_SOURCE_DIR}" + "${CMAKE_BINARY_DIR}/share/${PROJECT_NAME}/samples" ) +endif() \ No newline at end of file