-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
51 lines (41 loc) · 1.13 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
cmake_minimum_required(VERSION 3.0 FATAL_ERROR)
# Project Name
project(GMM CXX)
# Directory Name
set(SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
# Set Compiler Options
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wall")
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 8)
set(CMAKE_CXX_COMPILER "g++-8")
endif ()
# For OSX
#set(CMAKE_OSX_ARCHITECTURES "x86_64") # Intel cpu
set(CMAKE_OSX_ARCHITECTURES "arm64") # Apple cpu
# Find Package
find_package(Boost REQUIRED COMPONENTS program_options)
# Set Include Directories
set(INCLUDE_DIRS
${Boost_INCLUDE_DIRS}
${SRC_DIR}
)
# Set CXX_LIBRARIES
set(LIBRARIES
${Boost_LIBRARIES}
)
# Set Source Code
set(SRCS
${SRC_DIR}/main.cpp
${SRC_DIR}/gmm.cpp
)
# Link
add_executable(${PROJECT_NAME} ${SRCS})
include_directories(${INCLUDE_DIRS})
target_link_libraries(${PROJECT_NAME} ${LIBRARIES})
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 17)
# Display Message
message(STATUS "")
message(STATUS "~~~ Boost Information ~~~")
message(STATUS "${Boost_INCLUDE_DIRS};")
message(STATUS "${Boost_LIBRARIES};")
message(STATUS "")