Commit fd225ca7 authored by hjohnson's avatar hjohnson
Browse files

COMP: With the conversion to CMake version 2.6, the variables...

COMP: With the conversion to CMake version 2.6, the variables CMAKE_RUNTIME_OUTPUT_DIRECTORY CMAKE_LIBRARY_OUTPUT_DIRECTORY CMAKE_ARCHIVE_OUTPUT_DIRECTORY should be used instead of EXECUTABLE_OUTPUT_PATH and LIBRARY_OUTPUT_PATH.

git-svn-id: http://svn.slicer.org/Slicer4/trunk@10426 3bd1e089-480b-0410-8dfb-8563597acbee
parent e0eb42ee
......@@ -32,9 +32,9 @@ if(BatchMake_DIR)
find_path(Slicer3_BINARY_DIR NAMES Base/Logic/SlicerBaseLogicInit.cxx)
if(Slicer3_BINARY_DIR)
if(WIN32)
set(BatchMake_WRAPPED_APPLICATION_DIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE})
set(BatchMake_WRAPPED_APPLICATION_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
else(WIN32)
set(BatchMake_WRAPPED_APPLICATION_DIR ${EXECUTABLE_OUTPUT_PATH})
set(BatchMake_WRAPPED_APPLICATION_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif(WIN32)
# Copy the wrapped application for BatchMake.
......
......@@ -72,9 +72,9 @@ if(BatchMake_DIR)
${CMAKE_BINARY_DIR}/${Slicer3_INSTALL_PLUGINS_BIN_DIR})
if(WIN32)
set(BatchMake_WRAPPED_APPLICATION_DIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE})
set(BatchMake_WRAPPED_APPLICATION_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
else(WIN32)
set(BatchMake_WRAPPED_APPLICATION_DIR ${EXECUTABLE_OUTPUT_PATH})
set(BatchMake_WRAPPED_APPLICATION_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif(WIN32)
# Copy the wrapped application for BatchMake.
......
......@@ -49,9 +49,9 @@ if(BatchMake_DIR)
${CMAKE_BINARY_DIR}/${Slicer3_INSTALL_PLUGINS_BIN_DIR})
if(WIN32)
set(BatchMake_WRAPPED_APPLICATION_DIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE})
set(BatchMake_WRAPPED_APPLICATION_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
else(WIN32)
set(BatchMake_WRAPPED_APPLICATION_DIR ${EXECUTABLE_OUTPUT_PATH})
set(BatchMake_WRAPPED_APPLICATION_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif(WIN32)
# Copy the wrapped application for BatchMake.
......
......@@ -50,9 +50,9 @@ if(BatchMake_DIR)
#message( >>>>>>> Slicer3ExeModulePath ${AppPath} )
set( Slicer3ExeModulePath ${${Slicer3ExeModule}Path} )
if(WIN32)
set(BatchMake_WRAPPED_APPLICATION_DIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE})
set(BatchMake_WRAPPED_APPLICATION_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
else(WIN32)
set(BatchMake_WRAPPED_APPLICATION_DIR ${EXECUTABLE_OUTPUT_PATH})
set(BatchMake_WRAPPED_APPLICATION_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif(WIN32)
# Configure a header
......
......@@ -49,9 +49,9 @@ if(BatchMake_DIR)
set( Slicer3ExeModulePath ${${Slicer3ExeModule}Path} )
if(WIN32)
set(BatchMake_WRAPPED_APPLICATION_DIR ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE})
set(BatchMake_WRAPPED_APPLICATION_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
else(WIN32)
set(BatchMake_WRAPPED_APPLICATION_DIR ${EXECUTABLE_OUTPUT_PATH})
set(BatchMake_WRAPPED_APPLICATION_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
endif(WIN32)
# Configure a header
......
......@@ -51,15 +51,15 @@ endif (Slicer3_SOURCE_DIR)
#for this test. Include as many tests as you like. If your project doesn't have
#any tests you can comment out or delete the following line.
#IF (WIN32)
# ADD_TEST(DemonsRegistrationTest1 ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/${CLP} --help)
# ADD_TEST(DemonsRegistrationTest1 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CLP} --help)
#ELSE(WIN32)
# ADD_TEST(DemonsRegistrationTest1 ${EXECUTABLE_OUTPUT_PATH}/${CLP} --help)
# ADD_TEST(DemonsRegistrationTest1 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CLP} --help)
#ENDIF (WIN32)
# IF (WIN32)
# ADD_TEST(DemonsRegistrationTest2 ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE}/${CLP} -f ${CMAKE_SOURCE_DIR}/RatLungSlice1.mha -m ${CMAKE_SOURCE_DIR}/RatLungSlice2.mha -v -s2 -g1 -i 20x20x20 )
# ADD_TEST(DemonsRegistrationTest2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE}/${CLP} -f ${CMAKE_SOURCE_DIR}/RatLungSlice1.mha -m ${CMAKE_SOURCE_DIR}/RatLungSlice2.mha -v -s2 -g1 -i 20x20x20 )
# ELSE(WIN32)
# ADD_TEST(DemonsRegistrationTest2 ${EXECUTABLE_OUTPUT_PATH}/${CLP} -f ${CMAKE_SOURCE_DIR}/RatLungSlice1.mha -m ${CMAKE_SOURCE_DIR}/RatLungSlice2.mha -v -s2 -g1 -i 20x20x20)
# ADD_TEST(DemonsRegistrationTest2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CLP} -f ${CMAKE_SOURCE_DIR}/RatLungSlice1.mha -m ${CMAKE_SOURCE_DIR}/RatLungSlice2.mha -v -s2 -g1 -i 20x20x20)
# ENDIF (WIN32)
# ADD_TEST(CompareImage ImageCompare ${CMAKE_SOURCE_DIR}/RatLungSlice2-Reg.mha output.mha)
......
......@@ -26,7 +26,7 @@ if(BUILD_SHARED_LIBS)
set(Slicer3_NEED_SHARED_FORWARD 1)
set(Slicer3_EXE_SUFFIX -real)
set(Slicer3_EXE_INSTALL ".")
set(Slicer3_FORWARD_DIR_BUILD "${EXECUTABLE_OUTPUT_PATH}")
set(Slicer3_FORWARD_DIR_BUILD "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
set(Slicer3_FORWARD_DIR_INSTALL "${Slicer3_EXE_INSTALL}")
if(WIN32)
set(Slicer3_FORWARD_PATH_BUILD
......
......@@ -31,9 +31,10 @@ if(Slicer3_USE_NUMPY)
${PYTHON_INCLUDE_PATH}/../lib/
${PYTHON_INCLUDE_PATH}/../lib/site-packages/numpy/core/include/numpy
${PYTHON_INCLUDE_PATH}/../lib/site-packages/numpy/numarray/numpy
${PYTHON_INCLUDE_PATH}/../lib/python2.5/site-packages/numpy/core/include/numpy
${PYTHON_INCLUDE_PATH}/../../lib/python2.5/site-packages/numpy/core/include/numpy
${PYTHON_INCLUDE_PATH}/../lib/python2.6/site-packages/numpy/core/include/numpy
${PYTHON_INCLUDE_PATH}/../../lib/python2.6/site-packages/numpy/core/include/numpy
${PYTHON_INCLUDE_PATH}/../../lib/site-packages/numpy/core/include/numpy
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.6\\InstallPath]/libs
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.5\\InstallPath]/libs
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]/libs
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]/libs
......
......@@ -90,18 +90,17 @@ include("${Slicer3_CMAKE_DIR}/Slicer3PersistenceMacros.cmake")
#-----------------------------------------------------------------------------
# Top level slicer3 configurations
#
set(LIBRARY_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
set(EXECUTABLE_OUTPUT_PATH "${CMAKE_BINARY_DIR}/bin")
mark_as_advanced(
LIBRARY_OUTPUT_PATH
EXECUTABLE_OUTPUT_PATH
)
# If CMake >= 2.6.0
SET(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib")
# Do NOT force into the cache, as plugins need to override locally and scoping
# becomes an issue.
#set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin/
#set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/
# CACHE PATH "Single output directory for building all libraries." FORCE)
#set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin/
#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/
# CACHE PATH "Single output directory for building all executables." FORCE)
#-----------------------------------------------------------------------------
......@@ -235,7 +234,7 @@ set(extra_dirs
"${Slicer3_HOME}/${Slicer3_INSTALL_MODULES_LIB_DIR}"
)
kwwidgets_generate_setup_paths_scripts(
"${EXECUTABLE_OUTPUT_PATH}" "Slicer3SetupPaths"
"${CMAKE_RUNTIME_OUTPUT_DIRECTORY}" "Slicer3SetupPaths"
"${extra_dirs}"
)
......
......@@ -60,7 +60,7 @@ install(FILES ${GenerateCLP_BINARY_DIR}/UseGenerateCLP.cmake_install
# where the binary is actually not in the same directory as the shared
# libraries it depends on.
#
set(GenerateCLP_FORWARD_DIR_BUILD "${EXECUTABLE_OUTPUT_PATH}")
set(GenerateCLP_FORWARD_DIR_BUILD "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
set(GenerateCLP_FORWARD_DIR_INSTALL ".")
if(WIN32)
set(GenerateCLP_FORWARD_PATH_BUILD
......
......@@ -245,7 +245,7 @@ main(int argc, char *argv[])
return (EXIT_SUCCESS);
}
void GeneratePre(std::ofstream &sout, ModuleDescription &module, int argc, char *argv[])
void GeneratePre(std::ofstream &sout, ModuleDescription &, int argc, char *argv[])
{
sout << "// This file was automatically generated by:" << std::endl;
sout << "// ";
......
......@@ -25,8 +25,8 @@ GENERATECLP(SLICER3EXAMPLE_SOURCE Slicer3Example.xml)
ADD_EXECUTABLE ( Slicer3Example ${SLICER3EXAMPLE_SOURCE})
TARGET_LINK_LIBRARIES ( Slicer3Example)
ADD_TEST(Slicer3CLPExample1 ${EXECUTABLE_OUTPUT_PATH}/Slicer3Example --help)
ADD_TEST(Slicer3CLPExample2 ${EXECUTABLE_OUTPUT_PATH}/Slicer3Example --echo --load_freesurfer_volume FSV --stereo)
ADD_TEST(Slicer3CLPExample3 ${EXECUTABLE_OUTPUT_PATH}/Slicer3Example)
ADD_TEST(Slicer3CLPExample1 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Slicer3Example --help)
ADD_TEST(Slicer3CLPExample2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Slicer3Example --echo --load_freesurfer_volume FSV --stereo)
ADD_TEST(Slicer3CLPExample3 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/Slicer3Example)
......@@ -39,41 +39,47 @@ macro(GENERATECLP SOURCES)
# compute the input filename
if (TMP_FILEPATH)
set(TMP_INPUT ${TMP_FILEPATH}/${TMP_FILENAME}.xml)
set(TMP_INPUT ${TMP_FILEPATH}/${TMP_FILENAME}.xml)
else (TMP_FILEPATH)
set(TMP_INPUT ${CMAKE_CURRENT_SOURCE_DIR}/${TMP_FILENAME}.xml)
endif (TMP_FILEPATH)
# add custom command to output
if ("x${ARGV2}" STREQUAL "x")
## CASE OF NO LOGO FILE
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}CLP.h
DEPENDS "${GENERATECLP_EXE}" ${TMP_INPUT}
COMMAND "${GENERATECLP_EXE}"
--InputXML "${quote}${TMP_INPUT}${quote}"
--InputXML "${quote}${TMP_INPUT}${quote}"
--OutputCxx "${quote}${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}CLP.h${quote}"
${verbatim}
)
# mark the .clp file as a header file
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}CLP.h PROPERTIES HEADER_FILE_ONLY TRUE)
set_source_files_properties(${TMP_FILENAME}.cxx PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}CLP.h)
foreach( INPUT_SOURCE_FILE ${${SOURCES}} ${TMP_FILENAME}.cxx)
set_source_files_properties(${INPUT_SOURCE_FILE} PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}CLP.h)
endforeach( INPUT_SOURCE_FILE )
else ("x${ARGV2}" STREQUAL "x")
## CASE WITH LOGO FILE
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}CLP.h
DEPENDS "${GENERATECLP_EXE}" ${TMP_INPUT} ${ARGV2}
COMMAND "${GENERATECLP_EXE}"
COMMAND "${GENERATECLP_EXE}"
--logoFiles "${quote}${ARGV2}${quote}"
--InputXML "${quote}${TMP_INPUT}${quote}"
--InputXML "${quote}${TMP_INPUT}${quote}"
--OutputCxx "${quote}${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}CLP.h${quote}"
${verbatim}
)
# mark the .clp file as a header file
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}CLP.h PROPERTIES HEADER_FILE_ONLY TRUE)
foreach( INPUT_SOURCE_FILE ${${SOURCES}} ${TMP_FILENAME}.cxx)
set_source_files_properties(${INPUT_SOURCE_FILE} PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}CLP.h OBJECT_DEPENDS ${ARGV2})
endforeach( INPUT_SOURCE_FILE )
# mark the logo include file as a header file
set_source_files_properties(${ARGV2} PROPERTIES HEADER_FILE_ONLY TRUE)
set_source_files_properties(${TMP_FILENAME}.cxx PROPERTIES OBJECT_DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}CLP.h OBJECT_DEPENDS ${ARGV2})
endif ("x${ARGV2}" STREQUAL "x")
set(${SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}CLP.h ${${SOURCES}})
set(${SOURCES} ${CMAKE_CURRENT_BINARY_DIR}/${TMP_FILENAME}CLP.h ${${SOURCES}})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
endmacro(GENERATECLP)
......@@ -65,7 +65,7 @@ install(FILES ${GenerateLM_BINARY_DIR}/UseGenerateLM.cmake_install
# where the binary is actually not in the same directory as the shared
# libraries it depends on.
#
set(GenerateLM_FORWARD_DIR_BUILD "${EXECUTABLE_OUTPUT_PATH}")
set(GenerateLM_FORWARD_DIR_BUILD "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}")
set(GenerateLM_FORWARD_DIR_INSTALL ".")
if(WIN32)
set(GenerateLM_FORWARD_PATH_BUILD
......
......@@ -153,7 +153,7 @@ void vtkIGTIGSTKStream::Init()
// logger object created
std::string testName = "IGSTK";
std::string outputDirectory = EXECUTABLE_OUTPUT_PATH;
std::string outputDirectory = CMAKE_RUNTIME_OUTPUT_DIRECTORY;
std::string filename = outputDirectory +"/";
filename = filename + testName;
filename = filename + "LoggerOutput.txt";
......
......@@ -17,10 +17,10 @@ include_directories(
)
set(TEST_DATA ${LoadableModuleDescriptionParserTesting_SOURCE_DIR}/TestData)
add_test(LMParser1Test1 ${EXECUTABLE_OUTPUT_PATH}/LMParser1Test ${TEST_DATA}/ParserTest1.xml)
add_test(LMParser1Test1 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/LMParser1Test ${TEST_DATA}/ParserTest1.xml)
add_test(LMParser1Test2 ${EXECUTABLE_OUTPUT_PATH}/LMParser1Test ${TEST_DATA}/ParserTest2.xml)
add_test(LMParser1Test2 ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/LMParser1Test ${TEST_DATA}/ParserTest2.xml)
# commenting out until it runs faster via getbuildtest.tcl
#ADD_TEST(LoadableModuleFactoryTest ${EXECUTABLE_OUTPUT_PATH}/LoadableModuleFactoryTest ${Slicer3_BINARY_DIR}/${Slicer3_INSTALL_PLUGINS_BIN_DIR}/)
#ADD_TEST(LoadableModuleFactoryTest ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/LoadableModuleFactoryTest ${Slicer3_BINARY_DIR}/${Slicer3_INSTALL_PLUGINS_BIN_DIR}/)
......@@ -97,7 +97,7 @@ endif(USE_BFD)
# Build and install the library
set(lib_name ModuleDescriptionParser)
add_library(${lib_name}
add_library(${lib_name} STATIC
${ModuleDescriptionParser_SRCS}
)
......
......@@ -107,7 +107,9 @@ NameIsSharedLibrary(const char* name)
#endif
std::string sname = name;
if ( sname.rfind(extension) == sname.size() - extension.size() )
const std::string::size_type extpos(sname.rfind(extension));
if (extpos != std::string::npos &&
(extpos == sname.size() - extension.size()) )
{
return true;
}
......
......@@ -17,9 +17,9 @@ include_directories(
${ModuleDescriptionParser_SOURCE_DIR}
)
set(EXE_PREFIX ${EXECUTABLE_OUTPUT_PATH} )
set(EXE_PREFIX ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} )
if(WIN32)
set(EXE_PREFIX ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_BUILD_TYPE})
set(EXE_PREFIX ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_BUILD_TYPE})
endif(WIN32)
set(TEST_DATA ${ModuleDescriptionParserTesting_SOURCE_DIR}/TestData)
......
......@@ -107,10 +107,10 @@ protected:
inline void StdOutput::version(CmdLineInterface& _cmd)
{
std::string progName = _cmd.getProgramName();
std::string lversion = _cmd.getVersion();
const std::string returnVersion = _cmd.getVersion();
std::cout << std::endl << progName << " lversion: "
<< lversion << std::endl << std::endl;
std::cout << std::endl << progName << " version: "
<< returnVersion << std::endl << std::endl;
}
inline void StdOutput::usage(CmdLineInterface& _cmd )
......@@ -151,7 +151,7 @@ inline void StdOutput::failure( CmdLineInterface& _cmd,
}
inline void StdOutput::_shortUsage( CmdLineInterface& _cmd,
std::ostream& os ) const
std::ostream& ) const
{
std::list<Arg*> argList = _cmd.getArgList();
std::string progName = _cmd.getProgramName();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment