Skip to content

Commit

Permalink
Merge pull request #6 from mbargull/cmake-configurable
Browse files Browse the repository at this point in the history
CMake: Make additional compiler flags configurable
  • Loading branch information
AlphaSquad authored Apr 20, 2021
2 parents 15f7d8e + 0b2e2fa commit b25f6f0
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
project(Haploflow)
set(Boost_USE_STATIC_LIBS=ON)
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
if(NOT DEFINED Boost_USE_STATIC_LIBS)
set(Boost_USE_STATIC_LIBS=ON)
endif

set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)

Expand All @@ -14,9 +16,11 @@ link_directories(
${Boost_LIBRARY_DIRS}
)

set(COMPILER_FLAGS
"-ggdb -Wall -L/usr/include -I/usr/include -std=c++0x -pipe -Wno-deprecated -pedantic"
)
if(NOT DEFINED COMPILER_FLAGS)
set(COMPILER_FLAGS
"-ggdb -Wall -L/usr/include -I/usr/include -std=c++0x -pipe -Wno-deprecated -pedantic"
)
endif()

add_executable(haploflow
main.cpp
Expand All @@ -30,8 +34,10 @@ add_executable(haploflow
UnitigGraph.cpp
)

set_target_properties(haploflow PROPERTIES
COMPILE_FLAGS ${COMPILER_FLAGS}
)
if(NOT "${COMPILER_FLAGS}" STREQUAL "")
set_target_properties(haploflow PROPERTIES
COMPILE_FLAGS ${COMPILER_FLAGS}
)
endif()

target_link_libraries(haploflow ${Boost_LIBRARIES})

0 comments on commit b25f6f0

Please sign in to comment.