-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
54 lines (44 loc) · 1.67 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
47
48
49
50
51
52
53
54
cmake_minimum_required(VERSION 2.8)
project(ModeloGrade)
# dependência com o CPLEX
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake_extensions)
find_package(Cplex)
if (NOT CPLEX_FOUND)
message(error "Cplex not found")
endif()
include_directories(SYSTEM ${CPLEX_INCLUDE_DIRS})
add_definitions(-DIL_STD)
set(MODELO_FILES
modelo-grade/aluno.h
modelo-grade/aluno.cpp
modelo-grade/arquivos.h
modelo-grade/arquivos.cpp
modelo-grade/curso.h
modelo-grade/curso.cpp
modelo-grade/modelo_solver.h
modelo-grade/modelo_solver.cpp
modelo-grade/solucao.h
modelo-grade/solver.h
modelo-grade/disciplina.h
modelo-grade/jsoncpp.cxx
)
if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=c++14 -pedantic ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 ${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_RELEASE "-Ofast -march=native ${CMAKE_CXX_FLAGS_RELEASE}")
endif()
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang")
add_definitions("-stdlib=libstdc++")
set(CMAKE_CXX_FLAGS "-std=c++14 -Weverything ${CMAKE_CXX_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "-g -O0 ${CMAKE_CXX_FLAGS_DEBUG}")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 ${CMAKE_CXX_FLAGS_RELEASE}")
endif()
if (MSVC)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MD /Z7")
string (REPLACE "/D_DEBUG" "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG})
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /wd4100 -D_CRT_SECURE_NO_WARNINGS")
endif()
add_library(modelo-grade-lib ${MODELO_FILES})
add_executable(modelo-grade-exec modelo-grade/main.cpp)
target_link_libraries(modelo-grade-lib ${CPLEX_LIBRARIES})
target_link_libraries(modelo-grade-exec modelo-grade-lib)