fix build system: make eo/edo examples works
This commit is contained in:
parent
8a81bd2191
commit
0829afceb9
10 changed files with 61 additions and 79 deletions
|
|
@ -45,7 +45,6 @@ if(ENABLE_CMAKE_EXAMPLE)
|
||||||
if(${CMAKE_VERBOSE_MAKEFILE})
|
if(${CMAKE_VERBOSE_MAKEFILE})
|
||||||
message("EDO examples:")
|
message("EDO examples:")
|
||||||
endif(${CMAKE_VERBOSE_MAKEFILE})
|
endif(${CMAKE_VERBOSE_MAKEFILE})
|
||||||
add_subdirectory(tutorial)
|
|
||||||
add_subdirectory(application)
|
add_subdirectory(application)
|
||||||
endif(ENABLE_CMAKE_EXAMPLE)
|
endif(ENABLE_CMAKE_EXAMPLE)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ INCLUDE_DIRECTORIES(
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/common
|
${CMAKE_CURRENT_SOURCE_DIR}/common
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(common)
|
ADD_SUBDIRECTORY(common) # Rosenbrock and Sphere
|
||||||
#ADD_SUBDIRECTORY(eda_sa)
|
#ADD_SUBDIRECTORY(eda_sa)
|
||||||
ADD_SUBDIRECTORY(eda)
|
ADD_SUBDIRECTORY(eda)
|
||||||
ADD_SUBDIRECTORY(cmaes)
|
ADD_SUBDIRECTORY(cmaes)
|
||||||
|
|
|
||||||
|
|
@ -1,33 +1,37 @@
|
||||||
PROJECT(cmaes)
|
project(cmaes)
|
||||||
|
|
||||||
|
|
||||||
#find_package(Eigen3 REQUIRED)
|
#find_package(Eigen3 REQUIRED)
|
||||||
#include_directories(EIGEN3_INCLUDE_DIR)
|
#include_directories(EIGEN3_INCLUDE_DIR)
|
||||||
INCLUDE_DIRECTORIES( ${EIGEN3_INCLUDE_DIR} )
|
include_directories( ${EIGEN3_INCLUDE_DIR} )
|
||||||
MESSAGE( "MESSAGE:" ${EIGEN3_INCLUDE_DIR} )
|
#message( "MESSAGE:" ${EIGEN3_INCLUDE_DIR} )
|
||||||
|
|
||||||
#FIND_PACKAGE(Boost 1.33.0)
|
#find_package(Boost 1.33.0)
|
||||||
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
|
include_directories(${Boost_INCLUDE_DIRS})
|
||||||
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
|
link_directories(${Boost_LIBRARY_DIRS})
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
include_directories(${EO_SRC_DIR}/src)
|
||||||
|
include_directories(${EDO_SRC_DIR}/src)
|
||||||
|
link_directories(${EO_BIN_DIRS}/${LIB})
|
||||||
|
link_directories(${EDO_BIN_DIRS}/${LIB})
|
||||||
|
|
||||||
SET(RESOURCES
|
# set(RESOURCES
|
||||||
${PROJECT_NAME}.param
|
# ${PROJECT_NAME}.param
|
||||||
)
|
# )
|
||||||
|
#
|
||||||
|
# foreach(file ${RESOURCES})
|
||||||
|
# execute_process(
|
||||||
|
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
|
# ${CMAKE_CURRENT_SOURCE_DIR}/${file}
|
||||||
|
# ${EDO_BIN_DIR}/${file}
|
||||||
|
# )
|
||||||
|
# endforeach(file)
|
||||||
|
|
||||||
FOREACH(file ${RESOURCES})
|
#file(GLOB SOURCES *.cpp)
|
||||||
EXECUTE_PROCESS(
|
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/${file}
|
|
||||||
${EDO_BINARY_DIR}/${file}
|
|
||||||
)
|
|
||||||
ENDFOREACH(file)
|
|
||||||
|
|
||||||
#FILE(GLOB SOURCES *.cpp)
|
set(EXECUTABLE_OUTPUT_PATH ${EDO_BIN_DIR})
|
||||||
|
|
||||||
SET(EXECUTABLE_OUTPUT_PATH ${EDO_BINARY_DIR})
|
add_executable(${PROJECT_NAME} main.cpp)
|
||||||
|
target_link_libraries(${PROJECT_NAME} eo eoutils edoutils ${Boost_LIBRARIES})
|
||||||
ADD_EXECUTABLE(${PROJECT_NAME} main.cpp)
|
|
||||||
TARGET_LINK_LIBRARIES(${PROJECT_NAME} edo edoutils ${EO_LIBRARIES} ${Boost_LIBRARIES})
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,6 @@ FOREACH(file ${RESOURCES})
|
||||||
EXECUTE_PROCESS(
|
EXECUTE_PROCESS(
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/${file}
|
${CMAKE_CURRENT_SOURCE_DIR}/${file}
|
||||||
${EDO_BINARY_DIR}/${file}
|
${EDO_BIN_DIR}/${file}
|
||||||
)
|
)
|
||||||
ENDFOREACH(file)
|
ENDFOREACH(file)
|
||||||
|
|
|
||||||
|
|
@ -1,27 +1,33 @@
|
||||||
PROJECT(eda)
|
project(eda)
|
||||||
|
|
||||||
FIND_PACKAGE(Boost 1.33.0)
|
find_package(Boost 1.33.0)
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIRS})
|
include_directories(${Boost_INCLUDE_DIRS})
|
||||||
LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
|
link_directories(${Boost_LIBRARY_DIRS})
|
||||||
|
|
||||||
SET(RESOURCES
|
include_directories(${EO_SRC_DIR}/src)
|
||||||
|
include_directories(${EDO_SRC_DIR}/src)
|
||||||
|
link_directories(${EO_BIN_DIR}/${LIB})
|
||||||
|
link_directories(${EDO_BIN_DIR}/${LIB})
|
||||||
|
|
||||||
|
set(RESOURCES
|
||||||
${PROJECT_NAME}.param
|
${PROJECT_NAME}.param
|
||||||
)
|
)
|
||||||
|
|
||||||
FOREACH(file ${RESOURCES})
|
foreach(FILE ${RESOURCES})
|
||||||
EXECUTE_PROCESS(
|
execute_process(
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/${file}
|
${CMAKE_CURRENT_SOURCE_DIR}/${file}
|
||||||
${EDO_BINARY_DIR}/${file}
|
${EDO_BIN_DIR}/${file}
|
||||||
)
|
)
|
||||||
ENDFOREACH(file)
|
endforeach(FILE)
|
||||||
|
|
||||||
FILE(GLOB SOURCES *.cpp)
|
file(GLOB SOURCES *.cpp)
|
||||||
|
|
||||||
SET(EXECUTABLE_OUTPUT_PATH ${EDO_BINARY_DIR})
|
set(EXECUTABLE_OUTPUT_PATH ${EDO_BIN_DIR})
|
||||||
|
|
||||||
|
add_executable(${PROJECT_NAME} ${SOURCES})
|
||||||
|
target_link_libraries(${PROJECT_NAME} eo eoutils edoutils ${Boost_LIBRARIES})
|
||||||
|
|
||||||
ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCES})
|
|
||||||
TARGET_LINK_LIBRARIES(${PROJECT_NAME} edo edoutils ${EO_LIBRARIES} ${Boost_LIBRARIES})
|
|
||||||
|
|
|
||||||
|
|
@ -15,13 +15,13 @@ FOREACH(file ${RESOURCES})
|
||||||
EXECUTE_PROCESS(
|
EXECUTE_PROCESS(
|
||||||
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
COMMAND ${CMAKE_COMMAND} -E copy_if_different
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/${file}
|
${CMAKE_CURRENT_SOURCE_DIR}/${file}
|
||||||
${EDO_BINARY_DIR}/${file}
|
${EDO_BIN_DIR}/${file}
|
||||||
)
|
)
|
||||||
ENDFOREACH(file)
|
ENDFOREACH(file)
|
||||||
|
|
||||||
FILE(GLOB SOURCES *.cpp)
|
FILE(GLOB SOURCES *.cpp)
|
||||||
|
|
||||||
SET(EXECUTABLE_OUTPUT_PATH ${EDO_BINARY_DIR})
|
SET(EXECUTABLE_OUTPUT_PATH ${EDO_BIN_DIR})
|
||||||
|
|
||||||
ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCES})
|
ADD_EXECUTABLE(${PROJECT_NAME} ${SOURCES})
|
||||||
TARGET_LINK_LIBRARIES(${PROJECT_NAME} edo edoutils ${EO_LIBRARIES} ${MO_LIBRARIES} ${Boost_LIBRARIES})
|
TARGET_LINK_LIBRARIES(${PROJECT_NAME} edo edoutils ${EO_LIBRARIES} ${MO_LIBRARIES} ${Boost_LIBRARIES})
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@
|
||||||
include_directories(${EO_SRC_DIR})
|
include_directories(${EO_SRC_DIR})
|
||||||
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
set(EDO_LIB_OUTPUT_PATH ${EDO_BINARY_DIR}/lib)
|
set(EDO_LIB_OUTPUT_PATH ${EDO_BIN_DIR}/lib)
|
||||||
set(LIBRARY_OUTPUT_PATH ${EDO_LIB_OUTPUT_PATH})
|
set(LIBRARY_OUTPUT_PATH ${EDO_LIB_OUTPUT_PATH})
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -22,7 +22,7 @@ install(FILES ${HDRS} DESTINATION local/include${INSTALL_SUB_DIR}/edo COMPONENT
|
||||||
######################################################################################
|
######################################################################################
|
||||||
|
|
||||||
install(DIRECTORY utils
|
install(DIRECTORY utils
|
||||||
DESTINATION local/include${INSTALL_SUB_DIR}/moeo
|
DESTINATION local/include${INSTALL_SUB_DIR}/edo
|
||||||
COMPONENT headers
|
COMPONENT headers
|
||||||
FILES_MATCHING PATTERN "*.h"
|
FILES_MATCHING PATTERN "*.h"
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
/*
|
|
||||||
The Evolving Distribution Objects framework (EDO) is a template-based,
|
|
||||||
ANSI-C++ evolutionary computation library which helps you to write your
|
|
||||||
own estimation of distribution algorithms.
|
|
||||||
|
|
||||||
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, or (at your option) any later version.
|
|
||||||
|
|
||||||
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
|
||||||
|
|
||||||
Copyright (C) 2010 Thales group
|
|
||||||
*/
|
|
||||||
/*
|
|
||||||
Authors:
|
|
||||||
Caner Candan <caner.candan@thalesgroup.com>
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "edo"
|
|
||||||
|
|
@ -51,7 +51,7 @@ if(ENABLE_CMAKE_EXAMPLE)
|
||||||
message("EO examples:")
|
message("EO examples:")
|
||||||
endif(${CMAKE_VERBOSE_MAKEFILE})
|
endif(${CMAKE_VERBOSE_MAKEFILE})
|
||||||
add_subdirectory(tutorial)
|
add_subdirectory(tutorial)
|
||||||
add_subdirectory(app)
|
#add_subdirectory(app) # FIXME must be updated
|
||||||
endif(ENABLE_CMAKE_EXAMPLE)
|
endif(ENABLE_CMAKE_EXAMPLE)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,14 @@
|
||||||
### 1) Include the sources
|
### 1) Include the sources
|
||||||
######################################################################################
|
######################################################################################
|
||||||
|
|
||||||
INCLUDE_DIRECTORIES(${EO_SOURCE_DIR}/src)
|
INCLUDE_DIRECTORIES(${EO_SRC_DIR}/src)
|
||||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
### 2) Specify where CMake can find the libraries (mandatory: before 3) )
|
### 2) Specify where CMake can find the libraries (mandatory: before 3) )
|
||||||
######################################################################################
|
######################################################################################
|
||||||
|
|
||||||
LINK_DIRECTORIES(${EO_BIN_DIR}/lib)
|
LINK_DIRECTORIES(${EO_BIN_DIR}/${LIB})
|
||||||
|
|
||||||
######################################################################################
|
######################################################################################
|
||||||
### 3) Define your target(s): just an executable here
|
### 3) Define your target(s): just an executable here
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue