Przeglądaj źródła

[cmake] Standardise install tree for windows build (#709)

* [cmake] Standardise install tree for windows build

For cmake builds using MSVC, it now installs in with the same install
tree as the package from the visual studio sln build.
This means that the visual studio hlc templates can now also support
cmake installs of hashlink.

* [cmake] Add default windows install path
tobil4sk 1 rok temu
rodzic
commit
98addf9a99
1 zmienionych plików z 9 dodań i 0 usunięć
  1. 9 0
      CMakeLists.txt

+ 9 - 0
CMakeLists.txt

@@ -347,6 +347,15 @@ endif()
 set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_SOURCE_DIR}/README.md")
 set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE")
 
+if(MSVC)
+    if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
+        set (CMAKE_INSTALL_PREFIX "C:/HaxeToolkit/hashlink" CACHE PATH "default install path" FORCE)
+    endif()
+
+    set(CMAKE_INSTALL_BINDIR .)
+    set(CMAKE_INSTALL_LIBDIR .)
+endif()
+
 set(HDLL_DESTINATION
     ${CMAKE_INSTALL_LIBDIR}
 )