-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
50 lines (39 loc) · 1.34 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
cmake_minimum_required(VERSION 3.9)
project(fileparser_plugin VERSION 1.3.1)
set (CMAKE_CXX_STANDARD 11)
execute_process(
COMMAND
"git" "submodule" "update" "--init" "--recursive"
WORKING_DIRECTORY
"${CMAKE_SOURCE_DIR}"
RESULT_VARIABLE result
ERROR_VARIABLE error
)
include(cmake/DefaultBuildType.cmake)
include(cmake/GitSubmoduleUpdate.cmake)
git_submodule_update()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/common")
find_package(Scorep REQUIRED)
set(CMAKE_THREAD_PREFER_PTHREAD TRUE)
find_package(Threads REQUIRED)
add_library(${PROJECT_NAME} MODULE fileparser_plugin.c measurement_blob.c vector.c)
target_link_libraries(${PROJECT_NAME}
PUBLIC
Threads::Threads
PRIVATE
Scorep::Plugin
)
target_compile_options(${PROJECT_NAME} PRIVATE -Wall -pedantic -Wextra)
find_program(ARCHIVE_GIT archive-git ${CMAKE_SOURCE_DIR})
if(ARCHIVE_GIT)
set(ARCHIVE_NAME ${CMAKE_PROJECT_NAME}-${PROJECT_VERSION})
add_custom_command(
OUTPUT ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.gz
COMMAND ./archive-git ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.gz
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
add_custom_target(dist DEPENDS ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.gz)
else()
message(STATUS "Couldn't find ./archive-git.")
endif()
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION lib)