root/src/CMakeLists.txt @ 134:6ac3b4f46d79

Revision 134:6ac3b4f46d79, 1.9 KB (checked in by Andreas Schaefer <gentryx@…>, 16 months ago)

install config.h, too

Line 
1cmake_minimum_required(VERSION 2.6)
2project(LIBGEODECOMP)
3include(conf.cmake)
4
5include_directories(${LIBGEODECOMP_SOURCE_DIR})
6
7if(WIN32)
8  add_library(local_libgeodecomp_lib STATIC IMPORTED)
9  set_property(TARGET local_libgeodecomp_lib PROPERTY IMPORTED_LOCATION ${LIBGEODECOMP_BINARY_DIR}/libgeodecomp/geodecomp.lib)
10  set(LOCAL_LIBGEODECOMP_LINK_LIB local_libgeodecomp_lib)
11else(WIN32)
12  set(LOCAL_LIBGEODECOMP_LINK_LIB geodecomp)
13endif(WIN32)
14
15# LIBDIRS is used to find source files and headers
16set(LIBDIRS io loadbalancer misc mpilayer parallelization parallelization/hiparsimulator parallelization/hiparsimulator/partitions)
17# AUXDIRS lists auxiliary directories to be included in the main
18# build. They may for instance include additionally libraries to be
19# linked into the main lib.
20set(AUXDIRS)
21# set(AUXDIRS misc/testbed/cell/spustuff)
22set(SUBDIRS examples io loadbalancer misc mpilayer parallelization testbed)
23
24# link all sources
25set(SOURCES "")
26foreach(dir ${LIBDIRS})
27  set(RELATIVE_PATH ${dir}/)
28  include(${dir}/auto.cmake)
29endforeach(dir)
30
31add_library(geodecomp ${LIB_LINKAGE_TYPE} ${SOURCES})
32target_link_libraries(geodecomp boost_date_time${BOOST_LINK_SUFFIX})
33target_link_libraries(geodecomp boost_filesystem${BOOST_LINK_SUFFIX})
34target_link_libraries(geodecomp boost_system${BOOST_LINK_SUFFIX})
35if (LIBGEODECOMP_FEATURE_OPENCL)
36  target_link_libraries(geodecomp OpenCL)
37endif (LIBGEODECOMP_FEATURE_OPENCL)
38install(TARGETS geodecomp DESTINATION lib)
39install(FILES config.h DESTINATION include/${PACKAGE_NAME})
40
41# install all headers
42foreach(dir ${LIBDIRS})
43  set(HEADERS "")
44  set(RELATIVE_PATH ${dir}/)
45  include(${dir}/auto.cmake)
46  install(FILES ${HEADERS} DESTINATION include/${PACKAGE_NAME}/${dir})
47endforeach(dir)
48
49set(HEADERS "")
50set(SOURCES "")
51
52# recurse subdirs
53foreach(dir ${SUBDIRS})
54  add_subdirectory(${dir})
55endforeach(dir)
56
57foreach(dir ${AUXDIRS})
58  set(HEADERS "")
59  set(SOURCES "")
60  include(${dir}/aux.cmake)
61endforeach(dir)
Note: See TracBrowser for help on using the browser.