Browse Source

Update post-build command for embree target.

Former-commit-id: 22eac26995b05bca30052fabd5498fbcd80a1dd1
Jérémie Dumas 7 years ago
parent
commit
eb73e894b5
2 changed files with 6 additions and 5 deletions
  1. 2 2
      .travis.yml
  2. 4 3
      shared/cmake/libigl.cmake

+ 2 - 2
.travis.yml

@@ -20,7 +20,7 @@ matrix:
         - cd tutorial
         - mkdir build
         - cd build
-        - cmake -DLIBIGL_USE_STATIC_LIBRARY=ON -DLIBIGL_WITH_NANOGUI=OFF -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_C_COMPILER=gcc-4.8 ../
+        - cmake -DLIBIGL_USE_STATIC_LIBRARY=ON  -DCMAKE_CXX_COMPILER=g++-4.8 -DCMAKE_C_COMPILER=gcc-4.8 ../
         - make -j 2
       addons:
         apt:
@@ -63,5 +63,5 @@ matrix:
         - cd tutorial
         - mkdir build
         - cd build
-        - cmake -DLIBIGL_USE_STATIC_LIBRARY=ON ../
+        - cmake -DLIBIGL_USE_STATIC_LIBRARY=ON -DLIBIGL_WITH_NANOGUI=ON ../
         - make -j 2

+ 4 - 3
shared/cmake/libigl.cmake

@@ -179,15 +179,16 @@ if(LIBIGL_WITH_EMBREE)
     set(EMBREE_STATIC_LIB ON CACHE BOOL " " FORCE)
   endif()
 
-  if(NOT TARGET)
+  if(NOT TARGET embree)
     add_subdirectory("${EMBREE_DIR}" "embree")
   endif()
 
   if(MSVC)
-    add_custom_command(TARGET embree POST_BUILD # Adds a post-build event to embree
+    add_custom_target(Copy-Embree-DLL ALL # Adds a post-build event
         COMMAND ${CMAKE_COMMAND} -E copy_if_different # which executes "cmake - E
         $<TARGET_FILE:embree> # <--this is in-file
-        "${CMAKE_BINARY_DIR}") # <--this is out-file path
+        "${CMAKE_BINARY_DIR}" # <--this is out-file path
+        DEPENDS embree) # Execute after embree target has been built
   endif()
 
   compile_igl_module("embree" "")