diff --git a/CMakeLists.txt b/CMakeLists.txt index d2607ab0..38b6559c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -170,21 +170,22 @@ set(tick_tocked_cmake_files # Install symlinks for IgnPython and IgnBenchmark foreach(cmake_file ${tick_tocked_cmake_files}) string(REGEX REPLACE "^Gz" "Ign" ign_cmake_file ${cmake_file}) + file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/cmake") if (WIN32) # Windows requires copy instead of symlink install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E copy \ - ${gz_modules_install_dir}\/${cmake_file} \ - ${gz_modules_install_dir}\/${ign_cmake_file})") + ${CMAKE_INSTALL_PREFIX}\/${gz_modules_install_dir}\/${cmake_file} \ + ${PROJECT_BINARY_DIR}\/cmake/${ign_cmake_file})") else() - file(MAKE_DIRECTORY "${PROJECT_BINARY_DIR}/cmake") install(CODE "execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink \ ${CMAKE_INSTALL_PREFIX}\/${gz_modules_install_dir}\/${cmake_file} \ ${PROJECT_BINARY_DIR}\/cmake/${ign_cmake_file})") - install( - FILES ${PROJECT_BINARY_DIR}/cmake/${ign_cmake_file} - DESTINATION ${gz_modules_install_dir} - COMPONENT modules) endif() + + install( + FILES ${PROJECT_BINARY_DIR}/cmake/${ign_cmake_file} + DESTINATION ${gz_modules_install_dir} + COMPONENT modules) endforeach() include(CTest)