Fix Window-GPU build
authorRoland Schulz <roland@utk.edu>
Tue, 27 Nov 2012 02:12:26 +0000 (21:12 -0500)
committerRoland Schulz <roland@utk.edu>
Tue, 27 Nov 2012 23:25:44 +0000 (18:25 -0500)
7631a13fc278 broke the Windows build.
Cmake bug 8189 makes it impossible to set include
directories properly per file.
This temporary solution uses two solutions for
Windows / non-Windows. The non-Windows solution
uses COMPILE_FLAGS but doesn't work on Windows,
some IDE and potentially other compilers.
The Windows solution adds the include directory
for all source files, even those which don't
require CUDA.

This should be replace with a proper solution.

Change-Id: I3c581f2c34ea8c7af60b8c82aac52ac2ab9cf981

src/gmxlib/CMakeLists.txt

index 83a60cf2bc9ab3a09fcbe28b904f75032906b032..5054a4abf90ff84bf4101539068b5afec140d38a 100644 (file)
@@ -44,7 +44,11 @@ endif()
 
 # The log file output queries Cuda if GPU support is enabled
 if(GMX_GPU)
-set_source_files_properties(copyrite.c PROPERTIES COMPILE_FLAGS "-I${CUDA_TOOLKIT_INCLUDE}")
+    if(WIN32)
+        include_directories(${CUDA_TOOLKIT_INCLUDE})
+    else()
+        set_source_files_properties(copyrite.c PROPERTIES COMPILE_FLAGS "-I${CUDA_TOOLKIT_INCLUDE}")
+    endif()
 endif()
 
 if(NOT GMX_EXTERNAL_BLAS)