File: CMakeLists.txt

package info (click to toggle)
libitl 0.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 1,576 kB
  • sloc: ansic: 3,143; python: 55; sh: 16; makefile: 2
file content (47 lines) | stat: -rw-r--r-- 1,648 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# CMake build file for ITL
# By: Mohamed A.M. Bamakhrama (mohamed@alumni.tum.de)

cmake_minimum_required(VERSION 2.6)
project( itl )
include(GNUInstallDirs)
set(LIBRARY_VERSION_MAJOR "0")
set(LIBRARY_VERSION_MINOR "1")
set(LIBRARY_VERSION_PATCH "8")
set(LIBRARY_VERSION "${LIBRARY_VERSION_MAJOR}.${LIBRARY_VERSION_MINOR}")
set(LIBRARY_VERSION_FULL "${LIBRARY_VERSION}.${LIBRARY_VERSION_PATCH}")
message( "Installation target directory is: " ${CMAKE_INSTALL_PREFIX} )
message( "To override this value, use 'make -DCMAKE_INSTALL_PREFIX=$DIR'" )

set( COMPILE_FLAGS "-ansi -pedantic -Wall -O2" )
set( CMAKE_C_FLAGS  "${CMAKE_C_FLAGS} ${COMPILE_FLAGS}" )

# Specify header files
set( HEADER_FILES
        hijri/hijri.h
        prayertime/prayer.h
        prayertime/astro.h
        )

# Specify sources
set( SOURCE_FILES
        hijri/hijri.c
        prayertime/astro.c
        prayertime/prayer.c
        hijri/umm_alqura.c
        )

add_library( itl STATIC ${HEADER_FILES} ${SOURCE_FILES} )
add_library( itlShared SHARED  ${HEADER_FILES} ${SOURCE_FILES} )
set_target_properties(itlShared PROPERTIES VERSION "${LIBRARY_VERSION_FULL}" SOVERSION "${LIBRARY_VERSION_MAJOR}" OUTPUT_NAME "itl" )
target_link_libraries( itlShared -lm )
install( FILES ${HEADER_FILES} DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/itl" )
install( TARGETS itl DESTINATION ${CMAKE_INSTALL_LIBDIR} )
install( TARGETS itlShared DESTINATION ${CMAKE_INSTALL_LIBDIR} )

# Specify executables
add_executable( demo_hijri hijri/demo_hijri.c )
target_link_libraries( demo_hijri itl -lm )

add_executable( demo_prayer prayertime/demo_prayer.c )
target_link_libraries( demo_prayer itl -lm )