################################################################################ ## ## Copyright (c) 2007-2009 Illumina, Inc. ## ## This software is covered by the "Illumina Genome Analyzer Software ## License Agreement" and the "Illumina Source Code License Agreement", ## and certain third party copyright/licenses, and any user of this ## source file is bound by the terms therein (see accompanying files ## Illumina_Genome_Analyzer_Software_License_Agreement.pdf and ## Illumina_Source_Code_License_Agreement.pdf and third party ## copyright/license notices). ## ## This file is part of the Consensus Assessment of Sequence And VAriation ## (CASAVA) software package. ## ## file cxxLibrary.cmake ## ## CMake configuration file for all the c++ libraries ## ## author Come Raczy ## ################################################################################ include_directories (${CASAVA_CXX_ALL_INCLUDES}) include_directories (${CMAKE_CURRENT_BINARY_DIR}) include_directories (${CMAKE_CURRENT_SOURCE_DIR}) include_directories (${CASAVA_CXX_CONFIG_H_DIR}) get_filename_component(CASAVA_CURRENT_DIR_NAME ${CMAKE_CURRENT_SOURCE_DIR} NAME) message (STATUS "Adding the c++ library subdirectory: ${CASAVA_CURRENT_DIR_NAME}") ## ## Some generators (VS) require all targets to be unique across the project. ## Therefore, a unique prefix is needed to create the target names which are ## shared across libraries ## string(REGEX REPLACE ${CMAKE_SOURCE_DIR}/c[+][+]/ "" TMP1 ${CMAKE_CURRENT_SOURCE_DIR}/) string(REGEX REPLACE "/" "_" CASAVA_UNIQUE_PREFIX ${TMP1}) ## ## build the library ## file(GLOB CASAVA_LIBRARY_SOURCES *.cpp *.c) foreach (SOURCE_FILE ${CASAVA_LIBRARY_SOURCES}) get_filename_component(SOURCE_NAME ${SOURCE_FILE} NAME_WE) if (${SOURCE_NAME}_COMPILE_FLAGS) set_source_files_properties(${SOURCE_FILE} PROPERTIES COMPILE_FLAGS ${${SOURCE_NAME}_COMPILE_FLAGS}) endif (${SOURCE_NAME}_COMPILE_FLAGS) endforeach (SOURCE_FILE) include_directories (${CASAVA_COMMON_INCLUDE} ) add_library (casava_${CASAVA_LIB_DIR} STATIC ${CASAVA_LIBRARY_SOURCES}) add_dependencies(casava_${CASAVA_LIB_DIR} CASAVA_OPT) ## ## build the unit tests if any (this should be mandatory really) ## if (HAVE_CPPUNIT AND CASAVA_UNIT_TESTS) find_path(${CMAKE_CURRENT_SOURCE_DIR}_CPPUNIT_DIR cppunit PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH) if (${CMAKE_CURRENT_SOURCE_DIR}_CPPUNIT_DIR) message (STATUS "Adding the cppunit subdirectory for ${CASAVA_LIB_DIR}") add_subdirectory (cppunit) endif (${CMAKE_CURRENT_SOURCE_DIR}_CPPUNIT_DIR) endif(HAVE_CPPUNIT AND CASAVA_UNIT_TESTS)