add_definitions(-DLDAP_DEPRECATED)
# General includes:
-include_directories(include/anna)
+include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
include_directories(/usr/include/libxml2)
include_directories(/usr/lib/oracle/12.1/client64/include)
# Executable
set(target "anna_${module}_${subdir}")
- add_executable(${target} "${SRCS}")
+ add_executable(${target} ${SRCS})
set_target_properties(${target} PROPERTIES LINKER_LANGUAGE CXX)
set(libraries_file "${CMAKE_CURRENT_SOURCE_DIR}/example/${module}/${subdir}/libraries.txt")
set(includes_file "${CMAKE_CURRENT_SOURCE_DIR}/example/${module}/${subdir}/includes.txt")
# <test>
-enable_testing()
-find_package(GTest REQUIRED)
-include_directories(${GTEST_INCLUDE_DIRS})
+find_package(GTest)
+IF(GTest_FOUND)
-SUBDIRLIST(MODULES ${CMAKE_CURRENT_SOURCE_DIR}/test)
-FOREACH(module ${MODULES})
+ enable_testing()
+ include_directories(${GTEST_INCLUDE_DIRS})
- message(STATUS "Processing basic test at: test/${module}")
+ SUBDIRLIST(MODULES ${CMAKE_CURRENT_SOURCE_DIR}/test)
+ FOREACH(module ${MODULES})
- # Sources
- file(GLOB_RECURSE SRCS ${CMAKE_CURRENT_SOURCE_DIR}/test/${module}/*.cpp)
+ message(STATUS "Processing basic test at: test/${module}")
- # Executable
- set(target "anna_test_${module}")
- add_executable(${target} "${SRCS}")
- target_link_libraries(${target} ${GTEST_BOTH_LIBRARIES} pthread)
- set(libraries_file "${CMAKE_CURRENT_SOURCE_DIR}/test/${module}/libraries.txt")
+ # Sources
+ file(GLOB_RECURSE SRCS ${CMAKE_CURRENT_SOURCE_DIR}/test/${module}/*.cpp)
- if(EXISTS "${libraries_file}")
- file (STRINGS "${libraries_file}" LIBS)
- #message(STATUS "Libraries: ${LIBS}")
- target_link_libraries(${target} ${GTEST_BOTH_LIBRARIES} pthread ${LIBS})
- endif()
+ # Executable
+ set(target "anna_test_${module}")
+ add_executable(${target} ${SRCS})
+ target_link_libraries(${target} ${GTEST_BOTH_LIBRARIES} pthread)
+ set(libraries_file "${CMAKE_CURRENT_SOURCE_DIR}/test/${module}/libraries.txt")
+
+ if(EXISTS "${libraries_file}")
+ file (STRINGS "${libraries_file}" LIBS)
+ #message(STATUS "Libraries: ${LIBS}")
+ target_link_libraries(${target} ${GTEST_BOTH_LIBRARIES} pthread ${LIBS})
+ endif()
- add_test(${target} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${target})
+ add_test(${target} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${target})
-ENDFOREACH()
+ ENDFOREACH()
+ENDIF(GTest_FOUND)
# Install
# Add target for API documentation with Doxygen
find_package(Doxygen)
-if(DOXYGEN_FOUND)
-add_custom_target(doc
- ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/docs/doxygen/Doxyfile
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs/doxygen
- COMMENT "Generating API documentation with Doxygen" VERBATIM
-)
-endif(DOXYGEN_FOUND)
+IF(Doxygen_FOUND)
+ add_custom_target(doc
+ ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/docs/doxygen/Doxyfile
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/docs/doxygen
+ COMMENT "Generating API documentation with Doxygen" VERBATIM
+ )
+ENDIF(Doxygen_FOUND)