--- /dev/null
+## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+cmake_minimum_required (VERSION 2.6)
+
+include(FindGTest)
+
+
+#FIND_PACKAGE(GTest REQUIRED)
+#INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS})
+
+#FIND_PACKAGE(GMock REQUIRED)
+#INCLUDE_DIRECTORIES(${GMOCK_INCLUDE_DIRS})
+
+
+# GCC 4.4.6 does not support some C++11 features used by GMock
+add_definitions(-DGTEST_LANG_CXX11=0)
+
+include_directories(
+ $ENV{GTEST_ROOT}/googletest/include
+ $ENV{GTEST_ROOT}/googlemock/include
+ )
+
+set(GTEST_LIBRARY $ENV{GTEST_ROOT}/googlemock/make/gmock_main.a)
+
\ No newline at end of file
--- /dev/null
+## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
+find_package(SWIG REQUIRED)
+include(${SWIG_USE_FILE})
+
+set(CMAKE_SWIG_FLAGS "-Wall")
+
+# For doxyhelp.i
+include_directories(
+ ${PROJECT_BINARY_DIR}/doc/swig
+)
## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
INCLUDE(Common)
-INCLUDE(UnitTest)
-
-FIND_PACKAGE(SWIG REQUIRED)
-INCLUDE(${SWIG_USE_FILE})
-INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
-
SET(PROJECT_HEADERS
ConstructionAPI.h
ModelHighAPI
)
-ADD_DEFINITIONS(-DCONSTRUCTIONAPI_EXPORTS ${CAS_DEFINITIONS})
-ADD_LIBRARY(ConstructionAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
-
-SET(CMAKE_SWIG_FLAGS "-Wall")
-
-SET_SOURCE_FILES_PROPERTIES(ConstructionAPI.i PROPERTIES CPLUSPLUS ON)
-SET_SOURCE_FILES_PROPERTIES(ConstructionAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
-
INCLUDE_DIRECTORIES(
${PROJECT_SOURCE_DIR}/src/ModelAPI
${PROJECT_SOURCE_DIR}/src/ModelHighAPI
)
+ADD_DEFINITIONS(-DCONSTRUCTIONAPI_EXPORTS ${CAS_DEFINITIONS})
+ADD_LIBRARY(ConstructionAPI SHARED ${PROJECT_SOURCES} ${PROJECT_HEADERS})
TARGET_LINK_LIBRARIES(ConstructionAPI ${PROJECT_LIBRARIES})
-SET(SWIG_SCRIPTS
- ${CMAKE_CURRENT_BINARY_DIR}/ConstructionAPI.py
- )
+# SWIG wrapper
+
+INCLUDE(PythonAPI)
+
+SET_SOURCE_FILES_PROPERTIES(ConstructionAPI.i PROPERTIES CPLUSPLUS ON)
+SET_SOURCE_FILES_PROPERTIES(ConstructionAPI.i PROPERTIES SWIG_DEFINITIONS "-shadow")
SET(SWIG_LINK_LIBRARIES
ConstructionAPI
INSTALL(TARGETS _ConstructionAPI DESTINATION ${SHAPER_INSTALL_SWIG})
INSTALL(TARGETS ConstructionAPI DESTINATION ${SHAPER_INSTALL_BIN})
-INSTALL(FILES ${SWIG_SCRIPTS} DESTINATION ${SHAPER_INSTALL_SWIG})
+INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/ConstructionAPI.py DESTINATION ${SHAPER_INSTALL_SWIG})
+
+# Tests
+
+INCLUDE(UnitTest)
ADD_UNIT_TESTS(
TestPoint.py
## Copyright (C) 2014-20xx CEA/DEN, EDF R&D
-add_definitions(-DGTEST_LANG_CXX11=0)
+include(GTest)
-INCLUDE(FindGTest)
-#FIND_PACKAGE(GTest REQUIRED)
-#INCLUDE_DIRECTORIES(${GTEST_INCLUDE_DIRS})
+include_directories(
+ ${PROJECT_SOURCE_DIR}/src/Events
+ ${PROJECT_SOURCE_DIR}/src/ModelAPI
+ ${PROJECT_SOURCE_DIR}/src/ModelHighAPI
+ ${PROJECT_SOURCE_DIR}/src/ConstructionAPI
+)
-#FIND_PACKAGE(GMock REQUIRED)
-#INCLUDE_DIRECTORIES(${GMOCK_INCLUDE_DIRS})
+set(PROJECT_SOURCES
+ TestPoint.cpp
+)
-INCLUDE_DIRECTORIES(
- ${PROJECT_SOURCE_DIR}/src/Events
- ${PROJECT_SOURCE_DIR}/src/ModelAPI
- ${PROJECT_SOURCE_DIR}/src/ModelHighAPI
-
- $ENV{GTEST_ROOT}/googletest/include
- $ENV{GTEST_ROOT}/googlemock/include
- )
+set(PROJECT_LIBRARIES
+ ModelAPI
+ ModelHighAPI
+ ConstructionAPI
+)
-SET(TEST_LIBRARIES
- ModelAPI
- ModelHighAPI
- ConstructionAPI
- )
+set(PACKAGE_NAME "ConstructionAPI")
+set(TARGET_NAME "Test${PACKAGE_NAME}")
-SET(PACKAGE_NAME "ConstructionAPI")
-SET(TEST_NAME "${PACKAGE_NAME}_GTest")
-SET(TARGET_NAME "Test${PACKAGE_NAME}")
+add_executable(${TARGET_NAME} ${PROJECT_SOURCES})
+target_link_libraries(${TARGET_NAME} ${PROJECT_LIBRARIES} ${GTEST_LIBRARY})
-ADD_EXECUTABLE(${TARGET_NAME}
- TestPoint.cpp
- )
-
-TARGET_LINK_LIBRARIES(${TARGET_NAME}
- ${TEST_LIBRARIES}
-
- $ENV{GTEST_ROOT}/googlemock/make/gmock_main.a
- )
-
-GET_TARGET_PROPERTY(TEST_SOURCES ${TARGET_NAME} SOURCES)
-GTEST_ADD_TESTS(${CMAKE_BINARY_DIR}/bin/${TARGET_NAME}
- ""
- ${TEST_SOURCES}
- )
\ No newline at end of file
+GTEST_ADD_TESTS(${CMAKE_BINARY_DIR}/bin/${TARGET_NAME} "" ${PROJECT_SOURCES})