-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
36 lines (29 loc) · 1.3 KB
/
CMakeLists.txt
File metadata and controls
36 lines (29 loc) · 1.3 KB
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
CMAKE_MINIMUM_REQUIRED (VERSION 3.20)
PROJECT (sac-energy)
# Where the compiled sac modules result
SET (DLL_BUILD_DIR "${PROJECT_BINARY_DIR}/lib")
SET (TARGETS seq seq_checks mt_pth CACHE STRING "Build for these targets")
SET (SAC2C_EXEC CACHE STRING "Path to sac2c compiler")
OPTION (BUILDGENERIC "Do not use architecture-specific optimisations" OFF)
# Check whether sac2c is operational
LIST (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake-common")
INCLUDE ("cmake-common/check-sac2c.cmake")
INCLUDE ("cmake-common/check-sac2c-feature-support.cmake")
INCLUDE ("cmake-common/misc-macros.cmake")
# Check if sac2c suppports building generically
IF (BUILDGENERIC)
CHECK_SAC2C_SUPPORT_FLAG ("generic" "-generic")
IF (HAVE_FLAG_generic)
LIST (APPEND SAC2C_CPP_INC "-generic")
MESSAGE (STATUS "Building with *no* system-specific optimisations")
ELSE ()
MESSAGE (STATUS "Generic-build disabled as sac2c does not support this")
SET (BUILDGENERIC OFF)
ENDIF ()
ENDIF ()
# For every target run CMakeLists.txt in src
FOREACH (TARGET IN ITEMS ${TARGETS})
ADD_SUBDIRECTORY (src src-${TARGET})
ENDFOREACH ()
# This build target is responsible for generating the package sac2crc file
CREATE_SAC2CRC_TARGET ("energy" "${DLL_BUILD_DIR}" "${DLL_BUILD_DIR}" "")