project(fluidsGL) # set source files set(PROJECT_HEADER defines.h fluidsGL_kernels.cuh fluidsGL_kernels.h) set(PROJECT_SRC fluidsGL.cpp fluidsGL_kernels.cu) set(ALL_LIBRARIES ${FREEGLUT_LIBRARY} ${GLEW_LIBRARY}) set(GENCODE -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_35,code=compute_35) set(GENCODE ${GENCODE} -gencode=arch=compute_20,code=sm_20) set(GENCODE ${GENCODE} -gencode=arch=compute_10,code=sm_10) # debug options set(CUDA_NVCC_FLAGS_DEBUG "-G;-g") set(CUDA_NVCC_FLAGS_RELEASE "-O2") if (MSVC) set(CMAKE_CXX_FLAGS_DEBUG "/DEBUG") set(CMAKE_CXX_FLAGS_RELEASE "/O2") else() set(CMAKE_CXX_FLAGS_DEBUG "-g") set(CMAKE_CXX_FLAGS_RELEASE "-O2") endif() # set runtime library for VC if (MSVC) set(CUDA_NVCC_FLAGS_DEBUG ${CUDA_NVCC_FLAGS_DEBUG} ";-Xcompiler;/MTd") set(CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG} " /MTd") set(CUDA_NVCC_FLAGS_RELEASE ${CUDA_NVCC_FLAGS_RELEASE} ";-Xcompiler;/MT") set(CMAKE_CXX_FLAGS_RELEASE ${CMAKE_CXX_FLAGS_RELEASE} " /MT") endif() cuda_add_executable(fluidsGL ${PROJECT_SRC} ${PROJECT_HEADER} OPTIONS ${GENCODE} ${DEBUG_OPTION}) target_link_libraries(fluidsGL ${ALL_LIBRARIES}) cuda_add_cufft_to_target(fluidsGL) install(TARGETS fluidsGL RUNTIME DESTINATION ${INSTALL_PATH})