Skip to content

Commit

Permalink
Use system GSL if we have it
Browse files Browse the repository at this point in the history
  • Loading branch information
kdm9 committed Oct 21, 2015
1 parent 83c58e7 commit 577fdab
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ MESSAGE(STATUS "${CMAKE_BUILD_TYPE} build of axe version: ${AXE_VERSION}")
## Find Packages and Headers ##
###############################

# Done by libqes' CML.txt
FIND_PACKAGE(ZLIB 1.2.5 REQUIRED)

FIND_PACKAGE(GSL)

IF (GSL_FOUND)
SET(AXE_DEP_INCLUDES ${GSL_INCLUDE_DIRS})
SET(AXE_DEP_LIBS ${GSL_LIBRARIES})
ENDIF()


##########################
## Set Compiler Options ##
Expand Down
9 changes: 7 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,15 @@
# Axe library (libaxe.a)
FILE(GLOB DATRIE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/datrie/*.c)
FILE(GLOB GSL_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/gsl/*.c)
SET(AXELIB_SRCS ${DATRIE_SRCS} ${GSL_SRCS} axe.c)
SET(AXELIB_SRCS ${DATRIE_SRCS} axe.c)

IF (NOT GSL_FOUND)
MESSAGE(STATUS "Using bundled GSL sources")
SET(AXELIB_SRCS ${AXELIB_SRCS} ${GSL_SRCS})
ENDIF()

ADD_LIBRARY(axelib STATIC ${AXELIB_SRCS})
TARGET_LINK_LIBRARIES(axelib qes_static)
TARGET_LINK_LIBRARIES(axelib qes_static ${AXE_DEP_LIBS})
SET_TARGET_PROPERTIES(axelib PROPERTIES OUTPUT_NAME axe)

# Executable
Expand Down

0 comments on commit 577fdab

Please sign in to comment.