This repository has been archived by the owner on Aug 3, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
68 lines (58 loc) · 1.81 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
cmake_minimum_required(VERSION 3.0.0)
set (PROJECT_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
if ("${CMAKE_BUILD_TYPE}" STREQUAL "DEBUG")
message("Add define DEBUGGING")
add_definitions(-DDEBUGGING)
set(PROJECT_NAME "apriori_debug")
else()
set(PROJECT_NAME "apriori")
endif()
# config here
set(SOURCE_FOLDER "src")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_SOURCE_DIR})
# set version here
set (VERSION_MAJOR 0)
set (VERSION_MINOR 1)
set (VERSION_FIX 0)
configure_file (
"${PROJECT_SOURCE_DIR}/${SOURCE_FOLDER}/version.h.in"
"${PROJECT_SOURCE_DIR}/${SOURCE_FOLDER}/version.h"
)
# the included folder for <foo.h>
include_directories(${PROJECT_SOURCE_DIR})
link_directories("libcsv/.libs/")
find_package(OpenMP)
if (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()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
# using Clang
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# using gcc
SET(CMAKE_C_COMPILER g++)
set(WARNING "-Wall")
set(PUBLIC "-static -static-libgcc -static-libg++")
set(IDENTIFIER "-fextended-identifiers --input-charset=utf-8 -finput-charset=utf-8 --exec-charset=utf-8")
set(MULTITHREAD "-pthread")
set(CPPVERSION "-std=c++11")
set(CMAKE_CXX_FLAGS
"${CMAKE_CXX_FLAGS} \
${WARNING} \
${IDENTIFIER} \
${CPPVERSION} \
${MULTITHREAD}"
)
# add_subdirectory("src")
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel")
# using Intel C Compiler
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
endif()
set (SOURCE
src/main.cpp
src/readcsv.cpp
)
add_executable (${PROJECT_NAME} ${SOURCE})
target_link_libraries(${PROJECT_NAME} "csv")