Alex 'AdUser' Z
8 years ago
3 changed files with 44 additions and 0 deletions
@ -0,0 +1,32 @@ |
|||||||
|
set(CNAME "simdb-fdupes") |
||||||
|
set(VERSION 0.4) |
||||||
|
|
||||||
|
project($CNAME C) |
||||||
|
cmake_minimum_required(VERSION 2.6) |
||||||
|
|
||||||
|
include(CTest) |
||||||
|
include(GNUInstallDirs) |
||||||
|
|
||||||
|
option(WITH_HARDENING "Enable hardening options" ON) |
||||||
|
|
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -pedantic -std=c99") |
||||||
|
add_definitions("-D_XOPEN_SOURCE=500") |
||||||
|
|
||||||
|
if (WITH_HARDENING) |
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wformat -Wformat-security -Werror=format-security" ) |
||||||
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fstack-protector --param ssp-buffer-size=4" ) |
||||||
|
add_definitions("-D_FORTIFY_SOURCE=2") |
||||||
|
endif () |
||||||
|
|
||||||
|
message(STATUS "Project : ${CNAME} v${VERSION}") |
||||||
|
message(STATUS "Compiler : ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID} ${CMAKE_C_COMPILER_VERSION})") |
||||||
|
message(STATUS "- CFLAGS : ${CMAKE_C_FLAGS}") |
||||||
|
message(STATUS "Paths:") |
||||||
|
message(STATUS "- prefix : ${CMAKE_INSTALL_PREFIX}") |
||||||
|
message(STATUS "- binary : ${CMAKE_INSTALL_FULL_BINDIR}") |
||||||
|
message(STATUS "Build type : ${CMAKE_BUILD_TYPE}") |
||||||
|
message(STATUS "Options:") |
||||||
|
message(STATUS "- WITH_HARDENING : ${WITH_HARDENING}") |
||||||
|
|
||||||
|
add_subdirectory("src") |
||||||
|
add_subdirectory("tests") |
@ -0,0 +1,7 @@ |
|||||||
|
set(SOURCES "filelist.c" "group.c" "main.c") |
||||||
|
|
||||||
|
add_executable("simdb-fdupes" ${SOURCES}) |
||||||
|
set_property(TARGET "simdb-fdupes" PROPERTY LINK_FLAGS "-Wl,--as-needed") |
||||||
|
target_link_libraries("simdb-fdupes" "magic") |
||||||
|
target_link_libraries("simdb-fdupes" "simdb") |
||||||
|
install(TARGETS "simdb-fdupes" RUNTIME DESTINATION "bin") |
Loading…
Reference in new issue