diff --git a/CMakeLists.txt b/CMakeLists.txt index 3747180..8862733 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) @@ -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 @@ -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})