Changeset 406 for library/system
- Timestamp:
- 07/02/09 22:16:09 (16 years ago)
- Location:
- library/system
- Files:
-
- 2 modified
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
library/system/FindITPP.cmake
r362 r406 44 44 ELSE (ITPP_FOUND) 45 45 IF (ITPP_FIND_REQUIRED) 46 MESSAGE(FATAL_ERROR "Could not find ITPP library ")46 MESSAGE(FATAL_ERROR "Could not find ITPP library, make sure ITPP_DIR is properly set") 47 47 ENDIF (ITPP_FIND_REQUIRED) 48 48 ENDIF (ITPP_FOUND) -
library/system/FindMatlab.cmake
r357 r406 1 # - this module looks for Matlab1 # - This module looks for Matlab and associated development libraries 2 2 # Defines: 3 3 # MATLAB_INCLUDE_DIR: include path for mex.h, engine.h 4 # MATLAB_LIBRARIES: required libraries: libmex, etc 5 # MATLAB_MAT_LIBRARY: path to libmat.lib 6 # MATLAB_MEX_LIBRARY: path to libmex.lib 7 # MATLAB_MX_LIBRARY: path to libmx.lib 8 # MATLAB_ENG_LIBRARY: path to libeng.lib 4 # MATLAB_LIBRARIES: required libraries: libmex, etc 5 # MATLAB_MEX_LIBRARY: path to libmex.lib 6 # MATLAB_MX_LIBRARY: path to libmx.lib 7 # MATLAB_ENG_LIBRARY: path to libeng.lib 8 # MATLAB_MEX_VERSION_FILE: path to mexversion.rc or mexversion.c 9 # MATLAB_MEX_SUFFIX: filename suffix for mex-files (e.g. '.mexglx' or '.mexw64') 10 11 # This version modified by RW Penney, November 2008 12 # $Revision: 27 $, $Date: 2008-12-22 11:47:45 +0000 (Mon, 22 Dec 2008) $ 9 13 10 14 11 15 SET(MATLAB_FOUND 0) 16 12 17 IF(WIN32) 13 IF(${CMAKE_GENERATOR} MATCHES "Visual Studio .*" OR ${CMAKE_GENERATOR} MATCHES "NMake Makefiles")14 SET(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/")15 ELSE(${CMAKE_GENERATOR} MATCHES "Visual Studio .*" OR ${CMAKE_GENERATOR} MATCHES "NMake Makefiles")16 IF(${CMAKE_GENERATOR} MATCHES "Borland")17 # Same here, there are also: bcc50 and bcc51 directories18 SET(MATLAB_ROOT "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/lib/win32/microsoft/bcc54")19 ELSE(${CMAKE_GENERATOR} MATCHES "Borland")20 MESSAGE(FATAL_ERROR "Generator not compatible: ${CMAKE_GENERATOR}")21 ENDIF(${CMAKE_GENERATOR} MATCHES "Borland")22 ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio .*" OR ${CMAKE_GENERATOR} MATCHES "NMake Makefiles")23 FIND_LIBRARY(MATLAB_MEX_LIBRARY24 libmex25 ${MATLAB_ROOT}26 )27 FIND_LIBRARY(MATLAB_MX_LIBRARY28 libmx29 ${MATLAB_ROOT}30 )31 FIND_LIBRARY(MATLAB_ENG_LIBRARY32 libeng33 ${MATLAB_ROOT}34 )35 FIND_LIBRARY(MATLAB_MAT_LIBRARY36 libmat37 ${MATLAB_ROOT}38 )39 18 40 FIND_PATH(MATLAB_INCLUDE_DIR 41 "mex.h" 42 "[HKEY_LOCAL_MACHINE\\SOFTWARE\\MathWorks\\MATLAB\\7.0;MATLABROOT]/extern/include" 43 ) 44 ELSE( WIN32 ) 19 FILE(GLOB _auto_matlab_prefixes "C:/Program Files/MATLAB*/R20*") 20 21 IF(CMAKE_SIZEOF_VOID_P EQUAL 4) 22 # Regular x86 23 SET(MATLAB_MEX_SUFFIX mexw32) 24 SET(_extern_arch "win32") 25 ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4) 26 SET(MATLAB_MEX_SUFFIX mexw64) 27 SET(_extern_arch "win64") 28 ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4) 29 30 # Search for available compilers: 31 # (This would be neater using 'ELSEIF', but that isn't available until cmake-2.4.4) 32 IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") 33 SET(_matlab_path_suffixes "extern/lib/${_extern_arch}/microsoft/msvc60" 34 "extern/lib/${_extern_arch}/microsoft") 35 ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 6") 36 IF(${CMAKE_GENERATOR} MATCHES "Visual Studio 7") 37 SET(_matlab_path_suffixes "extern/lib/${_extern_arch}/microsoft/msvc70" 38 "extern/lib/${_extern_arch}/microsoft") 39 ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio 7") 40 IF(${CMAKE_GENERATOR} MATCHES "Visual Studio [891]*") 41 SET(_matlab_path_suffixes "extern/lib/${_extern_arch}/microsoft/msvc71" 42 "extern/lib/${_extern_arch}/microsoft") 43 ENDIF(${CMAKE_GENERATOR} MATCHES "Visual Studio [891]*") 44 IF(${CMAKE_GENERATOR} MATCHES "Borland") 45 SET(_matlab_path_suffixes "extern/lib/win32/microsoft/bcc54") 46 ENDIF(${CMAKE_GENERATOR} MATCHES "Borland") 47 IF(NOT _matlab_path_suffixes) 48 MESSAGE(FATAL_ERROR "Generator not compatible: ${CMAKE_GENERATOR}") 49 ENDIF(NOT _matlab_path_suffixes) 50 51 SET(_libmex_name "libmex") 52 SET(_libmx_name "libmx") 53 SET(_libeng_name "libeng") 54 55 ELSE(WIN32) 56 45 57 IF(NOT MATLAB_ROOT) 46 58 IF($ENV{MATLAB_ROOT}) 47 59 SET(MATLAB_ROOT $ENV{MATLAB_ROOT}) 48 60 ELSE($ENV{MATLAB_ROOT}) 49 SET(MATLAB_ROOT /opt/matlab)61 SET(MATLAB_ROOT "$ENV{HOME}/bin/matlab*") 50 62 ENDIF($ENV{MATLAB_ROOT}) 51 63 ENDIF(NOT MATLAB_ROOT) 64 65 FILE(GLOB _auto_matlab_prefixes "/usr/local/matlab*" "/opt/matlab*" ${MATLAB_ROOT}) 66 52 67 IF(CMAKE_SIZEOF_VOID_P EQUAL 4) 53 68 # Regular x86 54 SET(MATLAB_SYS 55 ${MATLAB_ROOT}/bin/glnx86 56 ) 69 SET(_matlab_path_suffixes "bin/glnx86") 70 SET(MATLAB_MEX_SUFFIX mexglx) 57 71 ELSE(CMAKE_SIZEOF_VOID_P EQUAL 4) 58 # AMD64: 59 SET(MATLAB_SYS 60 ${MATLAB_ROOT}/bin/glnxa64 61 ) 72 SET(_matlab_path_suffixes "bin/glnxa64") 73 SET(MATLAB_MEX_SUFFIX mexa64) 62 74 ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 4) 63 FIND_LIBRARY(MATLAB_MEX_LIBRARY 64 mex 65 ${MATLAB_SYS} 66 ) 67 FIND_LIBRARY(MATLAB_MX_LIBRARY 68 mx 69 ${MATLAB_SYS} 70 ) 71 FIND_LIBRARY(MATLAB_MAT_LIBRARY 72 mat 73 ${MATLAB_SYS} 74 ) 75 FIND_LIBRARY(MATLAB_ENG_LIBRARY 76 eng 77 ${MATLAB_SYS} 78 ) 79 FIND_PATH(MATLAB_INCLUDE_DIR 80 "mex.h" 81 ${MATLAB_ROOT}/extern/include 82 ) 75 76 SET(_libmex_name "mex") 77 SET(_libmx_name "mx") 78 SET(_libeng_name "eng") 83 79 84 80 ENDIF(WIN32) 85 81 86 # This is common to UNIX and Win32: 82 83 SET(_matlab_path_prefixes 84 ${MATLAB_PATH_PREFIXES} 85 ${_auto_matlab_prefixes} 86 ${MATLAB_ROOT} 87 ) 88 89 # Search for include-files & libraries using architecture-dependent paths: 90 FOREACH(_matlab_prefix ${_matlab_path_prefixes}) 91 MESSAGE("searching ${_matlab_prefix}") 92 IF(NOT MATLAB_INCLUDE_DIR) 93 FIND_PATH(MATLAB_INCLUDE_DIR "mex.h" 94 ${_matlab_prefix}/extern/include) 95 96 IF(MATLAB_INCLUDE_DIR) 97 SET(MATLAB_ROOT ${_matlab_prefix} 98 CACHE PATH "Matlab installation directory") 99 IF(WIN32) 100 SET(MATLAB_MEX_VERSIONFILE "${_matlab_prefix}/extern/include/mexversion.rc") 101 ELSE(WIN32) 102 SET(MATLAB_MEX_VERSIONFILE "${_matlab_prefix}/extern/src/mexversion.c") 103 ENDIF(WIN32) 104 ENDIF(MATLAB_INCLUDE_DIR) 105 ENDIF(NOT MATLAB_INCLUDE_DIR) 106 107 FOREACH(_matlab_path_suffix ${_matlab_path_suffixes}) 108 SET(_matlab_libdir ${_matlab_prefix}/${_matlab_path_suffix}) 109 MESSAGE("Searching ${_matlab_prefix} ... ${_matlab_libdir}") 110 IF(NOT MATLAB_MEX_LIBRARY) 111 FIND_LIBRARY(MATLAB_MEX_LIBRARY ${_libmex_name} ${_matlab_libdir}) 112 FIND_LIBRARY(MATLAB_MX_LIBRARY ${_libmx_name} ${_matlab_libdir}) 113 FIND_LIBRARY(MATLAB_ENG_LIBRARY ${_libeng_name} ${_matlab_libdir}) 114 ENDIF(NOT MATLAB_MEX_LIBRARY) 115 ENDFOREACH(_matlab_path_suffix) 116 ENDFOREACH(_matlab_prefix) 117 87 118 SET(MATLAB_LIBRARIES 88 119 ${MATLAB_MEX_LIBRARY} … … 91 122 ) 92 123 93 IF(MATLAB_INCLUDE_DIR 94 AND MATLAB_MEX_LIBRARY 95 AND MATLAB_MAT_LIBRARY 96 AND MATLAB_ENG_LIBRARY 97 AND MATLAB_MX_LIBRARY) 98 SET(MATLAB_LIBRARIES ${MATLAB_MX_LIBRARY} ${MATLAB_MEX_LIBRARY} ${MATLAB_ENG_LIBRARY} ${MATLAB_MAT_LIBRARY}) 99 ENDIF(MATLAB_INCLUDE_DIR 100 AND MATLAB_MEX_LIBRARY 101 AND MATLAB_MAT_LIBRARY 102 AND MATLAB_ENG_LIBRARY 103 AND MATLAB_MX_LIBRARY) 124 IF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES) 125 SET(MATLAB_FOUND 1) 126 MESSAGE(STATUS "Found Matlab arch ${MATLAB_MEX_SUFFIX} at ${MATLAB_INCLUDE_DIR}") 127 ELSE(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES) 128 MESSAGE(STATUS "Matlab not found") 129 ENDIF(MATLAB_INCLUDE_DIR AND MATLAB_LIBRARIES) 104 130 105 131 MARK_AS_ADVANCED( 132 MATLAB_LIBRARIES 106 133 MATLAB_MEX_LIBRARY 107 134 MATLAB_MX_LIBRARY 108 135 MATLAB_ENG_LIBRARY 109 136 MATLAB_INCLUDE_DIR 110 MATLAB_ROOT 137 MATLAB_MEX_SUFFIX 138 MATLAB_MEX_VERSIONFILE 139 MATLAB_FOUND 111 140 ) 112 141 113 INCLUDE(FindPackageHandleStandardArgs) 114 FIND_PACKAGE_HANDLE_STANDARD_ARGS(Matlab 115 MATLAB_INCLUDE_DIR 116 MATLAB_MEX_LIBRARY 117 MATLAB_MAT_LIBRARY 118 MATLAB_ENG_LIBRARY 119 MATLAB_MX_LIBRARY ) 120 142 # vim: set ts=2 sw=2 et: -
library/system/SetBdmEnv.cmake
r391 r406 1 # Compulsory line 2 cmake_minimum_required(VERSION 2.6) 1 # This Module Sets CMake variables for BDM 2 # Variable BDM_SOURCE_DIR must be set 3 # 4 # Other respected variables are 5 # ITPP_DIR, ACML_DIR, MATLAB_ROOT 6 # 3 7 4 SET(BDM_SOURCE_DIR "/home/smidl/work/git/mixpp/library")5 SET(CMAKE_MODULE_PATH "${BDM_SOURCE_DIR}/system/")6 SET(ITPP_DIR "${BDM_SOURCE_DIR}/system/linux/")8 IF(NOT BDM_SOURCE_DIR) 9 MESSAGE(FATAL_ERROR "BDM_SOURCE_DIR is not set!") 10 ENDIF(NOT BDM_SOURCE_DIR) 7 11 8 #MESSAGE(${CMAKE_MODULE_PATH}) 9 10 # copy settings from library 12 ###################### 13 #Platform specific 11 14 IF(WIN32) 12 15 # IF YOU WANT TO USE YOUR OWN INSTALLATION OF THE NEXT EXTERNAL LIBRARIES, 13 16 # THEN IT IS NECESSARY TO CREATE TEXT FILE "\system\WIN32\LOCAL_PATHS.TXT" WITH 14 17 # COPIES OF THE TWO FOLLOWING LINES AND THEN CORECT ALL THE INVOLVED PATHS 15 SET(ITPP_DIR "${BDM_SOURCE_DIR}\\system\\win32\\itpp-4.0.6") 16 SET(ACML_DIR "${BDM_SOURCE_DIR}\\system\\win32\\acml3.6.0") 17 18 IF(NOT ITPP_DIR) 19 SET(ITPP_DIR "${BDM_SOURCE_DIR}\\system\\win32\\itpp-4.0.6") 20 ENDIF(NOT ITPP_DIR) 21 IF(NOT ACML_DIR) 22 SET(ACML_DIR "${BDM_SOURCE_DIR}\\system\\win32\\acml3.6.0") 23 ENDIF(NOT ACML_DIR) 24 18 25 INCLUDE(\\system\\win32\\local_paths.txt OPTIONAL) 19 26 ADD_DEFINITIONS(-DHAVE_ACML) 20 27 ENDIF(WIN32) 21 28 IF(APPLE) 22 SET(ITPP_DIR "${BDM_SOURCE_DIR}\\macosx\\itpp-4.0.6") 29 IF(NOT ITPP_DIR) 30 SET(ITPP_DIR "${BDM_SOURCE_DIR}/macosx/itpp-4.0.6") 31 ENDIF(NOT ITPP_DIR) 23 32 FIND_LIBRARY(FRAMEWORK_VECLIB vecLib) 24 33 ADD_DEFINITIONS(-DHAVE_XLOCALE_H) 25 34 ENDIF(APPLE) 26 35 IF(UNIX) 36 # Generally this directory should not exist! 37 # Use this location is you compile itpp from sources 38 IF(NOT ITPP_DIR) 39 SET(ITPP_DIR "${BDM_SOURCE_DIR}/system/linux/") 40 ENDIF(NOT ITPP_DIR) 27 41 #This is for UNIX makefile which does only one release at a time. 28 SET(CMAKE_BUILD_TYPE Debug)29 SET(CMAKE_CXX_FLAGS "-Wall -pipe -Wno-unknown-pragmas -fPIC")30 SET(CMAKE_C_FLAGS "-Wall -pipe -Wno-unknown-pragmas -fPIC")31 SET(CMAKE_CXX_FLAGS_RELEASE " -DNDEBUG -O2")32 SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0")33 #ADD_DEFINITIONS(-DNDEBUG)34 35 SET(MATLAB_ROOT ~/bin/matlab2008a)36 # MATLAB_ROOT can be setup in Local37 42 ENDIF(UNIX) 38 43 … … 55 60 LINK_DIRECTORIES(${NATIVE_ACML_LIB_PATH}) 56 61 ENDIF(ACML_FOUND) 62 63 IF(UNIX) 64 SET(CMAKE_BUILD_TYPE Debug) 65 IF(MATLAB_FOUND) 66 SET(CMAKE_CXX_FLAGS "-Wall -pipe -Wno-unknown-pragmas -fPIC") 67 SET(CMAKE_C_FLAGS "-Wall -pipe -Wno-unknown-pragmas -fPIC") 68 ELSE(MATLAB_FOUND) 69 SET(CMAKE_CXX_FLAGS "-Wall -Wno-unknown-pragmas ") 70 SET(CMAKE_C_FLAGS "-Wall -Wno-unknown-pragmas ") 71 ENDIF(MATLAB_FOUND) 72 73 SET(CMAKE_CXX_FLAGS_RELEASE " -DNDEBUG -O2") 74 SET(CMAKE_CXX_FLAGS_DEBUG "-g -O0") 75 ENDIF(UNIX) 57 76 58 77 ## … … 78 97 ENDMACRO(EXEC) 79 98 80 81 add_subdirectory (pmsm) 82 add_subdirectory (mpdm) 83 add_subdirectory (doprava) 84 add_subdirectory (bdmtoolbox) 99 MACRO(MEX FN) 100 INCLUDE_DIRECTORIES(${MATLAB_INCLUDE_DIR} "${BDM_SOURCE_DIR}/bdm") 101 LINK_DIRECTORIES("${BDM_SOURCE_DIR}/bdm") 102 ADD_LIBRARY(${FN} MODULE ${FN}.cpp) 103 set_target_properties(${FN} PROPERTIES 104 PREFIX "" 105 SUFFIX ${MATLAB_MEX_SUFFIX} 106 ) 107 TARGET_LINK_LIBRARIES(${FN} ${MATLAB_LIBRARIES} bdm itpp) 108 ENDMACRO(MEX)