Commit 567eec59 authored by Julien Malik's avatar Julien Malik
Browse files

ENH: use lowercase CMake commands

(follow http://public.kitware.com/Bug/view.php?id=11175)
parent fc280e88
# ensure WIN32 definition
IF(WIN32)
ADD_DEFINITIONS(-DWIN32)
ENDIF(WIN32)
if(WIN32)
add_definitions(-DWIN32)
endif(WIN32)
# On Visual Studio 8 MS deprecated C. This removes all 1.276E1265 security
# warnings
IF(WIN32)
IF(NOT CYGWIN)
IF(NOT MINGW)
ADD_DEFINITIONS(
if(WIN32)
if(NOT CYGWIN)
if(NOT MINGW)
add_definitions(
-D_CRT_FAR_MAPPINGS_NO_DEPRECATE
-D_CRT_IS_WCTYPE_NO_DEPRECATE
-D_CRT_MANAGED_FP_NO_DEPRECATE
......@@ -23,11 +23,11 @@ IF(WIN32)
-D_SCL_SECURE_NO_DEPRECATE
)
IF (MSVC)
ADD_DEFINITIONS(-D_CRT_SECURE_NO_WARNINGS)
ADD_DEFINITIONS(-D_CRT_NONSTDC_NO_WARNING)
ENDIF(MSVC)
if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
add_definitions(-D_CRT_NONSTDC_NO_WARNING)
endif(MSVC)
ENDIF(NOT MINGW)
ENDIF(NOT CYGWIN)
ENDIF(WIN32)
\ No newline at end of file
endif(NOT MINGW)
endif(NOT CYGWIN)
endif(WIN32)
# Source : http://www.itk.org/Wiki/CMakeMacroParseArguments
MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
SET(DEFAULT_ARGS)
FOREACH(arg_name ${arg_names})
SET(${prefix}_${arg_name})
ENDFOREACH(arg_name)
FOREACH(option ${option_names})
SET(${prefix}_${option} FALSE)
ENDFOREACH(option)
macro(PARSE_ARGUMENTS prefix arg_names option_names)
set(DEFAULT_ARGS)
foreach(arg_name ${arg_names})
set(${prefix}_${arg_name})
endforeach(arg_name)
foreach(option ${option_names})
set(${prefix}_${option} FALSE)
endforeach(option)
SET(current_arg_name DEFAULT_ARGS)
SET(current_arg_list)
FOREACH(arg ${ARGN})
SET(larg_names ${arg_names})
LIST(FIND larg_names "${arg}" is_arg_name)
IF (is_arg_name GREATER -1)
SET(${prefix}_${current_arg_name} ${current_arg_list})
SET(current_arg_name ${arg})
SET(current_arg_list)
ELSE (is_arg_name GREATER -1)
SET(loption_names ${option_names})
LIST(FIND loption_names "${arg}" is_option)
IF (is_option GREATER -1)
SET(${prefix}_${arg} TRUE)
ELSE (is_option GREATER -1)
SET(current_arg_list ${current_arg_list} ${arg})
ENDIF (is_option GREATER -1)
ENDIF (is_arg_name GREATER -1)
ENDFOREACH(arg)
SET(${prefix}_${current_arg_name} ${current_arg_list})
ENDMACRO(PARSE_ARGUMENTS)
\ No newline at end of file
set(current_arg_name DEFAULT_ARGS)
set(current_arg_list)
foreach(arg ${ARGN})
set(larg_names ${arg_names})
list(FIND larg_names "${arg}" is_arg_name)
if(is_arg_name GREATER -1)
set(${prefix}_${current_arg_name} ${current_arg_list})
set(current_arg_name ${arg})
set(current_arg_list)
else(is_arg_name GREATER -1)
set(loption_names ${option_names})
list(FIND loption_names "${arg}" is_option)
if(is_option GREATER -1)
set(${prefix}_${arg} TRUE)
else(is_option GREATER -1)
set(current_arg_list ${current_arg_list} ${arg})
endif(is_option GREATER -1)
endif(is_arg_name GREATER -1)
endforeach(arg)
set(${prefix}_${current_arg_name} ${current_arg_list})
endmacro(PARSE_ARGUMENTS)
......@@ -10,12 +10,12 @@
# Set Source files properties such as CPLUSPLUS and SWIG_FLAGS to specify
# special behavior of SWIG. Also global CMAKE_SWIG_FLAGS can be used to add
# special flags to all swig calls.
# Another special variable is CMAKE_SWIG_OUTDIR, it allows one to specify
# Another special variable is CMAKE_SWIG_OUTDIR, it allows one to specify
# where to write all the swig generated module (swig -outdir option)
# The name-specific variable SWIG_MODULE_<name>_EXTRA_DEPS may be used
# to specify extra dependencies for the generated modules.
# If the source file generated by swig need some special flag you can use
# SET_SOURCE_FILES_PROPERTIES( ${swig_generated_file_fullname}
# set_source_files_properties( ${swig_generated_file_fullname}
# PROPERTIES COMPILE_FLAGS "-bla")
......@@ -33,144 +33,144 @@
# (To distributed this file outside of CMake, substitute the full
# License text for the above reference.)
SET(SWIG_CXX_EXTENSION "cxx")
SET(SWIG_EXTRA_LIBRARIES "")
set(SWIG_CXX_EXTENSION "cxx")
set(SWIG_EXTRA_LIBRARIES "")
SET(SWIG_PYTHON_EXTRA_FILE_EXTENSION "py")
set(SWIG_PYTHON_EXTRA_FILE_EXTENSION "py")
#
# For given swig module initialize variables associated with it
#
MACRO(SWIG_MODULE_INITIALIZE name language)
STRING(TOUPPER "${language}" swig_uppercase_language)
STRING(TOLOWER "${language}" swig_lowercase_language)
SET(SWIG_MODULE_${name}_LANGUAGE "${swig_uppercase_language}")
SET(SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG "${swig_lowercase_language}")
macro(SWIG_MODULE_INITIALIZE name language)
string(TOUPPER "${language}" swig_uppercase_language)
string(TOLOWER "${language}" swig_lowercase_language)
set(SWIG_MODULE_${name}_LANGUAGE "${swig_uppercase_language}")
set(SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG "${swig_lowercase_language}")
IF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xUNKNOWNx$")
MESSAGE(FATAL_ERROR "SWIG Error: Language \"${language}\" not found")
ENDIF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xUNKNOWNx$")
if("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xUNKNOWNx$")
message(FATAL_ERROR "SWIG Error: Language \"${language}\" not found")
endif("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xUNKNOWNx$")
SET(SWIG_MODULE_${name}_REAL_NAME "${name}")
IF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPYTHONx$")
set(SWIG_MODULE_${name}_REAL_NAME "${name}")
if("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPYTHONx$")
# when swig is used without the -interface it will produce in the module.py
# a 'import _modulename' statement, which implies having a corresponding
# a 'import _modulename' statement, which implies having a corresponding
# _modulename.so (*NIX), _modulename.pyd (Win32).
SET(SWIG_MODULE_${name}_REAL_NAME "_${name}")
ENDIF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPYTHONx$")
IF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xRUBYx$")
STRING(TOLOWER "${name}" ruby_module_name)
SET(SWIG_MODULE_${name}_REAL_NAME "${ruby_module_name}")
ENDIF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xRUBYx$")
IF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPERLx$")
SET(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow")
ENDIF("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPERLx$")
ENDMACRO(SWIG_MODULE_INITIALIZE)
set(SWIG_MODULE_${name}_REAL_NAME "_${name}")
endif("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPYTHONx$")
if("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xRUBYx$")
string(TOLOWER "${name}" ruby_module_name)
set(SWIG_MODULE_${name}_REAL_NAME "${ruby_module_name}")
endif("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xRUBYx$")
if("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPERLx$")
set(SWIG_MODULE_${name}_EXTRA_FLAGS "-shadow")
endif("x${SWIG_MODULE_${name}_LANGUAGE}x" MATCHES "^xPERLx$")
endmacro(SWIG_MODULE_INITIALIZE)
#
# For a given language, input file, and output file, determine extra files that
# will be generated. This is internal swig macro.
#
MACRO(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
GET_SOURCE_FILE_PROPERTY(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename
macro(SWIG_GET_EXTRA_OUTPUT_FILES language outfiles generatedpath infile)
get_source_file_property(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename
${infile} SWIG_MODULE_NAME)
IF(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
GET_FILENAME_COMPONENT(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${infile}" NAME_WE)
ENDIF(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
FOREACH(it ${SWIG_${language}_EXTRA_FILE_EXTENSION})
SET(${outfiles} ${${outfiles}}
if(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
get_filename_component(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename "${infile}" NAME_WE)
endif(SWIG_GET_EXTRA_OUTPUT_FILES_module_basename STREQUAL "NOTFOUND")
foreach(it ${SWIG_${language}_EXTRA_FILE_EXTENSION})
set(${outfiles} ${${outfiles}}
"${generatedpath}/${SWIG_GET_EXTRA_OUTPUT_FILES_module_basename}.${it}")
ENDFOREACH(it)
ENDMACRO(SWIG_GET_EXTRA_OUTPUT_FILES)
endforeach(it)
endmacro(SWIG_GET_EXTRA_OUTPUT_FILES)
#
# Take swig (*.i) file and add proper custom commands for it
#
MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
SET(swig_full_infile ${infile})
GET_FILENAME_COMPONENT(swig_source_file_path "${infile}" PATH)
GET_FILENAME_COMPONENT(swig_source_file_name_we "${infile}" NAME_WE)
GET_SOURCE_FILE_PROPERTY(swig_source_file_generated ${infile} GENERATED)
GET_SOURCE_FILE_PROPERTY(swig_source_file_cplusplus ${infile} CPLUSPLUS)
GET_SOURCE_FILE_PROPERTY(swig_source_file_flags ${infile} SWIG_FLAGS)
IF("${swig_source_file_flags}" STREQUAL "NOTFOUND")
SET(swig_source_file_flags "")
ENDIF("${swig_source_file_flags}" STREQUAL "NOTFOUND")
SET(swig_source_file_fullname "${infile}")
IF(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
STRING(REGEX REPLACE
macro(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
set(swig_full_infile ${infile})
get_filename_component(swig_source_file_path "${infile}" PATH)
get_filename_component(swig_source_file_name_we "${infile}" NAME_WE)
get_source_file_property(swig_source_file_generated ${infile} GENERATED)
get_source_file_property(swig_source_file_cplusplus ${infile} CPLUSPLUS)
get_source_file_property(swig_source_file_flags ${infile} SWIG_FLAGS)
if("${swig_source_file_flags}" STREQUAL "NOTFOUND")
set(swig_source_file_flags "")
endif("${swig_source_file_flags}" STREQUAL "NOTFOUND")
set(swig_source_file_fullname "${infile}")
if(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
string(REGEX REPLACE
"^${CMAKE_CURRENT_SOURCE_DIR}" ""
swig_source_file_relative_path
"${swig_source_file_path}")
ELSE(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
IF(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
STRING(REGEX REPLACE
else(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
if(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
string(REGEX REPLACE
"^${CMAKE_CURRENT_BINARY_DIR}" ""
swig_source_file_relative_path
"${swig_source_file_path}")
SET(swig_source_file_generated 1)
ELSE(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
SET(swig_source_file_relative_path "${swig_source_file_path}")
IF(swig_source_file_generated)
SET(swig_source_file_fullname "${CMAKE_CURRENT_BINARY_DIR}/${infile}")
ELSE(swig_source_file_generated)
SET(swig_source_file_fullname "${CMAKE_CURRENT_SOURCE_DIR}/${infile}")
ENDIF(swig_source_file_generated)
ENDIF(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
ENDIF(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
set(swig_source_file_generated 1)
else(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
set(swig_source_file_relative_path "${swig_source_file_path}")
if(swig_source_file_generated)
set(swig_source_file_fullname "${CMAKE_CURRENT_BINARY_DIR}/${infile}")
else(swig_source_file_generated)
set(swig_source_file_fullname "${CMAKE_CURRENT_SOURCE_DIR}/${infile}")
endif(swig_source_file_generated)
endif(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_BINARY_DIR}")
endif(${swig_source_file_path} MATCHES "^${CMAKE_CURRENT_SOURCE_DIR}")
SET(swig_generated_file_fullname
set(swig_generated_file_fullname
"${CMAKE_CURRENT_BINARY_DIR}")
IF(swig_source_file_relative_path)
SET(swig_generated_file_fullname
if(swig_source_file_relative_path)
set(swig_generated_file_fullname
"${swig_generated_file_fullname}/${swig_source_file_relative_path}")
ENDIF(swig_source_file_relative_path)
endif(swig_source_file_relative_path)
# If CMAKE_SWIG_OUTDIR was specified then pass it to -outdir
IF(CMAKE_SWIG_OUTDIR)
SET(swig_outdir ${CMAKE_SWIG_OUTDIR})
if(CMAKE_SWIG_OUTDIR)
set(swig_outdir ${CMAKE_SWIG_OUTDIR})
# it may not exist, so create it:
file(MAKE_DIRECTORY ${CMAKE_SWIG_OUTDIR})
ELSE(CMAKE_SWIG_OUTDIR)
SET(swig_outdir ${CMAKE_CURRENT_BINARY_DIR})
ENDIF(CMAKE_SWIG_OUTDIR)
else(CMAKE_SWIG_OUTDIR)
set(swig_outdir ${CMAKE_CURRENT_BINARY_DIR})
endif(CMAKE_SWIG_OUTDIR)
SWIG_GET_EXTRA_OUTPUT_FILES(${SWIG_MODULE_${name}_LANGUAGE}
swig_extra_generated_files
"${swig_outdir}"
"${infile}")
SET(swig_generated_file_fullname
set(swig_generated_file_fullname
"${swig_generated_file_fullname}/${swig_source_file_name_we}")
# add the language into the name of the file (i.e. TCL_wrap)
# this allows for the same .i file to be wrapped into different languages
SET(swig_generated_file_fullname
set(swig_generated_file_fullname
"${swig_generated_file_fullname}${SWIG_MODULE_${name}_LANGUAGE}_wrap")
IF(swig_source_file_cplusplus)
SET(swig_generated_file_fullname
if(swig_source_file_cplusplus)
set(swig_generated_file_fullname
"${swig_generated_file_fullname}.${SWIG_CXX_EXTENSION}")
ELSE(swig_source_file_cplusplus)
SET(swig_generated_file_fullname
else(swig_source_file_cplusplus)
set(swig_generated_file_fullname
"${swig_generated_file_fullname}.c")
ENDIF(swig_source_file_cplusplus)
endif(swig_source_file_cplusplus)
#MESSAGE("Full path to source file: ${swig_source_file_fullname}")
#MESSAGE("Full path to the output file: ${swig_generated_file_fullname}")
GET_DIRECTORY_PROPERTY(cmake_include_directories INCLUDE_DIRECTORIES)
SET(swig_include_dirs)
FOREACH(it ${cmake_include_directories})
SET(swig_include_dirs ${swig_include_dirs} "-I${it}")
ENDFOREACH(it)
#message("Full path to source file: ${swig_source_file_fullname}")
#message("Full path to the output file: ${swig_generated_file_fullname}")
get_directory_property(cmake_include_directories INCLUDE_DIRECTORIES)
set(swig_include_dirs)
foreach(it ${cmake_include_directories})
set(swig_include_dirs ${swig_include_dirs} "-I${it}")
endforeach(it)
SET(swig_special_flags)
set(swig_special_flags)
# default is c, so add c++ flag if it is c++
IF(swig_source_file_cplusplus)
SET(swig_special_flags ${swig_special_flags} "-c++")
ENDIF(swig_source_file_cplusplus)
SET(swig_extra_flags)
IF(SWIG_MODULE_${name}_EXTRA_FLAGS)
SET(swig_extra_flags ${swig_extra_flags} ${SWIG_MODULE_${name}_EXTRA_FLAGS})
ENDIF(SWIG_MODULE_${name}_EXTRA_FLAGS)
ADD_CUSTOM_COMMAND(
if(swig_source_file_cplusplus)
set(swig_special_flags ${swig_special_flags} "-c++")
endif(swig_source_file_cplusplus)
set(swig_extra_flags)
if(SWIG_MODULE_${name}_EXTRA_FLAGS)
set(swig_extra_flags ${swig_extra_flags} ${SWIG_MODULE_${name}_EXTRA_FLAGS})
endif(SWIG_MODULE_${name}_EXTRA_FLAGS)
add_custom_command(
OUTPUT "${swig_generated_file_fullname}" ${swig_extra_generated_files}
COMMAND "${SWIG_EXECUTABLE}"
ARGS "-${SWIG_MODULE_${name}_SWIG_LANGUAGE_FLAG}"
......@@ -184,54 +184,54 @@ MACRO(SWIG_ADD_SOURCE_TO_MODULE name outfiles infile)
"${swig_source_file_fullname}"
MAIN_DEPENDENCY "${swig_source_file_fullname}"
DEPENDS ${SWIG_MODULE_${name}_EXTRA_DEPS}
COMMENT "Swig source to generate ${SWIG_MODULE_${name}_LANGUAGE} wrapping")
SET_SOURCE_FILES_PROPERTIES("${swig_generated_file_fullname}" ${swig_extra_generated_files}
COMMENT "Swig source to generate ${SWIG_MODULE_${name}_LANGUAGE} wrapping")
set_source_files_properties("${swig_generated_file_fullname}" ${swig_extra_generated_files}
PROPERTIES GENERATED 1)
SET(${outfiles} "${swig_generated_file_fullname}" ${swig_extra_generated_files})
ENDMACRO(SWIG_ADD_SOURCE_TO_MODULE)
set(${outfiles} "${swig_generated_file_fullname}" ${swig_extra_generated_files})
endmacro(SWIG_ADD_SOURCE_TO_MODULE)
#
# Create Swig module
#
MACRO(SWIG_ADD_MODULE name language)
macro(SWIG_ADD_MODULE name language)
SWIG_MODULE_INITIALIZE(${name} ${language})
SET(swig_dot_i_sources)
SET(swig_other_sources)
FOREACH(it ${ARGN})
IF(${it} MATCHES ".*\\.i$")
SET(swig_dot_i_sources ${swig_dot_i_sources} "${it}")
ELSE(${it} MATCHES ".*\\.i$")
SET(swig_other_sources ${swig_other_sources} "${it}")
ENDIF(${it} MATCHES ".*\\.i$")
ENDFOREACH(it)
set(swig_dot_i_sources)
set(swig_other_sources)
foreach(it ${ARGN})
if(${it} MATCHES ".*\\.i$")
set(swig_dot_i_sources ${swig_dot_i_sources} "${it}")
else(${it} MATCHES ".*\\.i$")
set(swig_other_sources ${swig_other_sources} "${it}")
endif(${it} MATCHES ".*\\.i$")
endforeach(it)
SET(swig_generated_sources)
FOREACH(it ${swig_dot_i_sources})
set(swig_generated_sources)
foreach(it ${swig_dot_i_sources})
SWIG_ADD_SOURCE_TO_MODULE(${name} swig_generated_source ${it})
SET(swig_generated_sources ${swig_generated_sources} "${swig_generated_source}")
ENDFOREACH(it)
GET_DIRECTORY_PROPERTY(swig_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
SET_DIRECTORY_PROPERTIES(PROPERTIES
set(swig_generated_sources ${swig_generated_sources} "${swig_generated_source}")
endforeach(it)
get_directory_property(swig_extra_clean_files ADDITIONAL_MAKE_CLEAN_FILES)
set_directory_properties(PROPERTIES
ADDITIONAL_MAKE_CLEAN_FILES "${swig_extra_clean_files};${swig_generated_sources}")
ADD_LIBRARY(${SWIG_MODULE_${name}_REAL_NAME}
add_library(${SWIG_MODULE_${name}_REAL_NAME}
MODULE
${swig_generated_sources}
${swig_other_sources})
STRING(TOLOWER "${language}" swig_lowercase_language)
IF ("${swig_lowercase_language}" STREQUAL "java")
IF (APPLE)
string(TOLOWER "${language}" swig_lowercase_language)
if("${swig_lowercase_language}" STREQUAL "java")
if(APPLE)
# In java you want:
# System.loadLibrary("LIBRARY");
# then JNI will look for a library whose name is platform dependent, namely
# MacOS : libLIBRARY.jnilib
# Windows: LIBRARY.dll
# Linux : libLIBRARY.so
SET_TARGET_PROPERTIES (${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".jnilib")
ENDIF (APPLE)
ENDIF ("${swig_lowercase_language}" STREQUAL "java")
IF ("${swig_lowercase_language}" STREQUAL "python")
set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".jnilib")
endif(APPLE)
endif("${swig_lowercase_language}" STREQUAL "java")
if("${swig_lowercase_language}" STREQUAL "python")
# this is only needed for the python case where a _modulename.so is generated
SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "")
set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "")
# Python extension modules on Windows must have the extension ".pyd"
# instead of ".dll" as of Python 2.5. Older python versions do support
# this suffix.
......@@ -240,27 +240,27 @@ MACRO(SWIG_ADD_MODULE name language)
# Windows: .dll is no longer supported as a filename extension for extension modules.
# .pyd is now the only filename extension that will be searched for.
# </quote>
IF(WIN32 AND NOT CYGWIN)
SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".pyd")
ENDIF(WIN32 AND NOT CYGWIN)
ENDIF ("${swig_lowercase_language}" STREQUAL "python")
IF ("${swig_lowercase_language}" STREQUAL "ruby")
SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "")
IF(APPLE)
SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".bundle")
SET_TARGET_PROPERTIES(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES COMPILE_FLAGS "-bundle")
ENDIF(APPLE)
ENDIF ("${swig_lowercase_language}" STREQUAL "ruby")
ENDMACRO(SWIG_ADD_MODULE)
if(WIN32 AND NOT CYGWIN)
set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".pyd")
endif(WIN32 AND NOT CYGWIN)
endif("${swig_lowercase_language}" STREQUAL "python")
if("${swig_lowercase_language}" STREQUAL "ruby")
set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES PREFIX "")
if(APPLE)
set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES SUFFIX ".bundle")
set_target_properties(${SWIG_MODULE_${name}_REAL_NAME} PROPERTIES COMPILE_FLAGS "-bundle")
endif(APPLE)
endif("${swig_lowercase_language}" STREQUAL "ruby")
endmacro(SWIG_ADD_MODULE)
#
# Like TARGET_LINK_LIBRARIES but for swig modules
#
MACRO(SWIG_LINK_LIBRARIES name)
IF(SWIG_MODULE_${name}_REAL_NAME)
TARGET_LINK_LIBRARIES(${SWIG_MODULE_${name}_REAL_NAME} ${ARGN})
ELSE(SWIG_MODULE_${name}_REAL_NAME)
MESSAGE(SEND_ERROR "Cannot find Swig library \"${name}\".")
ENDIF(SWIG_MODULE_${name}_REAL_NAME)
ENDMACRO(SWIG_LINK_LIBRARIES name)
macro(SWIG_LINK_LIBRARIES name)
if(SWIG_MODULE_${name}_REAL_NAME)
target_link_libraries(${SWIG_MODULE_${name}_REAL_NAME} ${ARGN})
else(SWIG_MODULE_${name}_REAL_NAME)
message(SEND_ERROR "Cannot find Swig library \"${name}\".")
endif(SWIG_MODULE_${name}_REAL_NAME)
endmacro(SWIG_LINK_LIBRARIES name)
PROJECT(OTB-Wrapper)
project(OTB-Wrapper)
cmake_minimum_required(VERSION 2.6)
IF(COMMAND CMAKE_POLICY)
CMAKE_POLICY(SET CMP0003 NEW)
ENDIF(COMMAND CMAKE_POLICY)
if(COMMAND CMAKE_POLICY)
cmake_policy(SET CMP0003 NEW)
endif(COMMAND CMAKE_POLICY)
# Path to additional CMake modules
SET(CMAKE_MODULE_PATH
set(CMAKE_MODULE_PATH
${CMAKE_SOURCE_DIR}/CMake
${CMAKE_MODULE_PATH})
include(Definitions)
# Link to the Orfeo ToolBox
FIND_PACKAGE(OTB REQUIRED PATHS /usr/lib/otb )
INCLUDE(${OTB_USE_FILE})
find_package(OTB REQUIRED PATHS /usr/lib/otb )
include(${OTB_USE_FILE})
SET(BUILD_SHARED_LIBS ${OTB_BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS ${OTB_BUILD_SHARED_LIBS})
ADD_SUBDIRECTORY(Code)
ADD_SUBDIRECTORY(Example)
add_subdirectory(Code)
add_subdirectory(Example)
# Enable / Disable testing
OPTION(BUILD_TESTING "Build testing." OFF)
INCLUDE(${CMAKE_ROOT}/Modules/Dart.cmake)
MARK_AS_ADVANCED(TCL_TCLSH DART_ROOT)
IF(BUILD_TESTING)
ENABLE_TESTING()
# configure the test driver
FIND_PROGRAM(OTB_TEST_DRIVER otbTestDriver PATHS ${OTB_DIR}/bin ${OTB_DIR}/../../bin DOC "Path to the otbTestDriver executable from OTB")
FIND_PATH(OTB_DATA_ROOT README-OTB-Data PATHS $ENV{OTB_DATA_ROOT} ${OTB_SOURCE_DIR}/../OTB-Data)
MARK_AS_ADVANCED(OTB_DATA_ROOT)
SET(BUILDNAME "${BUILDNAME}" CACHE STRING "Name of build on the dashboard")
MARK_AS_ADVANCED(BUILDNAME)
ADD_SUBDIRECTORY(Testing)
ENDIF(BUILD_TESTING)
option(BUILD_TESTING "Build testing." OFF)
include(${CMAKE_ROOT}/Modules/Dart.cmake)
mark_as_advanced(TCL_TCLSH DART_ROOT)
if(BUILD_TESTING)
enable_testing()
find_program(OTB_TEST_DRIVER otbTestDriver PATHS ${OTB_DIR}/bin ${OTB_DIR}/../../bin DOC "Path to the otbTestDriver executable from OTB")
find_path(OTB_DATA_ROOT README-OTB-Data PATHS $ENV{OTB_DATA_ROOT} ${OTB_SOURCE_DIR}/../OTB-Data)
mark_as_advanced(OTB_DATA_ROOT)
set(BUILDNAME "${BUILDNAME}" CACHE STRING "Name of build on the dashboard")
mark_as_advanced(BUILDNAME)
add_subdirectory(Testing)
endif(BUILD_TESTING)
......@@ -2,8 +2,8 @@
## Then modify the CMakeLists.txt file in the root directory of your
## project to incorporate the testing dashboard.
## # The following are required to uses Dart and the Cdash dashboard
## ENABLE_TESTING()
## INCLUDE(Dart)
## enable_testing()
## include(Dart)
set(CTEST_PROJECT_NAME "OTB-Wrapper")
set(CTEST_NIGHTLY_START_TIME "20:00:00 CEST")
......
ADD_SUBDIRECTORY(Core)
ADD_SUBDIRECTORY(Wrappers)
add_subdirectory(Core)
add_subdirectory(Wrappers)
FILE(GLOB srcs "*.cxx")
file(GLOB srcs "*.cxx")
ADD_LIBRARY(OTBWrapperCore ${srcs})
TARGET_LINK_LIBRARIES(OTBWrapperCore OTBCommon OTBIO)
add_library(OTBWrapperCore ${srcs})
target_link_libraries(OTBWrapperCore OTBCommon OTBIO)
INCLUDE_DIRECTORIES(${QT_INCLUDE_DIRS})
INCLUDE_DIRECTORIES(../QtWidget)
include_directories(${QT_INCLUDE_DIRS})
include_directories(../QtWidget)
SET( SRCS
set( SRCS
otbApplicationLauncherQt.cxx )
ADD_EXECUTABLE(otbApplicationLauncherQt ${SRCS})
add_executable(otbApplicationLauncherQt ${SRCS})