-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
37 lines (29 loc) · 1.46 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
cmake_minimum_required(VERSION 3.3)
project(dsnview)
# start ulver's shit
set(GENERAL_WARNING_FLAGS "-Wall -Wextra -pedantic -Wno-unused-parameter -Wno-unused-variable -Wno-variadic-macros -Wno-gnu-zero-variadic-macro-arguments")
set(GENERAL_DEBUG_FLAGS "-g")
set(GENERAL_RELEASE_FLAGS "-mtune=native -DNDEBUG -O2 -fomit-frame-pointer")
set(GENERAL_COMPILER_FLAGS "-pipe")
set(CMAKE_CXX_FLAGS "-std=c++11 ${GENERAL_WARNING_FLAGS} ${GENERAL_COMPILER_FLAGS} -Wshadow -Weffc++ -fnon-call-exceptions -Wno-c99-extensions")
set(CMAKE_CXX_FLAGS_DEBUG "${GENERAL_DEBUG_FLAGS}")
set(CMAKE_CXX_FLAGS_RELEASE "${GENERAL_RELEASE_FLAGS}")
set(CMAKE_C_FLAGS "-std=c11 ${GENERAL_WARNING_FLAGS} ${GENERAL_COMPILER_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG "${GENERAL_DEBUG_FLAGS}")
set(CMAKE_C_FLAGS_RELEASE "${GENERAL_RELEASE_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "")
set(CMAKE_EXE_LINKER_FLAGS_DEBUG "")
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "-s")
# end ulver's shit
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
file(GLOB_RECURSE SOURCE_FILES src/*.c)
add_executable(dsnview ${SOURCE_FILES})
# Math Library
find_library(M_LIB m)
# Find cURL
find_package(CURL)
# Find libxml2
find_package(LibXml2)
# Link our libraries
target_include_directories(dsnview PUBLIC include/ ${CURL_INCLUDE_DIRS} ${LIBXML2_INCLUDE_DIR})
target_link_libraries(dsnview ${M_LIB} ${CURL_LIBRARIES} ${LIBXML2_LIBRARIES})