Skip to content

Commit

Permalink
Add an option in CMake to build the lib file
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaskf committed Apr 17, 2024
1 parent 53cc1a9 commit ea027e7
Showing 1 changed file with 22 additions and 8 deletions.
30 changes: 22 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,12 @@ if (CMAKE_BUILD_TYPE STREQUAL "Release")
message("Build mode : Release")
endif()

if (BUILD_LIB STREQUAL "ON")
message("Build lib : ON")
else()
message("Build lib : OFF")
endif()

if (CMAKE_GENERATOR MATCHES "Xcode")
set(CMAKE_XCODE_ATTRIBUTE_DEBUG_INFORMATION_FORMAT "dwarf-with-dsym")
# if (NOT CMAKE_XCODE_ATTRIBUTE_COMPILER_INDEX_STORE_ENABLE)
Expand Down Expand Up @@ -724,10 +730,6 @@ if (USE_LSD2)
add_subdirectory(lsd2)
endif()

##################################################################
# the main executable
##################################################################

add_library(kernelsse tree/phylokernelsse.cpp)

if (NOT BINARY32 AND NOT IQTREE_FLAGS MATCHES "novx")
Expand All @@ -738,10 +740,22 @@ add_library(kernelfma tree/phylokernelfma.cpp)
endif()
endif()

add_executable(iqtree2
obsolete/parsmultistate.cpp
obsolete/parsmultistate.h
)
##################################################################
# build lib file or main executable
##################################################################
option(BUILD_LIB "Build IQ-TREE2 library" OFF)

if (BUILD_LIB STREQUAL "ON")
add_library(iqtree2
obsolete/parsmultistate.cpp
obsolete/parsmultistate.h
)
else()
add_executable(iqtree2
obsolete/parsmultistate.cpp
obsolete/parsmultistate.h
)
endif()

if(Backtrace_FOUND)
include_directories(${Backtrace_INCLUDE_DIR})
Expand Down

0 comments on commit ea027e7

Please sign in to comment.