Modifying cmake configuration to compile and install TBB.
[dyninst.git] / cmake / platform_unix.cmake
1 set (PLATFORM $ENV{PLATFORM})
2 message(STATUS "-- Input platform: ${PLATFORM}")
3 set (VALID_PLATFORMS
4     amd64-unknown-freebsd7.2 
5     i386-unknown-freebsd7.2 
6     i386-unknown-linux2.4 
7     ppc32_linux 
8     ppc64_linux 
9     x86_64-unknown-linux2.4
10     ppc64_bgq_ion
11     aarch64-unknown-linux
12     )
13
14 if (NOT PLATFORM)
15 set (INVALID_PLATFORM true)
16 else()
17 list (FIND VALID_PLATFORMS ${PLATFORM} PLATFORM_FOUND)
18   if (PLATFORM_FOUND EQUAL -1)
19   set (INVALID_PLATFORM true)
20   endif()
21 endif()
22
23
24 execute_process (COMMAND ${DYNINST_ROOT}/scripts/sysname OUTPUT_VARIABLE SYSNAME_OUT)
25 string(REPLACE "\n" "" SYSPLATFORM ${SYSNAME_OUT})
26
27 if (INVALID_PLATFORM)
28 # Try to set it automatically
29 execute_process (COMMAND ${DYNINST_ROOT}/scripts/dynsysname ${SYSNAME_OUT}
30                  OUTPUT_VARIABLE DYNSYSNAME_OUT
31                  )
32 string (REPLACE "\n" "" PLATFORM ${DYNSYSNAME_OUT})
33 message (STATUS "-- Attempting to automatically identify platform: ${PLATFORM}")
34 endif()
35
36 list (FIND VALID_PLATFORMS ${PLATFORM} PLATFORM_FOUND)
37
38 if (PLATFORM_FOUND EQUAL -1)
39 message (FATAL_ERROR "Error: unknown platform ${PLATFORM}; please set the PLATFORM environment variable to one of the following options: ${VALID_PLATFORMS}")
40 endif()
41