forked from ameya005/AntColonyAlgorithms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
46 lines (38 loc) · 1.39 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
cmake_minimum_required(VERSION 2.8.4)
project(AntColonyAlgorithms)
set(INSTALL_INCLUDE_DIR include CACHE PATH
"Installation directory for header files")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
MACRO(HEADER_DIRECTORIES return_list)
FILE(GLOB_RECURSE new_list *.h)
SET(dir_list "")
FOREACH(file_path ${new_list})
GET_FILENAME_COMPONENT(dir_path ${file_path} PATH)
SET(dir_list ${dir_list} ${dir_path})
ENDFOREACH()
LIST(REMOVE_DUPLICATES dir_list)
SET(${return_list} ${dir_list})
ENDMACRO()
add_executable(antal antal.cpp common.cpp)
add_executable(antalRank antalRank.cpp)
add_executable(antalElitist antalElitist.cpp)
FIND_PACKAGE( OpenMP REQUIRED)
if(OPENMP_FOUND)
message("OPENMP FOUND")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
add_executable(antalShared antalShared.cpp common.cpp)
find_package(MPI REQUIRED)
include_directories(${MPI_INCLUDE_PATH})
add_executable(antalMPI antalMPI.cpp common.cpp)
target_link_libraries(antalMPI ${MPI_LIBRARIES})
if(MPI_COMPILE_FLAGS)
set_target_properties(antalMPI PROPERTIES
COMPILE_FLAGS "${MPI_COMPILE_FLAGS}")
endif()
if(MPI_LINK_FLAGS)
set_target_properties(antalMPI PROPERTIES
LINK_FLAGS "${MPI_LINK_FLAGS}")
endif()