mirror of
https://github.com/pocoproject/poco.git
synced 2024-12-12 10:13:51 +01:00
Moved contributed CMake modules to "cmake" folder
By convention CMake project files are placed on a folder called "cmake" and then called from the build system by appending the CMAKE_MODULE_PATH variable
This commit is contained in:
parent
ee70421f64
commit
dc9aafa7a1
@ -23,6 +23,9 @@ SET(PROJECT_VERSION ${COMPLETE_VERSION})
|
|||||||
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||||
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
|
||||||
|
|
||||||
|
# Append our module directory to CMake
|
||||||
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
|
||||||
|
|
||||||
#################################################################################
|
#################################################################################
|
||||||
# Setup C/C++ compiler options
|
# Setup C/C++ compiler options
|
||||||
#################################################################################
|
#################################################################################
|
||||||
@ -98,9 +101,9 @@ include(FindCygwin)
|
|||||||
include(FindOpenSSL)
|
include(FindOpenSSL)
|
||||||
#include(CMakeDetermineCompilerId)
|
#include(CMakeDetermineCompilerId)
|
||||||
|
|
||||||
include(contrib/cmake/FindMySQL.cmake)
|
include(FindMySQL)
|
||||||
include(contrib/cmake/FindAPR.cmake)
|
include(FindAPR)
|
||||||
include(contrib/cmake/FindApache2.cmake)
|
include(FindApache2)
|
||||||
|
|
||||||
# OS Detection
|
# OS Detection
|
||||||
if(CMAKE_SYSTEM MATCHES "Windows")
|
if(CMAKE_SYSTEM MATCHES "Windows")
|
||||||
@ -179,7 +182,7 @@ endif(APRUTIL_FOUND AND APACHE_FOUND)
|
|||||||
#############################################################
|
#############################################################
|
||||||
# Uninstall stuff see: http://www.vtk.org/Wiki/CMake_FAQ
|
# Uninstall stuff see: http://www.vtk.org/Wiki/CMake_FAQ
|
||||||
CONFIGURE_FILE(
|
CONFIGURE_FILE(
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/contrib/cmake/cmake_uninstall.cmake.in"
|
"${CMAKE_MODULE_PATH}/cmake_uninstall.cmake.in"
|
||||||
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
|
||||||
IMMEDIATE @ONLY)
|
IMMEDIATE @ONLY)
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ if(MYSQL_FOUND)
|
|||||||
add_subdirectory( MySQL )
|
add_subdirectory( MySQL )
|
||||||
endif(MYSQL_FOUND)
|
endif(MYSQL_FOUND)
|
||||||
|
|
||||||
include(../contrib/cmake/FindODBC.cmake)
|
include(FindODBC)
|
||||||
|
|
||||||
if(CMAKE_SYSTEM MATCHES "Windows")
|
if(CMAKE_SYSTEM MATCHES "Windows")
|
||||||
message(STATUS "Windows native ODBC Support Enabled")
|
message(STATUS "Windows native ODBC Support Enabled")
|
||||||
|
@ -1,121 +0,0 @@
|
|||||||
PROJECT (FTPTest)
|
|
||||||
|
|
||||||
SET (EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin CACHE PATH
|
|
||||||
"Single output directory for building all executables.")
|
|
||||||
|
|
||||||
SET( TARGET_BASE_NAME "${PROJECT_NAME}" )
|
|
||||||
SET( LIB_NAME "${TARGET_BASE_NAME}Lib" )
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
|
||||||
# Let's use the highest warning level.
|
|
||||||
#-----------------------------------------------------------------------------
|
|
||||||
IF(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv|nmake)")
|
|
||||||
# Use the highest warning level for visual studio.
|
|
||||||
IF(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
|
||||||
STRING(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
|
||||||
ELSE(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
|
|
||||||
ENDIF(CMAKE_CXX_FLAGS MATCHES "/W[0-4]")
|
|
||||||
IF(CMAKE_C_FLAGS MATCHES "/W[0-4]")
|
|
||||||
STRING(REGEX REPLACE "/W[0-4]" "/W4" CMAKE_C_FLAGS "${CMAKE_C_FLAGS}")
|
|
||||||
ELSE(CMAKE_C_FLAGS MATCHES "/W[0-4]")
|
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /W4")
|
|
||||||
ENDIF(CMAKE_C_FLAGS MATCHES "/W[0-4]")
|
|
||||||
# Disable deprecation warnings for standard C functions in VS2005 and later
|
|
||||||
IF(CMAKE_COMPILER_2005)
|
|
||||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE)
|
|
||||||
ENDIF(CMAKE_COMPILER_2005)
|
|
||||||
ENDIF(CMAKE_BUILD_TOOL MATCHES "(msdev|devenv|nmake)")
|
|
||||||
IF(CMAKE_BUILD_TOOL MATCHES "make")
|
|
||||||
IF(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
|
|
||||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
|
|
||||||
ENDIF(NOT CMAKE_CXX_FLAGS MATCHES "-Wall")
|
|
||||||
IF(NOT CMAKE_C_FLAGS MATCHES "-Wall")
|
|
||||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall")
|
|
||||||
ENDIF(NOT CMAKE_C_FLAGS MATCHES "-Wall")
|
|
||||||
ENDIF(CMAKE_BUILD_TOOL MATCHES "make")
|
|
||||||
|
|
||||||
SET(Poco_DIR ${PROJECT_SOURCE_DIR})
|
|
||||||
FIND_PACKAGE(Poco REQUIRED)
|
|
||||||
IF(${Poco_FOUND})
|
|
||||||
INCLUDE_DIRECTORIES(${Poco_INCLUDE_DIRS})
|
|
||||||
LINK_DIRECTORIES(${Poco_LIBRARY_DIRS})
|
|
||||||
ENDIF(WIN32)
|
|
||||||
ENDIF(${Poco_FOUND})
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
|
||||||
SET( EXE_NAME "${TARGET_BASE_NAME}" )
|
|
||||||
# Add any source files here.
|
|
||||||
SET( EXE_SRCS
|
|
||||||
"My File.cpp"
|
|
||||||
)
|
|
||||||
# Add any include files here.
|
|
||||||
SET( EXE_INCS
|
|
||||||
"My File.h"
|
|
||||||
)
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
|
||||||
# The executable.
|
|
||||||
ADD_EXECUTABLE(${EXE_NAME} ${EXE_SRCS} ${EXE_INCS})
|
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES ( ${EXE_NAME}
|
|
||||||
"optimized" CppUnit
|
|
||||||
"debug" CppUnitd
|
|
||||||
"optimized" PocoFoundation
|
|
||||||
"debug" PocoFoundationd
|
|
||||||
"optimized" PocoNet
|
|
||||||
"debug" PocoNetd
|
|
||||||
"optimized" PocoUtil
|
|
||||||
"debug" PocoUtild
|
|
||||||
"optimized" PocoXML
|
|
||||||
"debug" PocoXMLd
|
|
||||||
)
|
|
||||||
|
|
||||||
# Copy the DLLS to where the executable is.
|
|
||||||
# Only do this if you haven't set your path to the Poco DLLs.
|
|
||||||
IF(WIN32)
|
|
||||||
SET ( DLL_FILES_DEBUG
|
|
||||||
${Poco_BINARY_DIRS}/CppUnitd.dll
|
|
||||||
${Poco_BINARY_DIRS}/PocoFoundationd.dll
|
|
||||||
${Poco_BINARY_DIRS}/PocoNetd.dll
|
|
||||||
${Poco_BINARY_DIRS}/PocoUtild.dll
|
|
||||||
${Poco_BINARY_DIRS}/PocoXMLd.dll
|
|
||||||
)
|
|
||||||
|
|
||||||
SET ( DLL_FILES_RELEASE
|
|
||||||
${Poco_BINARY_DIRS}/CppUnit.dll
|
|
||||||
${Poco_BINARY_DIRS}/PocoFoundation.dll
|
|
||||||
${Poco_BINARY_DIRS}/PocoNet.dll
|
|
||||||
${Poco_BINARY_DIRS}/PocoUtil.dll
|
|
||||||
${Poco_BINARY_DIRS}/PocoXML.dll
|
|
||||||
)
|
|
||||||
|
|
||||||
# Copy these files to the build tree.
|
|
||||||
ADD_CUSTOM_TARGET(CopyDll ALL echo "Copying dlls ...")
|
|
||||||
|
|
||||||
FOREACH(file ${DLL_FILES_DEBUG})
|
|
||||||
GET_FILENAME_COMPONENT(fn ${file} NAME)
|
|
||||||
SET(tgt ${EXECUTABLE_OUTPUT_PATH}/Debug/${fn})
|
|
||||||
SET(src ${file})
|
|
||||||
ADD_CUSTOM_COMMAND(
|
|
||||||
TARGET CopyDll
|
|
||||||
COMMAND ${CMAKE_COMMAND}
|
|
||||||
ARGS -E copy_if_different ${src} ${tgt}
|
|
||||||
COMMENT "Source copy of dlls"
|
|
||||||
)
|
|
||||||
ENDFOREACH(file)
|
|
||||||
|
|
||||||
FOREACH(file ${DLL_FILES_RELEASE})
|
|
||||||
GET_FILENAME_COMPONENT(fn ${file} NAME)
|
|
||||||
SET(tgt ${EXECUTABLE_OUTPUT_PATH}/Release/${fn})
|
|
||||||
SET(src ${file})
|
|
||||||
ADD_CUSTOM_COMMAND(
|
|
||||||
TARGET CopyDll
|
|
||||||
COMMAND ${CMAKE_COMMAND}
|
|
||||||
ARGS -E copy_if_different ${src} ${tgt}
|
|
||||||
COMMENT "Source copy of dlls"
|
|
||||||
)
|
|
||||||
ENDFOREACH(file)
|
|
||||||
|
|
||||||
ENDIF(WIN32)
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user