CMake与OpenMP
cmake_minimum_required (VERSION 2.6)
project (TEST)
set (TEST_VERSION 0.1)
set(CMAKE_BUILD_TYPE "Debug")
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g -ggdb -DDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/../bin)
FIND_PACKAGE( OpenMP REQUIRED)
if(OPENMP_FOUND)
message("OPENMP FOUND")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS"${CMAKE_EXE_LINKER_FLAGS}${OpenMP_EXE_LINKER_FLAGS}")
endif()
aux_source_directory(${PROJECT_SOURCE_DIR}/src DIR_SRC)
include_directories(${PROJECT_SOURCE_DIR}/src)
include_directories(${PROJECT_SOURCE_DIR}/src)
#include_directories(${PROJECT_SOURCE_DIR}/include)
#include_directories(${PROJECT_SOURCE_DIR}/include/LDL)
#include_directories(${PROJECT_SOURCE_DIR}/include/AMD)
link_directories(${PROJECT_SOURCE_DIR}/lib)
add_executable(main ${DIR_SRC})
#target_link_libraries(main Test)
#target_link_libraries(main libamd.a)
#target_link_libraries(main libldl.a)
#target_link_libraries(main libsuitesparseconfig.a)
#target_link_libraries(main libopenblas.a)
#target_link_libraries(main -lm)
#target_link_libraries(main -lpthread)
#target_link_libraries(main libblas.a)