pavelliavonau/cmakeconverter

the path resolve of $(SolutionDir) is not corrected

Marskey opened this issue · 0 comments

It should be fix by following

def resolve_path_variables_of_vs(context, path_with_vars):
    """ Evaluates paths with visual studio variables """
    path_with_vars = path_with_vars.replace('$(ProjectDir)', './')
    rel_path = os.path.relpath(context.solution_path, context.cmake)
    path_with_vars = path_with_vars.replace('$(SolutionDir)', rel_path + '/')
    return path_with_vars

otherwise the output of cmakelist will be wrong like this:

target_include_directories(${PROJECT_NAME} PUBLIC
    "${CMAKE_CURRENT_SOURCE_DIR}/User/Name/solution/project/xxx;"
)