File: CMakeLists.txt

package info (click to toggle)
libmmmulti 0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 228 kB
  • sloc: cpp: 1,366; sh: 20; makefile: 4
file content (69 lines) | stat: -rw-r--r-- 1,821 bytes parent folder | download | duplicates (3)
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
# Specify the minimum version for CMake

cmake_minimum_required(VERSION 3.1)

# Project's name
project(mmmulti)
# We build using c++14
set(CMAKE_CXX_STANDARD 14)

set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)

# Use all standard-compliant optimizations
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -g -fPIC -fopenmp")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -g -fPIC -fopenmp")

# Set the output folder where your program will be created
set(CMAKE_BINARY_DIR ${CMAKE_SOURCE_DIR}/bin)
set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR})
set(LIBRARY_OUTPUT_PATH ${CMAKE_SOURCE_DIR}/lib)

# The following folder will be included
include_directories("${PROJECT_SOURCE_DIR}")

set(atomicqueue_INCLUDE "/usr/include/atomic_queue")

# set up our target executable and specify its dependencies and includes
add_executable(mmmulti
  ${CMAKE_SOURCE_DIR}/src/main.cpp
  )
target_include_directories(mmmulti PUBLIC
  "${CMAKE_SOURCE_DIR}/src"
#  "${sdsl-lite_INCLUDE}"
#  "${sdsl-lite-divsufsort_INCLUDE}"
#  "${dynamic_INCLUDE}"
#  "${ips4o_INCLUDE}"
  "${atomicqueue_INCLUDE}"
#  "${paryfor_INCLUDE}"
#  "${tayweeargs_INCLUDE}"
  )
  
# macOS doesn't want you to link in libatomic this way
if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
  target_link_libraries(mmmulti
    "${sdsl-lite_LIB}/libsdsl.a"
    "${sdsl-lite-divsufsort_LIB}/libdivsufsort.a"
    "${sdsl-lite-divsufsort_LIB}/libdivsufsort64.a"
    Threads::Threads
    )
elseif (TRUE)
  target_link_libraries(mmmulti
    "-lsdsl"
    "-ldivsufsort"
    "-ldivsufsort64"
    "-latomic"
    Threads::Threads
    )
endif()


if (APPLE)
elseif (TRUE)
  # this was hard to track down
  # https://stackoverflow.com/questions/35116327/when-g-static-link-pthread-cause-segmentation-fault-why
  set (CMAKE_SHARED_LINKER_FLAGS "-lpthread -Wl,--as-needed")
endif()