-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
78 lines (71 loc) · 2.24 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
69
70
71
72
73
74
75
76
77
78
cmake_minimum_required(VERSION 3.14)
project(lcom-metric-analyzer LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_definitions(-DROOT_DIR=\"${CMAKE_SOURCE_DIR}\")
find_package(Boost REQUIRED COMPONENTS
date_time
thread
filesystem
program_options
regex
system
serialization
wave
iostreams
chrono
)
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
# NOTE: ENV Not working here in Docker.
$ENV{ROSE_HOME}/include/rose
# You must manually specify the path for cmake to work in Docker.
/rose/install_tree/include/rose
$ENV{BOOST_HOME}/include/boost
)
link_libraries(
rose
Boost::date_time
Boost::thread
Boost::filesystem
Boost::program_options
Boost::regex
Boost::system
Boost::serialization
Boost::wave
Boost::iostreams
Boost::chrono
dl
m
quadmath
asis_adapter
stdc++fs
)
link_directories(
$ENV{ROSE_HOME}/lib
$ENV{BOOST_HOME}/lib
$ENV{ASIS_ADAPTER}/lib
)
SET(CMAKE_INSTALL_RPATH "$ENV{BOOST_HOME}/lib;$ENV{ASIS_ADAPTER}/lib;$ENV{ROSE_HOME}/lib")
# lcom.out
add_executable(lcom.out src/lcom.cpp)
set_source_files_properties(src/lcom.cpp PROPERTIES COMPILE_OPTIONS "-O0;-ggdb;-march=native;-Wall;-Wextra;-Wno-misleading-indentation;-Wno-unused-parameter;-pthread")
# lcom-dot.out
add_executable(lcom-dot.out src/lcom-dot.cpp)
set_source_files_properties(src/lcom-dot.cpp PROPERTIES COMPILE_OPTIONS "-O0;-ggdb;-march=native;-Wall;-Wextra;-Wno-misleading-indentation;-Wno-unused-parameter;-pthread")
# lcom-unittest
# GoogleTest components
include(FetchContent)
FetchContent_Declare(
googletest
URL https://github.com/google/googletest/archive/03597a01ee50ed33e9dfd640b249b4be3799d395.zip
)
# For Windows: Prevent overriding the parent project's compiler/linker settings
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
FetchContent_MakeAvailable(googletest)
enable_testing()
add_executable(lcom-unittest src/lcom-unittest.cpp)
set_source_files_properties(src/lcom-unittest.cpp PROPERTIES COMPILE_OPTIONS "-O0;-ggdb;-O0;-march=native;-Wall;-Wextra;-Wno-misleading-indentation;-Wno-unused-parameter;-pthread")
target_link_libraries(lcom-unittest GTest::gtest_main)
include(GoogleTest)
gtest_discover_tests(lcom-unittest)