Salome HOME
Improve build procedure
[tools/simanio.git] / src / CMakeLists.txt
index 7c2b65a16d1aa84ffdfa8db335cc16e707ff14b2..173f5dfc89879413259b8e35938a3f0e0f2b3831 100644 (file)
@@ -1,19 +1,73 @@
-project(SimanSrc CXX)
+#  Copyright (C) 2013  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+#  This library is free software; you can redistribute it and/or
+#  modify it under the terms of the GNU Lesser General Public
+#  License as published by the Free Software Foundation; either
+#  version 2.1 of the License.
+#
+#  This library is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+#  Lesser General Public License for more details.
+#
+#  You should have received a copy of the GNU Lesser General Public
+#  License along with this library; if not, write to the Free Software
+#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
 
-set(SimanSrc_SRCS SimanIO_Activity.cxx SimanIO_Configuration.cxx SimanIO_Document.cxx SimanIO_Link.cxx CheckIn.cpp CheckInResponse.cpp CreateConfigFile.cpp CreateConfigFileResponse.cpp GetFile.cpp GetFileResponse.cpp PutFile.cpp PutFileResponse.cpp SimanSalomeServiceStub.cpp)
-set(SimanSrc_HEADERS SimanIO_Activity.hxx SimanIO_Configuration.hxx SimanIO_Document.hxx SimanIO_Link.hxx CheckIn.h CheckInResponse.h CreateConfigFile.h CreateConfigFileResponse.h GetFile.h GetFileResponse.h ISimanSalomeServiceCallback.h PutFile.h PutFileResponse.h SimanSalomeServiceStub.h)
-include_directories($(PROJECT_SOURCE_DIR) $ENV{WSFCPP_HOME}/include $ENV{WSFCPP_HOME}/include/axis2-1.6.0 $ENV{WSFCPP_HOME}/include/axis2-1.6.0/platforms)
+# [ additional include dirs ]
+INCLUDE_DIRECTORIES(
+  ${WSO2_INCLUDES}
+  ${CMAKE_CURRENT_SOURCE_DIR}
+)
 
-add_library(SimanIO SHARED ${SimanSrc_SRCS} ${SimanSrc_HEADERS} $ENV{WSFCPP_HOME}/lib)
-target_link_libraries(SimanIO $ENV{WSFCPP_HOME}/lib $ENV{WSFCPP_HOME}/lib/libaxis2_axiom.so $ENV{WSFCPP_HOME}/lib/libaxis2_engine.so $ENV{WSFCPP_HOME}/lib/libwso2_wsf.so)
+# [ headers to be installed ]
+SET(SimanIO_HEADERS
+  SimanIO_Activity.hxx
+  SimanIO_Configuration.hxx
+  SimanIO_Document.hxx
+  SimanIO_Link.hxx
+)
 
-install(TARGETS SimanIO DESTINATION ${CMAKE_INSTALL_PREFIX}/lib)
-install(FILES ${SimanSrc_HEADERS} DESTINATION ${CMAKE_INSTALL_PREFIX}/include)
-
-# add_executable(TestCreateConfigFile TestCreateConfigFile.cpp)
-# target_link_libraries(TestCreateConfigFile ${CMAKE_INSTALL_PREFIX}/lib/libSimanIO.so $ENV{WSFCPP_HOME}/lib/libaxis2_axiom.so $ENV{WSFCPP_HOME}/lib/libaxis2_engine.so $ENV{WSFCPP_HOME}/lib/libwso2_wsf.so)
-# install(TARGETS TestCreateConfigFile DESTINATION bin)
+# [ generated sources ]
+# TODO: add procedure of automatic generation of the sources from the skeleton
+# TODO: this will raise dependency of SimanIO on SIMAN (where skeleton file is)
+#       and Apache Axis2/Java (which is used to generate wrappings)
+SET(_generated_SOURCES
+  CheckIn.cpp
+  CheckInResponse.cpp
+  CreateConfigFile.cpp
+  CreateConfigFileResponse.cpp
+  GetFile.cpp
+  GetFileResponse.cpp
+  PutFile.cpp
+  PutFileResponse.cpp
+  SimanSalomeServiceStub.cpp
+)
 
+# [ static sources ]
+SET(_other_SOURCES
+  SimanIO_Activity.cxx
+  SimanIO_Configuration.cxx
+  SimanIO_Document.cxx
+  SimanIO_Link.cxx
+)
 
+# [ all sources to be compiled ]
+SET(SimanIO_SOURCES
+  ${_generated_SOURCES}
+  ${_other_SOURCES}
+)
 
+# [ target: library ]
+ADD_LIBRARY(SimanIO SHARED ${SimanIO_SOURCES})
+TARGET_LINK_LIBRARIES(SimanIO ${PLATFORM_LIBS} ${WSO2_LIBRARIES})
+INSTALL(TARGETS SimanIO EXPORT ${PROJECT_NAME}Targets DESTINATION lib)
+INSTALL(FILES ${SimanIO_HEADERS} DESTINATION include)
 
+# [ target: test ]
+ADD_EXECUTABLE(TestCreateConfigFile TestCreateConfigFile.cpp)
+TARGET_LINK_LIBRARIES(TestCreateConfigFile SimanIO)
+INSTALL(TARGETS TestCreateConfigFile DESTINATION bin)