mi024

College project "Projet IAD" master 1
git clone https://esimon.eu/repos/mi024.git
Log | Files | Refs | README

CMakeLists.txt (1701B)


      1 cmake_minimum_required(VERSION 2.8)
      2 project(MI014S7)
      3 
      4 find_package(CUDA)
      5 find_package(Boost COMPONENTS unit_test_framework)
      6 find_package(Boost COMPONENTS serialization program_options)
      7 find_package(Doxygen)
      8 find_package(LATEX)
      9 
     10 set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/scripts" ${CMAKE_MODULE_PATH})
     11 set(COMPILE_PROGRAMS (${CUDA_FOUND} AND ${Boost_FOUND}))
     12 
     13 if(${COMPILE_PROGRAMS})
     14 	set(WALFU_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../WALFU" CACHE PATH "Path to the WALFU directory")
     15 
     16 	set(WALFU_INCLUDE_DIRS ${WALFU_DIR} ${WALFU_DIR}/Core ${WALFU_DIR}/nmlp)
     17 	set(WALFU_LIBRARY_DIRS ${WALFU_DIR}/Core ${WALFU_DIR}/nmlp)
     18 	set(SQLITE3_LIBRARY_DIRS ${WALFU_DIR}/sqlite)
     19 	set(SQLITE3_INCLUDE_DIRS ${WALFU_DIR}/sqlite)
     20 	set(SQLITE3_LIBRARY ${WALFU_DIR}/sqlite/liblib_sqlite.a)
     21 
     22 	# Sqlite3 needs dl, which is not part of libc on Linux.
     23 	if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
     24 		set(SQLITE3_LIBRARY ${SQLITE3_LIBRARY} dl)
     25 	endif(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
     26 
     27 	set(CUDA_PROPAGATE_HOST_FLAGS OFF)
     28 	if(CMAKE_COMPILER_IS_GNUCXX)
     29 		# CUDA is ill-formed in C++98/03 since it uses the `long long' type, `-std=c++0x' has to be used.
     30 		set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -std=c++0x -pedantic-errors -Wno-non-template-friend")
     31 	endif(CMAKE_COMPILER_IS_GNUCXX)
     32 
     33 	add_subdirectory(src)
     34 else(${COMPILE_PROGRAMS})
     35 	message(STATUS "The programs can not be compiled, check the prerequisite.")
     36 endif(${COMPILE_PROGRAMS})
     37 
     38 add_subdirectory(doc)
     39 
     40 #################
     41 #     Tests     #
     42 #################
     43 if(${COMPILE_PROGRAMS})
     44 	enable_testing()
     45 	add_test(Serialization ${CMAKE_CURRENT_BINARY_DIR}/src/test_serialization)
     46 	add_test(Learning ${CMAKE_CURRENT_BINARY_DIR}/src/test_learning)
     47 endif(${COMPILE_PROGRAMS})