Skip to content

Commit

Permalink
Add 4th optional parameter to set linux install path
Browse files Browse the repository at this point in the history
  • Loading branch information
mdinger authored and wwmayer committed Apr 30, 2014
1 parent a17cce3 commit 88a3e5b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 17 deletions.
27 changes: 12 additions & 15 deletions cMake/FreeCadMacros.cmake
Expand Up @@ -204,34 +204,31 @@ MACRO(GET_MSVC_PRECOMPILED_SOURCE PrecompiledSource SourcesVar)
ENDIF(MSVC)
ENDMACRO(GET_MSVC_PRECOMPILED_SOURCE)

# Macro to replace all the binary output locations. {ARGVN} is zero based so
# the 3rd element is ${ARGV2}. When the 3rd element is empty, Runtime and Lib
# directories default to /bin and /lib. When present, the 3rd element specifies
# both Runtime and Lib directories.
# Macro to replace all the binary output locations. Takes 2 optional parameters.
# ${ARGVN} is zero based so the 3rd element is ${ARGV2}. When the 3rd element is missing,
# Runtime and Lib directories default to /bin and /lib. When present, the 3rd element
# specifies both Runtime and Lib directories. 4th specifies linux install path.
MACRO(SET_BIN_DIR ProjectName OutputName)
set_target_properties(${ProjectName} PROPERTIES OUTPUT_NAME ${OutputName})
if(${ARGC} STREQUAL 3)
if(${ARGC} GREATER 2)
set_target_properties(${ProjectName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}${ARGV2})
set_target_properties(${ProjectName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}${ARGV2})
set_target_properties(${ProjectName} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}${ARGV2})
else(${ARGC} STREQUAL 3)
else(${ARGC} GREATER 2)
set_target_properties(${ProjectName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR}/bin)
set_target_properties(${ProjectName} PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}/bin)
set_target_properties(${ProjectName} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
endif(${ARGC} STREQUAL 3)
set_target_properties(${ProjectName} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
endif(${ARGC} GREATER 2)

if(WIN32)
set_target_properties(${ProjectName} PROPERTIES DEBUG_OUTPUT_NAME ${OutputName}_d)
else(WIN32)
set_target_properties(${ProjectName} PROPERTIES PREFIX "")

SET(COND_IS_PART_DESIGN ${ProjectName} STREQUAL PartDesign OR
${ProjectName} STREQUAL PartDesignGui)
if(${COND_IS_PART_DESIGN})
set_target_properties(${ProjectName} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}${ARGV2})
else(${COND_IS_PART_DESIGN})
if(${ARGC} STREQUAL 4)
set_target_properties(${ProjectName} PROPERTIES INSTALL_RPATH ${CMAKE_INSTALL_PREFIX}${ARGV3})
else(${ARGC} STREQUAL 4)
set_target_properties(${ProjectName} PROPERTIES INSTALL_RPATH ${INSTALL_RPATH})
endif(${COND_IS_PART_DESIGN})
UNSET(COND_IS_PART_DESIGN)
endif(${ARGC} STREQUAL 4)
endif(WIN32)
ENDMACRO(SET_BIN_DIR)
2 changes: 1 addition & 1 deletion src/Mod/PartDesign/App/CMakeLists.txt
Expand Up @@ -126,7 +126,7 @@ fc_target_copy_resource(PartDesign
${CMAKE_BINARY_DIR}/Mod/PartDesign
${PartDesign_Scripts})

SET_BIN_DIR(PartDesign PartDesign /Mod/PartDesign)
SET_BIN_DIR(PartDesign PartDesign /Mod/PartDesign /Mod/PartDesign)
if(WIN32)
set_target_properties(PartDesign PROPERTIES SUFFIX ".pyd")
endif(WIN32)
Expand Down
2 changes: 1 addition & 1 deletion src/Mod/PartDesign/Gui/CMakeLists.txt
Expand Up @@ -188,7 +188,7 @@ fc_target_copy_resource(PartDesignGui
${CMAKE_BINARY_DIR}/Mod/PartDesign
${PartDesignGui_Scripts})

SET_BIN_DIR(PartDesignGui PartDesignGui /Mod/PartDesign)
SET_BIN_DIR(PartDesignGui PartDesignGui /Mod/PartDesign /Mod/PartDesign)
if(WIN32)
set_target_properties(PartDesignGui PROPERTIES SUFFIX ".pyd")
endif(WIN32)
Expand Down

0 comments on commit 88a3e5b

Please sign in to comment.